/* ==========================================================================
   Base + components — niu-lai.net
   Specificity discipline: one class = one job. No element selectors fighting
   class selectors over spacing. Sibling spacing comes from flex/grid gap.
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);           /* explicit: the host paints its own ground */
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img, svg, canvas { max-width: 100%; display: block; }

a { color: var(--gold); text-underline-offset: 2px; }
a:hover { color: var(--vermilion); }

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 680;
  line-height: 1.14;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0; }

.u-measure { max-width: var(--measure); }
.u-dim     { color: var(--ink-dim); }
.u-nums    { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.u-center  { text-align: center; }

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.stack       { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack-lg    { display: flex; flex-direction: column; gap: var(--sp-5); }
.section     { padding-block: var(--sp-6); }
.section-tight { padding-block: var(--sp-5); }

/* --- eyebrow label: the mono/CGI voice ---------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.eyebrow::before {
  content: "";
  inline-size: 18px;
  block-size: 1px;
  background: currentColor;
  flex: none;
}

/* --- site chrome -------------------------------------------------------- */
.topbar {
  background: var(--bg-alt);
  border-block-end: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
  text-align: center;
  padding-block: var(--sp-1);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--border);
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 680;
  font-size: var(--step-1);
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand__mark { font-size: 1.15em; color: var(--gold); }
.navlinks { display: flex; gap: 2px; flex-wrap: wrap; }
.navlinks a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--ink-dim);
  padding: 7px 11px;
  border-radius: var(--radius);
}
.navlinks a:hover { color: var(--ink); background: var(--surface-2); }
.navlinks a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.theme-btn {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  flex: none;
}
.theme-btn:hover { color: var(--ink); border-color: var(--border-hard); }

/* --- language switch ----------------------------------------------------
   A <details> disclosure, not a JS-built menu — the toggle, keyboard
   support (Enter/Space/Escape-via-native-focus) and outside-click-to-open
   semantics all come from the browser for free, no framework needed, in
   keeping with the same progressive-enhancement approach as the FAQ
   <details> blocks on /movie/ and /facts/. Two languages fit inline fine,
   but past two this collapses into a proper menu — six languages laid out
   flat would eat the whole masthead. site.js adds one small enhancement
   (close on outside click / Escape); without JS it still opens and closes
   correctly via the native <summary> toggle. */
.lang-switch { position: relative; flex: none; }
.lang-switch summary {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
  padding: 6px 9px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::marker { content: ""; }
.lang-switch summary:hover { color: var(--ink); background: var(--surface-2); }
.lang-switch[open] > summary {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--border);
}
.lang-switch__chevron { transition: transform 160ms ease; flex: none; }
.lang-switch[open] .lang-switch__chevron { transform: rotate(180deg); }

.lang-switch__menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  margin: 0;
  padding: 5px;
  list-style: none;
  min-inline-size: 140px;
  background: var(--surface);
  border: 1px solid var(--border-hard);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
.lang-switch__menu li + li { margin-block-start: 1px; }
.lang-switch__menu a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius);
  /* Deliberately NOT --font-mono here: this one menu lists every language's
     own name in its own script (中文, ไทย, 日本語, Français...) on every
     page, including ones that never load a CJK/Thai webfont. IBM Plex Mono
     has none of those glyphs either, so pointing this at it would silently
     fall back to whatever system font each OS happens to pick — the exact
     trap called out in zh.css/th.css/ja.css. A plain system-ui stack lets
     each browser pick its own correct font per script instead, which is
     the right call for a handful of short labels (each <a> below also
     carries its own lang="" attribute for correctness). */
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--step--1);
  color: var(--ink-dim);
  text-decoration: none;
  white-space: nowrap;
}
.lang-switch__menu a:hover { color: var(--ink); background: var(--surface-2); }
.lang-switch__menu a[aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
}

/* --- language detection banner ------------------------------------------- */
.lang-banner {
  background: var(--surface-2);
  border-block-end: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
  text-align: center;
  padding: 9px 44px 9px 14px;
  position: relative;
}
.lang-banner a { color: var(--gold); margin-inline-start: 6px; }
.lang-banner button {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 8px;
}
.lang-banner button:hover { color: var(--ink); }

@media (max-width: 720px) {
  .masthead__row { flex-wrap: wrap; }
  .navlinks { order: 3; inline-size: 100%; justify-content: flex-start; }
}

/* --- poster figure (used in the /movie/ infobox) ------------------------- */
.pane-poster {
  inline-size: clamp(116px, 17vw, 168px);
  margin: var(--sp-2) 0 var(--sp-1);
}
.pane-poster a { display: block; }
.pane-poster img {
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 248 / 350;
  object-fit: cover;
  border: 1px solid var(--border-hard);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--gold) 15%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.pane-poster a:hover img,
.pane-poster a:focus-visible img {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 color-mix(in srgb, var(--gold) 22%, transparent);
}

/* --- hero --------------------------------------------------------------- */
.hero { padding-block: var(--sp-6) var(--sp-5); }
.hero__lede {
  font-size: var(--step-1);
  color: var(--ink-dim);
  max-inline-size: 60ch;
}
.answer {
  font-size: var(--step-1);
  max-inline-size: 62ch;
}
.answer strong { color: var(--ink); }

/* --- quote-hook: the viral-comment banner at the very top of the homepage,
   before the H1. Full-bleed so it reads as a distinct "here's the internet's
   verdict" beat rather than part of the hero itself. -------------------- */
.quote-hook {
  background: var(--surface-2);
  border-block-end: 1px solid var(--border);
}
.quote-hook__inner {
  padding-block: var(--sp-4);
  text-align: center;
}
.quote-hook__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.35;
  max-inline-size: 48ch;
  margin-inline: auto;
  text-wrap: balance;
  color: var(--ink);
}
.quote-hook__cite {
  margin-block-start: var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
}
.quote-hook__cite a { color: inherit; }

/* Homepage only: text hero beside a video panel. .hero-grid owns the
   section's block padding; the nested .hero drops its own so it isn't
   doubled. */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: var(--sp-5);
  align-items: center;
  padding-block: var(--sp-6) var(--sp-5);
}
.hero-grid > .hero { padding-block: 0; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: var(--sp-5) var(--sp-4); }
}

/* --- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.03em;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hard);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
  font-weight: 500;
}
.btn--primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--on-gold); }
.btn--block { inline-size: 100%; }
.btn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* --- triage cards (homepage) -------------------------------------------- */
.triage { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (max-width: 760px) { .triage { grid-template-columns: 1fr; } }
.triage__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
}
.triage__card:hover { border-color: var(--gold); color: var(--ink); }
.triage__kicker {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.triage__card h3 { font-size: var(--step-1); }
.triage__card p { color: var(--ink-dim); font-size: var(--step--1); }

/* --- stats -------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
  border-inline-end: 1px solid var(--border);
}
.stat:last-child { border-inline-end: 0; }
@media (max-width: 700px) {
  .stat:nth-child(2n) { border-inline-end: 0; }
  .stat:nth-child(-n+2) { border-block-end: 1px solid var(--border); }
}
.stat__n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--step-2);
  color: var(--gold);
}
.stat__l { font-size: var(--step--1); color: var(--ink-dim); margin-block-start: var(--sp-1); }

/* --- cards / prose ------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card h3 { font-size: var(--step-1); }
.card p { color: var(--ink-dim); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.prose { display: flex; flex-direction: column; gap: var(--sp-3); max-inline-size: var(--measure); }
.prose h2 { margin-block-start: var(--sp-3); }
.prose h3 { margin-block-start: var(--sp-2); }
.prose ul, .prose ol { margin: 0; padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: var(--sp-2); }
.prose li { color: var(--ink-dim); }
.prose li strong { color: var(--ink); }

.callout {
  border: 1px solid var(--border-hard);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.callout--warn { border-inline-start-color: var(--vermilion); }
.callout h3, .callout h4 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 600; }
.callout p { color: var(--ink-dim); font-size: var(--step--1); }

.quote {
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: var(--sp-3);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.quote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--step--1);
  color: var(--ink-dim);
}

/* --- tables ------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
table { inline-size: 100%; border-collapse: collapse; font-size: var(--step--1); }
th, td { padding: 11px 14px; text-align: start; border-block-end: 1px solid var(--border); }
tbody tr:last-child td { border-block-end: 0; }
th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- verdict pills (facts page) ----------------------------------------- */
.verdict {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.verdict--false { color: var(--verdict-false); }
.verdict--true  { color: var(--verdict-true); }
.verdict--murky { color: var(--verdict-murky); }

/* --- timeline ----------------------------------------------------------- */
.timeline { display: flex; flex-direction: column; }
.tl-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-block-start: 1px solid var(--border);
}
.tl-row:first-child { border-block-start: 0; }
@media (max-width: 560px) { .tl-row { grid-template-columns: 1fr; gap: var(--sp-1); } }
.tl-date {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--gold-soft);
}
.tl-body { display: flex; flex-direction: column; gap: var(--sp-1); }
/* h3, one level below the section's h2 — was h4 (skipped a level, axe heading-order) */
.tl-body h3 { font-family: var(--font-body); font-weight: 600; font-size: var(--step-0); }
.tl-body p { color: var(--ink-dim); font-size: var(--step--1); }

/* --- faq ---------------------------------------------------------------- */
.faq { display: flex; flex-direction: column; }
.faq details { border-block-start: 1px solid var(--border); padding-block: var(--sp-3); }
.faq details:last-child { border-block-end: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--gold); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { color: var(--ink-dim); margin-block-start: var(--sp-2); max-inline-size: var(--measure); }

/* --- meme format glossary ----------------------------------------------- */
.glossary { display: flex; flex-direction: column; gap: var(--sp-3); }
.gloss {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  scroll-margin-top: 90px;
}
.gloss__head { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.gloss__head h3 { font-size: var(--step-1); }
.gloss__anchor {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-faint);
  text-decoration: none;
}
.gloss__anchor:hover { color: var(--gold); }
.gloss__why { color: var(--ink-dim); }
.gloss__meta { font-size: var(--step--1); color: var(--ink-faint); }

/* --- footer ------------------------------------------------------------- */
.footer {
  border-block-start: 1px solid var(--border);
  padding-block: var(--sp-5);
  margin-block-start: var(--sp-5);
}
.footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 700px) { .footer__cols { grid-template-columns: 1fr; } }
/* h3: keeps every page's heading sequence valid regardless of what level the
   last content heading landed on (checked across all 5 pages; see commit) */
.footer h3 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.footer a { color: var(--ink-dim); text-decoration: none; font-size: var(--step--1); }
.footer a:hover { color: var(--gold); }
.footer p { color: var(--ink-dim); font-size: var(--step--1); }
.footer__note {
  border-block-start: 1px solid var(--border);
  margin-block-start: var(--sp-4);
  padding-block-start: var(--sp-3);
  color: var(--ink-faint);
  font-size: 0.78rem;
  max-inline-size: 80ch;
}

/* --- live box office panel ---------------------------------------------- */
.livebox {
  border: 1px solid var(--border-hard);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  background: var(--surface-2);
}
.livebox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-block-end: var(--sp-3);
}
.livebox__stamp {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-dim);
  margin: 0;
}
.livebox__dot {
  display: inline-block;
  inline-size: 0.5em;
  block-size: 0.5em;
  border-radius: 50%;
  background: var(--verdict-true);
  margin-inline-end: 0.45em;
  vertical-align: middle;
}
[data-box-state="stale"] .livebox__dot { background: var(--ink-faint); }
.livebox .stats { background: var(--surface); }
.livebox .stat__n { min-inline-size: 4ch; }
.livebox__chart { margin: var(--sp-3) 0 0; }
.livebox__chart svg {
  inline-size: 100%;
  block-size: 3.2rem;
  display: block;
  fill: var(--gold);
  opacity: 0.85;
}
.livebox__chart figcaption {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-faint);
  margin-block-start: var(--sp-1);
}
.livebox__note { font-size: var(--step--1); color: var(--ink-dim); margin-block-start: var(--sp-2); }
