@font-face {
  font-family: "TikTok Sans";
  src: url("assets/tiktok-sans-cyrillic.woff2") format("woff2");
  font-weight: 300 900;
  font-stretch: 75% 150%;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "TikTok Sans";
  src: url("assets/tiktok-sans-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-stretch: 75% 150%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Monocraft";
  src: url("assets/monocraft.woff2") format("woff2");
  font-display: swap;
}

/* Dark only: the whole page is built around a night scene. */
:root {
  color-scheme: dark;
  interpolate-size: allow-keywords;

  --ink-0: #06090f;
  --ink-1: #0a0f18;
  --ink-2: #0f1622;
  --ink-3: #172131;
  --line: rgba(178, 214, 255, 0.08);
  --line-2: rgba(178, 214, 255, 0.15);
  --fg: #edf3f9;
  --fg-2: #a4b2c3;
  --fg-3: #748297;
  --accent: #84e0ff;
  --accent-hi: #b6efff;
  --accent-soft: rgba(132, 224, 255, 0.14);
  --accent-ink: #03131c;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header-h: 64px;
  --n: 4px;
  --notch: polygon(
    0 var(--n), var(--n) var(--n), var(--n) 0,
    calc(100% - var(--n)) 0, calc(100% - var(--n)) var(--n), 100% var(--n),
    100% calc(100% - var(--n)), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n)) 100%,
    var(--n) 100%, var(--n) calc(100% - var(--n)), 0 calc(100% - var(--n))
  );

  --font-sans: "TikTok Sans", system-ui, sans-serif;
  --font-pixel: "Monocraft", ui-monospace, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

code {
  font-family: var(--font-pixel);
  font-size: 0.8em;
  color: var(--accent-hi);
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------- type */

.section-title {
  font-size: clamp(2.5rem, 1rem + 4.4vw, 5.25rem);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--fg-2);
}

/* ------------------------------------------------------------ frames */

/* Minecraft tooltip construction: notched dark plate plus an inset border. */
.frame { position: relative; isolation: isolate; }
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--frame-bg, var(--ink-1));
  clip-path: var(--notch);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 3;
  border: 2px solid var(--frame-line, rgba(132, 224, 255, 0.16));
  pointer-events: none;
}

/* ----------------------------------------------------------- buttons */

.btn {
  --btn-bg: rgba(237, 243, 249, 0.07);
  --btn-edge: rgba(0, 0, 0, 0.35);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px 4px;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 650;
  font-stretch: 95%;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-bg);
  box-shadow: inset 0 -4px 0 var(--btn-edge);
  clip-path: var(--notch);
  transition: background-color 200ms ease, box-shadow 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:active::before { box-shadow: inset 0 -2px 0 var(--btn-edge); }

.btn-primary { --btn-bg: var(--accent); --btn-edge: rgba(0, 45, 70, 0.4); color: var(--accent-ink); }
.btn-ghost { color: var(--fg); }
.btn-small { height: 42px; padding: 0 16px 3px; font-size: 15px; --n: 3px; }
.btn-small::before { box-shadow: inset 0 -3px 0 var(--btn-edge); }
.btn-large { height: 64px; padding: 0 30px 4px; font-size: 19px; }
.btn-block { display: flex; width: 100%; justify-content: space-between; }
.btn-icon { width: 42px; padding: 0 0 3px; }
.btn-ghost .btn-meta { border-left-color: rgba(237, 243, 249, 0.14); color: var(--fg-2); opacity: 1; }

.btn-meta {
  font-family: var(--font-pixel);
  font-size: 13.5px;
  font-weight: 400;
  padding-left: 14px;
  border-left: 2px solid rgba(3, 19, 28, 0.2);
  opacity: 0.72;
}
.btn-arrow {
  font-family: var(--font-pixel);
  font-weight: 400;
  transition: transform 200ms var(--ease-out);
}

/* label swap: idle and busy states share one grid cell */
.btn-label { display: inline-grid; }
.btn-label > span {
  grid-area: 1 / 1;
  transition: opacity 180ms ease, filter 220ms ease, transform 260ms var(--ease-out);
}
.btn-label > span:last-child { opacity: 0; filter: blur(4px); transform: translateY(6px); }
.btn[data-state="busy"] .btn-label > span:first-child { opacity: 0; filter: blur(4px); transform: translateY(-6px); }
.btn[data-state="busy"] .btn-label > span:last-child { opacity: 1; filter: none; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { --btn-bg: var(--accent-hi); }
  .btn-ghost:hover { --btn-bg: rgba(237, 243, 249, 0.13); }
  .btn:hover .btn-arrow { transform: translateY(3px); }
  .btn-telegram:hover .tg-icon,
  .footer-telegram:hover .tg-icon { transform: translate(2px, -2px); }
}

/* the paper plane leans forward on hover, like it is about to leave */
.tg-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
  transition: transform 220ms var(--ease-out);
}

.is-downloading { pointer-events: none; opacity: 0.7; }

/* ------------------------------------------------------------ header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
}
.site-header.is-solid {
  background: rgba(6, 9, 15, 0.78);
  border-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  font-weight: 750;
  font-stretch: 88%;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand img { transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .brand:hover img { transform: rotate(-14deg) scale(1.06); }
}

.site-nav { display: flex; gap: 32px; font-size: 15px; color: var(--fg-2); }
.site-nav a { position: relative; padding: 6px 0; transition: color 200ms ease; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { color: var(--fg); }
  .site-nav a:hover::after { transform: scaleX(1); }
}
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }

.header-sentinel { position: absolute; top: 72svh; left: 0; width: 1px; height: 1px; pointer-events: none; }

/* -------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: calc(var(--header-h) + 32px) var(--gutter) clamp(36px, 8vh, 88px);
  overflow: hidden;
  isolation: isolate;
  view-timeline: --hero block;
}

.hero-scene { position: absolute; inset: 0; z-index: -2; }
.hero-scene canvas,
.stage > canvas,
.demo canvas,
.finale-scene {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.hero-scene canvas { background: var(--ink-0); }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(6, 9, 15, 0.9) 0%, rgba(6, 9, 15, 0.4) 22%, rgba(6, 9, 15, 0) 44%),
    linear-gradient(100deg, rgba(6, 9, 15, 0.55) 0%, rgba(6, 9, 15, 0) 44%);
}

/* The bubble rim mirrors the logo: thin glassy edge, iridescent band, one highlight. */
.lens {
  position: absolute;
  left: 0;
  top: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  box-shadow:
    inset 0 0 0 1.5px rgba(220, 246, 255, 0.55),
    inset 0 0 28px rgba(132, 224, 255, 0.22),
    0 0 0 1px rgba(3, 19, 28, 0.35),
    0 24px 70px rgba(0, 0, 0, 0.35);
  transition: opacity 600ms ease;
}
.lens.is-on { opacity: 1; }
.lens::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, rgba(132, 224, 255, 0) 0deg, rgba(132, 224, 255, 0.6) 60deg, rgba(186, 160, 255, 0.45) 120deg, rgba(255, 196, 232, 0.3) 170deg, rgba(132, 224, 255, 0) 230deg, rgba(132, 224, 255, 0.35) 300deg, rgba(132, 224, 255, 0) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 86%, #000 95%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 86%, #000 95%, transparent 100%);
}
.lens::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 20%;
  width: 17%;
  height: 8%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  filter: blur(0.5px);
  transform: rotate(-38deg);
}

.hero-content { width: 100%; max-width: var(--max); margin: 0 auto; }

.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(2.6rem, 0.9rem + 6.3vw, 7.5rem);
  font-weight: 820;
  font-stretch: 76%;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.line > span { display: block; }

.hero-lead {
  max-width: 38ch;
  margin-top: 26px;
  font-size: clamp(17px, 0.9rem + 0.35vw, 20px);
  line-height: 1.5;
  color: var(--fg-2);
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.js .line > span { transform: translateY(108%); }
.js .hero-intro { opacity: 0; transform: translateY(14px); filter: blur(6px); }
.js .lens { visibility: hidden; }
.is-ready .line > span {
  transform: none;
  transition: transform 1100ms var(--ease-out-expo) calc(120ms + var(--i) * 90ms);
}
.is-ready .hero-intro {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 800ms ease, transform 900ms var(--ease-out-expo), filter 800ms ease;
  transition-delay: calc(260ms + var(--i) * 90ms);
}
.is-ready .lens { visibility: visible; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-content { animation: hero-drift linear both; animation-timeline: --hero; animation-range: exit 0% exit 90%; }
    .hero-scene { animation: hero-zoom linear both; animation-timeline: --hero; animation-range: exit 0% exit 100%; }
  }
}
@keyframes hero-drift { to { transform: translateY(14vh); opacity: 0; } }
@keyframes hero-zoom { to { transform: scale(1.08); } }

/* ----------------------------------------------------------- compare */

.compare {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(88px, 13vh, 160px) var(--gutter) clamp(32px, 6vh, 72px);
}

.compare-frame {
  --n: 6px;
  margin-top: clamp(32px, 5vh, 56px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  clip-path: var(--notch);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.compare-frame.is-dragging { cursor: grabbing; }

.compare-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* The vanilla shot sits on top and is clipped from the right; JS only rewrites the inset. */
.compare-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}

.compare-tag {
  position: absolute;
  bottom: 20px;
  z-index: 2;
  padding: 10px 12px 9px;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  line-height: 1;
  color: var(--fg);
  background: rgba(6, 9, 15, 0.74);
  box-shadow: inset 0 0 0 2px rgba(132, 224, 255, 0.18);
  pointer-events: none;
  transition: opacity 180ms ease;
}
.compare-tag-before { left: 20px; }
.compare-tag-after { right: 20px; color: var(--accent); }
.compare-tag.is-hidden { opacity: 0; }

/* Full-width layer so translateX(%) maps straight onto the frame width: no measuring, no layout. */
.compare-rail {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: translateX(50%);
  will-change: transform;
}
.compare-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--fg);
  box-shadow: 0 0 0 1px rgba(3, 19, 28, 0.4);
}

.compare-handle {
  position: absolute;
  left: -26px;
  top: calc(50% - 26px);
  width: 52px;
  height: 52px;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.compare-handle:focus-visible { outline-color: var(--fg); outline-offset: 4px; }
.is-dragging .compare-handle { cursor: grabbing; }

.compare-knob {
  --n: 4px;
  position: absolute;
  inset: 0;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 4px;
  transition: transform 160ms var(--ease-out);
}
.compare-knob::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  box-shadow: inset 0 -4px 0 rgba(0, 45, 70, 0.4);
  clip-path: var(--notch);
  transition: background-color 200ms ease;
}

/* pixel arrows, drawn on the 2px grid the rest of the HUD uses */
.compare-knob i {
  width: 6px;
  height: 10px;
  background: var(--accent-ink);
  clip-path: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, 100% 0, 100% 100%, 4px 100%, 4px 8px, 2px 8px, 2px 6px, 0 6px);
  transition: translate 200ms var(--ease-out);
}
.compare-knob i:last-child { scale: -1 1; }

.is-dragging .compare-knob { transform: scale(0.92); }
.is-dragging .compare-knob i:first-child { translate: -2px 0; }
.is-dragging .compare-knob i:last-child { translate: 2px 0; }

@media (hover: hover) and (pointer: fine) {
  .compare-frame:hover .compare-knob::before { background: var(--accent-hi); }
  .compare-frame:hover .compare-knob i:first-child { translate: -2px 0; }
  .compare-frame:hover .compare-knob i:last-child { translate: 2px 0; }
}

/* ---------------------------------------------------------- features */

.features {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 14vh, 168px) var(--gutter) clamp(40px, 8vh, 96px);
}
.features .section-title { max-width: 12ch; }

.features-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 112px);
  margin-top: clamp(32px, 6vh, 64px);
}

.chapter {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  opacity: 0.28;
  transition: opacity 500ms ease;
}
.chapter:first-child { min-height: 60vh; justify-content: flex-start; padding-top: 12vh; }
.chapter.is-active { opacity: 1; }
.chapter h3 {
  font-size: clamp(1.9rem, 1rem + 2vw, 3rem);
  font-weight: 760;
  font-stretch: 84%;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.chapter p { max-width: 40ch; color: var(--fg-2); font-size: 18px; text-wrap: pretty; }

.stage-column { position: relative; }
.stage {
  --n: 6px;
  --frame-bg: var(--ink-1);
  position: sticky;
  top: calc(var(--header-h) + (100svh - var(--header-h) - min(70svh, 660px)) / 2);
  height: min(70svh, 660px);
  overflow: hidden;
  clip-path: var(--notch);
}
.stage > canvas { position: absolute; inset: 0; }

.stage-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.985);
  filter: blur(6px);
  transition: opacity 360ms ease, transform 520ms var(--ease-out), filter 360ms ease;
}
.stage[data-mode="pvp"] [data-layer="pvp"],
.stage[data-mode="ui"] [data-layer="ui"] { opacity: 1; transform: none; filter: none; }

.hud-box {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  line-height: 1;
  color: var(--fg);
  background: rgba(6, 9, 15, 0.72);
  box-shadow: inset 0 0 0 2px rgba(132, 224, 255, 0.18);
  padding: 10px 12px;
}
.hud-box b { font-weight: 400; color: var(--accent); }

.hud-target { top: 7%; left: 5%; display: flex; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; }
.hud-avatar { width: 40px; height: 40px; image-rendering: pixelated; }
.hud-target-info { display: grid; gap: 9px; }
.hud-name { font-size: 18px; }
.hud-hp { display: flex; align-items: center; gap: 10px; }
.hud-bar { position: relative; display: block; width: 108px; height: 6px; background: rgba(237, 243, 249, 0.1); }
.hud-bar i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--hp)); transform-origin: left; }

.hud-combo { left: 5%; bottom: 7%; display: flex; gap: 18px; }

.hud-damage { position: absolute; inset: 0; }
.dmg {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 18px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(3, 19, 28, 0.8);
  will-change: transform, opacity;
}

.hud-fps { top: 7%; right: 5%; display: flex; align-items: flex-end; gap: 12px; }
.hud-fps canvas { width: 72px; height: 20px; image-rendering: pixelated; }

.crosshair { position: absolute; left: 50%; top: 46%; width: 28px; height: 28px; transform: translate(-50%, -50%); }
.crosshair i { position: absolute; background: var(--accent); box-shadow: 0 0 0 1px rgba(3, 19, 28, 0.6); }
.crosshair i:nth-child(1) { left: 12px; top: 0; width: 4px; height: 8px; }
.crosshair i:nth-child(2) { left: 12px; bottom: 0; width: 4px; height: 8px; }
.crosshair i:nth-child(3) { top: 12px; left: 0; width: 8px; height: 4px; }
.crosshair i:nth-child(4) { top: 12px; right: 0; width: 8px; height: 4px; }

.hotbar {
  position: absolute;
  left: 50%;
  bottom: 6%;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(6, 9, 15, 0.7);
  transform: translateX(-50%);
}
.slot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #182233;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.4), inset -3px -3px 0 rgba(255, 255, 255, 0.05);
}
.slot canvas { width: 28px; height: 28px; image-rendering: pixelated; }
.slot.is-selected { box-shadow: inset 0 0 0 3px var(--accent), inset 5px 5px 0 rgba(0, 0, 0, 0.35); }

/* ------------------------------------------------------------- release */

.release {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(120px, 16vh, 200px) var(--gutter) clamp(96px, 12vh, 160px);
}
.release-head { display: grid; gap: 22px; }
.release .section-title { max-width: 15ch; }

.demo {
  --n: 6px;
  margin-top: clamp(40px, 6vh, 72px);
  aspect-ratio: 16 / 7;
  min-height: 300px;
  overflow: hidden;
  clip-path: var(--notch);
}
.demo canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: manipulation; }

.demo-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sound-toggle [data-sound-label] { font-family: var(--font-pixel); font-size: 13.5px; font-weight: 400; color: var(--fg-3); transition: color 200ms ease; }
.sound-toggle[aria-pressed="true"] [data-sound-label] { color: var(--accent); }

.release-items {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px);
  row-gap: 28px;
  margin-top: clamp(56px, 8vh, 96px);
}
.release-items article { grid-column: span 5; display: grid; gap: 12px; align-content: start; }
.release-items article:nth-child(2) { grid-column: 7 / span 5; }
.release-items .format { font-family: var(--font-pixel); font-size: 13.5px; color: var(--accent); }
.release-items h3 { font-size: clamp(1.5rem, 1rem + 0.9vw, 2rem); font-weight: 720; font-stretch: 88%; line-height: 1.1; }
.release-items article > p:last-child { color: var(--fg-2); max-width: 42ch; }

/* ------------------------------------------------------------- modules */

.modules {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 12vh, 160px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}
.modules-copy { position: sticky; top: calc(var(--header-h) + 48px); display: grid; gap: 22px; }

.gui { --n: 6px; --frame-bg: var(--ink-1); }
.gui-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 16px;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-pixel);
  font-size: 13.5px;
  color: var(--fg-3);
}
.gui-title { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.gui-count b { font-weight: 400; color: var(--accent); }

.gui-body { display: grid; grid-template-columns: 172px minmax(0, 1fr); }
.gui-tabs { display: grid; padding: 12px; border-right: 2px solid var(--line); align-content: start; }
.gui-tablist { grid-area: 1 / 1; display: grid; gap: 4px; align-content: start; }
.gui-tablist button {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  border: 0;
  background: none;
  font-family: var(--font-pixel);
  font-size: 18px;
  text-align: left;
  color: var(--fg-3);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.gui-tablist:not(.gui-tablist-active) button:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .gui-tablist button:hover { color: var(--fg); background: rgba(237, 243, 249, 0.04); }
}
.gui-tablist-active { pointer-events: none; transition: clip-path 280ms var(--ease-in-out); }
.gui-tablist-active.is-instant { transition: none; }
.gui-tablist-active button { background: var(--accent); color: var(--accent-ink); }

.gui-panels { padding: 12px; }
.gui-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gui-panel[hidden] { display: none; }

.mod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px 12px 18px;
  background: rgba(237, 243, 249, 0.028);
  cursor: pointer;
  transition: background-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .mod:hover { background: rgba(237, 243, 249, 0.055); }
}
.mod-name { display: grid; gap: 4px; font-weight: 600; font-size: 16px; line-height: 1.2; }
.mod-name small { font-family: var(--font-pixel); font-size: 12px; font-weight: 400; color: var(--fg-3); }

.gui-panel.is-entering .mod { animation: mod-in 420ms var(--ease-out) both; animation-delay: calc(var(--ri, 0) * 35ms); }
.gui-panel .mod:nth-child(2) { --ri: 1; }
.gui-panel .mod:nth-child(3) { --ri: 2; }
.gui-panel .mod:nth-child(4) { --ri: 3; }
.gui-panel .mod:nth-child(5) { --ri: 4; }
.gui-panel .mod:nth-child(6) { --ri: 5; }
@keyframes mod-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }

.switch {
  --n: 3px;
  position: relative;
  flex: none;
  width: 48px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  isolation: isolate;
}
.switch::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink-3);
  clip-path: var(--notch);
  transition: background-color 200ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 16px;
  height: 16px;
  background: var(--fg-3);
  transition: transform 240ms var(--ease-out), background-color 200ms ease;
}
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(22px); background: var(--accent-ink); }
.mod:active .switch::after { transform: scale(0.85); }
.mod:active .switch[aria-checked="true"]::after { transform: translateX(22px) scale(0.85); }

/* ------------------------------------------------------------- install */

.install {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 12vh, 160px) var(--gutter);
}
.install-head { display: grid; gap: 22px; }
.install-head .section-title { max-width: 14ch; }

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 7vw, 128px);
  align-items: start;
  margin-top: clamp(48px, 8vh, 88px);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 52px;
}
.step:last-child { padding-bottom: 0; }
.step::before,
.step::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 52px;
  bottom: 8px;
  width: 2px;
  background: var(--line-2);
}
.step::after { background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 700ms var(--ease-out); }
.step:last-child::before,
.step:last-child::after { display: none; }
.step.is-lit::after { transform: scaleY(1); }

.step-node {
  --n: 3px;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--fg-3);
  transition: color 300ms ease;
}
.step-node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink-3);
  clip-path: var(--notch);
  transition: background-color 300ms ease, transform 400ms var(--ease-out);
}
.step.is-lit .step-node { color: var(--accent-ink); }
.step.is-lit .step-node::before { background: var(--accent); }

.step h3 { font-size: 22px; font-weight: 700; font-stretch: 92%; line-height: 1.2; margin: 9px 0 10px; }
.step p { color: var(--fg-2); max-width: 52ch; }

.download-card {
  --n: 6px;
  --frame-bg: var(--ink-2);
  --frame-line: rgba(132, 224, 255, 0.28);
  position: sticky;
  top: calc(var(--header-h) + 40px);
  display: grid;
  gap: 26px;
  padding: 32px;
}
.card-head { display: flex; align-items: center; gap: 16px; }
.card-name { font-size: 24px; font-weight: 780; font-stretch: 86%; line-height: 1.1; color: var(--accent); }
.card-version { margin-top: 6px; font-family: var(--font-pixel); font-size: 13.5px; color: var(--fg-3); }
.card-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.card-specs div { display: grid; gap: 4px; }
.card-specs dt { font-size: 14px; color: var(--fg-3); }
.card-specs dd { font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; }
.card-hash { font-family: var(--font-pixel); font-size: 12px; color: var(--fg-3); overflow-wrap: anywhere; }
.card-hash span { color: var(--fg-2); margin-right: 6px; }

.requirements { margin-top: clamp(88px, 12vh, 140px); padding-top: 48px; border-top: 1px solid var(--line); }
.requirements-title { font-size: clamp(1.75rem, 1rem + 1.4vw, 2.5rem); font-weight: 760; font-stretch: 84%; line-height: 1; }
.req-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 96px); margin-top: 36px; }
.req-label { font-family: var(--font-pixel); font-size: 13.5px; color: var(--fg-3); margin-bottom: 16px; }
.req-group ul { display: grid; gap: 12px; }
.req { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 18px; }
.slot-big { width: 64px; height: 64px; font-family: var(--font-pixel); font-size: 18px; color: var(--accent); }
.req b { display: block; font-size: 18px; font-weight: 650; }
.req small { display: block; font-size: 15px; color: var(--fg-3); line-height: 1.35; }

/* ----------------------------------------------------------------- faq */

.faq {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 12vh, 160px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}
.faq-head { position: sticky; top: calc(var(--header-h) + 48px); }
.faq-head .section-title { max-width: 8ch; }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  font-size: clamp(19px, 0.9rem + 0.5vw, 23px);
  font-weight: 620;
  font-stretch: 94%;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
  transition: color 200ms ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-family: var(--font-pixel);
  font-size: 27px;
  line-height: 1;
  color: var(--accent);
  transition: transform 300ms var(--ease-out);
}
details[open] .faq-icon { transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
  .faq-list summary:hover { color: var(--accent-hi); }
}
.faq-list details p { max-width: 60ch; padding: 0 56px 30px 0; color: var(--fg-2); }
.faq-list details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 380ms var(--ease-out), content-visibility 380ms allow-discrete;
}
.faq-list details[open]::details-content { block-size: auto; }
.faq-list details[open] p { animation: faq-in 420ms var(--ease-out) both; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } }

/* -------------------------------------------------------------- finale */

.finale {
  position: relative;
  min-height: 92svh;
  display: grid;
  place-items: center;
  padding: 120px var(--gutter);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.finale-scene { position: absolute; inset: 0; z-index: -2; background: var(--ink-0); }
.finale::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--ink-0) 0%, rgba(6, 9, 15, 0) 28%, rgba(6, 9, 15, 0) 70%, var(--ink-0) 100%),
    radial-gradient(ellipse 60% 45% at 50% 52%, rgba(6, 9, 15, 0.72), rgba(6, 9, 15, 0));
}
.finale-content { display: grid; justify-items: center; width: 100%; min-width: 0; }
.finale-logo { width: 96px; height: 96px; filter: drop-shadow(0 18px 40px rgba(132, 224, 255, 0.25)); }
.finale h2 {
  max-width: 13ch;
  margin: 28px 0 40px;
  font-size: clamp(2.8rem, 1rem + 6vw, 7.25rem);
  font-weight: 820;
  font-stretch: 76%;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.finale-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* -------------------------------------------------------------- footer */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px var(--gutter) 44px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  border-top: 1px solid var(--line);
  color: var(--fg-3);
  font-size: 15px;
}
.site-footer .brand { color: var(--fg); font-size: 16px; }
.footer-links { display: flex; align-items: center; gap: 28px; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; transition: color 200ms ease; }
.footer-telegram { color: var(--fg-2); }
.footer-top span { font-family: var(--font-pixel); }
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover { color: var(--accent); }
}

/* --------------------------------------------------------------- toast */

.download-toast {
  --n: 4px;
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  padding: 14px 20px;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  color: var(--fg);
  background: var(--ink-2);
  box-shadow: inset 0 0 0 2px rgba(132, 224, 255, 0.3);
  clip-path: var(--notch);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 28px));
  transition: transform 420ms var(--ease-drawer), opacity 240ms ease;
}
.download-toast:empty { visibility: hidden; }
.download-toast[data-state="active"],
.download-toast[data-state="success"],
.download-toast[data-state="error"] { opacity: 1; transform: translate(-50%, 0); }
.download-toast[data-state="success"] { box-shadow: inset 0 0 0 2px rgba(132, 224, 255, 0.6); }
.download-toast[data-state="error"] { box-shadow: inset 0 0 0 2px rgba(255, 140, 150, 0.6); }

.noscript-note {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 16px;
  text-align: center;
  background: var(--ink-3);
}

/* ------------------------------------------------------------- reveals */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(5px);
  transition:
    opacity 700ms ease var(--d, 0ms),
    transform 900ms var(--ease-out-expo) var(--d, 0ms),
    filter 700ms ease var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.w > span { display: inline-block; }
.js [data-split] .w > span { transform: translateY(110%); }
.js [data-split].is-in .w > span {
  transform: none;
  transition: transform 1000ms var(--ease-out-expo) calc(var(--wi) * 45ms);
}

/* -------------------------------------------------------------- mobile */

@media (max-width: 1080px) {
  .site-nav { gap: 22px; }
  .gui-body { grid-template-columns: 1fr; }
  .gui-tabs { border-right: 0; border-bottom: 2px solid var(--line); }
  .gui-tablist { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gui-tablist button { justify-content: center; padding: 0 8px; font-size: 13.5px; }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }

  .features-body { grid-template-columns: 1fr; gap: 0; }
  .stage-column { order: -1; position: sticky; top: var(--header-h); z-index: 2; padding: 12px 0; background: var(--ink-0); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .stage { position: relative; top: auto; height: min(46svh, 420px); }
  .chapter,
  .chapter:first-child { min-height: 62svh; padding-top: 0; justify-content: center; }

  .release-items article,
  .release-items article:nth-child(2) { grid-column: 1 / -1; }

  .modules,
  .faq { grid-template-columns: 1fr; }
  .modules-copy,
  .faq-head { position: static; }

  .install-grid { grid-template-columns: 1fr; }
  .download-card { position: relative; top: auto; }
  .req-groups { grid-template-columns: 1fr; }

  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .brand span { display: none; }
  .hero { padding-bottom: 28px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .demo { aspect-ratio: 4 / 3; min-height: 0; }
  .compare-tag { bottom: 12px; padding: 8px 9px 7px; font-size: 12px; }
  .compare-tag-before { left: 12px; }
  .compare-tag-after { right: 12px; }
  .compare-handle { left: -22px; top: calc(50% - 22px); width: 44px; height: 44px; }
  .compare-knob { gap: 6px; }
  .finale-actions { width: 100%; }
  .finale-actions .btn { flex: 1 1 100%; }
  .wide-only { display: none; }
  .site-footer { grid-template-columns: 1fr; gap: 20px; }
  .site-footer p { grid-row: 3; }
  .footer-links { justify-content: space-between; gap: 20px; }
  .demo-controls .btn { flex: 1 1 auto; }
  .gui-bar { padding: 14px 16px; }
  .gui-tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gui-panel { grid-template-columns: 1fr; }
  .hud-target { left: 4%; top: 5%; transform: scale(0.85); transform-origin: top left; }
  .hud-fps { right: 4%; top: 5%; }
  .hud-combo { left: 4%; bottom: 5%; }
  .slot { width: 30px; height: 30px; }
  .slot canvas { width: 20px; height: 20px; }
  .download-card { padding: 24px; }
  .card-specs dd { font-size: 13.5px; }
  .faq-list details p { padding-right: 0; }
}

/* ------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .js .line > span,
  .js [data-split] .w > span { transform: none; }
  .js .hero-intro,
  .js [data-reveal] { transform: none; filter: none; }
  .is-ready .hero-intro,
  .js [data-reveal] { transition: opacity 400ms ease; }
  .stage-layer { transform: none; filter: none; }
  .gui-panel.is-entering .mod { animation: none; }
  .faq-list details[open] p { animation: none; }
  .step::after { transition: none; }
}
