/* ============================================================
   FUNMIND STUDIO — PREMIUM BUILD
   Structural DNA: "Chapter Gates" — the page changes character
   as you descend. Each chapter owns its ground, type weight and
   rhythm. Brand colour (violet) is the studio's real identity,
   paired with a gold accent; no generic violet→blue gradient.
   ============================================================ */

/* ---------- Fonts: Clash Display (brand) + Satoshi (body) +
   Space Mono (metadata). Satoshi/Clash from Fontshare — same
   foundry as the brand mark; not the blacklisted Inter/Poppins. */
@import url("https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&f[]=satoshi@300,400,500,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

:root {
  /* ground layers — warm-cool near-blacks, not pure #000 */
  --ink:        #0B0A12;
  --ink-2:      #0F0D1A;
  --ink-3:      #14111F;
  --panel:      #1A1530;
  --panel-2:    #221B3D;

  /* brand violet (real identity) + gold accent */
  --violet:        #7A5CFF;
  --violet-bright: #9B7DFF;
  --violet-deep:   #5B3DF5;
  --violet-ink:    #3B1D73;
  --gold:          #F4C542;
  --gold-soft:     #FFD86B;

  /* paper / text */
  --paper:     #F7F6F2;
  --paper-dim: #E7E4DC;
  --text:      #ECEAF6;
  --text-soft: #A9A4C4;
  --text-mute: #6F6A8C;
  --ink-text:  #16131F;

  --line:       rgba(155,125,255,0.16);
  --line-soft:  rgba(255,255,255,0.08);
  --line-paper: rgba(22,19,31,0.12);

  --display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --body:    "Satoshi", system-ui, -apple-system, sans-serif;
  --mono:    "Space Mono", "Courier New", monospace;

  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 64px);

  /* easings from the premium skill */
  --ease-elegant: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-over:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snappy:  cubic-bezier(0.77, 0, 0.175, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
/* Lenis-free smooth scroll */
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  font-size: clamp(16px, 1.1vw, 18px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

::selection { background: var(--gold); color: var(--ink); }

/* custom scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--violet-ink); border-radius: 10px; border: 3px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--violet-deep); }

/* ---------- grain overlay for depth ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- scroll progress line ---------- */
.scroll-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: transparent;
}
.scroll-rail span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  box-shadow: 0 0 14px rgba(155,125,255,0.6);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- type helpers ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--violet-bright);
  display: inline-flex; align-items: center; gap: 12px;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--gold); display: inline-block; }
.kicker.gold { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.0; letter-spacing: -0.02em; text-wrap: balance; }

/* ============================================================
   NAV — left-vertical index, not the default three-column bar.
   A slim fixed rail on the left with rotated wordmark + dot index.
   Collapses to a top bar on mobile.
   ============================================================ */
.railnav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 92px; z-index: 150;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 26px 0; border-right: 1px solid var(--line-soft);
  background: rgba(11,10,18,0.6); backdrop-filter: blur(14px);
}
.railnav .mark { width: 38px; height: 44px; display: block; transition: transform 0.6s var(--ease-over); }
.railnav .mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(122,92,255,0.5)); }
.railnav .mark:hover { transform: translateY(-3px) rotate(-6deg); }

.rail-mid { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.rail-mid a {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-mute); transition: color 0.3s var(--ease-elegant);
  padding: 6px 0; position: relative;
}
.rail-mid a::after {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--violet); opacity: 0;
  transition: opacity 0.3s;
}
.rail-mid a:hover, .rail-mid a.active { color: var(--text); }
.rail-mid a.active::after { opacity: 1; }

.rail-ig { color: var(--text-mute); transition: color 0.3s, transform 0.3s; }
.rail-ig:hover { color: var(--violet-bright); transform: translateY(-2px); }
.rail-ig svg { width: 20px; height: 20px; }

/* mobile top bar (hidden on desktop) */
.topbar { display: none; }
.tb-menu { display: none; }

/* push content clear of the rail */
.page { margin-left: 92px; position: relative; z-index: 2; }

/* ============================================================
   CHAPTER 0 — HERO. Dark cinematic stage. Oversized split
   headline, the game cover floating on a plinth of light.
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden;
  background:
    radial-gradient(60% 50% at 22% 38%, rgba(91,61,245,0.20), transparent 62%),
    radial-gradient(40% 40% at 82% 70%, rgba(244,197,66,0.08), transparent 60%),
    var(--ink);
}
.hero-grid-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(30px, 5vw, 80px);
  align-items: center; width: 100%;
}
.hero-copy .kicker { margin-bottom: 30px; opacity: 0; animation: fadeUp 0.8s var(--ease-over) 0.1s forwards; }
.hero h1 {
  font-size: clamp(52px, 8.5vw, 132px);
  font-weight: 600; line-height: 0.92; letter-spacing: -0.04em;
  color: var(--paper);
}
.hero h1 .l { display: block; overflow: hidden; }
.hero h1 .l > span { display: inline-block; transform: translateY(110%); }
.hero h1 .l.in > span { animation: lineRise 0.9s var(--ease-over) forwards; }
.hero h1 .l:nth-child(1) > span { animation-delay: 0.15s; }
.hero h1 .l:nth-child(2) > span { animation-delay: 0.28s; }
.hero h1 .l:nth-child(3) > span { animation-delay: 0.41s; }
.hero h1 .accent {
  font-family: var(--display); font-style: italic; font-weight: 500;
  background: linear-gradient(100deg, var(--violet-bright), var(--violet) 40%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: shimmer 7s ease-in-out infinite;
}
.hero p.lede {
  margin: 34px 0 40px; max-width: 46ch; font-size: clamp(17px, 1.4vw, 20px);
  color: var(--text-soft); font-weight: 300;
  opacity: 0; animation: fadeUp 0.8s var(--ease-over) 0.9s forwards;
}
.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  opacity: 0; animation: fadeUp 0.8s var(--ease-over) 1.05s forwards; }

/* the cover on a plinth of light */
.hero-stage { position: relative; display: grid; place-items: center; opacity: 0; animation: fadeUp 1s var(--ease-over) 0.6s forwards; }
.plinth { position: relative; width: min(380px, 80%); aspect-ratio: 1; display: grid; place-items: center; }
.plinth .halo {
  position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(122,92,255,0.5), rgba(91,61,245,0.18) 55%, transparent 72%);
  filter: blur(20px); animation: breathe 6s ease-in-out infinite;
}
.plinth .ring {
  position: absolute; border: 1px solid var(--line); border-radius: 50%;
}
.plinth .ring.r1 { inset: -4%; }
.plinth .ring.r2 { inset: 10%; border-style: dashed; opacity: 0.4; animation: spin 44s linear infinite; }
.plinth-cover {
  position: relative; z-index: 2; width: 80%; aspect-ratio: 1;
  transform: rotate(-5deg); animation: floaty 7s ease-in-out infinite;
  filter: drop-shadow(0 40px 70px rgba(0,0,0,0.55));
}
.plinth-cover img { width: 100%; height: 100%; object-fit: contain; }
.plinth .chip {
  position: absolute; z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 9px 14px; border-radius: 100px;
  background: rgba(15,13,26,0.8); border: 1px solid var(--line); color: var(--text);
  backdrop-filter: blur(8px); box-shadow: 0 12px 30px -12px rgba(0,0,0,0.7);
  display: flex; align-items: center; gap: 8px;
}
.plinth .chip i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.plinth .chip.c1 { top: 4%; left: -8%; animation: floaty 6s ease-in-out 0.3s infinite; }
.plinth .chip.c2 { bottom: 8%; right: -6%; animation: floaty 6.5s ease-in-out 0.7s infinite; }

.hero-foot {
  position: absolute; bottom: 30px; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-mute);
}
.hero-foot .scrollcue { display: flex; align-items: center; gap: 10px; }
.hero-foot .scrollcue::before { content: ""; width: 30px; height: 1px; background: var(--text-mute);
  animation: cueline 2.2s var(--ease-elegant) infinite; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px; border-radius: 100px; font-family: var(--body); font-weight: 500;
  font-size: 15px; letter-spacing: 0.01em; overflow: hidden;
  transition: transform 0.4s var(--ease-over), box-shadow 0.4s var(--ease-over);
}
.btn svg { width: 16px; height: 16px; transition: transform 0.4s var(--ease-over); }
.btn:hover svg { transform: translateX(4px); }
.btn-solid { background: var(--paper); color: var(--ink); box-shadow: 0 14px 34px -14px rgba(247,246,242,0.4); }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -16px rgba(247,246,242,0.5); }
.btn-violet { background: var(--violet-deep); color: #fff; box-shadow: 0 14px 34px -14px rgba(91,61,245,0.7); }
.btn-violet:hover { transform: translateY(-3px); box-shadow: 0 22px 48px -16px rgba(122,92,255,0.7); }
.btn-line { border: 1px solid var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--violet-bright); color: var(--violet-bright); transform: translateY(-3px); }
.btn::after {
  content: ""; position: absolute; top: var(--my,50%); left: var(--mx,50%);
  width: 0; height: 0; border-radius: 50%; transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent 70%);
  opacity: 0; transition: width 0.5s var(--ease-over), height 0.5s var(--ease-over), opacity 0.5s;
}
.btn:hover::after { width: 260px; height: 260px; opacity: 1; }
.btn-solid::after { background: radial-gradient(circle, rgba(122,92,255,0.25), transparent 70%); }

/* ============================================================
   CHAPTER 1 — MARQUEE GATE. A full-bleed ticker that divides
   the dark hero from the studio chapter. Brand voice in motion.
   ============================================================ */
.gate {
  position: relative; padding: 40px 0; border-block: 1px solid var(--line-soft);
  background: var(--ink-2); overflow: hidden;
}
.marquee { display: flex; gap: 0; white-space: nowrap; width: max-content; animation: scrollx 32s linear infinite; }
.marquee span {
  font-family: var(--display); font-weight: 500; font-size: clamp(28px, 4vw, 52px);
  letter-spacing: -0.02em; color: transparent; -webkit-text-stroke: 1px var(--text-mute);
  padding: 0 32px; display: inline-flex; align-items: center; gap: 32px;
}
.marquee span::after { content: "✦"; -webkit-text-stroke: 0; color: var(--gold); font-size: 0.5em; }
.marquee span.fill { -webkit-text-stroke: 0; color: var(--paper); }
.gate:hover .marquee { animation-play-state: paused; }

/* ============================================================
   CHAPTER 2 — THE GAME. Pinned-feel showcase. Dark, focused on
   Blockium. Asymmetric: big cover left, editorial detail right.
   ============================================================ */
.chapter { padding: clamp(90px, 12vw, 160px) 0; position: relative; }
.chapter-game { background: linear-gradient(180deg, var(--ink-2), var(--ink-3)); }
.ch-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 70px; flex-wrap: wrap; }
.ch-head h2 { font-size: clamp(38px, 6vw, 86px); color: var(--paper); }
.ch-head .idx { font-family: var(--mono); font-size: 13px; color: var(--text-mute); letter-spacing: 0.2em; }

.game-show { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 80px); align-items: center; }
.game-visual { position: relative; }
.game-visual .frame {
  position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4/3;
  background: linear-gradient(150deg, var(--violet-ink), var(--violet-deep) 55%, var(--violet));
  display: grid; place-items: center;
  box-shadow: 0 50px 100px -40px rgba(0,0,0,0.8);
}
.game-visual .frame::after {
  content: ""; position: absolute; width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 22%, rgba(244,197,66,0.25), transparent 42%);
}
.game-visual .cover {
  position: relative; z-index: 2; width: 64%;
  transform: rotate(-5deg);
  filter: drop-shadow(0 30px 55px rgba(0,0,0,0.5));
  transition: transform 0.6s var(--ease-over);
}
.game-show:hover .game-visual .cover { transform: rotate(-2deg) scale(1.05); }
.game-visual .cover img { width: 100%; display: block; }

.game-detail .tag-row { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.game-detail .tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 100px; border: 1px solid var(--line); color: var(--violet-bright);
}
.game-detail h3 { font-size: clamp(40px, 5vw, 64px); color: var(--paper); margin-bottom: 20px; }
.game-detail p { color: var(--text-soft); font-size: 18px; max-width: 48ch; margin-bottom: 16px; font-weight: 300; }
.game-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 34px 0; }
.game-meta .m { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.game-meta .m b { font-family: var(--display); font-size: 26px; color: var(--paper); display: block; font-weight: 600; }
.game-meta .m span { font-family: var(--mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.1em; text-transform: uppercase; }
.store-row { display: flex; gap: 14px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex; align-items: center; gap: 11px; padding: 13px 22px; border-radius: 14px;
  border: 1px solid var(--line); color: var(--text); transition: border-color 0.3s, transform 0.3s, background 0.3s;
}
.store-btn:hover { border-color: var(--violet-bright); transform: translateY(-2px); background: var(--panel); }
.store-btn svg { width: 22px; height: 22px; }
.store-btn small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }
.store-btn b { font-size: 15px; font-weight: 600; }
.store-btn .soon { font-family: var(--mono); font-size: 10px; color: var(--gold); margin-left: 4px; }

/* ============================================================
   CHAPTER 3 — STUDIO. Tonal shift to PAPER (light) — the page
   changes character entirely. Editorial manifesto + ledger.
   ============================================================ */
.chapter-studio { background: var(--paper); color: var(--ink-text); }
.chapter-studio .kicker { color: var(--violet-deep); }
.chapter-studio .kicker::before { background: var(--gold); }
.studio-lede {
  font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.18;
  font-size: clamp(26px, 4vw, 48px); color: var(--ink-text); max-width: 20ch; margin: 24px 0 0;
}
.studio-lede .hl { color: var(--violet-deep); font-style: italic; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); margin-top: 80px; align-items: start; }
.studio-prose p { color: #43404e; font-size: 18px; margin-bottom: 22px; max-width: 56ch; }
.studio-prose p:first-child::first-letter {
  font-family: var(--display); font-size: 4.2em; font-weight: 600; float: left;
  line-height: 0.74; padding: 6px 14px 0 0; color: var(--violet-deep);
}
/* values as a ledger, not cards */
.ledger { border-top: 1px solid var(--line-paper); }
.ledger .row {
  display: grid; grid-template-columns: 56px 1fr; gap: 22px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line-paper);
  transition: padding-left 0.4s var(--ease-elegant);
}
.ledger .row:hover { padding-left: 14px; }
.ledger .row .n { font-family: var(--mono); font-size: 12px; color: var(--violet-deep); letter-spacing: 0.1em; }
.ledger .row h4 { font-family: var(--display); font-size: clamp(22px,2.6vw,30px); color: var(--ink-text); margin-bottom: 8px; }
.ledger .row p { color: #5a5668; font-size: 16px; max-width: 50ch; }

/* stats inline in the studio chapter */
.studio-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 70px; border-top: 1px solid var(--line-paper); padding-top: 40px; }
.studio-stats .s b { font-family: var(--display); font-size: clamp(40px,5vw,64px); font-weight: 600; color: var(--violet-deep); letter-spacing: -0.02em; display: block; font-variant-numeric: tabular-nums; }
.studio-stats .s span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }

/* ============================================================
   CHAPTER 4 — CLOSE. Back to dark. Big statement + contact.
   ============================================================ */
.chapter-close { background: var(--ink); position: relative; overflow: hidden; text-align: center; padding: clamp(110px,14vw,190px) 0; }
.chapter-close::before {
  content: ""; position: absolute; width: 800px; height: 800px; top: -300px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(91,61,245,0.28), transparent 62%); animation: breathe 9s ease-in-out infinite;
}
.chapter-close::after {
  content: ""; position: absolute; width: 360px; height: 360px; bottom: -150px; right: 10%;
  background: radial-gradient(circle, rgba(244,197,66,0.14), transparent 62%);
}
.chapter-close > * { position: relative; z-index: 2; }
.chapter-close h2 { font-size: clamp(44px, 8vw, 120px); color: var(--paper); line-height: 0.95; }
.chapter-close h2 em { font-style: italic; font-weight: 500;
  background: linear-gradient(100deg, var(--violet-bright), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chapter-close p { color: var(--text-soft); font-size: 20px; max-width: 46ch; margin: 28px auto 40px; font-weight: 300; }
.mailto { font-family: var(--mono); font-size: clamp(16px,2vw,22px); color: var(--gold); letter-spacing: 0.02em; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.mailto:hover { border-color: var(--gold); }

/* ============================================================
   FOOTER — colophon
   ============================================================ */
.colophon { background: var(--ink-2); border-top: 1px solid var(--line-soft); padding: 70px 0 36px; }
.colo-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; padding-bottom: 50px; border-bottom: 1px solid var(--line-soft); }
.colo-brand { display: flex; flex-direction: column; gap: 16px; }
.colo-brand .lk { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--text); }
.colo-brand .lk img { width: 34px; height: 38px; object-fit: contain; }
.colo-brand p { color: var(--text-soft); max-width: 36ch; font-size: 15px; font-weight: 300; }
.colo-ig { display: inline-flex; align-items: center; gap: 9px; color: var(--text-soft); font-family: var(--mono); font-size: 13px; transition: color 0.3s; }
.colo-ig:hover { color: var(--violet-bright); }
.colo-ig svg { width: 17px; height: 17px; }
.colo-col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 18px; }
.colo-col a { display: block; color: var(--text-soft); padding: 6px 0; font-size: 15px; transition: color 0.3s, padding-left 0.3s; }
.colo-col a:hover { color: var(--text); padding-left: 6px; }
.colo-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 28px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--text-mute); }

/* ============================================================
   Scroll reveal primitives
   ============================================================ */
.rv { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease-over), transform 0.9s var(--ease-over); }
.rv.in { opacity: 1; transform: none; }
.rv[data-d="1"] { transition-delay: 0.08s; }
.rv[data-d="2"] { transition-delay: 0.16s; }
.rv[data-d="3"] { transition-delay: 0.24s; }
.rv[data-d="4"] { transition-delay: 0.32s; }

/* clip reveal for the game cover frame — driven by the parent .rv
   becoming visible, because a fully-clipped element has zero visible
   area and never triggers its own IntersectionObserver. */
.clip { clip-path: inset(0 100% 0 0); transition: clip-path 1s var(--ease-snappy); }
.clip.in,
.rv.in .clip { clip-path: inset(0 0 0 0); }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes lineRise { to { transform: none; } }
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-14px) rotate(-5deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scrollx { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cueline { 0%,100% { opacity: 0.3; transform: scaleX(0.6); } 50% { opacity: 1; transform: scaleX(1); } }
/* chip & plinth float share floaty but chips need their own rotation baseline */
.plinth .chip.c1, .plinth .chip.c2 { animation-name: chipfloat; }
@keyframes chipfloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 50px; }
  .hero-stage { order: -1; }
  .game-show { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; gap: 50px; }
}
@media (max-width: 760px) {
  .railnav { display: none; }
  .page { margin-left: 0; }
  .topbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 150; height: 64px;
    align-items: center; justify-content: space-between; padding: 0 20px;
    background: rgba(11,10,18,0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft);
  }
  .topbar .lk { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; color: var(--text); }
  .topbar .lk img { width: 30px; height: 34px; object-fit: contain; }
  .topbar .tb-toggle { width: 42px; height: 42px; display: grid; place-items: center; }
  .topbar .tb-toggle span, .topbar .tb-toggle span::before, .topbar .tb-toggle span::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--text); position: relative; }
  .topbar .tb-toggle span::before { position: absolute; top: -6px; } .topbar .tb-toggle span::after { position: absolute; top: 6px; }
  .tb-menu { position: fixed; inset: 64px 0 auto 0; z-index: 149; background: var(--ink-2); border-bottom: 1px solid var(--line-soft);
    display: none; flex-direction: column; padding: 16px 20px; gap: 4px; }
  .tb-menu.open { display: flex; }
  .tb-menu a { padding: 14px 4px; font-family: var(--display); font-size: 22px; color: var(--text); border-bottom: 1px solid var(--line-soft); }
  .hero { padding-top: 100px; }
  .game-meta { grid-template-columns: 1fr 1fr; }
  .studio-stats { grid-template-columns: 1fr; gap: 16px; }
  .colo-top { grid-template-columns: 1fr; gap: 36px; }
  .hero-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.001ms !important; }
  .rv, .clip, .hero h1 .l > span, .hero-copy .kicker, .hero p.lede, .hero-actions, .hero-stage { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* ============================================================
   LEGAL PAGES — paper ground, editorial document
   ============================================================ */
.legal-page { background: var(--paper); color: var(--ink-text); min-height: 100vh; }
.legal-hero {
  padding: clamp(120px, 16vw, 200px) 0 60px; position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line-paper);
}
.legal-hero::before {
  content: ""; position: absolute; width: 600px; height: 600px; top: -340px; right: -120px;
  background: radial-gradient(circle, rgba(122,92,255,0.12), transparent 62%); pointer-events: none;
}
.legal-hero .wrap { position: relative; z-index: 1; }
.legal-hero .back { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-deep); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; transition: gap 0.3s; }
.legal-hero .back:hover { gap: 14px; }
.legal-hero h1 { font-size: clamp(40px, 7vw, 80px); color: var(--ink-text); margin: 8px 0 0; }
.legal-hero .upd { font-family: var(--mono); font-size: 13px; color: var(--text-mute); margin-top: 20px; }
.legal-doc { padding: 70px 0 120px; }
.legal-doc .wrap { max-width: 820px; }
.legal-doc h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); color: var(--ink-text); margin: 48px 0 16px; display: flex; align-items: baseline; gap: 16px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h2 .n { font-family: var(--mono); font-size: 14px; color: var(--violet-deep); }
.legal-doc p, .legal-doc li { color: #43404e; font-size: 17px; margin-bottom: 14px; }
.legal-doc ul { padding-left: 22px; margin-bottom: 16px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--violet-deep); border-bottom: 1px solid currentColor; }
.legal-footer { background: var(--ink-2); border-top: 1px solid var(--line-soft); padding: 40px 0; }
.legal-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--text-mute); }
.legal-footer a { color: var(--text-soft); transition: color 0.3s; }
.legal-footer a:hover { color: var(--violet-bright); }
/* legal pages don't use the rail; full width */
.legal-page .page { margin-left: 0; }

/* ============================================================
   "Browse all games" inline link (home featured section)
   ============================================================ */
.all-games-link {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 26px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--violet-bright); transition: gap 0.3s var(--ease-over), color 0.3s;
}
.all-games-link svg { width: 16px; height: 16px; }
.all-games-link:hover { gap: 16px; color: var(--gold); }

/* safety: all inline text-link arrow icons stay small */
.card-link svg, .detail-back svg, .games-hero .back svg,
.legal-hero .back svg, .all-games-link svg { width: 16px; height: 16px; flex: none; }

/* ============================================================
   GAMES INDEX PAGE — grid that scales from 1 to many
   ============================================================ */
.games-page { background: var(--ink); }
.games-hero { padding: clamp(120px, 16vw, 200px) 0 50px; position: relative; overflow: hidden; }
.games-hero::before {
  content: ""; position: absolute; width: 700px; height: 700px; top: -360px; left: 12%;
  background: radial-gradient(circle, rgba(91,61,245,0.22), transparent 62%); pointer-events: none;
}
.games-hero .wrap { position: relative; z-index: 1; }
.games-hero h1 { font-size: clamp(46px, 8vw, 104px); color: var(--paper); margin: 14px 0 22px; }
.games-hero p { color: var(--text-soft); font-size: clamp(17px, 1.5vw, 21px); max-width: 52ch; font-weight: 300; }
.games-hero .back { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-bright); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; transition: gap 0.3s; }
.games-hero .back:hover { gap: 14px; }

.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px; padding: 50px 0 clamp(100px, 14vw, 170px);
}
.game-card {
  position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); display: flex; flex-direction: column;
  transition: transform 0.5s var(--ease-over), border-color 0.5s, box-shadow 0.5s;
}
.game-card:hover { transform: translateY(-8px); border-color: var(--line-strong); box-shadow: 0 40px 80px -40px rgba(91,61,245,0.6); }
.game-card .thumb {
  position: relative; aspect-ratio: 16/11; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, var(--violet-ink), var(--violet-deep) 55%, var(--violet));
}
.game-card .thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 28% 22%, rgba(244,197,66,0.22), transparent 46%); }
.game-card .thumb img { position: relative; z-index: 1; width: 56%; transform: rotate(-5deg); filter: drop-shadow(0 22px 40px rgba(0,0,0,0.5)); transition: transform 0.6s var(--ease-over); }
.game-card:hover .thumb img { transform: rotate(-2deg) scale(1.06); }
.game-card .thumb.coming { background: linear-gradient(150deg, var(--panel-2), var(--ink-3)); }
.game-card .thumb.coming .qm { font-family: var(--display); font-size: 86px; font-weight: 600; color: var(--violet); opacity: 0.5; }
.game-card .body { padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-card .badge { position: absolute; top: 16px; left: 16px; z-index: 2; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; padding: 7px 12px; border-radius: 100px; background: rgba(11,10,18,0.7); border: 1px solid var(--line); color: var(--text); backdrop-filter: blur(6px); }
.game-card .badge.soon { color: var(--gold); }
.game-card h3 { font-family: var(--display); font-size: 28px; color: var(--paper); }
.game-card .tags { display: flex; gap: 7px; flex-wrap: wrap; }
.game-card .tags span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-bright); border: 1px solid var(--line); padding: 4px 9px; border-radius: 100px; }
.game-card p { color: var(--text-soft); font-size: 15px; font-weight: 300; flex: 1; }
.game-card .card-link { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet-bright); display: inline-flex; align-items: center; gap: 8px; transition: gap 0.3s; }
.game-card:hover .card-link { gap: 13px; }
.game-card.is-soon { pointer-events: auto; }
.game-card.is-soon .card-link { color: var(--text-mute); }
/* whole card clickable */
.game-card a.card-cover { position: absolute; inset: 0; z-index: 3; }

/* ============================================================
   GAME DETAIL PAGE
   ============================================================ */
.detail-page { background: var(--ink); }
.detail-hero { position: relative; padding: clamp(120px,15vw,190px) 0 60px; overflow: hidden; }
.detail-hero::before { content: ""; position: absolute; width: 760px; height: 760px; top: -380px; right: -120px; background: radial-gradient(circle, rgba(91,61,245,0.22), transparent 62%); pointer-events: none; }
.detail-hero .wrap { position: relative; z-index: 1; }
.detail-back { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-bright); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 40px; transition: gap 0.3s; }
.detail-back:hover { gap: 14px; }
.detail-top { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px,5vw,80px); align-items: center; }
.detail-visual { position: relative; display: grid; place-items: center; }
.detail-visual .frame { position: relative; width: 100%; aspect-ratio: 1; border-radius: 32px; display: grid; place-items: center; background: linear-gradient(150deg, var(--violet-ink), var(--violet-deep) 55%, var(--violet)); box-shadow: 0 50px 100px -40px rgba(0,0,0,0.8); overflow: hidden; }
.detail-visual .frame::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 22%, rgba(244,197,66,0.22), transparent 46%); }
.detail-visual img { position: relative; z-index: 1; width: 64%; transform: rotate(-5deg); filter: drop-shadow(0 30px 55px rgba(0,0,0,0.5)); }
.detail-info .tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-info .tags span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet-bright); border: 1px solid var(--line); padding: 7px 14px; border-radius: 100px; }
.detail-info h1 { font-size: clamp(48px,7vw,92px); color: var(--paper); margin-bottom: 18px; }
.detail-info .sub { color: var(--text-soft); font-size: clamp(17px,1.5vw,21px); font-weight: 300; max-width: 46ch; margin-bottom: 30px; }
.detail-info .store-row { margin-top: 8px; }
.detail-body { padding: clamp(70px,10vw,120px) 0; }
.detail-body .wrap { max-width: 880px; }
.detail-section { margin-bottom: 60px; }
.detail-section h2 { font-family: var(--display); font-size: clamp(26px,3vw,38px); color: var(--paper); margin-bottom: 18px; }
.detail-section p { color: var(--text-soft); font-size: 18px; font-weight: 300; margin-bottom: 14px; max-width: 64ch; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 20px; margin-top: 30px; }
.feature-grid .f { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--panel); transition: border-color 0.4s, transform 0.4s; }
.feature-grid .f:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.feature-grid .f .ic { font-size: 26px; margin-bottom: 14px; }
.feature-grid .f h4 { font-family: var(--display); font-size: 19px; color: var(--paper); margin-bottom: 6px; }
.feature-grid .f p { font-size: 14px; color: var(--text-soft); margin: 0; }

@media (max-width: 1024px) {
  .detail-top { grid-template-columns: 1fr; }
  .detail-visual { max-width: 420px; margin: 0 auto; }
}

/* ============================================================
   Game card hover: store buttons reveal over the thumb
   ============================================================ */
.game-card .store-overlay {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(180deg, rgba(11,10,18,0.4), rgba(11,10,18,0.78));
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease-over), visibility 0.4s;
  pointer-events: none;
}
.game-card:hover .store-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
.game-card .store-overlay .store-btn {
  transform: translateY(10px); transition: transform 0.45s var(--ease-over);
  background: rgba(26,21,48,0.92); backdrop-filter: blur(4px);
}
.game-card:hover .store-overlay .store-btn { transform: translateY(0); }
.game-card:hover .store-overlay .store-btn:nth-child(2) { transition-delay: 0.06s; }
