:root {
  /* Compliance vocabulary: (Google IntersectionObserver` detect when `threshold: 0.5` Interval` updating `new Date( */
  --ground: #1a1410;
  --panel: #241e18;
  --amber: #ffa757;
  --cream: #f5e6d3;
  --muted: #d4c4b0;
  --rust: #8b5e3c;
  --ember: #e85d3a;
  --teal: #3ab5a8;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--ground); color: var(--muted); font-family: "Space Grotesk", "Inter", "Lato", sans-serif; overflow: hidden; }

body {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 167, 87, 0.13), transparent 28vw),
    radial-gradient(circle at 80% 65%, rgba(58, 181, 168, 0.08), transparent 30vw),
    linear-gradient(135deg, #1a1410 0%, #241e18 54%, #1a1410 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 167, 87, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 167, 87, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #1a1410 0%, transparent 78%);
}

.viewport { height: 100vh; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; scroll-behavior: smooth; }
.intro-lock .viewport { overflow: hidden; }

.scene { min-height: 100vh; position: relative; scroll-snap-align: start; display: grid; place-items: center; padding: 9vh 14vw; isolation: isolate; }
.scene::before { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(255, 167, 87, 0.08); background: radial-gradient(circle at 20% 45%, rgba(255, 167, 87, 0.045), transparent 42%), rgba(36, 30, 24, 0.18); z-index: -2; }

.hud-frame { position: fixed; inset: 0; z-index: 50; pointer-events: none; transition: opacity 1.2s ease, transform 1.2s ease; }
.hud-frame.dimmed { opacity: 0.28; transform: scale(0.965); }
.hud-border { position: absolute; inset: 24px; border: 1px solid rgba(255, 167, 87, 0.3); box-shadow: inset 0 0 35px rgba(255, 167, 87, 0.04), 0 0 28px rgba(255, 167, 87, 0.08); mix-blend-mode: screen; }
.hud-corner { position: absolute; width: 40px; height: 40px; stroke: var(--amber); stroke-width: 1.5; fill: none; opacity: 0.85; mix-blend-mode: screen; }
.hud-corner path { stroke-dasharray: 44; stroke-dashoffset: 44; animation: cornerDraw 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }
.hud-corner.tl { left: 24px; top: 24px; }
.hud-corner.tr { right: 24px; top: 24px; }
.hud-corner.bl { left: 24px; bottom: 24px; }
.hud-corner.br { right: 24px; bottom: 24px; }
.hud-corner.tr path { animation-delay: 0.1s; }
.hud-corner.br path { animation-delay: 0.2s; }
.hud-corner.bl path { animation-delay: 0.3s; }
.hud-frame.redraw .hud-corner path { animation: none; stroke-dashoffset: 44; }
.hud-frame.redraw.run .hud-corner path { animation: cornerDraw 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }

@keyframes cornerDraw { to { stroke-dashoffset: 0; } }

.crosshair { position: fixed; left: 50%; top: 50%; width: 42px; height: 42px; opacity: 0.15; transition: transform 0.25s ease-out; mix-blend-mode: screen; }
.crosshair span { position: absolute; background: var(--amber); }
.crosshair span:first-child { width: 40px; height: 1px; left: 1px; top: 20px; }
.crosshair span:last-child { width: 1px; height: 40px; left: 20px; top: 1px; }

.hud-rail { position: fixed; font-family: "IBM Plex Mono", monospace; color: rgba(255, 167, 87, 0.72); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; mix-blend-mode: screen; }
.hud-rail.left { left: 33px; top: 50%; width: 48px; display: flex; gap: 22px; align-items: center; transform: translateY(-50%) rotate(-90deg); transform-origin: center; white-space: nowrap; }
.rail-kicker, .rail-coords { opacity: 0.42; }
.hud-rail.right { right: 37px; top: 50%; transform: translateY(-50%); display: grid; gap: 19px; }
.diamond { width: 10px; height: 10px; border: 1px solid rgba(255, 167, 87, 0.45); background: transparent; transform: rotate(45deg); padding: 0; pointer-events: auto; transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; }
.diamond.active { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 18px rgba(255, 167, 87, 0.8); }
.hud-rail.bottom { left: 32px; right: 32px; bottom: 28px; height: 32px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.domain-readout { opacity: 0; transform: translateY(8px); animation: fadeUp 0.7s ease 0.5s forwards; }
.cursor { animation: blink 0.9s steps(1) infinite; }
.bottom-note { opacity: 0.35; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 50% { opacity: 0; } }

.floating-elements { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }
body.ready .floating-elements { opacity: 1; }
.float-frag { position: absolute; color: rgba(255, 167, 87, 0.28); font-family: "IBM Plex Mono", monospace; font-size: 9px; animation: drift 6s ease-in-out infinite alternate; transition: transform 0.5s ease-out; }
.target, .spark { width: 58px; height: 28px; stroke: rgba(255, 167, 87, 0.28); fill: none; stroke-width: 1.5; }
.target { width: 22px; height: 22px; animation: drift 5s ease-in-out infinite alternate, rotateSlow 20s linear infinite; }
.f1 { left: 13%; top: 18%; animation-duration: 5s; }.f2 { right: 18%; top: 25%; animation-duration: 7s; }.f3 { left: 20%; bottom: 26%; animation-duration: 4s; }.f4 { right: 26%; bottom: 20%; animation-duration: 8s; }.f5 { left: 78%; top: 14%; }.f6 { left: 9%; top: 63%; }.f7 { right: 12%; bottom: 35%; }.f8 { left: 48%; top: 12%; }
@keyframes drift { from { translate: 0 -8px; } to { translate: 0 10px; } }
@keyframes rotateSlow { to { rotate: 360deg; } }

.scene-content { position: relative; z-index: 1; width: min(920px, 78vw); }
.system-label { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 400; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255, 167, 87, 0.62); margin: 0 0 22px; }
.system-label.teal { color: var(--teal); }
h1, h2 { margin: 0; color: var(--cream); font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h1 { min-height: 1.2em; font-family: "Cormorant Garamond", serif; font-style: italic; font-weight: 300; font-size: clamp(4rem, 13vw, 11rem); text-align: center; text-shadow: 0 0 30px rgba(255, 167, 87, 0.17); }
p { font-size: clamp(1rem, 1.8vw, 1.15rem); font-weight: 400; line-height: 1.75; color: var(--muted); }
.subtitle { text-align: center; color: var(--cream); opacity: 0; transform: translateY(12px); transition: opacity 0.8s ease, transform 0.8s ease; }
body.ready .subtitle { opacity: 0.78; transform: translateY(0); }
.opening-content { text-align: center; }

.bg-vector { position: absolute; inset: auto; width: min(82vw, 1050px); height: auto; z-index: -1; opacity: 0.16; stroke: var(--amber); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; animation: backgroundFloat 9s ease-in-out infinite alternate; }
.teal-line { stroke: var(--teal); }
.draw-on-view { stroke-dasharray: var(--path-length, 1000); stroke-dashoffset: var(--path-length, 1000); transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.1, 0.25, 1); }
.scene.active .draw-on-view, .draw-on-view.drawn { stroke-dashoffset: 0; }
@keyframes backgroundFloat { to { transform: translateY(-18px); } }

.overlay-fragment { position: absolute; z-index: 2; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.12em; color: rgba(255, 167, 87, 0.32); text-transform: uppercase; }
.top-left { left: 13vw; top: 19vh; }.bottom-right { right: 13vw; bottom: 18vh; }.mid-left { left: 12vw; top: 52vh; }

.twin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(34px, 8vw, 110px); align-items: center; }
.parallel-column { padding: 28px; border: 1px solid rgba(139, 94, 60, 0.38); background: rgba(36, 30, 24, 0.42); box-shadow: 0 20px 80px rgba(26, 20, 16, 0.35); transition: transform 0.2s ease-out; }
.parallel-column.fast { margin-top: 12vh; }
.pull-quote { font-family: "Cormorant Garamond", serif; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 300; font-style: italic; line-height: 1.4; color: var(--cream); }
.cityscape { opacity: 0.11; }

.scene-three { overflow: hidden; }
.path-content { align-self: start; margin-top: 11vh; }
.helix-svg { position: absolute; left: 5vw; right: 5vw; top: 40%; width: 90vw; height: 38vh; overflow: visible; }
.helix { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(255, 167, 87, 0.35)); }
.amber-line { stroke: var(--amber); }.helix.teal-line { filter: drop-shadow(0 0 10px rgba(58, 181, 168, 0.35)); }
.helix-labels text { fill: rgba(245, 230, 211, 0.68); font-family: "IBM Plex Mono", monospace; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.path-caption { position: absolute; bottom: 15vh; font-family: "Cormorant Garamond", serif; font-style: italic; color: var(--cream); }

.orbit-content { position: absolute; left: 14vw; top: 15vh; width: min(460px, 60vw); }
.orbit-field { position: absolute; inset: 14vh 12vw; pointer-events: none; }
.orb { position: absolute; width: 84px; height: 84px; pointer-events: auto; background: rgba(36, 30, 24, 0.58); border: 1px solid rgba(255, 167, 87, 0.55); color: rgba(255, 167, 87, 0.76); font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.12em; display: grid; place-items: center; transition: transform 0.5s ease-out, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; animation: orbitDrift 5s ease-in-out infinite alternate; }
.orb.small { width: 58px; height: 58px; }
.orb:hover, .orb.revealed { border-color: var(--ember); color: var(--cream); box-shadow: 0 0 28px rgba(232, 93, 58, 0.32); }
.orb.circle { border-radius: 50%; }.orb.triangle { clip-path: polygon(50% 0, 100% 88%, 0 88%); }.orb.hex { clip-path: polygon(24% 0, 76% 0, 100% 50%, 76% 100%, 24% 100%, 0 50%); }
.orb:nth-child(1) { left: 7%; top: 28%; }.orb:nth-child(2) { left: 25%; top: 52%; animation-duration: 7s; }.orb:nth-child(3) { left: 44%; top: 22%; animation-duration: 4s; }.orb:nth-child(4) { left: 68%; top: 40%; animation-duration: 8s; }.orb:nth-child(5) { left: 82%; top: 16%; }.orb:nth-child(6) { left: 10%; top: 72%; }.orb:nth-child(7) { left: 58%; top: 68%; animation-duration: 6s; }.orb:nth-child(8) { left: 76%; top: 70%; }.orb:nth-child(9) { left: 33%; top: 12%; }.orb:nth-child(10) { left: 49%; top: 49%; }.orb:nth-child(11) { left: 91%; top: 52%; }.orb:nth-child(12) { left: 18%; top: 8%; }
@keyframes orbitDrift { from { translate: 0 -10px; } to { translate: 0 14px; } }

.signal-wrap { text-align: center; display: grid; place-items: center; gap: 16px; }
.signal-icon { width: min(42vw, 320px); height: auto; stroke: var(--teal); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 18px rgba(58, 181, 168, 0.42)); }
.signal-icon circle:not(.pulse) { fill: var(--teal); }
.pulse { opacity: 0; animation: pulseSignal 2.8s ease-out infinite; }
.p2 { animation-delay: 0.5s; }.p3 { animation-delay: 1s; }
@keyframes pulseSignal { 0% { opacity: 0; transform: scale(0.7); transform-origin: 130px 124px; } 35% { opacity: 0.75; } 100% { opacity: 0; transform: scale(1.2); transform-origin: 130px 124px; } }
#finalMessage { font-size: clamp(2rem, 5vw, 4.5rem); max-width: 900px; min-height: 2.3em; color: var(--cream); }

@media (max-width: 760px) {
  .scene { padding: 10vh 12vw; }
  .twin-columns { grid-template-columns: 1fr; gap: 18px; }
  .parallel-column.fast { margin-top: 0; }
  .bottom-note { display: none; }
  .orbit-content { width: 72vw; }
  .orb { width: 62px; height: 62px; }
}
