/* HYPERNIX — SITE
 *
 * The public website, written in the launcher's vocabulary rather than in a
 * fourth one of its own. Before this the landing page carried its own
 * typography (system sans), its own accent (one flat yellow), its own idea of a
 * button, and a footer whose brand mark was the letter H in a box — so a player
 * who downloaded the launcher and then opened the site was looking at two
 * products with the same name.
 *
 * Everything here is taken from HQLauncher/renderer/css: the Unbounded family,
 * the near-black field, the ink, the section colours, the 12/18/999 radius
 * scale, depth via --lift instead of hairline borders, and the two springs. The
 * token NAMES are deliberately the launcher's own, so a rule can be moved
 * between the two codebases without translation.
 *
 * Three things this sheet owns that the launcher does not need:
 *   1. A scroll layer. Sections arrive rather than being simply present —
 *      [data-reveal] is off-screen until site.js says otherwise, and the whole
 *      thing degrades to "visible" when JavaScript never runs.
 *   2. A depth layer. The hero, the feature slabs and the product cards are
 *      real 3D — perspective, transform-style: preserve-3d, translateZ — not a
 *      drop shadow pretending to be one.
 *   3. A width. The launcher is a fixed window; this has to survive 360px.
 */

/* --- The launcher's faces ------------------------------------------------- */
/* The same file modern.css already loads for the Hub and Studio, at the same
   path, so a player moving from a site page to an embedded one does not pay for
   a second 760 KB download of the same typeface. */
@font-face {
  font-family: "Unbounded Hypernix";
  src: url("/Unbounded-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Hypernix Display";
  src: url("/fonts/horizon/horizon.woff2") format("woff2"),
       url("/fonts/horizon/horizon.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Minecraft Ten";
  src: url("/fonts/MinecraftTen.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* The brand accent is the launcher's, to the digit: #f5c400 is the accent a
     launcher ships with (ipc.js DEFAULTS.accent), the colour of the application
     icon, and what web/hypernix-deck.css already builds the embedded Hub and
     Studio out of. The launcher lets a player change it; the site is the
     product, so it stays on the default. */
  --accent: #f5c400;
  --accent-2: #ffe07a;
  --accent-deep: #d99a00;
  --accent-deeper: #96650a;

  --black: #050604;
  --black-2: #0c0b07;
  --ink: #f5f5ef;
  --dim: #a6a294;
  --dimmer: #7b776b;

  --font: "Unbounded Hypernix", "Segoe UI", system-ui, sans-serif;
  --display: "Unbounded Hypernix", "Segoe UI", system-ui, sans-serif;
  --pixel: "Minecraft Ten", "Unbounded Hypernix", sans-serif;

  --r: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Depth, not outlines — the launcher's three lifts verbatim. */
  --lift-1: 0 1px 0 rgba(255,255,255,.055) inset, 0 6px 18px -8px rgba(0,0,0,.75);
  --lift-2: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 44px -16px rgba(0,0,0,.85);
  --lift-3: 0 1px 0 rgba(255,255,255,.1) inset, 0 32px 70px -22px rgba(0,0,0,.9);

  --line: color-mix(in srgb, var(--ink) 8%, transparent);
  --line-lit: color-mix(in srgb, var(--section) 42%, transparent);
  --surface: color-mix(in srgb, var(--ink) 4%, transparent);
  --surface-lit: color-mix(in srgb, var(--ink) 7.5%, transparent);

  /* Where you are, as a colour. Same hues as the launcher's data-view map, so
     the shop on the site is the same cyan as Коллекция in the launcher. */
  --section: var(--accent);
  --section-soft: color-mix(in srgb, var(--section) 13%, transparent);
  --section-line: color-mix(in srgb, var(--section) 36%, transparent);

  --spring: cubic-bezier(.2,.9,.24,1);
  --spring-out: cubic-bezier(.34,1.4,.5,1);

  --bar: 66px;
  --page: 1240px;
  --pad: clamp(18px, 4vw, 44px);
}

/* Declared here and not on :root for the reason the launcher documents: a
   custom property is substituted where it is declared, so a derived tint
   written on :root freezes at the root's --section and stays blue on a violet
   page. On the body it resolves against whatever data-section won. */
body[data-section] {
  --section-soft: color-mix(in srgb, var(--section) 13%, transparent);
  --section-line: color-mix(in srgb, var(--section) 36%, transparent);
  --line-lit: color-mix(in srgb, var(--section) 42%, transparent);
}
body[data-section="studio"] { --section: #8b7bc4; }
body[data-section="shop"] { --section: #4fa9b0; }
body[data-section="guides"] { --section: #63ab77; }
body[data-section="rules"] { --section: #8792a1; }
body[data-section="download"] { --section: #6d8fc4; }

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

html {
  background: var(--black);
  scroll-behavior: smooth;
  /* Every in-page anchor has to clear the sticky bar or the heading it jumps to
     lands underneath it. */
  scroll-padding-top: calc(var(--bar) + 22px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  position: relative;
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 620px at 78% -12%, color-mix(in srgb, var(--section) 16%, transparent), transparent 70%),
    radial-gradient(900px 520px at 4% 8%, rgba(245,196,0,.07), transparent 68%),
    linear-gradient(178deg, var(--black), #0b0a06 58%, var(--black));
  color: var(--ink);
  font: 400 15px/1.65 var(--font);
  letter-spacing: -.005em;
}
/* A faint blueprint grid, masked out before it reaches the footer so the page
   ends on the field rather than on a pattern that stops mid-air. */
body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 3%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 3%, transparent) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 12%, transparent 72%);
  pointer-events: none;
}
body > * { position: relative; z-index: 1; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--section) 42%, transparent); color: #fff; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}
p { margin: 0; }

.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--pad); }

/* --- Reading rhythm ------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--section);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--section), color-mix(in srgb, var(--section) 30%, transparent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--section) 60%, transparent);
}
.lede { max-width: 62ch; color: var(--dim); font-size: 15.5px; line-height: 1.72; }

section.band { padding-block: clamp(64px, 9vw, 128px); }
.band-head { max-width: 760px; margin-bottom: clamp(30px, 4vw, 52px); }
.band-head h2 { font-size: clamp(30px, 4.1vw, 50px); text-transform: uppercase; }
.band-head p { margin-top: 18px; }

/* --- Controls ------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--lift-1);
  transition: transform .22s var(--spring), box-shadow .22s var(--spring),
              background-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--surface-lit); box-shadow: var(--lift-2); }
.btn:active { transform: translateY(0) scale(.985); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--section), color-mix(in srgb, var(--section) 55%, var(--accent-deeper)));
  color: #161200;
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset,
              0 14px 34px -14px color-mix(in srgb, var(--section) 85%, transparent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--section) 82%, #fff), var(--section));
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset,
              0 22px 52px -16px color-mix(in srgb, var(--section) 95%, transparent);
}
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-lit), var(--lift-1); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 11px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; filter: saturate(.4); pointer-events: none; }

/* The primary action sweeps once on hover. Cheap, and it is the one control on
   the page that has to look pressable from across the room. */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  translate: -120% 0;
  pointer-events: none;
}
.btn-primary:hover::after { transition: translate .7s var(--spring); translate: 120% 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--dim);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  box-shadow: inset 0 0 0 1px var(--line);
}
/* An inline <svg> with no width defaults to 300×150, and inside a stretched
   grid item it inflates to whatever the row allows — the back-link in the guide
   sidebar rendered as a 167px circle. Every icon slot in this sheet states its
   own size for that reason. */
.chip svg { width: 15px; height: 15px; flex: none; }
.chip-lit { background: var(--section-soft); color: var(--section); box-shadow: inset 0 0 0 1px var(--section-line); }

/* --- Brand --------------------------------------------------------------- */
/* The mark is the launcher's twin strike at every size on every page — the rear
   bolt struck a beat higher than the front one. The old footer used a letter H
   in a rounded square, which is a different logo for the same company. */
.mark { width: 26px; height: 26px; flex: none; color: var(--section); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--section) 45%, transparent)); }
.mark path { fill: currentColor; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--ink);
}

/* --- Top bar ------------------------------------------------------------- */
.site-bar {
  position: sticky;
  z-index: 40;
  top: 0;
  height: var(--bar);
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}
.site-bar.is-stuck {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--black) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
}
.site-bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}
.site-nav { display: flex; align-items: center; gap: 2px; margin-left: 22px; }
.site-nav a {
  position: relative;
  padding: 9px 13px;
  border-radius: 9px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .03em;
  transition: color .18s ease, background-color .18s ease;
}
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 13px -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--section);
  box-shadow: 0 0 12px var(--section);
}
.bar-spacer { flex: 1 1 auto; }
.bar-ip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 6px 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--dim);
  font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s ease, color .2s ease;
}
.bar-ip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-lit); }
.bar-ip code { font-family: var(--font); font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.bar-ip .copy { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--section); }
.bar-ip .copy:hover { background: var(--section-soft); }
.bar-ip .copy svg { width: 14px; height: 14px; }

.bar-burger { display: none; width: 42px; height: 42px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bar-burger svg { width: 18px; height: 18px; margin: auto; }

@media (max-width: 1080px) {
  .site-nav {
    position: fixed;
    z-index: 39;
    inset: var(--bar) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 14px var(--pad) 22px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--black) 96%, transparent);
    backdrop-filter: blur(22px);
    box-shadow: var(--lift-3);
    translate: 0 -14px;
    opacity: 0;
    visibility: hidden;
    transition: translate .28s var(--spring), opacity .22s ease, visibility .22s;
  }
  .site-nav a { padding: 14px; font-size: 14px; }
  .site-nav a[aria-current="page"]::after { inset: auto auto auto 0; width: 3px; height: 22px; top: 50%; translate: 0 -50%; }
  body.nav-open .site-nav { translate: 0 0; opacity: 1; visibility: visible; }
  .bar-burger { display: grid; }
  .bar-ip { display: none; }
}
/* The bar has a brand, a CTA and a burger, and on a phone those three do not
   fit — the CTA pushed the wordmark under the mark. The burger stays (it opens
   a menu whose first items are Магазин and Скачать), and the CTA goes: the hero
   directly below it is a full-width download button. */
@media (max-width: 620px) {
  .site-bar .wrap > .btn { display: none; }
  .brand strong { font-size: 11.5px; letter-spacing: .22em; text-indent: .22em; }
  .site-bar .wrap { gap: 8px; }
}

/* --- Scroll layer -------------------------------------------------------- */
/* One rule does the entire scroll choreography. Elements declare how they want
   to arrive; site.js only ever adds .is-in. No JavaScript means no class is
   ever added, so the fallback below has to be "everything is visible" — a
   reveal system that hides the page when a script fails is a broken page. */
[data-reveal] {
  opacity: 0;
  translate: 0 22px;
  transition: opacity .42s var(--spring), translate .52s var(--spring), filter .52s var(--spring);
  filter: blur(4px);
  transition-delay: var(--delay, 0ms);
}
[data-reveal="left"] { translate: -34px 0; }
[data-reveal="right"] { translate: 34px 0; }
[data-reveal="scale"] { translate: 0 0; scale: .94; transition-property: opacity, scale, filter; }
[data-reveal="tilt"] { translate: 0 34px; transform: perspective(1200px) rotateX(9deg); }
[data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  filter: blur(0);
  transform: perspective(1200px) rotateX(0);
}
.no-js [data-reveal], html:not(.js) [data-reveal] { opacity: 1; translate: 0 0; scale: 1; filter: none; transform: none; }

/* Read progress. Driven by a CSS scroll timeline where the browser supports one
   and by site.js where it does not — the animation below is inert until an
   ancestor gives it a timeline, so no double-drive. */
.read-bar {
  position: fixed;
  z-index: 45;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  transform-origin: 0 50%;
  scale: var(--progress, 0) 1;
  background: linear-gradient(90deg, var(--section), var(--accent-2));
  box-shadow: 0 0 14px color-mix(in srgb, var(--section) 70%, transparent);
}
@supports (animation-timeline: scroll()) {
  .read-bar { animation: read-progress linear; animation-timeline: scroll(root block); scale: 1 1; }
  @keyframes read-progress { from { scale: 0 1; } to { scale: 1 1; } }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; translate: 0 0 !important; scale: 1 !important; filter: none !important; transform: none !important; transition: none !important; }
  .read-bar { display: none; }
}

/* --- 3D: the shared card behaviour --------------------------------------- */
/* Cards that lift and turn toward the pointer. site.js writes --rx/--ry from
   pointer position; the transform is declared here so a card without script
   still has a hover state, and touch devices (no pointer) get the lift only. */
.lift3d {
  transform-style: preserve-3d;
  transition: transform .35s var(--spring), box-shadow .35s var(--spring), border-color .3s ease;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .lift3d:hover {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(16px);
    box-shadow: var(--lift-3), 0 0 0 1px var(--line-lit);
  }
  .lift3d:hover .lift3d-pop { transform: translateZ(34px); }
}
.lift3d-pop { transition: transform .35s var(--spring); }
@media (prefers-reduced-motion: reduce) { .lift3d, .lift3d:hover, .lift3d-pop { transform: none !important; } }

.panel {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
}
.panel-lit { background: var(--surface-lit); box-shadow: var(--lift-2); }

/* --- HERO ---------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  align-items: center;
  gap: clamp(30px, 4vw, 56px);
  min-height: min(88vh, 860px);
  padding-block: clamp(48px, 8vw, 104px);
}
/* Sized against the column, not the viewport. At 7.4vw the second line of the
   headline ran past the copy column and under the stage — a 1440px viewport is
   not a 1440px text measure once a second column takes 40% of it. */
.hero-copy h1 {
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: .94;
  letter-spacing: -.038em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.hero-copy h1 em {
  display: block;
  font-style: normal;
  color: transparent;
  background: linear-gradient(96deg, var(--section), var(--accent-2) 52%, #fff);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-copy .lede { margin-top: 20px; font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* The address block. This is the single most-copied string on the whole site,
   so it is a control rather than a line of prose. */
.ip-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin-top: 24px;
  padding: 12px 12px 12px 18px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--lift-1), inset 0 0 0 1px var(--line);
}
.ip-card > div { min-width: 0; }
.ip-card small { display: block; color: var(--dimmer); font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.ip-card b { display: block; margin-top: 3px; font-size: clamp(16px, 2.4vw, 21px); font-weight: 750; letter-spacing: -.01em; }
.ip-card .btn { min-height: 42px; }

.hero-metrics { display: flex; flex-wrap: wrap; gap: 22px 40px; margin-top: 28px; }
.hero-metrics div b { display: block; font-family: var(--display); font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.hero-metrics div span { color: var(--dimmer); font-size: 10.5px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }

/* The stage. A real 3D scene: a perspective container, four layers at different
   Z, and a slow orbit. It replaces a 2.3 MB hero photograph — the previous
   landing page's single largest asset and the reason it took two seconds to
   paint on a phone. */
.hero-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 1400px;
  perspective-origin: 50% 42%;
}
.stage-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* site.js nudges these from pointer position; the orbit runs regardless. */
  transform: rotateX(var(--sx, 0deg)) rotateY(var(--sy, 0deg));
  animation: stage-orbit 26s ease-in-out infinite;
}
@keyframes stage-orbit {
  0%, 100% { rotate: y -7deg; }
  50% { rotate: y 7deg; }
}
/* Positioned by data attribute rather than by :nth-of-type. Every layer in the
   scene is a div, so :nth-of-type counted the glow and the rings along with the
   tiles and none of them landed where the rule said — all four tiles stacked in
   one corner. An attribute says which layer this is regardless of markup order. */
.stage-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--section-line);
  transform: rotateX(74deg) translateZ(-90px);
  opacity: .5;
}
.stage-ring[data-ring="2"] { inset: 20%; transform: rotateX(74deg) translateZ(10px); opacity: .32; }
.stage-ring[data-ring="3"] { inset: 32%; transform: rotateX(74deg) translateZ(110px); opacity: .2; }
.stage-glow {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--section) 30%, transparent), transparent 66%);
  filter: blur(20px);
  transform: translateZ(-140px);
  animation: stage-breathe 6s ease-in-out infinite;
}
@keyframes stage-breathe { 0%, 100% { opacity: .55; scale: .94; } 50% { opacity: 1; scale: 1.04; } }

/* The mark, floating at the front of the scene and charging like the launcher's
   splash. Same clip geometry as #hq-splash in the launcher's index.html. */
.stage-mark {
  position: absolute;
  left: 50%; top: 50%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  transform: translateZ(180px);
  color: var(--section);
  filter: drop-shadow(0 22px 44px rgba(0,0,0,.7)) drop-shadow(0 0 40px color-mix(in srgb, var(--section) 55%, transparent));
  animation: stage-float 7s ease-in-out infinite;
}
@keyframes stage-float {
  0%, 100% { transform: translateZ(180px) translateY(-8px); }
  50% { transform: translateZ(210px) translateY(10px); }
}
.stage-mark svg { width: 100%; height: 100%; }
.stage-mark .mark-empty { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.stage-mark .mark-fill { fill: currentColor; animation: mark-charge 3.2s cubic-bezier(.45,.05,.55,.95) infinite; }
.stage-mark .mark-outline { fill: none; stroke: color-mix(in srgb, var(--section) 40%, transparent); stroke-width: .6; }
@keyframes mark-charge {
  0% { translate: 0 24px; }
  62% { translate: 0 0; }
  100% { translate: 0 0; }
}

/* Cards orbiting the mark, one per thing the platform is. They are positioned
   in 3D so the near one occludes the far one — which is what makes the scene
   read as depth rather than as four stickers. */
.stage-tile {
  position: absolute;
  display: grid;
  gap: 6px;
  width: 46%;
  padding: 14px 16px;
  border-radius: var(--r);
  /* Opaque enough to read as a card. At 84% over a near-black field the panel
     was invisible and the text looked like it was floating on the page. */
  background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 9%, var(--black-2)), var(--black-2));
  box-shadow: var(--lift-3), inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
  animation: tile-bob 9s ease-in-out infinite;
}
.stage-tile b { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.stage-tile span { color: var(--dimmer); font-size: 10.5px; line-height: 1.45; }
.stage-tile i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--section-soft); color: var(--section); }
.stage-tile i svg { width: 15px; height: 15px; }
.stage-tile[data-tile="1"] { left: -7%; top: 8%; transform: translateZ(90px) rotateY(13deg); animation-delay: 0s; }
.stage-tile[data-tile="2"] { right: -9%; top: 28%; transform: translateZ(140px) rotateY(-15deg); animation-delay: -2.2s; }
.stage-tile[data-tile="3"] { left: -3%; bottom: 14%; transform: translateZ(50px) rotateY(11deg); animation-delay: -4.4s; }
.stage-tile[data-tile="4"] { right: -5%; bottom: 2%; transform: translateZ(120px) rotateY(-12deg); animation-delay: -6.6s; }
@keyframes tile-bob { 0%, 100% { translate: 0 -7px; } 50% { translate: 0 7px; } }

.scroll-cue {
  position: absolute;
  left: 50%; bottom: -46px;
  translate: -50% 0;
  color: var(--dimmer);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.scroll-cue::after {
  content: "";
  display: block;
  width: 1px; height: 30px;
  margin: 10px auto 0;
  background: linear-gradient(var(--section), transparent);
  animation: cue-fall 2.1s ease-in-out infinite;
}
@keyframes cue-fall { 0% { opacity: 0; scale: 1 .2; transform-origin: top; } 45% { opacity: 1; scale: 1 1; } 100% { opacity: 0; scale: 1 1; } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  /* width:100% is load-bearing. Every layer in the scene is absolutely
     positioned, so the stage has no content to size itself from; once
     margin-inline:auto made it shrink-to-fit in the one-column layout it
     collapsed to 0×0 and the whole hero graphic vanished on phones. The grid
     column supplied a definite width on desktop, which is why it only broke
     below this breakpoint. */
  .hero-stage { order: -1; width: 100%; max-width: 460px; margin-inline: auto; }
  .scroll-cue { display: none; }
}
/* Below ~760px the four orbiting tiles are 180px wide and overlap each other
   into unreadable text. They are also the only thing on the page that repeats:
   the same four are the feature slabs in the next band. So the scene keeps the
   mark and the rings — which is what makes it a scene — and drops the labels. */
@media (max-width: 760px) {
  .stage-tile { display: none; }
  .hero-stage { max-width: 330px; }
  .stage-mark { width: 46%; }
}

/* --- Feature slabs ------------------------------------------------------- */
.slab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.slab {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
}
.slab i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--section-soft); color: var(--section); box-shadow: inset 0 0 0 1px var(--section-line); }
.slab i svg { width: 21px; height: 21px; }
.slab h3 { font-size: 17px; letter-spacing: -.02em; }
.slab p { color: var(--dim); font-size: 13.5px; line-height: 1.62; }
.slab .num { position: absolute; right: 20px; top: 16px; font-family: var(--display); font-size: 34px; font-weight: 800; color: color-mix(in srgb, var(--ink) 6%, transparent); }
.slab { position: relative; overflow: hidden; }

/* Two-up story rows, alternating side. */
.story-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(26px, 5vw, 64px);
  padding-block: clamp(38px, 5vw, 66px);
}
.story-row:nth-of-type(even) .story-art { order: -1; }
.story-row h3 { font-size: clamp(24px, 3.2vw, 38px); text-transform: uppercase; }
.story-row p { margin-top: 16px; color: var(--dim); line-height: 1.72; }
.story-points { display: grid; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.story-points li { display: flex; gap: 11px; color: var(--dim); font-size: 13.5px; }
.story-points li::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin-top: 7px;
  border-radius: 2px;
  background: var(--section);
  box-shadow: 0 0 10px var(--section);
  rotate: 45deg;
}
.story-art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--section) 18%, var(--black-2)), var(--black-2));
  box-shadow: var(--lift-3), inset 0 0 0 1px var(--line);
}
.story-art img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.story-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 40%, color-mix(in srgb, var(--black) 70%, transparent));
}
/* A voxel field drawn in CSS, for the rows that have no photograph. It reads as
   the game without shipping a megabyte of one. */
.voxels { position: absolute; inset: 0; perspective: 800px; }
.voxels i {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 5px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--section) 70%, #fff), var(--section) 55%, color-mix(in srgb, var(--section) 45%, #000));
  box-shadow: 0 14px 26px -10px rgba(0,0,0,.8);
  animation: voxel-drift 8s ease-in-out infinite;
}
.voxels i:nth-child(1) { left: 14%; top: 22%; transform: rotateX(-18deg) rotateY(26deg); }
.voxels i:nth-child(2) { left: 44%; top: 46%; width: 62px; height: 62px; transform: rotateX(-14deg) rotateY(-22deg); animation-delay: -2s; }
.voxels i:nth-child(3) { right: 16%; top: 18%; width: 34px; height: 34px; transform: rotateX(-20deg) rotateY(18deg); animation-delay: -4s; opacity: .82; }
.voxels i:nth-child(4) { left: 22%; bottom: 14%; width: 30px; height: 30px; transform: rotateX(-16deg) rotateY(-28deg); animation-delay: -6s; opacity: .7; }
.voxels i:nth-child(5) { right: 22%; bottom: 20%; width: 50px; height: 50px; transform: rotateX(-18deg) rotateY(24deg); animation-delay: -1s; opacity: .9; }
@keyframes voxel-drift { 0%, 100% { translate: 0 -10px; } 50% { translate: 0 10px; } }

@media (max-width: 860px) {
  .story-row { grid-template-columns: 1fr; }
  .story-row:nth-of-type(even) .story-art { order: 0; }
}

/* --- Stat band ----------------------------------------------------------- */
.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; border-radius: var(--r-lg); overflow: hidden; background: var(--line); box-shadow: var(--lift-2); }
.stat-band div { padding: 26px 24px; background: color-mix(in srgb, var(--black-2) 92%, transparent); }
.stat-band b { display: block; font-family: var(--display); font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.035em; }
.stat-band span { color: var(--dimmer); font-size: 10.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.stat-band em { display: block; margin-top: 8px; color: var(--dim); font-size: 12.5px; font-style: normal; line-height: 1.5; }

/* --- Closing call -------------------------------------------------------- */
.closing {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: clamp(52px, 7vw, 96px) var(--pad);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, color-mix(in srgb, var(--section) 22%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line);
}
.closing h2 { font-size: clamp(28px, 4.6vw, 56px); text-transform: uppercase; }
.closing p { max-width: 56ch; color: var(--dim); }
.closing .hero-actions { justify-content: center; }

/* --- Footer -------------------------------------------------------------- */
.site-foot { margin-top: clamp(50px, 7vw, 100px); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--black) 60%, transparent); }
.foot-grid { display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 34px; padding-block: 48px 34px; }
.foot-grid p { max-width: 34ch; margin-top: 14px; color: var(--dimmer); font-size: 12.5px; line-height: 1.6; }
.foot-col h4 { margin-bottom: 14px; color: var(--dimmer); font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.foot-col a { display: block; padding: 5px 0; color: var(--dim); font-size: 13px; transition: color .18s ease, translate .18s var(--spring); }
.foot-col a:hover { color: var(--ink); translate: 3px 0; }
.foot-base { display: flex; flex-wrap: wrap; gap: 12px 26px; padding-block: 20px 34px; border-top: 1px solid var(--line); color: var(--dimmer); font-size: 11.5px; }
.foot-base .bar-spacer { flex: 1 1 auto; }

/* --- Toast --------------------------------------------------------------- */
.toast-rail { position: fixed; z-index: 60; inset: auto 0 26px; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 13px 20px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--black-2) 94%, transparent);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: var(--lift-3), inset 0 0 0 1px var(--line-lit);
  backdrop-filter: blur(14px);
  animation: toast-in .4s var(--spring-out) both;
}
@keyframes toast-in { from { opacity: 0; translate: 0 18px; scale: .94; } }
.toast.is-out { animation: toast-out .3s var(--spring) both; }
@keyframes toast-out { to { opacity: 0; translate: 0 12px; scale: .96; } }

/* ==========================================================================
   DOWNLOAD
   ========================================================================== */
.dl-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: clamp(28px, 5vw, 60px); align-items: start; padding-block: clamp(40px, 6vw, 80px); }
.dl-hero h1 { font-size: clamp(36px, 6vw, 76px); text-transform: uppercase; }
.dl-card { padding: 26px; border-radius: var(--r-lg); background: var(--surface-lit); box-shadow: var(--lift-3), inset 0 0 0 1px var(--line); }
.dl-card .btn { width: 100%; }
.dl-meta { display: grid; gap: 10px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.dl-meta div { display: flex; justify-content: space-between; gap: 14px; color: var(--dim); font-size: 12.5px; }
.dl-meta b { color: var(--ink); font-weight: 650; text-align: right; word-break: break-all; }
.dl-alt { display: grid; gap: 8px; margin-top: 18px; }
.dl-alt a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-radius: var(--r); background: var(--surface); color: var(--dim); font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); transition: color .18s ease, background-color .18s ease; }
.dl-alt a:hover { color: var(--ink); background: var(--surface-lit); }
.dl-alt a small { color: var(--dimmer); font-size: 10.5px; }
.dl-steps { counter-reset: step; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.dl-steps li { position: relative; padding: 20px 22px 20px 66px; border-radius: var(--r); background: var(--surface); box-shadow: var(--lift-1); }
.dl-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 20px; top: 18px;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--section-soft);
  color: var(--section);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--section-line);
}
.dl-steps b { display: block; margin-bottom: 5px; font-size: 14px; }
.dl-steps span { color: var(--dim); font-size: 13px; line-height: 1.6; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.req-grid div { padding: 20px; border-radius: var(--r); background: var(--surface); box-shadow: var(--lift-1); }
.req-grid small { display: block; color: var(--dimmer); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.req-grid b { display: block; margin-top: 7px; font-size: 14px; font-weight: 650; }
.req-grid span { display: block; margin-top: 5px; color: var(--dim); font-size: 12.5px; }
@media (max-width: 900px) { .dl-hero { grid-template-columns: 1fr; } }

/* ==========================================================================
   SHOP
   ========================================================================== */
.shop-head { display: grid; gap: 22px; padding-block: clamp(34px, 5vw, 60px) 26px; }
.shop-head h1 { font-size: clamp(34px, 5.4vw, 66px); text-transform: uppercase; }
.shop-bar {
  position: sticky;
  z-index: 20;
  top: var(--bar);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--black-2) 90%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line);
}
.shop-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-filters button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.shop-filters button:hover { color: var(--ink); background: var(--surface); }
.shop-filters button.active { background: var(--section-soft); color: var(--section); box-shadow: inset 0 0 0 1px var(--section-line); }
.shop-filters button b { margin-left: 7px; color: var(--dimmer); font-weight: 650; }
.shop-search { position: relative; flex: 1 1 190px; min-width: 150px; }
.shop-search input {
  width: 100%;
  min-height: 36px;
  padding: 0 14px 0 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.shop-search input::placeholder { color: var(--dimmer); }
.shop-search svg { position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; color: var(--dimmer); }
.shop-currency { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.shop-currency button { min-height: 30px; padding: 0 12px; border-radius: var(--r-pill); color: var(--dimmer); font-size: 11px; font-weight: 700; }
.shop-currency button.active { background: var(--section-soft); color: var(--section); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.product {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
}
.product-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tint, var(--section)) 26%, transparent), transparent 68%), var(--black-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.product-art img { width: 74%; height: 74%; object-fit: contain; filter: drop-shadow(0 12px 22px rgba(0,0,0,.6)); }
.product-art .swatch { width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--tint, var(--section)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--tint, var(--section)) 16%, transparent), 0 18px 34px -12px rgba(0,0,0,.8); }
.product-art .glyph { font-family: var(--display); font-size: 40px; font-weight: 800; color: var(--tint, var(--section)); }
/* The art turns slightly with the card, one layer in front of the panel. */
.product:hover .product-art { transform: translateZ(24px); }
.product-art { transition: transform .35s var(--spring); }

.product-tag { position: absolute; right: 10px; top: 10px; z-index: 2; min-height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--black) 78%, transparent); backdrop-filter: blur(8px); color: var(--dim); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.product-tag[data-rarity="epic"] { color: #cbb0ff; box-shadow: inset 0 0 0 1px rgba(203,176,255,.4); }
.product-tag[data-rarity="rare"] { color: #8fd3ff; box-shadow: inset 0 0 0 1px rgba(143,211,255,.4); }
.product-tag[data-rarity="vip"] { color: #ffd97a; box-shadow: inset 0 0 0 1px rgba(255,217,122,.42); }
.product h3 { font-size: 14.5px; letter-spacing: -.015em; }
.product .kind { margin-top: 5px; color: var(--dimmer); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.product p { margin-top: 8px; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }
.product-price { display: grid; }
.product-price b { font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.product-price small { color: var(--dimmer); font-size: 10.5px; }
.product-price small img { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.product .btn { min-height: 38px; padding: 0 14px; font-size: 10.5px; }

.shop-empty { padding: 60px 24px; border-radius: var(--r-lg); background: var(--surface); text-align: center; box-shadow: var(--lift-1); }
.shop-empty strong { display: block; margin-bottom: 8px; font-family: var(--display); font-size: 18px; }
.shop-empty span { color: var(--dim); font-size: 13px; }

/* The cart. A drawer rather than its own page, because nothing on this site
   should take a player away from the grid to add a second frame. */
.cart-toggle {
  position: fixed;
  z-index: 41;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(16px, 3vw, 30px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--section), color-mix(in srgb, var(--section) 55%, var(--accent-deeper)));
  color: #161200;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 18px 44px -14px color-mix(in srgb, var(--section) 90%, transparent), 0 1px 0 rgba(255,255,255,.3) inset;
  transition: transform .28s var(--spring-out), opacity .2s ease;
}
.cart-toggle:hover { transform: translateY(-3px) scale(1.02); }
.cart-toggle[hidden] { display: none; }
.cart-toggle b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: rgba(3,12,22,.34); color: #fff; font-size: 11px; }

.cart-scrim { position: fixed; z-index: 49; inset: 0; background: rgba(2,6,14,.66); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
body.cart-open .cart-scrim { opacity: 1; visibility: visible; }
.cart {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--black-2) 97%, transparent);
  box-shadow: var(--lift-3);
  translate: 100% 0;
  transition: translate .38s var(--spring);
}
body.cart-open .cart { translate: 0 0; }
.cart header { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.cart header strong { flex: 1; font-family: var(--display); font-size: 15px; letter-spacing: .02em; text-transform: uppercase; }
.cart header button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--dim); }
.cart header button:hover { background: var(--surface); color: var(--ink); }
.cart-lines { flex: 1; overflow-y: auto; padding: 14px 22px; display: grid; align-content: start; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 11px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cart-line .thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px; background: var(--black); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cart-line .thumb img { width: 80%; height: 80%; object-fit: contain; }
.cart-line .thumb i { width: 22px; height: 22px; border-radius: 50%; background: var(--tint, var(--section)); }
.cart-line b { display: block; font-size: 12.5px; font-weight: 650; }
.cart-line small { color: var(--dimmer); font-size: 11px; }
.cart-line .drop { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--dimmer); }
.cart-line .drop:hover { background: color-mix(in srgb, #ff5670 18%, transparent); color: #ff8b9c; }
.cart-note { padding: 18px 22px; color: var(--dimmer); font-size: 12px; line-height: 1.6; }
.cart-foot { padding: 18px 22px 24px; border-top: 1px solid var(--line); display: grid; gap: 13px; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; }
.cart-total span { color: var(--dim); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.cart-total b { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.cart-foot .btn { width: 100%; }

/* ==========================================================================
   RULES
   ========================================================================== */
.doc-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: clamp(24px, 4vw, 54px); align-items: start; padding-block: 34px 20px; }
.doc-aside { position: sticky; top: calc(var(--bar) + 20px); display: grid; gap: 14px; }
.doc-search { position: relative; }
.doc-search input { width: 100%; min-height: 42px; padding: 0 14px 0 38px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
.doc-search input::placeholder { color: var(--dimmer); }
.doc-search svg { position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; color: var(--dimmer); }
.doc-toc {
  display: grid; gap: 1px;
  max-height: min(62vh, 620px);
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
  /* The default scrollbar is a bright white slab against a near-black panel and
     reads as the loudest thing in the sidebar. */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 16%, transparent) transparent;
}
.doc-toc::-webkit-scrollbar { width: 8px; }
.doc-toc::-webkit-scrollbar-track { background: transparent; }
.doc-toc::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: color-mix(in srgb, var(--ink) 16%, transparent); background-clip: content-box; }
.doc-toc::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 28%, transparent); background-clip: content-box; }
.cart-lines { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 16%, transparent) transparent; }
.doc-toc a { display: flex; gap: 10px; padding: 9px 11px; border-radius: 9px; color: var(--dim); font-size: 12.5px; line-height: 1.4; transition: color .16s ease, background-color .16s ease; }
.doc-toc a em { flex: none; color: var(--dimmer); font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-toc a:hover { color: var(--ink); background: var(--surface-lit); }
.doc-toc a.active { background: var(--section-soft); color: var(--section); }
.doc-toc a.active em { color: var(--section); }

.doc-body { display: grid; gap: 18px; min-width: 0; }
.doc-intro { padding: 26px; border-radius: var(--r-lg); background: var(--surface-lit); box-shadow: var(--lift-2), inset 0 0 0 1px var(--line); }
.doc-intro h1 { font-size: clamp(30px, 4.6vw, 54px); text-transform: uppercase; }
.doc-intro p { margin-top: 16px; color: var(--dim); line-height: 1.7; }
.doc-intro dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-intro dt { color: var(--dimmer); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.doc-intro dd { margin: 6px 0 0; font-size: 13px; font-weight: 650; }

.rule-group {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--lift-1);
  scroll-margin-top: calc(var(--bar) + 20px);
}
.rule-group > header { display: flex; align-items: center; gap: 15px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--section) 8%, transparent); }
.rule-group > header b { display: grid; place-items: center; min-width: 44px; height: 40px; padding: 0 8px; border-radius: var(--r); background: var(--section-soft); color: var(--section); font-family: var(--display); font-size: 16px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--section-line); }
.rule-group > header div { min-width: 0; }
.rule-group > header h2 { font-size: 18px; letter-spacing: -.02em; text-transform: uppercase; }
.rule-group > header p { margin-top: 5px; color: var(--dim); font-size: 12.5px; }
.rule-list { display: grid; gap: 1px; background: var(--line); }
.rule {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 17px 24px;
  background: color-mix(in srgb, var(--black-2) 88%, transparent);
  transition: background-color .18s ease;
  scroll-margin-top: calc(var(--bar) + 20px);
}
.rule:hover { background: var(--surface-lit); }
.rule:target { background: var(--section-soft); box-shadow: inset 3px 0 0 var(--section); }
.rule > b { color: var(--section); font-family: var(--display); font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.rule > div > p { color: var(--ink); font-size: 13.5px; line-height: 1.65; }
.rule .why { display: block; margin-top: 7px; color: var(--dimmer); font-size: 12px; line-height: 1.55; }
.rule .pen { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: color-mix(in srgb, #ff5670 13%, transparent); color: #ff9aa8; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; }
.rule[hidden] { display: none; }
.rule-group[hidden] { display: none; }

@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-aside { position: static; }
  .doc-toc { max-height: 240px; }
  .rule { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 15px 16px; }
  .rule-group > header { padding: 16px; }
}

/* ==========================================================================
   GUIDES
   ========================================================================== */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; }
.guide-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
  overflow: hidden;
}
.guide-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--section), transparent);
  scale: 0 1;
  transform-origin: 0 50%;
  transition: scale .45s var(--spring);
}
.guide-card:hover::after { scale: 1 1; }
.guide-card .row { display: flex; align-items: center; gap: 8px; }
.guide-card h3 { font-size: 18px; letter-spacing: -.022em; }
.guide-card p { color: var(--dim); font-size: 13px; line-height: 1.6; }
.guide-card .go { display: inline-flex; align-items: center; gap: 8px; color: var(--section); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.guide-card .go svg { width: 14px; height: 14px; transition: translate .25s var(--spring); }
.guide-card:hover .go svg { translate: 4px 0; }
.guide-card .level { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: var(--section-soft); color: var(--section); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.guide-card .mins { color: var(--dimmer); font-size: 11px; }

.article { display: grid; gap: 20px; min-width: 0; }
.article-head { padding: 28px; border-radius: var(--r-lg); background: var(--surface-lit); box-shadow: var(--lift-2), inset 0 0 0 1px var(--line); }
.article-head h1 { font-size: clamp(28px, 4.4vw, 50px); text-transform: uppercase; }
.article-head p { margin-top: 16px; color: var(--dim); line-height: 1.7; }
.article-head .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.article section {
  padding: 24px 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--lift-1);
  scroll-margin-top: calc(var(--bar) + 20px);
}
.article section > h2 { display: flex; align-items: baseline; gap: 12px; font-size: 19px; letter-spacing: -.02em; text-transform: uppercase; }
.article section > h2 em { color: var(--section); font-family: var(--display); font-size: 13px; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.article section > p { margin-top: 14px; color: var(--dim); font-size: 14px; line-height: 1.72; }
.article ol, .article ul { margin: 16px 0 0; padding-left: 0; list-style: none; display: grid; gap: 11px; }
.article ol { counter-reset: s; }
.article ol > li { position: relative; padding-left: 38px; color: var(--dim); font-size: 13.5px; line-height: 1.65; }
.article ol > li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 25px; height: 25px;
  border-radius: 8px;
  background: var(--section-soft);
  color: var(--section);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
}
.article ul > li { position: relative; padding-left: 22px; color: var(--dim); font-size: 13.5px; line-height: 1.65; }
.article ul > li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 7px; height: 7px; border-radius: 2px; rotate: 45deg; background: var(--section); }
.article strong { color: var(--ink); font-weight: 650; }
.article code, .kbd {
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--section) 12%, transparent);
  color: color-mix(in srgb, var(--section) 70%, #fff);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .88em;
  box-shadow: inset 0 0 0 1px var(--section-line);
}
.callout {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--section) 9%, transparent);
  box-shadow: inset 0 0 0 1px var(--section-line);
}
.callout i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--section-soft); color: var(--section); }
.callout i svg { width: 18px; height: 18px; }
.callout b { display: block; margin-bottom: 5px; font-size: 13px; }
.callout span { color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.callout[data-tone="warn"] { --section: #e8b23c; }
.callout[data-tone="stop"] { --section: #ff5670; }

.article-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.article-nav a { flex: 1 1 240px; padding: 18px 20px; border-radius: var(--r); background: var(--surface); box-shadow: var(--lift-1); transition: transform .25s var(--spring), box-shadow .25s var(--spring); }
.article-nav a:hover { transform: translateY(-2px); box-shadow: var(--lift-2); }
.article-nav small { display: block; color: var(--dimmer); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.article-nav b { display: block; margin-top: 6px; font-size: 14px; }

/* --- Print --------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .site-bar, .site-foot, .doc-aside, .read-bar, .cart, .cart-toggle, .cart-scrim, .scroll-cue { display: none !important; }
  .rule, .rule-group, .article section { background: #fff !important; box-shadow: none !important; border: 1px solid #ddd; }
  .rule > b, .eyebrow { color: #000 !important; }
}
