/* Verdict: a dark signal field. One accent (iris), a high-contrast display serif and a precise UI sans.
   Motion is transform/opacity only and is switched off under prefers-reduced-motion. */

@font-face {
  font-family: "Noto Serif Display";
  src: url("/fonts/noto-serif-display.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/golos-text.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07070b; --bg-2: #0c0c13; --surface: #11111a; --surface-2: #171722;
  --line: rgba(236, 235, 245, .08); --line-2: rgba(236, 235, 245, .14);
  --ink: #ecebf5; --ink-2: #a8a7b9; --ink-3: #807f94;
  --iris: #a594ff; --iris-hi: #cbc3ff; --iris-ink: #140f2e; --iris-dim: rgba(165, 148, 255, .14);
  --neg: #e08b8b;
  --f-display: "Noto Serif Display", "Iowan Old Style", Georgia, serif;
  --f-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(18px, 4vw, 40px);
  --r-panel: 16px; --r-ctl: 10px;
  --ease: cubic-bezier(.2, .75, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-ui);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
dl, dd, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--iris-hi); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(165, 148, 255, .35); color: #fff; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--iris); color: var(--iris-ink); border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; } /* no transition: it must be fully on screen the moment it takes focus */

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 1.35rem/1 var(--f-display); letter-spacing: .01em; min-height: 44px; }
.brand-mark { flex: none; }
.nav { display: flex; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: .9rem; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); background: rgba(236, 235, 245, .04); }
.nav a[aria-current="page"] { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-ctl); border: 1px solid transparent;
  font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.btn-primary { background: var(--iris); color: var(--iris-ink); }
.btn-primary:hover:not(:disabled) { background: var(--iris-hi); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-quiet:hover { border-color: rgba(165, 148, 255, .5); background: var(--iris-dim); }
.btn:disabled { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.btn-wide { width: 100%; }
.pressed { transform: scale(.975); }

/* ---------- hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before { /* faint horizon line behind the map */
  content: ""; position: absolute; inset: auto 0 0 0; height: 60%; pointer-events: none;
  background: radial-gradient(60% 70% at 70% 100%, rgba(165, 148, 255, .07), transparent 70%);
}
.hero-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding-block: clamp(28px, 5vw, 56px); }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: .9rem; margin-bottom: 22px; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--iris); box-shadow: 0 0 0 4px var(--iris-dim); }
h1 {
  font-family: var(--f-display); font-weight: 340; font-size: clamp(2.3rem, 1.3rem + 2.6vw, 3.4rem);
  line-height: 1.04; letter-spacing: -.012em;
}
h1 > span { display: inline-block; }
.lede { margin-top: 22px; color: var(--ink-2); font-size: 1.06rem; max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin-top: 40px; border-top: 1px solid var(--line); }
.hero-stats > div { padding: 16px 28px 0 0; margin-right: 28px; border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-stats dt { color: var(--ink-3); font-size: .8rem; }
.hero-stats dd { margin-top: 4px; font-size: 1.3rem; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }

.field { margin: 0; position: relative; min-width: 0; }
.field-stage { position: relative; height: clamp(400px, 56vh, 540px); }
#field { width: 100%; height: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.field-hint { position: absolute; top: 4px; right: 0; color: var(--ink-3); font-size: .8rem; pointer-events: none; }

.readout {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
  margin-top: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-panel);
  background: linear-gradient(180deg, rgba(23, 23, 34, .86), rgba(12, 12, 19, .86));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ro-main { min-width: 0; }
.ro-k { color: var(--iris-hi); font-size: .82rem; }
.ro-name { margin-top: 2px; font: 400 1.6rem/1.15 var(--f-display); overflow-wrap: anywhere; }
.ro-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 32px; margin-top: 14px; }
@media (max-width: 1100px) and (min-width: 901px) { .ro-stats { grid-template-columns: repeat(2, auto); } }
.ro-stats dt { color: var(--ink-3); font-size: .78rem; white-space: nowrap; }
.ro-stats dd { font-size: 1.02rem; font-weight: 500; white-space: nowrap; }
.ro-note { margin-top: 8px; color: var(--ink-2); font-size: .9rem; max-width: 52ch; }
.ro-ctl { display: flex; align-items: center; gap: 6px; }
.step {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s, transform .15s var(--ease);
}
.step:hover { color: var(--ink); border-color: rgba(165, 148, 255, .55); background: var(--iris-dim); }
.btn-mid { min-height: 44px; padding: 0 18px; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 44px; }

/* load sequence: the hero's one orchestrated moment */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.js .hero-copy > * { animation: rise .8s var(--ease) both; }
.js .hero-copy > :nth-child(2) { animation-delay: .06s; }
.js .hero-copy > :nth-child(3) { animation-delay: .14s; }
.js .hero-copy > :nth-child(4) { animation-delay: .22s; }
.js .hero-copy > :nth-child(5) { animation-delay: .3s; }
.js .field-stage { animation: fade 1.4s .1s ease-out both; }
.js .readout { animation: rise .8s .35s var(--ease) both; }

/* ---------- sections ---------- */
.sect-head { margin-bottom: 22px; }
h2 { font-family: var(--f-display); font-weight: 380; font-size: clamp(1.75rem, 1.3rem + 1.3vw, 2.35rem); line-height: 1.1; letter-spacing: -.005em; }
.sect-sub { margin-top: 6px; color: var(--ink-2); font-size: .95rem; }
.hint { margin-top: 8px; color: var(--ink-3); font-size: .82rem; }
.foot-note { margin-top: 16px; color: var(--ink-3); font-size: .84rem; max-width: 70ch; }
.foot-note b { color: var(--ink-2); font-weight: 500; }
.net-note { margin-top: 12px; color: var(--neg); font-size: .9rem; }

.empty-state { padding: 28px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-panel); color: var(--ink-2); font-size: .94rem; }
.empty-state p { max-width: 60ch; }
.es-art { width: 120px; height: 64px; margin-bottom: 10px; }
.es-title { color: var(--ink); font: 400 1.3rem/1.2 var(--f-display); margin-bottom: 6px; }

.play { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-block: clamp(48px, 7vw, 88px); }

/* standings */
.stand-list { list-style: none; border-top: 1px solid var(--line); }
.srow { border-bottom: 1px solid var(--line); }
.sr-btn {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center;
  width: 100%; min-height: 64px; padding: 12px 12px 12px 6px; border: 0; background: transparent; text-align: left; cursor: pointer;
  border-radius: 10px; transition: background-color .2s;
}
.sr-btn::before { /* focus marker */
  content: ""; position: absolute; left: -10px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--iris);
  transform: scaleY(0); transition: transform .25s var(--ease);
}
.srow.is-focus .sr-btn::before { transform: scaleY(1); }
.sr-btn:hover { background: rgba(236, 235, 245, .03); }
.sr-btn[aria-pressed="true"] { background: var(--iris-dim); }
.sr-rank { font: 400 1.4rem/1 var(--f-display); color: var(--ink-3); text-align: center; }
.srow.is-lead .sr-rank, .sr-btn[aria-pressed="true"] .sr-rank { color: var(--iris-hi); }
.sr-main { min-width: 0; }
.sr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sr-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-vol { flex: none; font-weight: 500; }
.sr-bar { display: block; height: 2px; margin: 8px 0 6px; background: var(--line); border-radius: 2px; overflow: hidden; }
.sr-bar i { display: block; height: 100%; background: var(--iris); transform-origin: left; transform: scaleX(0); transition: transform .9s var(--ease); }
.sr-meta { display: block; color: var(--ink-3); font-size: .8rem; }

/* theme detail: the focused theme's real top launches */
.detail {
  position: sticky; top: 20px; padding: 24px; border: 1px solid var(--line-2); border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(236, 235, 245, .04);
}
.detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-head h2 { font-size: 1.75rem; flex: none; }
.detail-head h2:focus { outline: none; }
.detail-head h2:focus-visible { outline: 2px solid var(--iris-hi); }
.detail-sub { min-width: 0; color: var(--iris-hi); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-msg { margin-top: 16px; color: var(--ink-2); font-size: .92rem; }
.detail-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 18px; }
.detail-stats dt { color: var(--ink-3); font-size: .78rem; }
.detail-stats dd { margin-top: 2px; font-size: 1.15rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list { list-style: none; margin-top: 20px; border-top: 1px solid var(--line); }
.top-list li { border-bottom: 1px solid var(--line); }
.tl-row {
  display: grid; grid-template-columns: 1.2rem 32px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  min-height: 60px; padding: 8px 6px; border-radius: 10px; text-decoration: none; transition: background-color .2s;
}
a.tl-row:hover { background: rgba(236, 235, 245, .04); }
a.tl-row:hover .tl-name b { color: var(--iris-hi); }
.tl-n { color: var(--ink-3); font: 400 1rem/1 var(--f-display); text-align: center; }
.tl-row img, .tl-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.tl-name { display: grid; min-width: 0; }
.tl-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.tl-sym { color: var(--ink-3); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-vol { font-weight: 500; white-space: nowrap; }

/* how it works */
.how { padding-block: clamp(48px, 7vw, 96px); background: linear-gradient(var(--line), var(--line)) no-repeat top center / calc(100% - 2 * var(--gutter)) 1px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.step-card { position: relative; }
.step-art { width: 100%; height: auto; aspect-ratio: 200 / 120; border-radius: var(--r-panel); background: radial-gradient(80% 90% at 50% 100%, rgba(165, 148, 255, .07), transparent 70%), var(--bg-2); border: 1px solid var(--line); }
.step-card h3 { display: flex; align-items: baseline; gap: 12px; margin-top: 20px; font: 400 1.4rem/1.2 var(--f-display); }
.step-n {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; transform: translateY(-3px);
  border: 1px solid rgba(165, 148, 255, .55); background: var(--iris-dim); color: var(--iris-hi); font: 500 .85rem/1 var(--f-ui);
}
.step-card p { margin-top: 8px; color: var(--ink-2); font-size: .95rem; max-width: 40ch; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); margin-top: clamp(40px, 6vw, 72px); }
.rules > div { padding: 18px 0; border-top: 1px solid var(--line); }
.rules dt { font-weight: 500; }
.rules dd { margin-top: 4px; color: var(--ink-2); font-size: .93rem; max-width: 62ch; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 32px 40px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font: 400 1.15rem/1 var(--f-display); }
.foot-small { margin-top: 8px; color: var(--ink-3); font-size: .84rem; }
.x-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: .9rem; transition: border-color .2s, background-color .2s; }
.x-btn:hover { border-color: rgba(165, 148, 255, .5); background: var(--iris-dim); }

/* scroll reveals (staggered) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .play .detail.reveal { transition-delay: .08s; }
.js .steps .reveal:nth-child(2) { transition-delay: .1s; }
.js .steps .reveal:nth-child(3) { transition-delay: .2s; }

/* ---------- 404 ---------- */
.page { padding-block: clamp(36px, 6vw, 72px); min-height: 60vh; }
.page h1 { font-size: clamp(2.3rem, 1.6rem + 2.6vw, 3.6rem); max-width: none; }
.page .lede { margin-top: 12px; }
.round-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.round-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: .9rem; transition: color .2s, border-color .2s, background-color .2s; }
.round-nav a:hover { color: var(--ink); border-color: rgba(165, 148, 255, .5); background: var(--iris-dim); }
.notfound h1 { max-width: 14ch; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 28px; }
  .field { margin-inline: calc(-1 * var(--gutter)); }
  .field-stage { height: clamp(340px, 52vh, 460px); }
  .field-hint { right: auto; left: var(--gutter); }
  .readout { margin-inline: var(--gutter); }
  .play { grid-template-columns: minmax(0, 1fr); }
  .detail { position: relative; top: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .rules { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .head-row { flex-wrap: wrap; gap: 0; padding-top: 8px; }
  /* phones: the nav drops below the brand, all three links visible without scrolling */
  .nav { width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); padding-inline: calc(var(--gutter) - 12px); }
}
@media (max-width: 560px) {
  /* hero order on phones: eyebrow, headline, lede, then the field and its readout, then actions and stats */
  .hero-row { row-gap: 0; }
  .hero-copy { display: contents; }
  .hero-copy > .eyebrow { order: 1; margin-bottom: 14px; }
  .hero-copy > h1 { order: 2; }
  .hero-copy > .lede { order: 3; margin-top: 14px; font-size: 1rem; }
  .field { order: 4; margin-top: 8px; }
  .hero-cta { order: 5; margin-top: 20px; }
  .hero-copy > .hero-stats { order: 6; }
  .hero-cta .hero-how { display: none; }
  .hero-cta .btn { flex: 1 1 100%; }
  .ro-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-stats dd { overflow: hidden; text-overflow: ellipsis; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 30px; }
  .hero-stats > div { padding-right: 10px; margin-right: 10px; min-width: 0; }
  .hero-stats dd { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; }
  .hero-stats dt { font-size: .74rem; min-height: 2.6em; }
  .field-stage { height: 340px; }
  .readout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .ro-ctl { justify-content: space-between; }
  .btn-mid { flex: 1; max-width: none; text-align: center; }
  .ro-stats { gap: 8px 16px; }
  .detail { padding: 20px 16px; border-radius: 18px; }
  .tl-row { gap: 10px; }
}
@media (max-width: 380px) {
  .detail-head { flex-wrap: wrap; }
  .tl-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .tl-n { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
