/* ==========================================================================
   Saiokatta — main stylesheet
   Dark, futuristic, low-poly. Fonts are self-hosted (no third-party requests).
   ========================================================================== */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Oxanium";
  src: url("../fonts/oxanium.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #07060f;
  --ink-2: #0d0b1c;
  --ink-3: #151230;
  --ink-4: #1d1940;
  --fog: #1b1036;
  --text: #f4f1ff;
  --text-2: #b9b3d6;
  --text-3: #8a84ad;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.17);
  --pink: #ff2e97;
  --orange: #ff6a3d;
  --amber: #ffb547;
  --violet: #8b5cf6;
  --indigo: #4f46e5;
  --mint: #3cf2d8;
  --grad: linear-gradient(100deg, var(--amber) 0%, var(--orange) 28%, var(--pink) 62%, var(--violet) 100%);
  --grad-v: linear-gradient(180deg, var(--amber), var(--orange) 30%, var(--pink) 65%, var(--violet));

  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-hud: "Oxanium", "Manrope", system-ui, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  --r: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  overflow-x: clip;
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1rem/1.65 var(--f-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* film grain for richness */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 0.8rem 1.1rem;
  background: var(--mint);
  color: var(--ink);
  font: 700 0.85rem/1 var(--f-hud);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.accent { color: var(--pink); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Type components ---------- */
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0 0 1.4rem;
  font: 600 0.76rem/1.2 var(--f-hud);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
}
.kicker span {
  padding: 0.45em 0.7em 0.4em;
  background: var(--mint);
  color: var(--ink);
  letter-spacing: 0.14em;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.headline {
  margin: 0;
  max-width: 21ch;
  font: 700 clamp(1.85rem, 4.4vw, 3.4rem)/1.1 var(--f-display);
  letter-spacing: -0.03em;
  color: var(--text-3);
  text-wrap: balance;
}
.headline strong { color: var(--text); font-weight: inherit; }
.headline--xl { font-size: clamp(2rem, 5.2vw, 4.3rem); }

.lead {
  max-width: 58ch;
  margin: 1.6rem 0 0;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-2);
}

.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-head--center { text-align: center; }
.section-head--center .kicker { justify-content: center; }
.section-head--center .headline { margin-inline: auto; }

/* ---------- Buttons (chamfered HUD style) ---------- */
.btn {
  --c: 10px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.85em 1.5em;
  border: 0;
  font: 700 0.82rem/1 var(--f-hud);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: transform 0.3s var(--ease-out), background-position 0.5s var(--ease-out), filter 0.3s;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
.btn--primary {
  background: var(--grad);
  background-size: 160% 100%;
  color: #16091d;
}
.btn--primary:hover { background-position: 100% 0; transform: translateY(-2px); filter: brightness(1.08); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.24);
  color: var(--text);
}
.btn--ghost::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: #110e25;
  clip-path: polygon(calc(var(--c) - 0.4px) 0, 100% 0, 100% calc(100% - var(--c) + 0.4px), calc(100% - var(--c) + 0.4px) 100%, 0 100%, 0 calc(var(--c) - 0.4px));
  transition: background 0.3s;
}
.btn--ghost:hover { transform: translateY(-2px); background: rgba(60, 242, 216, 0.7); }
.btn--ghost:hover::before { background: #16122e; }
.btn--sm { --c: 8px; min-height: 38px; padding: 0.6em 1.05em; font-size: 0.72rem; }
.btn--xl {
  --c: 14px;
  min-height: 64px;
  padding: 1.1em 2em;
  font: 700 clamp(0.95rem, 2vw, 1.2rem)/1 var(--f-display);
  letter-spacing: -0.01em;
  text-transform: none;
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  margin: 0 0.12em;
  padding: 0.3em 0.45em;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  font: 700 0.72rem/1 var(--f-hud);
  color: var(--text-2);
  text-align: center;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 0.35s, box-shadow 0.35s;
}
.nav.is-scrolled {
  background: rgba(7, 6, 15, 0.74);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  width: min(100% - 2 * var(--gutter), 1360px);
  height: var(--nav-h);
  margin-inline: auto;
}
.nav__logo { flex: none; width: clamp(112px, 11vw, 138px); color: var(--text); }
.nav__logo svg { width: 100%; height: auto; fill: currentColor; }

.xp {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font: 600 0.66rem/1 var(--f-hud);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s, transform 0.4s var(--ease-out);
}
.nav.is-scrolled .xp { opacity: 1; transform: none; }
.xp__lvl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-width: 4.4em;
  white-space: nowrap;
  padding: 0.45em 0.5em 0.4em;
  background: var(--ink-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.xp__lvl b { color: var(--amber); }
.xp.is-levelup .xp__lvl { animation: levelup 0.9s var(--ease-out); }
.xp__meta { display: grid; gap: 0.35rem; min-width: 104px; }
.xp__name { color: var(--text-2); white-space: nowrap; }
.xp__bar {
  position: relative;
  display: block;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.xp__bar i {
  position: absolute;
  inset: 0;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--xp, 0));
}
.xp__pts b { color: var(--mint); font-variant-numeric: tabular-nums; }
@keyframes levelup {
  0% { transform: scale(1); box-shadow: inset 0 0 0 1px var(--line-2); }
  30% { transform: scale(1.25); box-shadow: inset 0 0 0 1px var(--amber), 0 0 24px rgba(255, 181, 71, 0.6); }
  100% { transform: scale(1); }
}

.nav__links { display: flex; gap: 0.15rem; margin-left: auto; }
.nav__links a {
  position: relative;
  padding: 0.6rem 0.8rem;
  font: 600 0.74rem/1 var(--f-hud);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.2rem;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="true"] { color: var(--text); }
.nav__links a[aria-current="true"]::after { transform: scaleX(1); }
.nav__cta { flex: none; }

.nav__progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--page, 0));
  opacity: 0;
  transition: opacity 0.3s;
}
.nav.is-scrolled .nav__progress { opacity: 1; }

.nav__menu {
  display: none;
  place-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  cursor: pointer;
}
.nav__menu i {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out);
}
.nav__menu[aria-expanded="true"] i:first-of-type { transform: translateY(4px) rotate(45deg); }
.nav__menu[aria-expanded="true"] i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 2rem;
  background: rgba(7, 6, 15, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.menu[hidden] { display: none; }
.menu nav { display: grid; gap: 0.3rem; }
.menu nav a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  font: 800 clamp(1.9rem, 9vw, 3rem)/1.1 var(--f-display);
  letter-spacing: -0.035em;
  color: var(--text);
  text-decoration: none;
  animation: menu-in 0.5s var(--ease-out) both;
}
.menu nav a:nth-child(2) { animation-delay: 0.04s; }
.menu nav a:nth-child(3) { animation-delay: 0.08s; }
.menu nav a:nth-child(4) { animation-delay: 0.12s; }
.menu nav a:nth-child(5) { animation-delay: 0.16s; }
.menu nav a small { font: 600 0.75rem/1 var(--f-hud); letter-spacing: 0.16em; color: var(--pink); }
.menu__foot { margin-top: 2.5rem; font: 600 0.9rem/1 var(--f-hud); letter-spacing: 0.1em; color: var(--mint); }
.menu__foot a { text-decoration: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 1080px) {
  .nav__links a { padding-inline: 0.55rem; letter-spacing: 0.12em; }
  .nav__links a::after { left: 0.55rem; right: 0.55rem; }
}
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
  .nav__menu { display: grid; }
}
@media (max-width: 520px) {
  .xp__meta { min-width: 64px; }
  .xp__pts { display: none; }
  .nav__cta { display: none; }
  .nav__menu { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 230vh; height: 230svh; }
.hero__sticky {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.hero__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 45% at 50% 64%, rgba(255, 46, 151, 0.55), transparent 70%),
    radial-gradient(40% 22% at 50% 60%, rgba(255, 181, 71, 0.55), transparent 70%),
    linear-gradient(180deg, #07060f 0%, #140b2c 38%, #3b1552 58%, #1b1036 64%, #0d0a1f 100%);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero__canvas.is-ready { opacity: 1; }
.hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 6, 15, 0.55) 0%, transparent 22%, transparent 60%, rgba(7, 6, 15, 0.5) 85%, var(--ink) 100%);
}
.hero__hud {
  position: absolute;
  z-index: 3;
  top: calc(var(--nav-h) + 14px);
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  opacity: var(--hud-o, 1);
}
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font: 600 0.66rem/1 var(--f-hud);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hud-chip i {
  width: 6px;
  height: 6px;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: pulse 1.8s ease-in-out infinite;
}
.hud-chip--dim { color: var(--text-3); }

.hero__content {
  position: relative;
  z-index: 2;
  width: min(92vw, 1080px);
  text-align: center;
  opacity: var(--c-o, 1);
  transform: translate3d(0, var(--c-y, 0), 0) scale(var(--c-s, 1));
  will-change: transform, opacity;
}
.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.1rem, 2.6vw, 2.2rem);
  margin: 0;
  font-weight: 400;
}
.hero__logo {
  position: relative;
  display: block;
  width: min(86vw, 960px);
  color: #fff;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.6s var(--ease-out);
}
.logo-hero {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 12px 42px rgba(255, 46, 151, 0.35)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.25));
}
.logo-l {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.js .logo-l { animation: letter-in 0.95s var(--ease-spring) both; animation-delay: calc(0.2s + var(--i) * 0.075s); }
@keyframes letter-in {
  0% { opacity: 0; transform: translateY(-140%) scale(1, 1.35); }
  55% { opacity: 1; transform: translateY(5%) scale(1.04, 0.9); }
  75% { transform: translateY(-2%) scale(0.99, 1.02); }
  100% { opacity: 1; transform: none; }
}
.hero__logo-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask: url("../img/logo-saiokatta.svg") center / 100% 100% no-repeat;
  mask: url("../img/logo-saiokatta.svg") center / 100% 100% no-repeat;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.95) 47%, rgba(60, 242, 216, 0.95) 51%, rgba(255, 46, 151, 0.8) 55%, transparent 64%);
  background-size: 320% 100%;
  background-position: 160% 0;
  animation: shine 7s 2.2s ease-in-out infinite;
}
@keyframes shine {
  0% { background-position: 160% 0; }
  22%, 100% { background-position: -60% 0; }
}
.logo-glitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  fill: currentColor;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.logo-glitch--a { color: var(--pink); animation: glitch-a 8s 4s steps(1) infinite; }
.logo-glitch--b { color: var(--mint); animation: glitch-b 8s 4s steps(1) infinite; }
@keyframes glitch-a {
  0%, 92%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  93% { opacity: 0.9; transform: translateX(-1.1%); clip-path: inset(8% 0 58% 0); }
  94.5% { opacity: 0.9; transform: translateX(0.9%); clip-path: inset(62% 0 6% 0); }
  96% { opacity: 0.8; transform: translateX(-0.5%); clip-path: inset(34% 0 38% 0); }
  97.5% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 92%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  93% { opacity: 0.85; transform: translateX(1.1%); clip-path: inset(40% 0 30% 0); }
  94.5% { opacity: 0.85; transform: translateX(-0.8%); clip-path: inset(12% 0 70% 0); }
  96% { opacity: 0.7; transform: translateX(0.6%); clip-path: inset(70% 0 4% 0); }
  97.5% { opacity: 0; }
}

.hero__tagline {
  display: block;
  font: 800 clamp(1.7rem, 5.4vw, 4.4rem)/1 var(--f-display);
  letter-spacing: -0.04em;
  text-shadow: 0 4px 30px rgba(7, 6, 15, 0.5);
}
.js .hero__tagline { animation: rise 0.9s 0.35s var(--ease-out) both; }
.hero__sub {
  margin: clamp(1rem, 2vw, 1.6rem) 0 0;
  font: 600 clamp(0.64rem, 1.1vw, 0.84rem)/1.8 var(--f-hud);
  letter-spacing: clamp(0.18em, 0.9vw, 0.32em);
  text-transform: uppercase;
  color: var(--text-2);
}
.hero__sub span { white-space: nowrap; }
@media (max-width: 560px) {
  .hero__sub span { display: block; }
  .hero__sep { display: none !important; }
}
.js .hero__sub { animation: rise 0.9s 0.55s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.hero__second {
  position: absolute;
  z-index: 2;
  inset: 50% 0 auto;
  margin: 0;
  padding-inline: var(--gutter);
  text-align: center;
  font: 800 clamp(2.1rem, 7.4vw, 6.6rem)/1.02 var(--f-display);
  letter-spacing: -0.045em;
  opacity: var(--s-o, 0);
  transform: translate3d(0, calc(-50% + var(--s-y, 0px)), 0) scale(var(--s-s, 1));
  pointer-events: none;
  will-change: transform, opacity;
}
.no-js .hero__second { display: none; }

.hero__start {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  transform: translateX(-50%);
  opacity: var(--hud-o, 1);
}
.hero__press {
  font: 700 0.78rem/1 var(--f-hud);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 181, 71, 0.7);
  animation: blink 1.1s steps(2, jump-none) infinite;
}
.hero__mouse {
  position: relative;
  width: 22px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
}
.hero__mouse i {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #fff;
  animation: wheel 1.7s var(--ease-out) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ---------- Studio / word reveal ---------- */
.words { position: relative; height: 210vh; height: 210svh; }
.words__sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100% - 2 * var(--gutter), 1120px);
  height: 100vh;
  height: 100svh;
  margin-inline: auto;
  padding-top: var(--nav-h);
}
.words__text {
  margin: 0;
  font: 700 clamp(1.6rem, 4.3vw, 3.75rem)/1.2 var(--f-display);
  letter-spacing: -0.03em;
  text-wrap: pretty;
}
/* unlit words stay at 3.3:1 contrast so the copy is readable before it lights up */
.words__text .w { color: #635e7e; transition: color 0.35s ease, text-shadow 0.35s; }
.words__text .w.is-on { color: var(--text); }
.words__text .w.is-grad.is-on {
  background: var(--grad);
  background-size: var(--gw, 100%) 100%;
  background-position: var(--gx, 0) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  background: var(--ink);
}
.fact__value { font: 700 clamp(1.25rem, 2.4vw, 2rem)/1.1 var(--f-display); letter-spacing: -0.025em; }
.fact__label { font: 600 0.72rem/1.2 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Shelf (Apple Store style) ---------- */
.shelf-block { padding-top: clamp(5rem, 11vw, 9rem); scroll-margin-top: calc(var(--nav-h) + 24px); }
.shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.6rem;
}
.shelf-head .headline { max-width: 26ch; }
.shelf-nav { display: flex; gap: 0.6rem; flex: none; }
.shelf-nav[hidden] { display: none; }
.shelf-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.shelf-btn:hover { background: rgba(255, 255, 255, 0.16); }
.shelf-btn:disabled { opacity: 0.3; cursor: default; }
.shelf-btn svg { width: 18px; height: 18px; }
[data-shelf-prev] svg { transform: rotate(180deg); }
.shelf {
  --pad: max(var(--gutter), (100vw - var(--wrap)) / 2);
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 14px var(--pad) 48px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf__item { flex: 0 0 auto; width: min(80vw, 400px); scroll-snap-align: start; }

.game-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line);
  text-decoration: none;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px var(--line-2), 0 30px 60px -24px rgba(255, 46, 151, 0.45);
}
.game-card__art { display: block; aspect-ratio: 400 / 260; overflow: hidden; }
.game-card__art svg { width: 100%; height: 100%; transition: transform 0.7s var(--ease-out); }
.game-card:hover .game-card__art svg { transform: scale(1.05); }
.game-card__body { display: flex; flex: 1; flex-direction: column; gap: 0.45rem; padding: 1.35rem 1.5rem 1.6rem; }
.game-card__kicker { font: 600 0.68rem/1.2 var(--f-hud); letter-spacing: 0.17em; text-transform: uppercase; color: var(--text-3); }
.game-card__title { font: 700 1.4rem/1.15 var(--f-display); letter-spacing: -0.025em; }
.game-card__desc { color: var(--text-2); font-size: 0.97rem; line-height: 1.5; }
.game-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: auto;
  padding-top: 0.6rem;
  font: 700 0.74rem/1 var(--f-hud);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
}
.game-card__cta svg { width: 1.1em; height: 1.1em; transition: transform 0.3s var(--ease-out); }
.game-card:hover .game-card__cta svg { transform: translateX(5px); }

/* little looping animations on the card art (run on hover / focus) */
.gc-ball { animation: gc-ball 2.4s ease-in-out infinite paused; transform-box: fill-box; transform-origin: center; }
.gc-paddle-a { animation: gc-pad-a 2.4s ease-in-out infinite paused; }
.gc-paddle-b { animation: gc-pad-b 2.4s ease-in-out infinite paused; }
.gc-lanes { animation: gc-lanes 0.6s linear infinite paused; }
.gc-sun { animation: gc-sun 3s ease-in-out infinite paused; }
.gc-slab { animation: gc-slab 1.6s ease-in-out infinite paused; }
.game-card:is(:hover, :focus-visible) :is(.gc-ball, .gc-paddle-a, .gc-paddle-b, .gc-lanes, .gc-sun, .gc-slab) { animation-play-state: running; }
@keyframes gc-ball { 0% { transform: translate(-150px, -30px) rotate(0); } 50% { transform: translate(90px, 30px) rotate(180deg); } 100% { transform: translate(-150px, -30px) rotate(360deg); } }
@keyframes gc-pad-a { 0%, 100% { transform: translateY(-12px); } 50% { transform: translateY(26px); } }
@keyframes gc-pad-b { 0%, 100% { transform: translateY(10px); } 50% { transform: translateY(-40px); } }
@keyframes gc-lanes { to { stroke-dashoffset: -22; } }
@keyframes gc-sun { 50% { transform: translateY(6px); } }
@keyframes gc-slab { 0%, 100% { transform: translate(-64px, -32px); } 50% { transform: translate(0, 0); } }

/* ---------- Modes (what we make) ---------- */
.make { padding-top: clamp(6rem, 13vw, 11rem); }
.make .section-head { margin-bottom: 0; }
.modes { position: relative; height: calc(4 * 80vh + 20vh); height: calc(4 * 80svh + 20svh); }
.modes__sticky {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
  width: min(100% - 2 * var(--gutter), 1320px);
  height: 100vh;
  height: 100svh;
  margin-inline: auto;
  padding-top: var(--nav-h);
}
.modes__stage { position: relative; height: min(76svh, 700px); }
.modes__glow {
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--mode-glow, rgba(255, 46, 151, 0.4)), transparent 72%);
  filter: blur(10px);
  transition: background 0.9s ease;
}
.modes__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.modes__index {
  position: absolute;
  left: 0;
  top: 4%;
  font: 800 clamp(4.5rem, 11vw, 10rem)/0.8 var(--f-display);
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.13);
  pointer-events: none;
}
.modes__panel { min-width: 0; }
.modes__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: clamp(1.4rem, 3vh, 2.4rem); }
.modes__tabs button {
  --c: 7px;
  padding: 0.62rem 0.9rem 0.58rem;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  font: 600 0.7rem/1 var(--f-hud);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: background 0.25s, color 0.25s;
}
.modes__tabs button span { margin-right: 0.55em; color: var(--pink); }
.modes__tabs button:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.modes__tabs button[aria-selected="true"] { background: var(--text); color: var(--ink); }
.modes__tabs button[aria-selected="true"] span { color: #b3125f; }
.modes__cards { position: relative; min-height: 430px; }
.mode__kicker { margin: 0; font: 600 0.72rem/1 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mint); }
.mode__title { margin: 0.7rem 0 0.7rem; font: 800 clamp(1.9rem, 3.8vw, 3.3rem)/1.02 var(--f-display); letter-spacing: -0.035em; }
.mode__tag {
  display: inline-block;
  margin: 0 0 1.1rem;
  font: 700 clamp(1.05rem, 1.8vw, 1.4rem)/1.25 var(--f-display);
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mode__text { max-width: 46ch; margin: 0; font-size: 1.06rem; color: var(--text-2); }
.stats { display: grid; gap: 0.85rem; max-width: 430px; margin: 1.8rem 0 0; }
.stat { display: grid; grid-template-columns: 8.6rem 1fr; align-items: center; gap: 1rem; }
.stat dt { font: 600 0.7rem/1.2 var(--f-hud); letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-3); }
.stat dd { margin: 0; }
.stat__bar {
  position: relative;
  display: block;
  height: 10px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 calc(20% - 4px), transparent calc(20% - 4px) 20%);
}
.stat__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 20%);
  background: repeating-linear-gradient(90deg, var(--mint) 0 calc(100% / var(--v) - 4px), transparent calc(100% / var(--v) - 4px) calc(100% / var(--v)));
  filter: drop-shadow(0 0 6px rgba(60, 242, 216, 0.55));
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s 0.25s var(--ease-out);
}
.js .mode:not(.is-active) .stat__bar::after { clip-path: inset(0 100% 0 0); transition-duration: 0.2s; transition-delay: 0s; }
.modes__progress {
  position: relative;
  height: 2px;
  margin-top: 2rem;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.1);
}
.modes__progress i { position: absolute; inset: 0; background: var(--grad); transform-origin: left; transform: scaleX(var(--mp, 0)); }

.js .mode {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px);
  transition: opacity 0.2s, transform 0.3s ease-in, visibility 0s 0.3s;
}
.js .mode.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.55s 0.2s, transform 0.8s 0.2s var(--ease-out), visibility 0s;
}
.js .mode.is-active .mode__title,
.js .mode.is-active .mode__tag { animation: rise 0.8s 0.22s var(--ease-out) both; }
.no-js .modes { height: auto; }
.no-js .modes__sticky { position: relative; height: auto; grid-template-columns: 1fr; }
.no-js .modes__stage, .no-js .modes__tabs, .no-js .modes__progress { display: none; }
.no-js .modes__cards { display: grid; gap: 3rem; min-height: 0; }

/* ---------- Arcade cabinets ---------- */
.arcade { position: relative; padding-block: clamp(5rem, 11vw, 9rem); }
.arcade::before {
  /* synthwave floor grid */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 55%;
  pointer-events: none;
  background:
    linear-gradient(to top, transparent, var(--ink) 92%),
    repeating-linear-gradient(90deg, rgba(139, 92, 246, 0.16) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(139, 92, 246, 0.16) 0 1px, transparent 1px 80px);
  transform: perspective(500px) rotateX(58deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
.arcade .section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.cabinet { position: relative; max-width: 1000px; margin-inline: auto; }
.cabinet--wide { max-width: 1140px; }
.cabinet__bar {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 2rem);
  padding: 0.8rem clamp(0.9rem, 2vw, 1.3rem);
  background: linear-gradient(180deg, #1b1738, #110e25);
  box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%, 0 16px);
}
.cabinet__name {
  margin-right: auto;
  font: 800 clamp(0.72rem, 1.4vw, 0.9rem)/1 var(--f-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cabinet__name i { margin: 0 0.12em; font-style: normal; color: var(--pink); }
.cabinet__stat { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.cabinet__stat small { font: 600 0.6rem/1 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); }
.cabinet__stat b {
  min-width: 4ch;
  font: 700 clamp(0.95rem, 1.8vw, 1.15rem)/1 var(--f-hud);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--mint);
  white-space: nowrap;
}
.cabinet__stat b.is-new { color: var(--amber); animation: levelup 0.9s var(--ease-out); }
.cabinet__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05040b;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 50px 120px -50px rgba(139, 92, 246, 0.55), 0 30px 80px -40px rgba(255, 46, 151, 0.35);
}
.cabinet--wide .cabinet__screen { aspect-ratio: 2 / 1; }
.cabinet__screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: pointer;
}
.cabinet.is-playing .cabinet__screen canvas { touch-action: none; cursor: none; }
.cabinet[data-cabinet="stack"].is-playing .cabinet__screen canvas,
.cabinet[data-cabinet="racer"].is-playing .cabinet__screen canvas { cursor: pointer; }
.cabinet__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}
.cabinet__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2vw, 1.1rem);
  padding: 1.5rem;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(7, 6, 15, 0.45), rgba(7, 6, 15, 0.82));
  transition: opacity 0.35s, visibility 0.35s;
}
.cabinet.is-playing .cabinet__overlay { opacity: 0; visibility: hidden; pointer-events: none; }
.cabinet__title {
  margin: 0;
  font: 800 clamp(1.5rem, 4.2vw, 3.1rem)/1 var(--f-display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(255, 46, 151, 0.45);
}
.cabinet__detail { max-width: 44ch; margin: 0; color: var(--text-2); font-size: clamp(0.9rem, 1.4vw, 1.02rem); line-height: 1.5; }
.cabinet__badge {
  font: 700 0.7rem/1 var(--f-hud);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  animation: blink 0.9s steps(2, jump-none) 4;
}
.cabinet__noscript { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--text-2); }
.cabinet__hint {
  margin: 1.1rem 0 0;
  text-align: center;
  font: 600 0.7rem/2 var(--f-hud);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- How we work: level map ---------- */
.how { position: relative; padding-block: clamp(5rem, 11vw, 9rem); }
.map { position: relative; padding-block: 1rem 2rem; }
.map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.map__track { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 2; stroke-dasharray: 1 11; stroke-linecap: round; }
.map__lit { fill: none; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(255, 46, 151, 0.7)); }
.map__player {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(255, 181, 71, 0.9));
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  opacity: 0;
}
.map.is-ready .map__player { opacity: 1; }
.map__player svg { width: 100%; height: 100%; animation: spin-slow 4s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.map__levels {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(2.5rem, 7vw, 6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.lvl { display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center; }
.lvl__node {
  position: relative;
  isolation: isolate;
  grid-row: 1;
  grid-column: 2;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  font: 800 0.95rem/1 var(--f-hud);
  letter-spacing: 0.04em;
  color: var(--text-2);
  transition: color 0.5s;
}
.lvl__node::before {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: -1;
  border-radius: 10px;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 2px var(--line-2);
  transform: rotate(45deg);
  transition: background 0.5s, box-shadow 0.5s, transform 0.6s var(--ease-spring);
}
.lvl__node--boss { font-size: 1.3rem; }
.lvl.is-cleared .lvl__node { color: #16091d; }
.lvl.is-cleared .lvl__node::before {
  background: var(--grad);
  box-shadow: 0 0 34px rgba(255, 46, 151, 0.55);
  transform: rotate(45deg) scale(1.08);
}
.lvl__card {
  grid-row: 1;
  max-width: 440px;
  padding: 1.5rem 1.7rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  transition: opacity 0.7s, transform 0.9s var(--ease-out), border-color 0.7s;
}
.lvl:nth-child(odd) .lvl__card { grid-column: 1; justify-self: end; text-align: right; }
.lvl:nth-child(even) .lvl__card { grid-column: 3; justify-self: start; }
.js .lvl__card { opacity: 0.28; transform: translateY(18px); }
.js .lvl.is-cleared .lvl__card { opacity: 1; transform: none; border-color: var(--line-2); }
.lvl__card h3 { margin: 0 0 0.6rem; font: 700 clamp(1.15rem, 2vw, 1.4rem)/1.2 var(--f-display); letter-spacing: -0.025em; }
.lvl__card p { margin: 0; color: var(--text-2); }

/* ---------- Coming next: locked slots ---------- */
.next { position: relative; padding-block: clamp(5rem, 11vw, 9rem); background: linear-gradient(180deg, var(--ink), var(--ink-2) 30%, var(--ink-2) 70%, var(--ink)); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.slot {
  position: relative;
  padding: 12px 12px 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink);
  transition: transform 0.45s var(--ease-out), border-color 0.45s, box-shadow 0.45s;
}
.slot:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: 0 30px 60px -30px rgba(139, 92, 246, 0.5); }
.slot__art { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--r) - 6px); background: var(--ink-3); }
.slot__art canvas { width: 100%; height: 100%; transition: transform 0.8s var(--ease-out), filter 0.8s; filter: saturate(0.9) brightness(0.85); transform: scale(1.04); }
.slot:hover .slot__art canvas { filter: saturate(1.2) brightness(1); transform: scale(1); }
.slot__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(7, 6, 15, 0.45), transparent 42%),
    repeating-linear-gradient(135deg, rgba(7, 6, 15, 0.16) 0 2px, transparent 2px 9px);
  pointer-events: none;
}
.slot__lock { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.slot__lock svg { width: 44px; height: 44px; color: #fff; filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.7)); transition: transform 0.5s var(--ease-spring); }
.slot:hover .slot__lock svg { transform: scale(1.12) rotate(-8deg); }
.slot__meta { display: flex; gap: 0.7rem; margin: 1.25rem 0.6rem 0.45rem; font: 600 0.7rem/1.2 var(--f-hud); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); }
.slot__meta span { color: var(--pink); }
.slot__title {
  margin: 0 0.6rem 0.55rem;
  font: 700 clamp(1.15rem, 1.8vw, 1.45rem)/1.15 var(--f-hud);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}
.slot__text { margin: 0 0.6rem 1.1rem; color: var(--text-2); }
.slot__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.6rem;
  font: 700 0.7rem/1 var(--f-hud);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint);
}
.slot__status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: pulse 1.6s ease-in-out infinite; }
.slot__status--dim { color: var(--amber); }

/* ---------- Founder ---------- */
.founder { position: relative; padding-block: clamp(5rem, 11vw, 9rem); }
.founder::before {
  content: "";
  position: absolute;
  inset: 10% auto auto -10%;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 242, 216, 0.12), transparent);
  pointer-events: none;
}
.founder__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.portrait { position: sticky; top: calc(var(--nav-h) + 40px); margin: 0; }
.portrait__frame {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--r);
  background: #140d2c;
  box-shadow: 0 0 0 1px var(--line-2), 0 60px 120px -50px rgba(60, 242, 216, 0.4);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.4s var(--ease-out);
}
.portrait__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait__mesh { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait__scan {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  background: var(--mint);
  box-shadow: 0 0 22px 5px rgba(60, 242, 216, 0.55);
  opacity: var(--scan-o, 0);
  transform: translateY(var(--scan-y, 0px));
  pointer-events: none;
}
.portrait__corner { position: absolute; width: 26px; height: 26px; border: 2px solid var(--mint); pointer-events: none; }
.portrait__corner--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.portrait__corner--br { right: 12px; bottom: 12px; border-left: 0; border-top: 0; }
.portrait__tags {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.portrait__credit {
  padding: 0.5em 0.7em 0.45em;
  background: rgba(7, 6, 15, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font: 600 0.62rem/1 var(--f-hud);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(244, 241, 255, 0.9);
  text-decoration: none;
  pointer-events: auto;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  transition: background 0.2s, color 0.2s;
}
.portrait__credit:hover { color: var(--mint); text-decoration: underline; text-underline-offset: 2px; }
/* the chamfer clips outlines, so show keyboard focus with a fill instead */
.portrait__credit:focus-visible { outline: none; background: var(--mint); color: var(--ink); }
.portrait__badge {
  padding: 0.45em 0.6em 0.4em;
  background: var(--pink);
  color: #fff;
  font: 800 0.78rem/1 var(--f-hud);
  letter-spacing: 0.12em;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.portrait__cap {
  margin-top: 1rem;
  text-align: center;
  font: 600 0.68rem/1.4 var(--f-hud);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}
.no-js .portrait__cap { display: none; }

.sheet__name { font: 800 clamp(2.3rem, 5.6vw, 4.9rem)/0.98 var(--f-display); letter-spacing: -0.045em; }
.sheet__class { margin: 1.3rem 0 2rem; font: 600 0.8rem/1.5 var(--f-hud); letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber); }
.sheet__bio p { max-width: 60ch; font-size: 1.07rem; color: var(--text-2); }
.sheet__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 2.2rem 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.sheet__stats > div { padding: 1.15rem 1.3rem 1.25rem; background: var(--ink); }
.sheet__stats dt { font: 600 0.66rem/1.2 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); }
.sheet__stats dd { margin: 0.55rem 0 0; font: 600 1.02rem/1.35 var(--f-display); letter-spacing: -0.015em; }
.sheet__stats b {
  font: 800 2.3rem/1 var(--f-display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sheet__stats small { display: block; margin-top: 0.35rem; font: 500 0.82rem/1.3 var(--f-body); letter-spacing: 0; color: var(--text-3); }
.sheet__quote { margin: 0 0 2.2rem; padding: 0.3rem 0 0.3rem 1.5rem; border-left: 3px solid var(--pink); }
.sheet__quote p { margin: 0; font: 600 clamp(1.1rem, 1.9vw, 1.4rem)/1.45 var(--f-display); letter-spacing: -0.02em; }
.sheet__links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(7rem, 15vw, 12rem);
  text-align: center;
}
.contact__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--ink) 0%, rgba(7, 6, 15, 0.35) 22%, rgba(7, 6, 15, 0.35) 78%, var(--ink) 100%),
    radial-gradient(60% 50% at 50% 50%, rgba(7, 6, 15, 0.55), transparent 80%);
}
.no-js .contact, .contact:not(.has-bg) {
  background: radial-gradient(70% 60% at 50% 60%, rgba(255, 46, 151, 0.22), transparent 70%), var(--ink);
}
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__inner .kicker { justify-content: center; }
.contact__title { max-width: 14ch; font: 800 clamp(2.3rem, 7.6vw, 6.6rem)/1.02 var(--f-display); letter-spacing: -0.05em; text-wrap: balance; }
.contact__inner .lead { margin-inline: auto; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.6rem; }

/* ---------- Footer ---------- */
.footer {
  padding: clamp(3.5rem, 8vw, 6rem) 0 2rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink), #040309);
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
}
.footer__logo { display: block; width: min(64vw, 340px); color: var(--text); }
.footer__logo svg { width: 100%; height: auto; fill: currentColor; }
.footer__tag { max-width: 34ch; margin: 0; color: var(--text-2); }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; padding-block: 2.8rem; }
.footer__h { margin: 0 0 1rem; font: 600 0.68rem/1.2 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); }
.footer ul { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; color: var(--text-2); }
.footer a { color: var(--text-2); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-3);
}
.footer__bottom p { margin: 0; }
.footer__cheat { font: 600 0.72rem/1.6 var(--f-hud); letter-spacing: 0.32em; opacity: 0.45; }

/* ---------- Toasts (achievements) ---------- */
.toasts {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 380px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px 11px 11px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(13, 11, 28, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 0 30px -10px rgba(255, 181, 71, 0.35);
  animation: toast-in 0.55s var(--ease-spring) both;
}
.toast.is-out { animation: toast-out 0.4s ease both; }
.toast__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--grad);
  color: #16091d;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.toast__icon svg { width: 22px; height: 22px; }
.toast__label { display: block; font: 600 0.62rem/1.2 var(--f-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); }
.toast__title { display: block; margin-top: 0.2rem; font: 700 0.95rem/1.25 var(--f-display); letter-spacing: -0.015em; }
.toast__xp { font: 700 0.8rem/1 var(--f-hud); letter-spacing: 0.08em; color: var(--mint); white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(30px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px) scale(0.96); } }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Confetti canvas (cheat code) ---------- */
.confetti { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .modes { height: calc(4 * 90vh + 10vh); height: calc(4 * 90svh + 10svh); }
  .modes__sticky {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 40%) minmax(0, 1fr);
    align-items: stretch;
    gap: 0.5rem;
    padding-top: calc(var(--nav-h) + 4px);
    padding-bottom: 1rem;
  }
  .modes__stage { height: 100%; min-height: 0; }
  .modes__index { font-size: clamp(3.5rem, 16vw, 6rem); }
  .modes__panel { min-height: 0; }
  .modes__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 1.1rem; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
  .modes__tabs::-webkit-scrollbar { display: none; }
  .modes__tabs button { flex: none; }
  .modes__cards { min-height: 0; }
  .mode__title { margin: 0.45rem 0; }
  .mode__tag { margin-bottom: 0.7rem; }
  .mode__text { font-size: 0.98rem; }
  .stats { margin-top: 1.1rem; gap: 0.6rem; }
  .stat { grid-template-columns: 7.4rem 1fr; }
  .modes__progress { display: none; }

  .founder__grid { grid-template-columns: 1fr; }
  .portrait { position: relative; top: 0; width: min(100%, 440px); margin-inline: auto; }

  .slots { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}

@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .lvl { grid-template-columns: 64px minmax(0, 1fr); column-gap: 1rem; }
  .lvl__node { grid-column: 1; width: 58px; height: 58px; font-size: 0.82rem; }
  .lvl__node::before { inset: 9px; }
  .lvl:nth-child(n) .lvl__card { grid-column: 2; justify-self: stretch; text-align: left; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet__stats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cabinet__screen, .cabinet--wide .cabinet__screen { aspect-ratio: 4 / 5; }
  .cabinet__bar { gap: 0.8rem; }
  .cabinet__hint kbd { display: none; }
  .shelf-nav { display: none; }
  .hero__hud .hud-chip--dim { display: none; }
}

@media (max-height: 640px) and (max-width: 960px) {
  .stats { display: none; }
}

/* ---------- Secondary pages: legal & 404 ---------- */
.sub-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--nav-h) + clamp(4rem, 10vw, 7rem)) 0 clamp(3.5rem, 8vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}
.sub-hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0.85; }
.sub-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--ink) 0%, rgba(7, 6, 15, 0.82) 45%, rgba(7, 6, 15, 0.35) 100%), linear-gradient(0deg, var(--ink), transparent 40%);
}
.sub-hero__title { font: 800 clamp(3rem, 11vw, 8rem)/0.95 var(--f-display); letter-spacing: -0.05em; }
.toc { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2.2rem; }
.toc a {
  --c: 8px;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  font: 600 0.74rem/1 var(--f-hud);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: background 0.2s;
}
.toc a:hover { background: rgba(255, 255, 255, 0.14); }
.toc a small { font: inherit; color: var(--pink); }

.legal { display: grid; gap: clamp(2.5rem, 6vw, 4rem); padding-block: clamp(3rem, 8vw, 6rem); }
.legal__doc {
  max-width: 72ch;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.legal__doc h2 { margin-bottom: 0.6rem; font: 800 clamp(1.7rem, 3.6vw, 2.6rem)/1.05 var(--f-display); letter-spacing: -0.035em; }
.legal__doc h3 { margin: 2.2rem 0 0.7rem; font: 700 1.05rem/1.3 var(--f-display); letter-spacing: -0.01em; }
.legal__doc p, .legal__doc li { color: var(--text-2); }
.legal__doc ul { margin: 0 0 1em; padding-left: 1.2rem; }
.legal__doc li { margin-bottom: 0.4rem; }
.legal__doc li::marker { color: var(--mint); }
.legal__doc a { color: var(--mint); text-underline-offset: 3px; }
.legal__date { font: 600 0.78rem/1.4 var(--f-hud); letter-spacing: 0.14em; text-transform: uppercase; }
.legal__date strong { color: var(--text); font-weight: 700; }
.legal__declaration { margin-top: 1.5rem; color: var(--text-2); font-size: 0.92rem; overflow-x: auto; }
.legal__declaration table { width: 100%; border-collapse: collapse; }
.legal__declaration th, .legal__declaration td { padding: 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.gameover {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 3rem;
  overflow: hidden;
  text-align: center;
}
.gameover__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.gameover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 55% at 50% 50%, rgba(7, 6, 15, 0.75), rgba(7, 6, 15, 0.35) 70%, rgba(7, 6, 15, 0.7));
}
.gameover__inner { display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.gameover__inner .kicker { justify-content: center; }
.gameover__inner .lead { margin-inline: auto; }
.gameover__title {
  font: 800 clamp(3.2rem, 13vw, 9rem)/0.92 var(--f-display);
  letter-spacing: -0.055em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gameover__continue {
  margin: 2rem 0 0;
  font: 700 0.9rem/1 var(--f-hud);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
  animation: blink 1.1s steps(2, jump-none) infinite;
}
.gameover__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem; }
.page-404 .nav__cta { margin-left: auto; }
@media (max-width: 520px) {
  .page-404 .nav__cta { display: inline-flex; }
}

/* ---------- Without JavaScript: plain, fully readable page ---------- */
.no-js .hero { height: 100vh; height: 100svh; }
.no-js .words { height: auto; }
.no-js .words__sticky { position: relative; height: auto; padding-block: 7rem 5rem; }
.no-js .cabinet__overlay { display: none; }
.cabinet__noscript { z-index: 3; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero { height: 100vh; height: 100svh; }
  .words { height: auto; }
  .words__sticky { position: relative; height: auto; padding-block: 6rem; }
  .logo-glitch, .hero__logo-shine { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .lvl__card { opacity: 1; transform: none; }
}
