/* ————— Zavija — shared article styles (SEO content cluster) —————
   Midnight tokens mirror web/index.html + web/tokens; one voice across the landing,
   the policy pages, and these crawlable guide pages. Loaded by /how-to-play,
   /how-to-solve, /harder-than-queens, and the /es twins. Fonts are linked per-page
   (so each page can pick its own weights); this file assumes Syne / Manrope / Michroma. */

:root {
  --bg: #14182C;
  --bg-deep: #0F1220;
  --surface: #1E2338;
  --ink: #E9EBF3;
  --prose: #C6CAD8;
  --ink-soft: #A3A8B9;
  --gold: #F2C66B;
  --teal: #41C5B2;
  --teal-ink: #0E2320;
  --bad: #E07A7A;
  --unv: #6FA8E8;
  --violet: #A78BFA;
  --starglow: #F2F4FB;
  --hairline: rgba(233, 235, 243, 0.10);
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mark: "Michroma", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) fixed;
  color: var(--prose);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
/* Faint fixed starfield — matches the landing's night ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(242, 244, 251, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, rgba(242, 244, 251, 0.34) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 62% 44%, rgba(242, 244, 251, 0.24) 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 66%, rgba(242, 244, 251, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 72%, rgba(242, 244, 251, 0.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 88%, rgba(242, 244, 251, 0.2) 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 8%, rgba(242, 244, 251, 0.36) 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 34%, rgba(242, 244, 251, 0.26) 50%, transparent 51%);
  opacity: 0.55;
}
header.site, main, footer.site { position: relative; z-index: 1; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px); }
.wrap-wide { max-width: 980px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; color: var(--ink); margin: 0; }
p { margin: 0 0 16px; text-wrap: pretty; max-width: 68ch; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong, b { color: var(--ink); }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em;
  background: rgba(233, 235, 243, 0.07); padding: 1px 6px; border-radius: 6px; color: var(--ink);
}

/* ————— Header ————— */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav { display: flex; align-items: center; gap: 20px; padding: 13px 0; }
.mark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mark); font-size: 14px; letter-spacing: 0.14em;
  color: var(--starglow); text-shadow: 0 0 18px rgba(155, 176, 255, 0.35); text-decoration: none;
}
.mark img { width: 19px; height: 19px; display: block; }
.mark:hover { text-decoration: none; }
.nav-links { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.btn, .nav-links a.btn:hover { color: var(--teal-ink); }

/* ————— Buttons ————— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  border-radius: 13px; padding: 11px 18px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-1.5px); }
.btn-teal { background: var(--teal); color: var(--teal-ink); box-shadow: 0 4px 24px rgba(65, 197, 178, 0.22); }
.btn-teal:hover { box-shadow: 0 8px 32px rgba(65, 197, 178, 0.32); }
.btn-ghost { border-color: rgba(65, 197, 178, 0.45); color: var(--teal); }
.btn-ghost:hover { border-color: var(--teal); background: rgba(65, 197, 178, 0.07); }
.btn-small { font-size: 13.5px; padding: 8px 14px; border-radius: 11px; box-shadow: none; }

/* ————— Article shell ————— */
main { padding: clamp(30px, 5vw, 56px) 0 20px; }
.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 14px;
}
.article-h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 600; letter-spacing: -0.01em; }
.article-h1 em { font-style: normal; color: var(--teal); }
.lede { margin-top: 18px; font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--ink-soft); line-height: 1.65; max-width: 60ch; }
.byline { color: var(--ink-soft); font-size: 13.5px; margin: 20px 0 0; }

section.block { padding: clamp(30px, 5vw, 52px) 0; }
section.block + section.block { border-top: 1px solid var(--hairline); }
h2.sec { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.005em; margin-bottom: 14px; }
h3.sub { font-size: 1.12rem; font-weight: 700; margin: 26px 0 8px; color: var(--ink); }

ul.prose, ol.prose { margin: 0 0 16px; padding-left: 20px; max-width: 66ch; }
ul.prose li, ol.prose li { margin-bottom: 9px; }
ul.checks { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 13px; max-width: 64ch; }
ul.checks li { display: flex; gap: 13px; align-items: baseline; }
ul.checks li::before { content: "✓"; color: var(--teal); font-weight: 800; flex: 0 0 auto; }

/* ————— Callouts & figures ————— */
.callout {
  background: linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface) 84%, var(--bg-deep)));
  border: 1px solid var(--hairline); border-left: 3px solid var(--teal);
  border-radius: 14px; padding: 16px 18px; margin: 22px 0; max-width: 66ch;
}
.callout p:last-child { margin-bottom: 0; }
.callout .k { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }

figure {
  margin: 26px 0; padding: 18px; border-radius: 16px;
  background: var(--bg-deep); border: 1px solid var(--hairline);
  box-shadow: 0 18px 48px rgba(8, 10, 20, 0.4);
}
figure svg { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; }
figure figcaption { margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); text-align: center; max-width: none; }

/* board diagram primitives (inline SVG) */
.bd-cell-x { stroke: var(--bad); stroke-width: 2.4; stroke-linecap: round; }
.bd-dot { fill: rgba(233, 235, 243, 0.4); }
.bd-star { fill: var(--gold); }
.bd-block { fill: rgba(224, 122, 122, 0.14); }
.bd-hl { fill: rgba(65, 197, 178, 0.14); stroke: var(--teal); stroke-width: 1.4; }

/* ————— Tier cards (how-to-solve) ————— */
.tier { border: 1px solid var(--hairline); border-radius: 16px; padding: 18px 20px; margin: 18px 0; background: rgba(30, 35, 56, 0.4); }
.tier-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tier-badge {
  font-family: var(--font-mark); font-size: 12px; letter-spacing: 0.06em; font-weight: 700;
  color: var(--teal-ink); background: var(--teal); border-radius: 8px; padding: 3px 9px;
}
.tier-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.tier-blurb { margin: 10px 0 4px; color: var(--ink-soft); font-size: 14.5px; }
.tech-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.tech-list li { padding-left: 16px; position: relative; font-size: 14.5px; }
.tech-list li::before { content: "·"; position: absolute; left: 3px; color: var(--teal); font-weight: 800; }
.tech-list .tname { color: var(--ink); font-weight: 700; }

/* ————— Related links / CTA ————— */
.cta-band {
  margin: 8px 0; padding: clamp(26px, 4vw, 40px); border-radius: 20px;
  background: linear-gradient(180deg, var(--surface), var(--bg-deep));
  border: 1px solid var(--hairline); text-align: center;
}
.cta-band h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 600; }
.cta-band p { margin: 12px auto 22px; color: var(--ink-soft); max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 8px; }
.related a {
  display: block; padding: 16px 18px; border-radius: 14px; text-decoration: none;
  background: rgba(30, 35, 56, 0.5); border: 1px solid var(--hairline);
  transition: border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.related a:hover { border-color: rgba(65, 197, 178, 0.45); transform: translateY(-2px); text-decoration: none; }
.related .r-k { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); }
.related .r-t { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin-top: 6px; font-size: 1.02rem; }
.related .r-d { color: var(--ink-soft); font-size: 13.5px; margin-top: 5px; line-height: 1.5; }

/* ————— FAQ ————— */
.faq { max-width: 720px; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 17px 4px; font-weight: 700; font-size: 1rem; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--teal); font-weight: 700; font-size: 1.2rem; transition: transform 0.25s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 4px 18px; color: var(--ink-soft); max-width: 64ch; }
.faq .a b { color: var(--ink); }

/* ————— Footer ————— */
footer.site { border-top: 1px solid var(--hairline); padding: 40px 0 56px; margin-top: 30px; }
.foot-grid { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px 30px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.foot-links a { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.foot-links a:hover { color: var(--ink); }
.foot-note { margin-top: 20px; font-size: 13px; color: var(--ink-soft); max-width: 60ch; }

/* ————— Responsive ————— */
@media (max-width: 560px) {
  .nav { gap: 12px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after, .related a { transition: none; }
  .btn:hover, .related a:hover { transform: none; }
}
