/* ─── Vortex Studio design system ───────────────────────────────────
   Foundation #05060e · violet #7a6cf0 · DX12 blue #00a6fb ·
   green #00b894 (open source) · red #ff6b6b (alpha/storm only)     */

:root {
  --bg: #05060e;
  --surface: #0b0d1a;
  --line: #2a2d45;
  --violet: #7a6cf0;
  --violet2: #6c5ce7;
  --blue: #00a6fb;
  --green: #00b894;
  --red: #ff6b6b;
  --text: #f2f3f7;
  --dim: #8a8fa3;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* overflow-x: clip (NOT hidden) — hidden would turn body into a scroll
   container and silently kill every position:sticky on the page */
html { scroll-behavior: auto; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.06rem;
  line-height: 1.65;
  overflow-x: clip;
}

::selection { background: var(--violet); color: var(--bg); }

/* ── canvas + flash ── */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: opacity 0.8s ease;
}
body.at-footer #gl { opacity: 0.35; }

#flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--violet);
  opacity: 0;
  pointer-events: none;
}

/* ── nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(to bottom, rgba(5,6,14,0.85), rgba(5,6,14,0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.nav-links a {
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--text); }
.btn-nav {
  border: 1px solid var(--violet);
  color: var(--text) !important;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  transition: background 0.25s, color 0.25s;
}
.btn-nav:hover { background: var(--violet); color: var(--bg) !important; }

.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--red);
  color: var(--red);
}

/* ── sections + sticky copy ── */
main {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
/* copy blocks stay selectable/copyable; the canvas has no interactions */
main .copy, main #fps-panel, main a, main .btn { pointer-events: auto; }

section[data-scene] { position: relative; }
#hero      { height: 150vh; }
#editor    { height: 220vh; }
#bridge    { height: 200vh; }
#core      { height: 180vh; }
#pipeline  { height: 220vh; }
#perf      { height: 200vh; }
#opensource{ height: 170vh; }
#roadmap   { height: 190vh; }
#cta       { height: 170vh; }
#footer-spacer { height: 120vh; }

.copy {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh; /* iOS: don't hide under the collapsed toolbar */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.2rem, 5vw, 4rem);
  max-width: 44rem;
}
.copy.center { margin: 0 auto; text-align: center; align-items: center; }
.copy.left   { margin-right: auto; }
.copy.right  { margin-left: auto; text-align: right; align-items: flex-end; }
.copy.top-left { justify-content: flex-start; padding-top: 18vh; }
.copy.bottom-center { margin: 0 auto; text-align: center; align-items: center; justify-content: flex-end; padding-bottom: 12vh; }

/* scrim so text stays readable over bright 3D */
.copy::before {
  content: "";
  position: absolute;
  inset: 10% -20%;
  background: radial-gradient(ellipse at center, rgba(5,6,14,0.72), rgba(5,6,14,0) 70%);
  z-index: -1;
}

/* ── typography ── */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--violet);
  margin-bottom: 1.1rem;
}
h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 7.5vw, 6.5rem);
  line-height: 0.99;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}
h2 { font-size: clamp(2.1rem, 5.6vw, 4.8rem); }
.sub {
  color: var(--dim);
  max-width: 38ch;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}
.grad {
  background: linear-gradient(180deg, #b0a5ff 0%, var(--violet) 55%, var(--blue) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.grad.green { background: linear-gradient(180deg, #7dffd8, var(--green)); -webkit-background-clip: text; background-clip: text; }
.grad.red   { background: linear-gradient(180deg, #ffb0a5, var(--red)); -webkit-background-clip: text; background-clip: text; }
.play { color: var(--violet); }

.mono-note {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  margin-top: 1.2rem;
  letter-spacing: 0.04em;
}
.mono-note.green { color: var(--green); }

/* ── giant scrub counters ── */
.giant {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: clamp(6rem, 13vw, 15rem);
  color: rgba(122,108,240,0.16);
  z-index: -1;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.giant.big { font-size: clamp(4.2rem, 12vw, 14rem); color: rgba(159,216,255,0.14); }

/* ── chips / legend / milestones ── */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; justify-content: inherit; }
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--dim);
}
.chip.green { border-color: var(--green); color: var(--green); }

.legend {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--dim);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.legend i {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  margin-right: 0.45rem;
  transform: rotate(45deg);
}

.milestones {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.milestones li {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  padding: 0.75rem 1.1rem;
  background: rgba(11,13,26,0.72);
  border-radius: 6px;
  max-width: 24rem;
}
.milestones li span { color: var(--red); margin-right: 0.9rem; }

/* ── strikethrough beat (open source) ── */
.strikes {
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  color: #4a4e66;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.strike { position: relative; }
.strike::after {
  content: "";
  position: absolute;
  left: -2%; top: 52%;
  width: 104%; height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.strike.on::after { transform: scaleX(1); }
.strike.on { color: #363a52; }

/* ── FPS readout panel (pipeline) ── */
#fps-panel {
  position: sticky;
  top: 72vh;
  margin-left: auto;
  margin-right: clamp(1rem, 5vw, 4rem);
  margin-top: -30vh; /* pull its natural slot up into the pinned window */
  width: max-content;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11,13,26,0.82);
  padding: 0.9rem 1.2rem;
  font-size: 0.9rem;
}
#fps-panel .lbl { color: var(--dim); display: inline-block; width: 4.2em; font-size: 0.72rem; letter-spacing: 0.12em; }
#fps-panel .val { color: var(--text); font-size: 1.3rem; display: inline-block; min-width: 2.4em; text-align: right; }
#fps-panel .unit { color: var(--dim); font-size: 0.72rem; margin-left: 0.5em; }
#fps-panel .mult { color: var(--violet); font-size: 0.66rem; letter-spacing: 0.16em; margin-top: 0.5rem; }
#fps-panel[data-mult="x1"] .mult { color: var(--dim); }

/* ── buttons ── */
.cta-row { display: flex; gap: 0.9rem; margin-top: 2rem; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--mono);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 99px;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--violet); color: var(--bg); font-weight: 500; }
.btn.primary:hover { background: #9a8cf6; }
.btn.outline { border: 1px solid var(--violet); color: var(--text); }
.btn.outline:hover { border-color: #9a8cf6; color: #fff; }
.btn.ghost { color: var(--dim); border: 1px solid transparent; }
.btn.ghost:hover { color: var(--text); border-color: var(--line); }

/* ── scroll cue ── */
.cue {
  margin-top: 3.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-transform: uppercase;
}
.cue span {
  display: block;
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--violet), transparent);
  animation: cue-drop 1.8s ease-in-out infinite;
}
@keyframes cue-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── reveal choreography: beats start hidden, .on flies them in ── */
.js [data-beat] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
/* unrevealed beats leave the tab order — no focus on invisible links */
.js body:not(.fallback) [data-beat]:not(.on) { visibility: hidden; }
.js [data-beat].on { opacity: 1; transform: translateY(0); }
.js .stamp { transform: translateY(24px) scale(0.96); }
.js .stamp.on { transform: translateY(0) scale(1); transition-timing-function: cubic-bezier(0.2, 1.6, 0.4, 1); }
.js .giant { transition: opacity 0.6s; transform: translate(-50%, -58%); }
.js .giant.on { transform: translate(-50%, -58%); }

/* ── footer ── */
footer {
  position: relative;
  z-index: 1;
  padding: 4rem clamp(1.2rem, 6vw, 5rem) 3rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(5,6,14,0.4), rgba(5,6,14,0.92));
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 2.5rem;
}
.foot-brand { display: flex; gap: 1rem; align-items: flex-start; font-size: 0.98rem; }
.foot-brand .mono-note { margin-top: 0.6rem; }
.foot-cols { display: flex; gap: clamp(2rem, 6vw, 5rem); justify-content: flex-end; flex-wrap: wrap; }
.foot-cols h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--dim);
  margin-bottom: 0.9rem;
}
.foot-cols a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 0.55rem;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}
.foot-cols a:hover { opacity: 1; color: var(--violet); }
.foot-line {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  margin-top: 1rem;
}

.noscript-note {
  position: relative;
  z-index: 5;
  padding: 2rem;
  font-family: var(--mono);
  text-align: center;
}
.noscript-note a { color: var(--violet); }

/* ── fallback / reduced motion: poster mode ── */
body.fallback section[data-scene] { height: auto; min-height: 70vh; }
body.fallback .cue, body.fallback .scroll-hint { display: none; }
body.fallback .copy { position: relative; min-height: 60vh; }
body.fallback [data-beat] { opacity: 1 !important; transform: none !important; }
body.fallback .copy::before { inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(58,46,140,0.25), rgba(5,6,14,0) 70%); }
body.fallback .giant { position: relative; top: auto; left: auto; transform: none; font-size: clamp(3rem, 9vw, 8rem); }
body.fallback #footer-spacer { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cue span { animation: none; }
  .js [data-beat] { transition: none; }
}

/* ── mobile ── */
@media (max-width: 820px) {
  .nav-links a[data-href="releases"], .nav-links .pill { display: none; }
  .copy.right { text-align: left; align-items: flex-start; }
  .legend { justify-content: flex-start; }
  .giant { font-size: 20vw; }
  .giant.big { font-size: 17vw; }
  #fps-panel { margin-left: clamp(1rem, 5vw, 4rem); margin-right: auto; }
  footer { grid-template-columns: 1fr; }
  .foot-cols { justify-content: flex-start; }
  h1 { font-size: clamp(2.3rem, 11vw, 4rem); }
  h2 { font-size: clamp(1.9rem, 8.5vw, 3.2rem); }
}
