/* ─────────────────────────────────────────────────────
   Hero — desktop default: split two-column, S-curve SVG divider
   Responsive overrides start at max-width: 1023px
   ───────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}

/* Full-bleed video sits behind SVG and text */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #1A1E52;
}

#hero-video-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Poster paints immediately from CSS (preloaded ~55 KB) as the LCP element;
     the video (when it loads) fades in on top. */
  background: #1A1E52 url('/images/hero-poster.jpg') center / cover no-repeat;
}

/* Desktop: shift video right so the van is more visible */
#hero-video-container video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateX(25%);
  opacity: 0;
  transition: opacity 1500ms ease-in-out;
}

#hero-video-container video.active {
  opacity: 1;
}

/* SVG that paints the navy left panel with a sigmoid right edge */
.hero__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.hero__shape path {
  fill: var(--neutral-wood);
}

/* Text panel — transparent; SVG provides the navy background */
.hero__panel {
  position: relative;
  z-index: 2;
  width: 45%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: var(--space-20)
           var(--space-10)
           var(--space-20)
           max(var(--space-10), calc((100vw - var(--max-width)) / 2));
}

.hero__content {
  position: relative;
  color: var(--white);
  max-width: 480px;
  width: 100%;
}

/* ── Hero typography (desktop) ─────────────────────── */

.hero__eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: var(--space-4);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: var(--space-5);
}

.hero__subline {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-5);
  margin-top: calc(-1 * var(--space-3));
}

.hero__lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.hero__content .social-links {
  margin-top: var(--space-8);
}

.hero__secondary-link {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.15s;
  padding-left: 2px;
}
.hero__secondary-link:hover {
  color: rgba(255,255,255,0.9);
}

/* Phone CTA never shown — spec: no phone number in hero on mobile */
.hero__phone-cta {
  display: none;
}

/* Wave divider — desktop: hidden (S-curve SVG handles the split) */
.hero__wave {
  display: none;
}


/* ─────────────────────────────────────────────────────
   Stacked layout — mobile + tablet (≤ 1023px)
   ───────────────────────────────────────────────────── */

@media (max-width: 1023px) {

  /* ── Hero: two stacked blocks ── */
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: hidden;
  }

  /* Block 1: video — tablet height (overridden at ≤767px for mobile) */
  .hero__media {
    position: relative;
    inset: auto;
    flex: none;
    width: 100%;
    height: 50vh;
    z-index: 0;
    overflow: hidden;
    background: #1A1E52;
  }

  /* Gradient at top of video so logo + hamburger are always readable */
  .hero__media::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 110px;
    background: linear-gradient(to bottom, rgba(26,30,82,0.72) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
  }

  /* Wave divider — pulls up to overlap the bottom of the video block */
  .hero__wave {
    display: block;
    position: relative;
    z-index: 5;
    flex: none;
    height: 56px;
    margin-top: -56px;
    /* -2px overlap eliminates sub-pixel gap between wave and panel */
    margin-bottom: -2px;
    pointer-events: none;
  }

  .hero__wave svg {
    display: block;
    width: 100%;
    height: 58px;
  }

  /* Fill full width on stacked layout — no desktop offset */
  #hero-video-container video {
    transform: none;
  }

  /* SVG hidden — Block 2 uses solid navy */
  .hero__shape {
    display: none;
  }

  /* Block 2: content */
  .hero__panel {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: auto;
    background: var(--neutral-wood);
    padding: 32px 28px 48px;
    text-align: left;
    align-items: flex-start;
    clip-path: none;
  }

  .hero__content {
    position: static;
    max-width: 100%;
  }

  .hero__eyebrow {
    font-size: 0.6875rem; /* 11px */
    color: rgba(255,255,255,0.55);
    margin-bottom: 12px;
  }

  .hero__title {
    margin-bottom: 16px;
  }

  .hero__lead {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .hero__actions {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* ── Header backdrop: transparent at top, navy on scroll (mobile/tablet only) ── */
  body.has-hero #nav-backdrop {
    background: transparent;
    box-shadow: none;
  }

  /* Logo and hamburger always visible over the video gradient */
  body.has-hero .header__logo,
  body.has-hero .header__burger {
    position: relative;
    z-index: 1;
  }

  body.has-hero #site-header.scrolled ~ #nav-backdrop {
    background: var(--neutral-wood);
    box-shadow: 0 2px 20px rgba(26,30,82,0.18);
  }

  /* ── Header: show burger, hide desktop phone + CTA ── */
  .header__burger { display: flex; }
  .header__phone  { display: none; }
  .header__cta    { display: none; }

  /* ── Nav drawer: slides in from the right ── */
  #site-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--neutral-wood);
    border-left: 1px solid rgba(255,255,255,0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.3s;
    visibility: hidden;
    z-index: 150;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 80px var(--space-6) var(--space-8);
    /* override desktop flex item behaviour */
    flex: none;
  }

  #site-nav.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
  }

  #site-nav > ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  #site-nav > ul > li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  #site-nav > ul > li > a {
    display: block;
    padding: var(--space-4) 0;
    font-size: 1.0625rem;
  }

  .header__phone-mobile {
    display: block;
    margin-top: var(--space-5);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
  }

  .header__cta--mobile {
    display: block;
    text-align: center;
    margin-top: var(--space-6);
    padding: 12px 24px;
    background: var(--secondary);
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s;
  }

  .header__cta--mobile:hover {
    background: var(--white);
    color: var(--primary);
  }

  /* ── Megamenu: flat accordion inside the drawer ── */
  .nav-megamenu-toggle {
    font-size: 1.0625rem;
    padding: var(--space-4) 0;
    width: 100%;
    justify-content: space-between;
  }

  .megamenu {
    position: static;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 var(--space-2) var(--space-4);
    background: transparent;
    gap: 0;
    flex-direction: column;
  }

  .megamenu__col + .megamenu__col {
    margin-top: var(--space-2);
  }

  .megamenu__col ul a {
    font-size: 0.9375rem;
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .megamenu__heading {
    margin-top: var(--space-4);
    font-size: 0.6875rem;
  }
}

/* ── Mobile only (≤ 767px): shorter video block, larger headline ── */
@media (max-width: 767px) {
  .hero__media {
    height: 45vh;
  }

  .hero__title {
    font-size: clamp(2.125rem, 9vw, 2.375rem);
  }
}


/* ─────────────────────────────────────────────────────
   Nav overlay backdrop
   ───────────────────────────────────────────────────── */

#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 140;
  cursor: pointer;
}

#nav-overlay.active {
  display: block;
}

body.nav-open {
  overflow: hidden;
}


/* ─────────────────────────────────────────────────────
   Site header (desktop defaults)
   ───────────────────────────────────────────────────── */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* Transparent — #nav-backdrop (z-index:98) provides the visible background,
     letting the page-hero mascot (z-index:99) slot between them */
  background: transparent;
  transition: background 0.35s ease;
}

/* ── Nav backdrop: the visible navy background layer ──
   Sits at z-index:98 so the page-hero mascot (z-index:99) can overlap it
   while remaining behind the header's nav elements (z-index:100) ── */
#nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--neutral-wood);
  z-index: 98;
  transition: background 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
}

#site-header.scrolled ~ #nav-backdrop {
  box-shadow: 0 2px 20px rgba(26,30,82,0.18);
}

/* When nav drawer is open, raise header above the overlay (z-index:140) so
   the drawer (inside header's stacking context) isn't covered by the backdrop */
body.nav-open #site-header {
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-3);
  position: relative;
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.header__logo img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

#site-nav {
  flex: 1;
}

#site-nav > ul {
  list-style: none;
  display: flex;
  gap: var(--space-6);
  padding: 0;
  margin: 0;
  align-items: center;
}

#site-nav ul a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: color 0.2s;
}
#site-nav ul a:hover { color: #fff; }

.header__phone {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s;
}
.header__phone:hover { color: #fff; }

.header__phone-mobile {
  display: none;
}

.header__cta--mobile {
  display: none;
}

.header__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--secondary);
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.header__cta:hover {
  background: var(--white);
  color: var(--primary);
}

/* Hamburger — mobile-first (visible by default, hidden at desktop widths) */
.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.header__burger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

/* X state when nav open */
.header__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger.open span:nth-child(2) { opacity: 0; }
.header__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1024px) {
  .header__burger { display: none; }
}


/* ─────────────────────────────────────────────────────
   Services megamenu (desktop)
   ───────────────────────────────────────────────────── */

.has-megamenu {
  position: relative;
}

.nav-megamenu-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.9375rem;
  font-weight: 400;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: color 0.2s;
  line-height: inherit;
}
.nav-megamenu-toggle:hover,
.has-megamenu.open > .nav-megamenu-toggle {
  color: #fff;
}

.nav-arrow {
  font-size: 0.65em;
  transition: transform 0.2s;
  display: inline-block;
  margin-top: 1px;
}
.has-megamenu.open .nav-arrow {
  transform: rotate(180deg);
}

.megamenu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: -20px;
  background: var(--neutral-wood);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: var(--space-6);
  min-width: 460px;
  z-index: 200;
  gap: var(--space-8);
}

.has-megamenu.open .megamenu {
  display: flex;
}

.megamenu__col {
  flex: 1;
  min-width: 200px;
}

.megamenu__heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.megamenu__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.megamenu__col ul li {
  border-bottom: none !important;
  width: auto !important;
}

.megamenu__col ul a {
  display: block;
  padding: var(--space-2) 0;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
}
.megamenu__col ul a:hover {
  color: #fff;
}
