/* FOLDSPACE — one brand with the deck: pure black, Helvetica Neue Light,
   uppercase letter-spaced micro labels, orange black hole, one cyan fold line. */
:root {
  --fg: #fff;
  --muted: rgba(255, 255, 255, .66);
  --dim: rgba(255, 255, 255, .4);
  --line: rgba(255, 255, 255, .14);
  --cyan: #3DF2FF;
  --font: "Helvetica Neue", Helvetica, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 5.5vw, 96px);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: #000; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #000; color: var(--fg); font-family: var(--font); font-weight: 300; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 300; letter-spacing: -.005em; }
h2 { font-size: clamp(34px, 5.4vw, 84px); line-height: 1.05; }
.label { margin: 0; font-size: 11px; font-weight: 400; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.label i { font-style: normal; margin: 0 .6em; color: var(--dim); }

/* fixed starfield behind everything, like every deck slide */
.stars { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main, .nav { position: relative; z-index: 1; }

/* the single cyan accent */
.fold-line {
  height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(61,242,255,.85) 14%, #effeff 62%, rgba(61,242,255,.85) 88%, transparent);
  box-shadow: 0 0 12px 1px rgba(61,242,255,.5), 0 0 40px 5px rgba(61,242,255,.18);
  border-radius: 2px;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border: 1px solid rgba(255,255,255,.7); font-size: 11px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s; white-space: nowrap;
}
.btn:hover { background: #fff; color: #000; border-color: #fff; }
.btn-solid { background: #fff; color: #000; border-color: #fff; }
.btn-solid:hover { background: transparent; color: #fff; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 10px; border-color: rgba(255,255,255,.45); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.ctas.center { justify-content: center; }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; height: 68px; padding: 0 var(--pad); padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between; transition: background .4s; }
.nav.solid { background: rgba(0,0,0,.7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { font-size: 14px; font-weight: 400; letter-spacing: .36em; }
.nav-links { display: flex; gap: 10px; }
@media (max-width: 480px) { .nav-links .btn:first-child { display: none; } }

/* ------------------------------------------------------------ 1 hero */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; background: #000; }
.hero-video, .hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; }
.hero-poster { display: none; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.15) 45%, transparent 65%), linear-gradient(0deg, #000 0%, transparent 25%); }
.hero-copy { position: absolute; left: var(--pad); right: var(--pad); top: 50%; transform: translateY(-50%); max-width: 860px; }
.hero h1 { font-size: clamp(58px, 9.4vw, 170px); line-height: .95; font-weight: 300; margin: 22px 0 20px; letter-spacing: 0; }
.hero .fold-line { width: calc(100% + var(--pad)); margin-left: calc(-1 * var(--pad)); transform-origin: left; animation: foldIn 2s cubic-bezier(.2,.7,.1,1) .2s both; }
.tagline { font-size: clamp(20px, 2.5vw, 36px); margin: 22px 0 40px; }
@keyframes foldIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.hero .label, .tagline, .hero .ctas { animation: rise 1.4s cubic-bezier(.2,.7,.1,1) both; }
.tagline { animation-delay: .5s; } .hero .ctas { animation-delay: .8s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 20px; height: 56px; transform: translateX(-50%); display: flex; justify-content: center; }
.scroll-cue b { width: 1px; height: 100%; background: linear-gradient(#fff, transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 700px) {
  .hero-video, .hero-poster { object-position: 76% 38%; }
  .hero-copy { top: auto; bottom: 96px; transform: none; }
  .hero-shade { background: linear-gradient(0deg, #000 0%, rgba(0,0,0,.75) 42%, transparent 68%); }
  .tagline { margin-bottom: 28px; }
  .ctas .btn { flex: 1 1 auto; }
  .hero .ctas .btn:first-child { flex-basis: 100%; }
}

/* ------------------------------------------------------------ 2 device */
.device { position: relative; height: 320vh; }
.device-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 80px var(--pad) 40px; }
.device-head { text-align: center; margin-bottom: clamp(20px, 5vh, 56px); }
.device-head h2 { margin-top: 18px; font-size: clamp(28px, 4.2vw, 64px); }
.device-head h2 span { transition: opacity .5s; }
.device-head h2 span.off { opacity: .28; }
.readout { margin-top: clamp(16px, 4vh, 44px); display: flex; gap: 14px; align-items: baseline; }
.readout b { font-weight: 300; font-size: 22px; letter-spacing: .06em; color: var(--fg); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }

.rig { --w: min(74vw, 620px, 95vh); --h: calc(var(--w) * .56); perspective: 2000px; perspective-origin: 50% 20%; width: var(--w); height: calc(var(--h) * 1.5); position: relative; }
.duo { position: absolute; left: 0; right: 0; top: 50%; height: 0; transform-style: preserve-3d; transform: translateY(calc(var(--h) * .1)); }
.half { position: absolute; left: 0; width: var(--w); height: var(--h); transform-style: preserve-3d; }
.base { top: 0; transform-origin: 50% 0; transform: rotateX(64deg); }
.lid { bottom: 0; transform-origin: 50% 100%; transform: rotateX(calc((64 + var(--hinge) - 180) * 1deg)); }
.bezel, .face { position: absolute; inset: 0; }
.bezel {
  border-radius: 18px; padding: 10px; background: linear-gradient(160deg, #2b2e33, #0c0d0f 40%, #17181b);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.25), 0 30px 60px rgba(0,0,0,.6);
}
.base .bezel { border-radius: 0 0 18px 18px; padding-top: 4px; }
.lid .bezel { border-radius: 18px 18px 0 0; padding-bottom: 4px; }
.screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; }
.base .screen { border-radius: 0 0 9px 9px; }
.lid .screen { border-radius: 9px 9px 0 0; }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.04)); }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateX(180deg); border-radius: 18px 18px 0 0; background: linear-gradient(200deg, #25272b, #0b0c0e 55%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; }
.outer { width: 62%; height: 70%; border-radius: 12px; background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.outer strong { font-weight: 300; letter-spacing: .3em; font-size: clamp(11px, 2.2vw, 20px); color: var(--cyan); text-shadow: 0 0 14px rgba(61,242,255,.6); }
.outer .ly { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.outer .label { font-size: 8px; }
.game canvas { width: 100%; height: 100%; }
.game .fallback { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.no-webgl .game canvas { display: none; }
.no-webgl .game .fallback { display: block; }
.warp-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s;
  background: radial-gradient(ellipse at 50% 100%, rgba(61,242,255,.35), rgba(0,0,0,.9) 60%); }
.warp-veil span { letter-spacing: .4em; font-size: clamp(10px, 1.6vw, 16px); color: #eaffff; text-shadow: 0 0 12px var(--cyan); }
.console { background: #000; }
.hud { width: 100%; height: 100%; }
.hud-line path { stroke: var(--cyan); stroke-width: 1; fill: none; opacity: .7; }
.hud text { font-family: var(--mono); fill: var(--cyan); }
.hud .t-lbl { font-size: 11px; letter-spacing: .2em; opacity: .75; }
.hud .t-lbl.dim { opacity: .4; }
.hud .t-big { font-size: 52px; font-family: var(--font); font-weight: 300; fill: #fff; }
.hud .t-val { font-size: 18px; fill: #fff; font-family: var(--font); letter-spacing: .12em; }
.hud .bar-bg { fill: rgba(61,242,255,.18); }
.hud .bar { fill: var(--cyan); transition: width .2s; }
/* the hinge itself */
.lid::after { content: ""; position: absolute; left: 3%; right: 3%; bottom: -2px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, #111, #555 20%, #888 50%, #555 80%, #111); transform: translateZ(-1px); }
@media (max-width: 700px) { .rig { --w: 88vw; } .bezel { padding: 6px; border-radius: 12px; } .base .bezel { border-radius: 0 0 12px 12px; } .lid .bezel { border-radius: 12px 12px 0 0; } .hud .t-lbl { font-size: 13px; } }

/* ------------------------------------------------------------ 3 moves */
.move { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; background: #000; }
.move img { position: absolute; top: 0; bottom: 0; right: 0; width: min(62%, 120vh); height: 100%; object-fit: cover; opacity: .95; transform: scale(1.08); transition: transform 6s cubic-bezier(.2,.7,.1,1); }
.move.right img { right: auto; left: 0; }
.move.seen img { transform: scale(1); }
.move::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #000 34%, rgba(0,0,0,.5) 46%, transparent 62%); }
.move.right::before { background: linear-gradient(270deg, #000 34%, rgba(0,0,0,.5) 46%, transparent 62%); }
.move-copy { position: relative; z-index: 2; padding: 0 var(--pad); max-width: min(900px, 52%); }
.move.right .move-copy { margin-left: auto; text-align: right; }
.move h3 { margin-top: 20px; font-size: clamp(44px, 7.6vw, 128px); line-height: 1; font-weight: 300; }
.move h3 b { font-weight: 300; color: var(--cyan); text-shadow: 0 0 22px rgba(61,242,255,.55); display: inline-block; padding: 0 .12em; }
@media (max-width: 800px) {
  .move { align-items: flex-end; }
  .move img, .move.right img { width: 100%; left: 0; right: 0; height: 72%; }
  .move::before, .move.right::before { background: linear-gradient(0deg, #000 30%, rgba(0,0,0,.5) 50%, transparent 72%); }
  .move-copy, .move.right .move-copy { text-align: left; margin: 0; padding-bottom: 72px; max-width: none; }
}

/* ------------------------------------------------------------ 4 destinations */
.dest, .gameplay { position: relative; min-height: 100vh; min-height: 100svh; padding: 140px 0 80px; display: flex; flex-direction: column; justify-content: center; }
.dest-head { padding: 0 var(--pad); margin-bottom: 56px; }
.dest-head .hint { margin-top: 22px; color: var(--dim); }
.dest-head h2 { margin-top: 18px; }
.strip { display: flex; gap: clamp(14px, 2vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--pad) 24px; scroll-padding: 0 var(--pad); scrollbar-width: none; overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
.card { flex: 0 0 min(76vw, 440px); margin: 0; scroll-snap-align: start; position: relative; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.card figcaption { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.card strong { font-weight: 300; font-size: clamp(34px, 3.6vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; }
.card strong em, .final em { font-style: normal; }

/* ------------------------------------------------------------ 5 gameplay */
.carousel { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 0 var(--pad); }
.frame { position: relative; width: min(88vw, 460px, 62vh); aspect-ratio: 3 / 4; border-radius: 30px; padding: 12px;
  background: linear-gradient(160deg, #2b2e33, #0c0d0f 40%, #17181b); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.25), 0 40px 90px rgba(0,0,0,.7); }
.frame-screen { position: relative; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: #000; }
.frame-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.08), transparent 35%); }
.frame-hinge { position: absolute; left: 12px; right: 12px; top: 50%; height: 1px; background: rgba(255,255,255,.12); }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s; }
.slide.on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide figcaption { display: none; }
.car-ui { display: flex; align-items: center; gap: 24px; }
.car-ui .label { min-width: 16ch; text-align: center; }
.car-btn { width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 16px; cursor: pointer; transition: background .2s, color .2s; }
.car-btn:hover { background: #fff; color: #000; }
.gameplay.empty { display: none; }

/* ------------------------------------------------------------ 6 final */
.final { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; padding: 120px var(--pad) 0; }
.final-bg { position: absolute; left: 50%; top: 50%; width: max(110vw, 110vh); max-width: none; transform: translate(-50%, -50%); opacity: .38; }
.final::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at center, rgba(0,0,0,.2), #000 75%); }
.final-copy { position: relative; z-index: 2; margin-top: auto; }
.final h2 { font-size: clamp(34px, 6.4vw, 108px); text-transform: uppercase; letter-spacing: .02em; line-height: 1.04; }
.final h2 span { display: block; }
.final .fold-line { margin: 42px auto; width: min(80vw, 760px); }
.foot { position: relative; z-index: 2; margin-top: auto; padding: 80px 0 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; font-size: 10px; color: var(--dim); }
.foot a:hover { color: var(--fg); }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.2s cubic-bezier(.2,.7,.1,1), transform 1.2s cubic-bezier(.2,.7,.1,1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video { display: none; }
  .hero-poster { display: block; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero .fold-line, .hero .label, .tagline, .hero .ctas, .scroll-cue b { animation: none; }
  .move img { transform: none; transition: none; }
  .slide { transition: none; }
}
