@property --ink  { syntax: '<color>'; inherits: true; initial-value: #0d0d10; }
@property --dim  { syntax: '<color>'; inherits: true; initial-value: rgba(13,13,16,.56); }
@property --line { syntax: '<color>'; inherits: true; initial-value: rgba(13,13,16,.13); }
@property --card { syntax: '<color>'; inherits: true; initial-value: rgba(13,13,16,.045); }
@property --inv  { syntax: '<color>'; inherits: true; initial-value: #f4f4f1; }

:root {
  --accent: #ff3b2f;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --pad: max(20px, 5vw);
}
/* black mode (html[data-mode="black"]): dark sections use light text */
body[data-theme="space"], body[data-theme="dark"] {
  --ink: #f4f4f1; --dim: rgba(244,244,241,.58); --line: rgba(244,244,241,.13); --card: rgba(255,255,255,.045); --inv: #0b0b0d;
}
html[data-mode="black"] body { background: #050507; }
html[data-mode="black"] #loader { background: #050507; color: #f4f4f1; }
html[data-mode="black"] #loader .dim { color: rgba(244,244,241,.5); }
html[data-mode="black"] .ld-count span { color: rgba(244,244,241,.4); }
body[data-theme="light"] {
  --ink: #0d0d10; --dim: rgba(13,13,16,.56); --line: rgba(13,13,16,.13); --card: rgba(13,13,16,.045); --inv: #f4f4f1;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: #ffffff; color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: --ink .6s, --dim .6s, --line .6s, --card .6s, --inv .6s;
}
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.u { text-decoration: underline; text-underline-offset: 3px; }
.center { text-align: center; justify-content: center; margin-left: auto; margin-right: auto; }
.small { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, footer { position: relative; z-index: 1; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100; background: #ffffff; color: #0d0d10;
  display: flex; flex-direction: column; justify-content: space-between; padding: 28px var(--pad) 0;
  transition: transform 1s cubic-bezier(.7,0,.2,1);
}
#loader.out { transform: translateY(-100%); }
#loader .dim { color: rgba(13,13,16,.5); }
.ld-top, .ld-bottom { display: flex; justify-content: space-between; align-items: center; }
.ld-bottom { align-items: flex-end; padding-bottom: 20px; }
.ld-count { display: flex; align-items: flex-start; font-stretch: 125%; font-weight: 800; line-height: .8; letter-spacing: -.05em; }
.ld-count span { font-size: clamp(40px, 6vw, 90px); color: rgba(13,13,16,.35); margin-right: 8px; }
.ld-count b { font-size: clamp(120px, 22vw, 320px); font-variant-numeric: tabular-nums; text-align: right; }
.ld-bar { display: block; height: 3px; background: var(--accent); width: calc(var(--p, 0) * 100%); margin: 0 calc(var(--pad) * -1); }

/* ---------- nav ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-stretch: 112%; font-size: 17px; letter-spacing: -.01em; }
.logo svg { width: 28px; height: 28px; }
.nav {
  position: fixed; z-index: 50; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1180px, calc(100% - 28px)); display: flex; align-items: center; justify-content: space-between;
  padding: 7px 7px 7px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(16,16,20,.55); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  transition: background .6s;
}
body[data-theme="light"] .nav { background: rgba(255,255,255,.68); }
.nav nav { display: flex; gap: 28px; font-size: 14px; }
.nav nav a { color: var(--dim); transition: color .2s; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 26px;
  border-radius: 999px; background: var(--ink); color: var(--inv); font-weight: 600; font-size: 15px;
  transition: transform .2s, background .6s, color .6s; white-space: nowrap; border: 0; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn.sm { height: 38px; padding: 0 18px; font-size: 14px; }
.accent-btn { background: var(--accent); color: #fff; }
.link { font-weight: 600; font-size: 15px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* ---------- type ---------- */
.display { font-stretch: 125%; font-weight: 800; letter-spacing: -.04em; line-height: .92; }
h2.display { font-size: clamp(42px, 6.2vw, 100px); margin: 18px 0 26px; }
.lead { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.55; color: var(--dim); max-width: 32em; }
.lead strong { color: var(--ink); font-weight: 600; }
.tag { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tag b { display: inline-grid; place-items: center; min-width: 30px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 500; }

/* ---------- layout ---------- */
section { position: relative; padding: 16vh var(--pad); }
.stage { position: relative; }

.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding-top: 120px; padding-bottom: 36px; text-align: center; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.hero h1 { font-size: clamp(54px, 10.4vw, 176px); margin-top: 16px; }
.hero .stage { flex: 1; min-height: 26vh; margin: 2vh 0 1vh; }  /* fills exactly the gap between headline and footer */
.hero-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px; text-align: left; }
.hero-foot .lead { max-width: 24em; font-size: 17px; }
.hero-foot .cta { justify-content: flex-end; }
.cue { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; min-height: 100vh; max-width: 1320px; margin: 0 auto; }
.split .stage { height: min(78vh, 720px); }
.split.rev .stage { order: -1; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; max-width: 520px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 22px 20px; backdrop-filter: blur(6px); }
.stat.wide { grid-column: span 2; }
.stat span { font-size: 13px; color: var(--dim); }
.stat b { display: block; font-size: clamp(32px, 3.2vw, 48px); font-stretch: 125%; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.stat small { font-size: 14px; color: var(--dim); margin-left: 8px; font-weight: 500; letter-spacing: 0; font-stretch: 100%; }
.meter { display: block; height: 3px; background: var(--line); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.meter::after { content: ''; display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--accent); }

/* ---------- pinned story ---------- */
.pin { height: var(--len); padding: 0; }
.pin .sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; padding: 0 var(--pad); max-width: 1320px; margin: 0 auto; }
.pin .stage { height: 82vh; }
.pin h2.display { font-size: clamp(40px, 5vw, 84px); margin-bottom: 30px; }
.counter { display: flex; align-items: flex-start; gap: 10px; font-stretch: 125%; font-weight: 800; letter-spacing: -.045em; line-height: .95; font-size: clamp(64px, 8.4vw, 140px); color: var(--c, var(--ink)); font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.counter small { font-size: .3em; margin-top: .2em; color: var(--dim); font-weight: 600; letter-spacing: -.01em; }
.steps { list-style: none; padding: 0; position: relative; height: 118px; margin-top: 26px; max-width: 28em; }
.step { position: absolute; inset: 0; opacity: 0; transform: translateY(12px); transition: opacity .45s, transform .45s; }
.step.on { opacity: 1; transform: none; }
.step .n { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.step h3 { font-size: 24px; font-stretch: 112%; font-weight: 700; margin: 6px 0 6px; }
.step p { color: var(--dim); line-height: 1.5; font-size: 16px; }
.bars { display: flex; gap: 6px; max-width: 300px; }
.bars i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.bars i::after { content: ''; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--f, 0)); }

/* ---------- configurator ---------- */
.config .head { text-align: center; margin-bottom: 7vh; }
.config .head .lead { max-width: 30em; }
.cfg { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; max-width: 1240px; margin: 0 auto; }
.cfg .stage { height: min(66vh, 620px); border: 1px solid var(--line); border-radius: 28px; cursor: grab; touch-action: pan-y; user-select: none; }
.cfg .stage:active { cursor: grabbing; }
.cfg-name { position: absolute; left: 24px; top: 22px; font-weight: 600; }
.cfg-hint { position: absolute; left: 24px; bottom: 20px; font-size: 12px; color: var(--dim); }
.panel { border: 1px solid var(--line); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 14px; background: rgba(255,255,255,.6); }
.panel h4 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sw { border: 1px solid var(--line); background: transparent; border-radius: 16px; padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.sw i { width: 100%; height: 38px; border-radius: 10px; background: var(--c); }
.sw[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sizes button { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-weight: 600; cursor: pointer; }
.sizes button[aria-pressed="true"] { background: var(--ink); color: var(--inv); border-color: var(--ink); }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 6px; }
.specs div { background: var(--card); border-radius: 14px; padding: 12px 14px; }
.specs dt { font-size: 12px; color: var(--dim); }
.specs dd { font-weight: 700; font-size: 18px; margin-top: 4px; font-stretch: 112%; }
.fine { font-size: 13px; color: var(--dim); line-height: 1.5; }

/* ---------- marquee ---------- */
.marquee { padding: 10vh 0 18vh; overflow: hidden; }
.track { white-space: nowrap; font-size: clamp(72px, 13vw, 220px); font-stretch: 125%; font-weight: 800; letter-spacing: -.045em; color: var(--line); will-change: transform; }
.track i { display: inline-block; width: .16em; height: .16em; border-radius: 50%; background: var(--accent); margin: 0 .3em; vertical-align: middle; }
.big-note { max-width: 20em; margin: 8vh auto 0; padding: 0 var(--pad); text-align: center; font-size: clamp(24px, 2.8vw, 44px); font-weight: 600; font-stretch: 112%; letter-spacing: -.02em; line-height: 1.2; }

/* ---------- why ---------- */
.why h2 { max-width: 14em; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1240px; margin: 7vh auto 0; }
.grid4 > div { border: 1px solid var(--line); border-radius: 24px; padding: 26px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; background: rgba(255,255,255,.5); }
.grid4 b { font-size: clamp(40px, 4vw, 64px); font-stretch: 125%; font-weight: 800; letter-spacing: -.04em; }
.grid4 p { color: var(--dim); line-height: 1.5; }

/* ---------- faq ---------- */
.faq { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6vw; max-width: 1240px; margin: 0 auto; }
.qs details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.qs summary { list-style: none; cursor: pointer; font-size: 19px; font-weight: 600; display: flex; justify-content: space-between; gap: 20px; }
.qs summary::-webkit-details-marker { display: none; }
.qs summary::after { content: '+'; font-weight: 400; font-size: 24px; line-height: 1; transition: transform .3s; }
.qs details[open] summary::after { transform: rotate(45deg); }
.qs details p { color: var(--dim); line-height: 1.6; margin-top: 12px; max-width: 36em; }

/* ---------- final ---------- */
.final { min-height: 100vh; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.final h2 { font-size: clamp(44px, 7vw, 120px); }
.final-stages { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; height: 42vh; max-width: 1100px; width: 100%; margin: 0 auto 5vh; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px var(--pad) 36px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.credits { max-width: 60em; text-align: right; line-height: 1.5; }


/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .nav nav, .hide-sm { display: none; }
  .ld-bottom { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  .hero-foot { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero-foot .cta { justify-content: center; }
  .hero .stage { min-height: 34vh; }
  .cue { display: none; }
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split .stage { height: 46vh; order: -1; }
  .pin .sticky { grid-template-columns: 1fr; grid-template-rows: 40svh auto; align-items: start; gap: 0; padding-top: 64px; }
  .pin .stage { height: 38svh; order: -1; }
  .pin h2.display { font-size: 32px; margin: 10px 0 12px; }
  .counter { font-size: 64px; }
  .steps { height: 104px; margin-top: 12px; }
  .step h3 { font-size: 20px; }
  .step p { font-size: 15px; }
  .cfg { grid-template-columns: 1fr; }
  .cfg .stage { height: 46vh; }
  .panel { padding: 20px; }
  .grid4 { grid-template-columns: minmax(0, 1fr); }
  .grid4 > div { min-height: 170px; padding: 20px; }
  .faq { grid-template-columns: 1fr; }
  .final-stages { height: 30vh; }
  footer { flex-direction: column; }
  .credits { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cue { animation: none; }
}
