/* ═══════════════════════════════════════════════════════════════════════════
   HSI — ELEVATION LAYER STYLES
   3D hero canvas · native lockups · page transitions · FenceLine beam ·
   magnetic CTAs · sound toggle
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── HERO 3D CANVAS ────────────────────────────────────────────────────────── */
.hero-canvas {
  position: absolute; inset: 0 0 auto 0; width: 100%; height: 100vh;
  max-height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
.hero-inner { position: relative; z-index: 1; }

/* ── NAV LOCKUP (native, replaces iframe) ──────────────────────────────────── */
.nav-lockup { display: inline-flex; align-items: center; gap: 11px; }
.nav-mark { width: 42px; height: 42px; display: block; overflow: visible; }
.nav-word { display: flex; flex-direction: column; line-height: 1; }
.nav-hsi {
  font-family: var(--hsi-display); font-size: 21px;
  color: var(--white); letter-spacing: -0.5px;
}
.nav-tag {
  font-family: var(--hsi-sans); font-weight: 600; font-size: 7px;
  letter-spacing: 2.7px; color: var(--lgray); margin-top: 3px; white-space: nowrap;
}

/* ── HERO LOCKUP (native, replaces iframe) ─────────────────────────────────── */
.hero-lockup-native {
  position: relative; display: flex; flex-direction: column;
  align-items: center; text-align: center; padding: 20px 0 8px;
}
.hlk-halo {
  position: absolute; inset: -40px; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 42%, rgba(240,112,32,0.13), transparent 70%);
}
.hlk-mark { width: 230px; height: auto; display: block; overflow: visible; }
.hlk-word {
  font-family: var(--hsi-display); font-size: 104px; line-height: 0.9;
  letter-spacing: -3px; color: var(--white); display: flex; margin-top: 10px;
}
.hlk-letter { display: inline-block; }
.hlk-sub {
  font-family: var(--hsi-sans); font-weight: 600; font-size: 13px;
  letter-spacing: 5.5px; color: var(--lgray); text-transform: uppercase; margin-top: 12px;
}

/* ── HERO TITLE CHAR SPLIT ─────────────────────────────────────────────────── */
.hero-title { perspective: 700px; }
.hero-title > span { display: block; overflow: hidden; padding-bottom: 0.04em; }
.ht-char { display: inline-block; will-change: transform; }

/* ── PAGE TRANSITION OVERLAY ───────────────────────────────────────────────── */
.pt-overlay {
  position: fixed; inset: 0; z-index: 9500; pointer-events: none;
  display: grid; grid-template-rows: 1fr 1fr 1fr;
}
.pt-band { transform: scaleX(0); transform-origin: left center; will-change: transform; }
.pt-b1 { background: #F07020; }
.pt-b2 { background: #F5A623; }
.pt-b3 { background: #101012; }
.pt-overlay.pt-anim .pt-band { transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1); }
.pt-overlay.pt-anim .pt-band:nth-child(2) { transition-delay: 0.06s; }
.pt-overlay.pt-anim .pt-band:nth-child(3) { transition-delay: 0.12s; }
.pt-overlay.pt-cover .pt-band { transform: scaleX(1); }
.pt-overlay.pt-from-right .pt-band { transform-origin: right center; }
.pt-mark {
  position: absolute; left: 50%; top: 50%; width: 88px; height: 88px;
  transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.25s ease;
}
.pt-overlay.pt-cover .pt-mark { opacity: 0.9; }

/* ── SOUND TOGGLE ──────────────────────────────────────────────────────────── */
.sound-toggle {
  position: fixed; left: 22px; bottom: 22px; z-index: 6000;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(20, 20, 22, 0.8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--lgray); display: flex; align-items: center; justify-content: center;
  cursor: none; transition: color 0.2s, border-color 0.2s, transform 0.15s;
  padding: 0;
}
.sound-toggle:hover { color: var(--orange); border-color: var(--orange); }
.sound-toggle:active { transform: scale(0.92); }
.sound-toggle svg { width: 18px; height: 18px; }
@media (hover: none), (max-width: 1024px) { .sound-toggle { display: none; } }

/* ── DESKTOP MOTION LAYER (GSAP active) ────────────────────────────────────── */
/* ── ROUTE RAIL (journey progress) ── */
.route-rail {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%);
  z-index: 5500; display: none; flex-direction: column; align-items: center; gap: 14px;
}
.rr-line {
  position: relative; width: 2px; height: 38vh;
  background: rgba(255, 255, 255, 0.08); border-radius: 2px;
}
.rr-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--orange), var(--amber));
  transform: scaleY(0); transform-origin: top; border-radius: 2px;
}
.rr-marker {
  position: absolute; left: 50%; top: 0; width: 14px; height: 14px;
  transform: translate(-50%, -50%);
}
.rr-marker svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(240, 112, 32, 0.8)); }
.rr-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.22em;
  color: var(--lgray); writing-mode: vertical-rl; text-transform: uppercase; white-space: nowrap;
}

/* ── TRACKING MILESTONE CHIPS ── */
.ms-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--amber);
  border: 1px solid rgba(245, 166, 35, 0.35); border-radius: 2px;
  padding: 6px 12px; margin-bottom: 18px;
}
.ms-chip .ms-num { color: var(--lgray); }
.ms-chip .ms-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite;
}
.cta-inner .ms-chip { margin-bottom: 28px; }

@media (hover: hover) and (min-width: 1025px) {
  body:not(.no-gsap) .route-rail { display: flex; }
  /* FenceLine scroll beam */
  .fenceline-phases-large { position: relative; }
  .fl-beam {
    position: absolute; left: 30px; top: 32px; bottom: 48px; width: 3px;
    background: rgba(255, 255, 255, 0.05); border-radius: 3px;
    overflow: hidden; display: none;
  }
  .fl-beam-fill {
    position: absolute; inset: 0; transform: scaleY(0); transform-origin: top;
    background: linear-gradient(180deg, var(--orange), var(--amber));
  }
  body:not(.no-gsap) .fl-beam { display: block; }
  body:not(.no-gsap) .phase-line { display: none; }
  body:not(.no-gsap) .fenceline-phase-item {
    opacity: 0.3 !important; transform: none !important;
    transition: opacity 0.35s ease;
  }
  body:not(.no-gsap) .fenceline-phase-item.fl-active { opacity: 1 !important; }
  body:not(.no-gsap) .fenceline-phase-item.fl-active .phase-circle {
    border-color: var(--orange); background: rgba(240, 112, 32, 0.12);
    box-shadow: 0 0 26px rgba(240, 112, 32, 0.28);
  }

  /* GSAP owns transforms on these — neutralize CSS transform transitions */
  body:not(.no-gsap) .service-card.reveal.visible { transition: background 0.3s; }
  body:not(.no-gsap) .coverage-map.reveal { opacity: 1; transform: none; transition: none; }
  .magnetic { transition: background 0.2s, border-color 0.2s, color 0.2s; }

  /* Lenis owns scrolling */
  html.lenis-on { scroll-behavior: auto; }

  .service-card { transform-style: preserve-3d; will-change: transform; }
}

/* ── MOBILE PARITY — same design language, IO-driven ───────────────────────── */
body.fl-mobile .fenceline-phases-large { position: relative; }
body.fl-mobile .fl-beam {
  position: absolute; left: 30px; top: 32px; bottom: 48px; width: 3px;
  background: rgba(255, 255, 255, 0.05); border-radius: 3px;
  overflow: hidden; display: block;
}
body.fl-mobile .fl-beam-fill {
  position: absolute; inset: 0; transform: scaleY(0); transform-origin: top;
  background: linear-gradient(180deg, var(--orange), var(--amber));
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
body.fl-mobile .phase-line { display: none; }
body.fl-mobile .fenceline-phase-item .phase-circle {
  transition: border-color 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}
body.fl-mobile .fenceline-phase-item.fl-active .phase-circle {
  border-color: var(--orange); background: rgba(240, 112, 32, 0.12);
  box-shadow: 0 0 26px rgba(240, 112, 32, 0.28);
}

/* ── REDUCED MOTION / FALLBACKS ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fenceline-phase-item { opacity: 1 !important; transform: none !important; }
  .pt-overlay { display: none; }
}
body.no-gsap .fenceline-phase-item { opacity: 1; }

/* ── RESPONSIVE LOCKUP ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hlk-mark { width: 180px; }
  .hlk-word { font-size: 82px; }
}
@media (max-width: 720px) {
  .hlk-mark { width: 140px; }
  .hlk-word { font-size: 60px; letter-spacing: -2px; }
  .hlk-sub { font-size: 10px; letter-spacing: 4px; }
  .nav-mark { width: 36px; height: 36px; }
  .nav-hsi { font-size: 18px; }
}
