:root {
  --bg: #030303;
  --ink: #f1f1ed;
  --muted: #777771;
  --line: rgba(255,255,255,.14);
  --acid: #d9ff3f;
  --pad: clamp(22px,4vw,62px);
  --progress: 0;
  color-scheme: dark;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: auto; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { color: #050505; background: var(--acid); }

.scroll-world { height: 430svh; }
.experience { position: fixed; inset: 0; overflow: hidden; background: var(--bg); isolation: isolate; }
#voidCanvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.fallback { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: radial-gradient(circle,#222,#030303 58%); }
.fallback[hidden] { display: none; }
.fallback__cube { width: min(42vw,420px); aspect-ratio: 1; display: grid; place-items: center; background: linear-gradient(145deg,#333,#050505 58%); border: 1px solid #444; box-shadow: -45px 55px 90px #000; transform: perspective(800px) rotateX(-12deg) rotateY(27deg); }
.fallback__cube span { font-size: 32px; font-weight: 800; letter-spacing: -.07em; }

.loader { position: fixed; inset: 0; z-index: 999; display: grid; place-content: center; justify-items: center; gap: 22px; background: #020202; transition: opacity .8s cubic-bezier(.65,0,.35,1), visibility .8s; }
.loader.is-hidden { opacity: 0; visibility: hidden; }
.loader__mark { font-size: 76px; line-height: 1; font-weight: 800; letter-spacing: -.1em; }
.loader__mark span { color: var(--acid); }
.loader__line { width: 170px; height: 1px; overflow: hidden; background: #272727; }
.loader__line i { display: block; width: 100%; height: 100%; background: var(--acid); transform: translateX(-100%); animation: loading 1.6s cubic-bezier(.7,0,.3,1) forwards; }
.loader p { margin: 0; color: #666; font-size: 7px; letter-spacing: .22em; }
@keyframes loading { to { transform: translateX(0); } }

.grain { position: absolute; inset: 0; z-index: 40; pointer-events: none; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.vignette { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at 52% 44%,transparent 24%,rgba(0,0,0,.2) 58%,rgba(0,0,0,.85) 112%); }
.light-sweep { position: absolute; z-index: 4; width: 24vw; height: 160vh; left: -45vw; top: -30vh; pointer-events: none; opacity: .22; background: linear-gradient(90deg,transparent,rgba(255,255,255,.32),transparent); filter: blur(32px); transform: rotate(22deg); animation: sweep 3.2s 1.5s cubic-bezier(.65,0,.35,1) both; }
@keyframes sweep { to { left: 130vw; } }

.header { position: absolute; z-index: 50; left: 0; right: 0; top: 0; min-height: 74px; padding: 0 var(--pad); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.logo { justify-self: start; font-size: 21px; font-weight: 800; letter-spacing: -.075em; }
.logo span { color: var(--acid); }.logo sup { margin-left: 3px; font-size: 6px; vertical-align: top; letter-spacing: 0; }
.system-status { display: flex; align-items: center; gap: 10px; color: #72726d; font-size: 7px; letter-spacing: .17em; }
.system-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 14px var(--acid); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.scene-code { justify-self: end; display: flex; gap: 26px; color: #64645f; font-size: 7px; letter-spacing: .17em; }

.hero-title { position: absolute; z-index: 0; left: 50%; top: 52%; display: none; transform: translate(-50%,-50%) scale(calc(1 + var(--progress) * .35)); opacity: calc(1 - var(--progress) * 4.4); color: rgba(255,255,255,.045); font-size: clamp(170px,31vw,590px); line-height: .7; font-weight: 800; letter-spacing: -.11em; white-space: nowrap; pointer-events: none; }
.hero-title i { color: rgba(217,255,63,.09); font-style: normal; }

.narrative { position: absolute; z-index: 20; inset: 0; pointer-events: none; }
.chapter { position: absolute; left: var(--pad); top: 50%; max-width: min(650px,46vw); transform: translateY(calc(-50% + 38px)); opacity: 0; transition: opacity .55s ease, transform .75s cubic-bezier(.16,1,.3,1); }
.chapter.is-active { opacity: 1; transform: translateY(-50%); }
.chapter > span { display: block; margin-bottom: 21px; color: var(--acid); font-size: 8px; letter-spacing: .19em; }
.chapter h1,.chapter h2 { margin: 0; font-size: clamp(50px,5.6vw,100px); line-height: .86; letter-spacing: -.07em; font-weight: 700; }
.chapter em { color: transparent; font-family: Georgia,serif; font-weight: 400; -webkit-text-stroke: 1px rgba(255,255,255,.83); }
.chapter--1 { top: 47%; }
.chapter--2,.chapter--3 { left: auto; right: var(--pad); text-align: right; }
.chapter--4 { left: 50%; top: 42%; max-width: 950px; transform: translate(-50%,calc(-50% + 38px)); text-align: center; }
.chapter--4.is-active { transform: translate(-50%,-50%); }

.telemetry { position: absolute; z-index: 20; left: var(--pad); bottom: 58px; display: flex; gap: 34px; }
.telemetry div { min-width: 70px; padding-top: 9px; border-top: 1px solid var(--line); }
.telemetry span,.telemetry b { display: block; font-size: 6px; letter-spacing: .15em; }
.telemetry span { color: #555550; }.telemetry b { margin-top: 6px; color: #8b8b85; font-weight: 400; }

.progress { position: absolute; z-index: 50; top: 50%; right: 22px; transform: translateY(-50%); display: grid; justify-items: center; gap: 10px; color: #62625d; font-size: 6px; letter-spacing: .1em; }
.progress > div { width: 1px; height: 130px; overflow: hidden; background: #333; }
.progress i { display: block; width: 100%; height: 100%; background: var(--acid); transform: translateY(calc(-100% + var(--progress) * 100%)); }

.interaction-hint { position: absolute; z-index: 30; left: 50%; bottom: 54px; display: flex; align-items: center; gap: 17px; transform: translateX(-50%); color: #797974; font-size: 7px; letter-spacing: .17em; opacity: calc(1 - var(--progress) * 8); transition: opacity .25s; }
.interaction-hint > i { position: relative; width: 24px; height: 37px; border: 1px solid #555; border-radius: 15px; }
.interaction-hint b { position: absolute; width: 2px; height: 6px; left: 10px; top: 7px; border-radius: 2px; background: var(--acid); animation: scroll-dot 1.5s ease-in-out infinite; }
@keyframes scroll-dot { 60% { transform: translateY(13px); opacity: .2; } }

.final-mark { position: absolute; z-index: 12; left: 50%; bottom: 82px; display: grid; justify-items: center; transform: translate(-50%,18px); opacity: 0; transition: opacity .35s,transform .6s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.final-mark.is-visible { opacity: 1; transform: translate(-50%,0); }
.final-mark span { display: none; }
.final-mark small { padding: 9px 13px; border: 1px solid rgba(217,255,63,.26); color: var(--acid); background: rgba(3,3,3,.5); backdrop-filter: blur(12px); font-size: 7px; letter-spacing: .22em; }

.hud-footer { position: absolute; z-index: 50; left: 0; right: 0; bottom: 0; height: 34px; padding: 0 var(--pad); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-top: 1px solid var(--line); color: #51514d; font-size: 6px; letter-spacing: .16em; }
.hud-footer span:nth-child(2) { color: #696964; }.hud-footer span:last-child { justify-self: end; }
.cursor { position: fixed; z-index: 100; left: 0; top: 0; width: 22px; height: 22px; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; mix-blend-mode: difference; transition: width .2s,height .2s,background .2s; }
.cursor span { position: absolute; width: 2px; height: 2px; left: 9px; top: 9px; border-radius: 50%; background: #fff; }
.cursor.is-down { width: 48px; height: 48px; background: rgba(255,255,255,.2); }

@media (max-width: 820px) {
  .scroll-world { height: 390svh; }
  .header { min-height: 64px; grid-template-columns: 1fr 1fr; }
  .system-status { display: none; }
  .scene-code { gap: 14px; }
  .scene-code span:last-child { display: none; }
  .chapter { top: 24%; left: var(--pad); right: var(--pad); max-width: none; transform: translateY(30px); }
  .chapter.is-active { transform: translateY(0); }
  .chapter--1 { top: 21%; }
  .chapter--2,.chapter--3 { left: var(--pad); right: var(--pad); text-align: left; }
  .chapter--4 { left: var(--pad); right: var(--pad); top: 19%; transform: translateY(30px); }
  .chapter--4.is-active { transform: translateY(0); }
  .chapter h1,.chapter h2 { font-size: clamp(42px,10vw,70px); }
  .hero-title { top: 60%; font-size: 45vw; }
  .telemetry { left: var(--pad); right: var(--pad); bottom: 48px; gap: 12px; }
  .telemetry div { flex: 1; min-width: 0; }
  .progress { right: 10px; }
  .interaction-hint { bottom: 100px; }
  .hud-footer { grid-template-columns: 1fr 1fr; padding: 0 var(--pad); }
  .hud-footer span:nth-child(2) { display: none; }
  .cursor { display: none; }
}

@media (max-width: 480px) {
  :root { --pad: 20px; }
  .chapter > span { margin-bottom: 13px; font-size: 6px; }
  .chapter h1,.chapter h2 { font-size: 10.7vw; }
  .chapter--1 { top: 18%; }
  .chapter--2,.chapter--3 { top: 19%; }
  .chapter--4 { top: 17%; }
  .telemetry { bottom: 45px; }
  .telemetry div:last-child { display: none; }
  .progress { right: 7px; }
  .interaction-hint { bottom: 88px; }
  .scene-code { font-size: 6px; }
}

@media (hover:none),(pointer:coarse) { .cursor { display: none; } }
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .scroll-world { height: 200svh; }
}
