/* ==========================================================================
   PAC - Plan Ahead Constructions
   Custom Stylesheet (styles.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CSS Variables & Theme Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-primary-navy: #1B2A4A;
  --color-darker-navy: #0f1d33;
  --color-gold: #D4A843;
  --color-gold-hover: #c49a38;
  --color-white: #FFFFFF;
  --color-light-gray: #F5F5F5;
  --color-dark-text: #1a1a1a;
  --color-body-text: #4a4a4a;
  --color-border: #e2e8f0;
  --color-gold-shadow: rgba(212, 168, 67, 0.25);
  --color-navy-shadow: rgba(27, 42, 74, 0.12);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* --------------------------------------------------------------------------
   1. Base Styles & Global Resets
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--color-body-text);
  background-color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-gold);
  color: var(--color-white);
}

::-moz-selection {
  background: var(--color-gold);
  color: var(--color-white);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-dark-text);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   2. Custom Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-darker-navy);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-hover);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) var(--color-darker-navy);
}

/* --------------------------------------------------------------------------
   3. Navigation Bar & Mobile Menu
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.25rem 0;
  background: transparent;
  transition: background-color var(--transition-normal), box-shadow var(--transition-normal), padding var(--transition-normal);
}

/* A page that does not open with the hero has no dark band for the bar to sit
   over: white text on a white section reads as a bar that lost its background.
   It carries its own from the start, and `.scrolled` then only adds the shadow
   and the tighter padding. */
.navbar-solid {
  background: var(--color-primary-navy);
}

/* The bar of the user logged in (comps.gadx user_bar) is fixed at the top: the
   header goes down its height, and the page with it. */
body.has-user-bar {
  padding-top: 2.25rem;
}

body.has-user-bar .navbar {
  top: 2.25rem;
}

.navbar.scrolled {
  background: var(--color-primary-navy);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 0.85rem 0;
}

.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--color-white);
  padding: 0.5rem 0;
  transition: color var(--transition-normal);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width var(--transition-normal);
}

.nav-link:hover {
  color: var(--color-gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-gold);
}

/* Mobile Navigation Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 29, 51, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 380px;
  height: 100vh;
  background: var(--color-darker-navy);
  z-index: 1100;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transform: translateX(100%);
  transition: transform var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.4);
}

.mobile-menu-drawer.open,
.mobile-menu-overlay.active .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-nav-link {
  color: var(--color-white);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--color-gold);
  padding-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. Hero Section & Animated Background Pattern
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #1B2A4A 0%, #0f1d33 50%, #1B2A4A 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--color-white);
}

/* Subtle animated diagonal background pattern */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image: 
    radial-gradient(rgba(212, 168, 67, 0.08) 1.5px, transparent 1.5px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%, rgba(255, 255, 255, 0.02) 100%);
  background-size: 40px 40px, 80px 80px;
  background-position: 0 0, 0 0;
  opacity: 0.8;
  animation: heroPatternMove 40s linear infinite;
  pointer-events: none;
}

@keyframes heroPatternMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-40px, -40px);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-text {
  opacity: 0;
  animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-stats {
  opacity: 0;
  animation: fadeIn 1s ease 0.8s forwards;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
}

.stat-item {
  position: relative;
  padding: 1.25rem 2rem;
  text-align: center;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   5. Section Titles & Alternating Layouts
   -------------------------------------------------------------------------- */
.section-title {
  position: relative;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.bg-light-section {
  background-color: var(--color-light-gray);
}

.bg-dark-section {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
}

.bg-darker-section {
  background-color: var(--color-darker-navy);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   6. Service Cards
   -------------------------------------------------------------------------- */
.service-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  border-top: 3px solid transparent;
  box-shadow: 0 4px 15px var(--color-navy-shadow);
  padding: 2.25rem 2rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(27, 42, 74, 0.15);
  border-top: 3px solid var(--color-gold);
}

.service-icon,
.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.12);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  transition: background-color var(--transition-normal), color var(--transition-normal), transform var(--transition-normal);
}

.service-card:hover .service-icon,
.service-card:hover .icon-circle {
  background: var(--color-gold);
  color: var(--color-white);
  transform: scale(1.05) rotate(4deg);
}

/* --------------------------------------------------------------------------
   7. Portfolio Cards & Placeholders
   -------------------------------------------------------------------------- */
.portfolio-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.portfolio-card .placeholder-bg {
  height: 250px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.25rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-slow);
}

.portfolio-card:hover .placeholder-bg {
  transform: scale(1.06);
}

.portfolio-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(27, 42, 74, 0.88);
  backdrop-filter: blur(3px);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  transition: opacity var(--transition-normal);
  z-index: 2;
}

.portfolio-card:hover .overlay {
  opacity: 1;
}

/* Varied Gradient Backgrounds for Portfolio Items */
.portfolio-card:nth-child(1) .placeholder-bg {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.portfolio-card:nth-child(2) .placeholder-bg {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.portfolio-card:nth-child(3) .placeholder-bg {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.portfolio-card:nth-child(4) .placeholder-bg {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.portfolio-card:nth-child(5) .placeholder-bg {
  background: linear-gradient(135deg, #fa709a, #fee140);
}

.portfolio-card:nth-child(6) .placeholder-bg {
  background: linear-gradient(135deg, #a18cd1, #fbc2eb);
}

/* --------------------------------------------------------------------------
   8. Testimonial Cards
   -------------------------------------------------------------------------- */
.testimonial-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 18px var(--color-navy-shadow);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: -10px;
  left: 20px;
  font-family: Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--color-gold);
  opacity: 0.15;
  pointer-events: none;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(27, 42, 74, 0.12);
}

/* --------------------------------------------------------------------------
   9. Contact Section & Custom Form Controls
   -------------------------------------------------------------------------- */
.contact-section {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  position: relative;
}

.contact-form .form-control,
.form-input-custom {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  color: var(--color-white);
  font-size: 0.95rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.contact-form .form-control::placeholder,
.form-input-custom::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.contact-form .form-control:focus,
.form-input-custom:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.28);
}

.contact-form textarea.form-control,
textarea.form-input-custom {
  min-height: 130px;
  resize: vertical;
}

.contact-map-wrapper iframe {
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   10. Footer Styling & Social Links
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--color-darker-navy);
  color: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-link {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: inline-block;
}

.footer-link:hover {
  color: var(--color-gold);
  transform: translateX(4px);
}

.social-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-normal), color var(--transition-normal), transform var(--transition-normal);
}

.social-icon-circle:hover {
  background: var(--color-gold);
  color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--color-gold-shadow);
}

/* --------------------------------------------------------------------------
   11. Buttons & Utility Classes
   -------------------------------------------------------------------------- */
.gold-underline::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  margin-top: 15px;
  border-radius: 2px;
}

.gold-underline-center::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-gold);
  margin: 15px auto 0;
  border-radius: 2px;
}

.btn-gold {
  background-color: var(--color-gold);
  color: var(--color-white);
  font-weight: 600;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-gold);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--color-gold-shadow);
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn-gold:hover {
  background-color: var(--color-gold-hover);
  border-color: var(--color-gold-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.45);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  font-weight: 600;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px solid var(--color-white);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-primary-navy);
  transform: translateY(-2px);
}

.btn-outline:active {
  transform: translateY(0);
}

.text-gold {
  color: var(--color-gold) !important;
}

.bg-gold {
  background-color: var(--color-gold) !important;
}

/* --------------------------------------------------------------------------
   12. Keyframe Animations & Staggered Reveal
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  opacity: 0;
}

.fade-in.visible {
  animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delays */
.fade-in.visible:nth-child(1) { animation-delay: 0.05s; }
.fade-in.visible:nth-child(2) { animation-delay: 0.15s; }
.fade-in.visible:nth-child(3) { animation-delay: 0.30s; }
.fade-in.visible:nth-child(4) { animation-delay: 0.45s; }
.fade-in.visible:nth-child(5) { animation-delay: 0.60s; }
.fade-in.visible:nth-child(6) { animation-delay: 0.75s; }

/* --------------------------------------------------------------------------
   13. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-stats {
    flex-wrap: wrap;
  }
  
  .stat-item {
    flex: 1 1 45%;
  }
  
  .stat-item:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }

  .navbar {
    padding: 1rem 0;
  }

  .hero {
    min-height: auto;
    padding-top: 7.5rem;
    padding-bottom: 4rem;
    text-align: center;
  }

  .hero .btn-gold,
  .hero .btn-outline {
    width: 100%;
  }

  .stat-item {
    padding: 1rem;
    flex: 1 1 100%;
  }

  .stat-item::after {
    display: none !important;
  }

  .stat-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .portfolio-card .placeholder-bg {
    height: 220px;
  }

  .testimonial-card {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.65rem;
  }

  .btn-gold,
  .btn-outline {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }

  .portfolio-card .placeholder-bg {
    height: 200px;
    font-size: 1.1rem;
  }

  .social-icon-circle {
    width: 38px;
    height: 38px;
  }
}

/* --------------------------------------------------------------------------
   Hero background
   The single rule the page carried inline instead of here. It is the section's
   photograph plus the navy wash that keeps the white text legible over it.
   -------------------------------------------------------------------------- */
.hero-bg {
  background: linear-gradient(rgba(27, 42, 74, 0.85), rgba(27, 42, 74, 0.95)),
              url('https://images.unsplash.com/photo-1541888081622-4a0058b292e0?q=80&w=2070&auto=format&fit=crop') center/cover;
}

/* A comment just written or edited (main.js refreshComments): lit a moment. */
.comment-flash {
  background-color: rgba(212, 175, 55, 0.15);
  transition: background-color 0.6s ease;
}
