/* Storm The Court Games — site styles
   Visual language follows the game's "Apex Front-Office" system:
   carbon tiers, 1px strokes, court-orange actions, Chivo / Hanken Grotesk / JetBrains Mono. */

:root {
  /* Carbon tiers */
  --bg: #0A0E17;
  --surface: #111827;
  --surface-alt: #1E2640;
  --surface-high: #273152;
  --border: #2A344D;
  --border-soft: rgba(42, 52, 77, 0.55);

  /* Text */
  --text-strong: #F3F4F6;
  --text: #E6EAF2;
  --muted: #98A2B6;
  --faint: #636E86;

  /* Fixed-meaning accents */
  --accent: #FF6B00;
  --accent-hover: #FF8533;
  --accent-contrast: #0A0E17;
  --accent-soft: rgba(255, 107, 0, 0.15);
  --accent-border: rgba(255, 107, 0, 0.55);
  --cyan: #38BDF8;
  --cyan-bg: rgba(56, 189, 248, 0.15);
  --amber: #F59E0B;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --make: #10B981;
  --make-bg: rgba(16, 185, 129, 0.15);
  --miss: #EF4444;
  --miss-bg: rgba(239, 68, 68, 0.15);

  /* Type */
  --font-display: 'Chivo', 'Hanken Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;

  /* Shape & space */
  --radius: 4px;
  --radius-pill: 9999px;
  --gutter: 16px;
  --max: 1160px;
  --section-y: clamp(56px, 9vw, 112px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.5rem, 6.2vw, 4.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }

.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 14px; border-radius: var(--radius); font-weight: 700; z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-strong); }
.brand-mark {
  /* Logo slot: replace with <img src="/assets/logo.svg" alt="" width="32" height="32"> */
  width: 32px; height: 32px; flex: none;
  border: 1px dashed var(--accent-border); border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; color: var(--accent);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text-strong); background: var(--surface-alt); }
.site-nav a[aria-current="page"] { color: var(--text-strong); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.site-nav a, .brand-name { white-space: nowrap; }
@media (max-width: 560px) {
  .site-header .wrap { gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 0.875rem; }
  .site-nav a { padding: 8px 10px; font-size: 0.875rem; }
}
@media (max-width: 359px) {
  .brand-name { font-size: 0.8rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text-strong); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-high); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid currentColor;
}
.pill-amber { color: var(--amber); background: var(--amber-bg); }
.pill-cyan { color: var(--cyan); background: var(--cyan-bg); }

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; border-top: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.125rem; }
.lede { font-size: clamp(1.125rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 60ch; }

/* ---------- Placeholder slots (screenshots / logo) ---------- */
.slot {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(42, 52, 77, 0.25) 14px 15px),
    var(--surface);
  display: grid; place-items: center; text-align: center;
  color: var(--faint); font-family: var(--font-mono); font-size: 0.8rem;
  padding: 16px;
  aspect-ratio: 16 / 9;
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* ---------- Home ---------- */
.home-hero { padding: clamp(56px, 10vw, 128px) 0 var(--section-y); }
.home-hero h1 { max-width: 14ch; }
.home-hero .lede { margin-bottom: 32px; }

.feature-game {
  display: grid; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.feature-game-shot { display: block; border-bottom: 1px solid var(--border); background: var(--bg); }
.feature-game-shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.feature-game-body { padding: clamp(20px, 4vw, 40px); }
.feature-game-body h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 12px; }
.feature-game-body p { color: var(--muted); }
@media (min-width: 900px) {
  .feature-game { grid-template-columns: 1.35fr 1fr; }
  .feature-game-shot { border-bottom: 0; border-right: 1px solid var(--border); }
  .feature-game-body { display: flex; flex-direction: column; justify-content: center; }
}

.beliefs { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.beliefs > div { background: var(--surface); padding: 28px; }
.beliefs p { color: var(--muted); margin: 0; }
@media (min-width: 720px) { .beliefs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .beliefs { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Game hero ---------- */
.game-hero { padding: clamp(48px, 8vw, 104px) 0 var(--section-y); }
.game-hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) { .game-hero-grid { grid-template-columns: 1.05fr 1fr; gap: 64px; } }
.game-hero h1 { margin-top: 16px; }
.game-hero .lede { margin-bottom: 32px; }
.hero-note { margin-top: 16px; color: var(--faint); font-size: 0.9rem; }

/* The open-engine roll readout */
.roll {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.95rem;
}
.roll-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.roll-head strong { font-family: var(--font-display); color: var(--text-strong); font-size: 1.05rem; }
.roll-head .mono { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.roll-lines { list-style: none; margin: 0; padding: 8px 18px; }
.roll-lines li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
}
.roll-lines li:last-child { border-bottom: 0; }
.roll-lines .num { color: var(--text); }
.roll-lines .plus { color: var(--make); }
.roll-lines .minus { color: var(--miss); }
.roll-target {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-weight: 700; color: var(--text-strong);
}
.roll-target .num { color: var(--cyan); font-size: 1.15rem; }
.roll-result {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 18px;
}
.die {
  width: 76px; height: 76px; border-radius: var(--radius);
  border: 1px solid var(--accent-border); background: var(--accent-soft);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 2rem; color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.die-label { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.die-label b { display: block; color: var(--text-strong); font-size: 1rem; }
.verdict {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
  padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid currentColor;
}
.verdict.make { color: var(--make); background: var(--make-bg); }
.verdict.miss { color: var(--miss); background: var(--miss-bg); }
.roll-foot { padding: 0 18px 18px; }
.roll-foot button {
  width: 100%; min-height: 44px;
  background: var(--surface-alt); color: var(--text-strong);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: 600 0.95rem var(--font-body); cursor: pointer;
}
.roll-foot button:hover { background: var(--surface-high); }
.die.rolling { animation: shake 0.45s steps(6) 1; }
@keyframes shake { 50% { transform: rotate(-6deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .die.rolling { animation: none; } }
@media (max-width: 420px) {
  .roll-result { grid-template-columns: auto 1fr; }
  .verdict { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Screenshots ---------- */
.shot { margin: 0; }
.shot a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: zoom-in; }
.shot img { width: 100%; height: auto; }
.shot a:hover { border-color: var(--accent-border); }
.shot figcaption { margin-top: 12px; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
.hero-shot { padding-bottom: var(--section-y); }

.feature-row { display: grid; gap: 24px; align-items: center; padding: 40px 0; border-top: 1px solid var(--border-soft); }
.feature-row:first-of-type { border-top: 0; padding-top: 0; }
.feature-copy p { color: var(--muted); }
.feature-copy h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.feature-copy ul { margin: 0; padding: 0; list-style: none; }
.feature-copy li { padding: 10px 0 10px 20px; border-top: 1px solid var(--border-soft); position: relative; }
.feature-copy li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 8px; height: 2px; background: var(--accent); }
@media (min-width: 980px) {
  .feature-row { grid-template-columns: 1.35fr 1fr; gap: 56px; padding: 56px 0; }
  .feature-row:nth-of-type(even) { grid-template-columns: 1fr 1.35fr; }
  .feature-row:nth-of-type(even) .shot { order: 2; }
}

.yourway-grid { display: grid; gap: 24px; align-items: start; margin-bottom: 40px; }
@media (min-width: 980px) { .yourway-grid { grid-template-columns: 1.6fr 1fr; gap: 32px; } }
.yourway-copy { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.yourway-copy > div { background: var(--surface); padding: 24px 28px; }
.yourway-copy p { color: var(--muted); margin: 0; }
@media (min-width: 820px) { .yourway-copy { grid-template-columns: repeat(3, 1fr); } }

.thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .thumbs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .thumbs { grid-template-columns: repeat(3, 1fr); } }
.thumbs a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.thumbs a:hover { border-color: var(--accent-border); }
.thumbs img { width: 100%; height: auto; }
.thumbs span { display: block; margin-top: 10px; color: var(--muted); font-size: 0.95rem; }

.lightbox { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); padding: 0; width: 96vw; max-width: 1600px; }
.lightbox::backdrop { background: rgba(10, 14, 23, 0.85); backdrop-filter: blur(6px); }
.lightbox img { width: 100%; height: auto; max-height: 84vh; object-fit: contain; background: var(--bg); }
.lightbox-caption { margin: 0; padding: 12px 64px 12px 16px; color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--border); }
.lightbox-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--text-strong); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: var(--surface-high); }

/* ---------- Evolution mode ---------- */
.evolution { background: var(--surface); }
.evolution .section-head h2 { margin-top: 14px; }
.season-chain {
  list-style: none; margin: 0 0 56px; padding: 0;
  display: grid; gap: 0; position: relative;
}
.season-chain li {
  position: relative; padding: 0 0 24px 32px;
}
.season-chain li::before {
  /* the rail */
  content: ""; position: absolute; left: 7px; top: 6px; bottom: -6px; width: 2px; background: var(--border);
}
.season-chain li:last-child::before { display: none; }
.season-chain li::after {
  /* the node */
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px;
  border-radius: var(--radius-pill); background: var(--bg); border: 2px solid var(--muted);
}
.season-chain .is-title::after { border-color: var(--amber); background: var(--amber); }
.season-chain .is-now::after { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.season-chain .is-next::after { border-style: dashed; border-color: var(--faint); }
.season-year { display: block; font-weight: 700; font-size: 1.25rem; color: var(--text-strong); line-height: 1.2; }
.season-note { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 4px; max-width: 34ch; }
.is-title .season-year { color: var(--amber); }
.is-next .season-year, .is-next .season-note { color: var(--faint); }
@media (min-width: 900px) {
  .season-chain { grid-template-columns: repeat(5, 1fr); }
  .season-chain li { padding: 32px 20px 0 0; }
  .season-chain li::before { left: 8px; right: 0; top: 7px; bottom: auto; width: auto; height: 2px; }
  .season-chain li:last-child::before { display: block; background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px); }
  .season-chain li::after { left: 0; top: 0; }
}

.evolution-grid { display: grid; gap: 32px; align-items: center; margin-bottom: 56px; }
@media (min-width: 980px) { .evolution-grid { grid-template-columns: 1.35fr 1fr; gap: 56px; } }

.progression { margin-bottom: 40px; }
.progression > p { color: var(--muted); max-width: 70ch; }
.progression table { background: var(--bg); }
.progression thead th { background: var(--surface-alt); }

.mode-aside { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 24px 28px; }
.mode-aside p { color: var(--muted); margin: 0; max-width: 70ch; }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 560px; background: var(--surface); }
caption { text-align: left; padding: 14px 18px; color: var(--muted); caption-side: top; font-size: 0.95rem; }
th, td { text-align: left; padding: 14px 18px; border-top: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--bg); font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); font-weight: 600; }
tbody th { font-family: var(--font-display); color: var(--text-strong); white-space: nowrap; }
td { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: 18px 0; font-weight: 700; color: var(--text-strong);
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--faint); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text-strong); text-decoration: underline; }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: grid; align-content: center; padding: var(--section-y) 0; }
