/* ==========================================================================
   The Visionaries.net — 2026 redesign
   One stylesheet, no framework. Light + dark themes via CSS custom properties.
   Theme is chosen by: [data-theme="light|dark"] on <html>, else the OS setting.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
/* Barlow Condensed (SIL Open Font Licence, see fonts/OFL-Barlow.txt): sturdy, well-hinted headings */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Visionaries Display";
  src: url("../fonts/visionaries-display.woff2") format("woff2");
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Brand constants (taken from the 2026 logo) */
  --navy: #0c0752;
  --gold: #d6a20b;
  --gold-soft: #dfac2b;
  --violet: #8e44ad;
  --pink: #f2b8dd;
  --unicorn: #4bb3de;   /* Spectral Knights */
  --dragon: #2e7d32;    /* Darkling Lords */

  /* Light theme */
  --bg: #f6f4fb;
  --bg-elev: #ffffff;
  --bg-sunken: #ece8f6;
  --bg-header: rgb(255 255 255 / .82);
  --text: #19162f;
  --text-muted: #5d5978;
  --border: #ddd7ee;
  --link: #5b2a9a;
  --link-hover: #7b3fc4;
  --accent: #7a5c00;          /* gold, darkened to 4.5:1+ on every light surface */
  --accent-contrast: #ffffff;
  --sk: #176a98;
  --dl: #256c29;
  --shadow-sm: 0 1px 2px rgb(20 16 60 / .06), 0 1px 3px rgb(20 16 60 / .08);
  --shadow-md: 0 4px 12px rgb(20 16 60 / .08), 0 2px 4px rgb(20 16 60 / .06);
  --shadow-lg: 0 18px 40px rgb(20 16 60 / .16);
  --hero-fade: linear-gradient(180deg, rgb(var(--scrim) / .2) 0%, rgb(var(--scrim) / .6) 50%, rgb(var(--scrim) / .94) 100%);
  --glow: radial-gradient(60% 80% at 50% 0%, rgb(142 68 173 / .14), transparent 70%);
  --texture: none;
  --scrim: 10 9 32;              /* rgb triplet for image scrims and overlays */
  --surface-brand: var(--navy);  /* behind hero/banner art while it loads */
  --home-hero-bg: radial-gradient(120% 90% at 50% 10%, #2b2391 0%, #0c0752 45%, #05031d 100%);
  --placeholder-bg: radial-gradient(circle at 50% 30%, #2b2391, #0c0752);
  --avatar-bg: linear-gradient(135deg, var(--violet), var(--navy));
  --rhyme-bg: linear-gradient(135deg, color-mix(in srgb, var(--violet) 14%, var(--bg-elev)), var(--bg-elev));
  --rhyme-border: color-mix(in srgb, var(--violet) 30%, var(--border));
  --faction-sk: radial-gradient(90% 120% at 100% 0%, #4bb3de 0%, #1b5f8f 45%, #0c0752 100%);
  --faction-dl: radial-gradient(90% 120% at 100% 0%, #3c9a41 0%, #1d4d22 45%, #070616 100%);
  --btn-glow: 0 6px 18px rgb(214 162 11 / .35);

  /* Type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-display: "Visionaries Display", "Barlow Condensed", system-ui, sans-serif;

  /* Layout */
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* Neutral near-black with zinc panels and hairline borders; gold is the only colour accent */
    --bg: #0a0a0b;
    --bg-elev: #141417;
    --bg-sunken: #1c1c1f;
    --bg-header: rgb(10 10 11 / .8);
    --text: #f2f2f3;
    --text-muted: #a8a8ae;
    --border: rgb(228 228 231 / .1);
    --link: #e9c46a;
    --link-hover: #f5d88f;
    --accent: #e0b03a;
    --accent-contrast: #141005;
    --sk: #7cc4e8;
    --dl: #7fc283;
    --shadow-sm: 0 1px 0 rgb(255 255 255 / .03) inset;
    --shadow-md: 0 8px 24px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 60px rgb(0 0 0 / .7), 0 0 0 1px rgb(228 228 231 / .08);
    --glow: none;
    --texture: linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 56px 56px,
               linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 56px 56px;
    --scrim: 10 10 11;
    --surface-brand: #141417;
    --home-hero-bg: radial-gradient(45% 55% at 30% 45%, rgb(224 176 58 / .09), transparent 70%), var(--texture), #0a0a0b;
    --placeholder-bg: radial-gradient(circle at 50% 30%, #26262b, #141417);
    --avatar-bg: linear-gradient(135deg, #3f3f46, #1c1c1f);
    --rhyme-bg: #18181b;
    --rhyme-border: rgb(228 228 231 / .1);
    --faction-sk: radial-gradient(90% 120% at 100% 0%, rgb(75 179 222 / .55) 0%, rgb(75 179 222 / .12) 45%, transparent 75%), #141417;
    --faction-dl: radial-gradient(90% 120% at 100% 0%, rgb(60 154 65 / .55) 0%, rgb(60 154 65 / .12) 45%, transparent 75%), #141417;
    --btn-glow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Neutral near-black with zinc panels and hairline borders; gold is the only colour accent */
  --bg: #0a0a0b;
  --bg-elev: #141417;
  --bg-sunken: #1c1c1f;
  --bg-header: rgb(10 10 11 / .8);
  --text: #f2f2f3;
  --text-muted: #a8a8ae;
  --border: rgb(228 228 231 / .1);
  --link: #e9c46a;
  --link-hover: #f5d88f;
  --accent: #e0b03a;
  --accent-contrast: #141005;
  --sk: #7cc4e8;
  --dl: #7fc283;
  --shadow-sm: 0 1px 0 rgb(255 255 255 / .03) inset;
  --shadow-md: 0 8px 24px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 60px rgb(0 0 0 / .7), 0 0 0 1px rgb(228 228 231 / .08);
  --glow: none;
  --texture: linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 56px 56px,
             linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 56px 56px;
  --scrim: 10 10 11;
  --surface-brand: #141417;
  --home-hero-bg: radial-gradient(45% 55% at 30% 45%, rgb(224 176 58 / .09), transparent 70%), var(--texture), #0a0a0b;
  --placeholder-bg: radial-gradient(circle at 50% 30%, #26262b, #141417);
  --avatar-bg: linear-gradient(135deg, #3f3f46, #1c1c1f);
  --rhyme-bg: #18181b;
  --rhyme-border: rgb(228 228 231 / .1);
  --faction-sk: radial-gradient(90% 120% at 100% 0%, rgb(75 179 222 / .55) 0%, rgb(75 179 222 / .12) 45%, transparent 75%), #141417;
  --faction-dl: radial-gradient(90% 120% at 100% 0%, rgb(60 154 65 / .55) 0%, rgb(60 154 65 / .12) 45%, transparent 75%), #141417;
  --btn-glow: none;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
/* Reduced motion is handled in a targeted block at the end of this file. */
body {
  margin: 0;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  background: var(--glow) no-repeat, var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Faint grid texture (dark theme), fading out down the first screen */
body::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1100px; z-index: -1; pointer-events: none;
  background: var(--texture);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.3rem); }
h3 { font-size: 1.5rem; }
p, ul, ol, dl, blockquote, figure { margin: 0 0 1rem; }
ol, ul { padding-left: 1.4em; }
li + li { margin-top: .4em; }
q { quotes: "“" "”" "‘" "’"; font-style: italic; }
blockquote { padding: .9rem 1.1rem; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); font-style: italic; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-contrast); padding: .5rem 1rem; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }
.skip-link:hover, .skip-link:focus { color: var(--accent-contrast); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--text-muted); }
.kicker { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; color: var(--accent); font-weight: 700; margin-bottom: .35rem; display: block; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #140f00; box-shadow: var(--btn-glow); }
.btn-primary:hover { background: #e9b520; color: #140f00; }
.btn-ghost { background: rgb(255 255 255 / .08); color: #fff; border-color: rgb(255 255 255 / .35); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgb(255 255 255 / .16); color: #fff; }
.btn-quiet { background: var(--bg-sunken); color: var(--text); border-color: var(--border); }
.btn-quiet:hover { color: var(--text); border-color: var(--accent); }
.btn svg { width: 1.1em; height: 1.1em; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .875rem; line-height: 1.3;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; white-space: nowrap;
}
a.chip:not(.is-active):hover { border-color: var(--accent); color: var(--text); }
a.chip.is-active:hover { color: var(--accent-contrast); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.badge { display: inline-block; font: 700 .7rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; padding: .35rem .55rem; border-radius: 6px; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border); }
.badge-sk, .badge-dl, .badge-gold { background: var(--bg-sunken); }
.badge-sk { background: color-mix(in srgb, var(--sk) 12%, var(--bg-elev)); color: var(--sk); border-color: color-mix(in srgb, var(--sk) 40%, transparent); }
.badge-dl { background: color-mix(in srgb, var(--dl) 12%, var(--bg-elev)); color: var(--dl); border-color: color-mix(in srgb, var(--dl) 40%, transparent); }
.badge-gold { background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
/* The blur lives on a pseudo-element: backdrop-filter on the header itself would
   become the containing block for the fixed-position mobile drawer and clip it. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg-header);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; height: var(--header-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 52px; width: auto; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .25)); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-sunken); border-color: var(--border); }
.icon-btn svg { width: 22px; height: 22px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* Primary navigation — desktop dropdowns, mobile drawer (same markup) */
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li + li { margin-top: 0; }
.nav-top { display: flex; align-items: center; gap: .15rem; }
.nav-link, .nav-trigger {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .55rem .8rem; border-radius: 999px; border: 0; background: none; cursor: pointer;
  font: 600 .975rem/1 var(--font-body); color: var(--text); text-decoration: none; white-space: nowrap;
}
.nav-link:hover, .nav-trigger:hover, .nav-trigger[aria-expanded="true"] { background: var(--bg-sunken); color: var(--text); }
.nav-link[aria-current="page"], .nav-item.is-current > .nav-trigger { color: var(--accent); }
.nav-trigger svg { width: 14px; height: 14px; transition: transform .2s; }
.nav-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-item { position: relative; }
.nav-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 300px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .75rem; display: none;
}
.nav-menu.is-open { display: block; animation: menu-in .16s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.nav-menu.mega { display: none; grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: .5rem 1.25rem; width: min(820px, calc(100vw - 2 * var(--gutter))); left: 50%; transform: translateX(-50%); }
.nav-menu.mega.is-open { display: grid; animation: none; }
.nav-menu.cols-2 { display: none; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; min-width: 560px; }
.nav-menu.cols-2.is-open { display: grid; }
.nav-heading { font: 700 .72rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: .7rem .6rem .4rem; }
.nav-menu a { display: flex; gap: .6rem; align-items: baseline; padding: .45rem .6rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .95rem; line-height: 1.3; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { background: var(--bg-sunken); color: var(--text); }
.nav-menu a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
.nav-menu .num { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .8rem; min-width: 1.6rem; }
.nav-menu .tag { margin-left: auto; font-size: .7rem; color: var(--text-muted); }
.nav-group + .nav-group { margin-top: .25rem; }
.menu-toggle { display: none; }
.nav-close { display: none; }

@media (max-width: 1023px) {
  .menu-toggle { display: inline-grid; }
  .site-nav {
    position: fixed; inset: 0 0 0 auto; width: min(380px, 88vw); z-index: 60;
    background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
    overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1rem 2rem;
  }
  .site-nav.is-open { transform: none; visibility: visible; }
  .nav-close { display: inline-grid; margin-left: auto; }
  .nav-drawer-head { display: flex; align-items: center; margin-bottom: .5rem; }
  .nav-top { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link, .nav-trigger { width: 100%; justify-content: space-between; padding: .9rem .75rem; border-radius: var(--radius-sm); font-size: 1.05rem; }
  .nav-item { border-bottom: 1px solid var(--border); }
  .nav-menu, .nav-menu.mega, .nav-menu.cols-2 { position: static; transform: none; width: auto; min-width: 0; box-shadow: none; border: 0; padding: 0 0 .75rem .5rem; grid-template-columns: 1fr; background: transparent; }
  .nav-menu.is-open { animation: none; }
  .nav-backdrop { position: fixed; inset: 0; background: rgb(var(--scrim) / .6); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
  body.nav-locked { overflow: hidden; }
}
@media (min-width: 1024px) {
  .site-nav { margin-left: .5rem; }
  .nav-drawer-head, .nav-backdrop { display: none; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .875rem; color: var(--text-muted); padding-block: 1rem .25rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: .5rem; }
.breadcrumbs li + li::before { content: "›"; opacity: .6; }
.breadcrumbs a { display: inline-block; padding-block: .2rem; color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--link); text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: calc(var(--radius) + 4px); margin-block: 1rem 2rem;
  min-height: clamp(260px, 34vw, 420px); display: flex; align-items: flex-end;
  background: var(--surface-brand); color: #fff; box-shadow: var(--shadow-md);
}
.hero-media, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--hero-fade); z-index: -1; }
.hero-body { padding: clamp(1.25rem, 4vw, 2.5rem); max-width: 860px; }
.hero h1 { color: #fff; margin-bottom: .35em; text-shadow: 0 2px 16px rgb(0 0 0 / .45); }
/* The label sits on its own dark backing so it passes 4.5:1 over any banner art (5.4:1 even on pure white) */
.hero .kicker {
  display: inline-block; width: fit-content; margin-bottom: .6rem; padding: .35rem .65rem; border-radius: 6px;
  color: var(--gold-soft); background: rgb(var(--scrim) / .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero p { color: rgb(255 255 255 / .88); margin: 0; font-size: 1.05rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.hero-meta .chip { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .22); color: #fff; backdrop-filter: blur(6px); }
.hero-meta .chip b { color: var(--gold-soft); font-weight: 600; }
.hero-emblem { position: absolute; right: 3%; top: 10%; width: clamp(110px, 18vw, 220px); opacity: .9; filter: drop-shadow(0 8px 24px rgb(0 0 0 / .5)); }
@media (max-width: 700px) { .hero-emblem { display: none; } }
.hero .display { font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; }

/* Hero with rotating banners (crossfade) */
.hero-rotator .hero-media img { opacity: 0; transition: opacity 1.2s ease; }
.hero-rotator .hero-media img.is-active { opacity: 1; }

/* Home hero */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background: var(--home-hero-bg);
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid rgb(255 255 255 / .06);
}
.home-title { font-size: clamp(2.2rem, 6vw, 4.2rem); color: #fff; margin-bottom: .3em; }
.home-hero .logo-xl { order: -1; }
.home-hero .wrap { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; text-align: center; }
.home-hero .logo-xl { width: min(560px, 92%); margin-inline: auto; filter: drop-shadow(0 10px 30px rgb(0 0 0 / .5)); }
.home-hero .tagline { font-size: clamp(1.1rem, 2.2vw, 1.4rem); max-width: 40ch; margin: 0 auto 1.5rem; color: rgb(255 255 255 / .88); }
.home-hero .tagline em { color: var(--gold-soft); font-style: normal; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
@media (min-width: 960px) {
  .home-hero .wrap { grid-template-columns: 1.1fr 1fr; text-align: left; }
  .home-hero .tagline { margin-left: 0; }
  .cta-row { justify-content: flex-start; }
}
.stat-strip { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 2rem; justify-content: center; }
.stat-strip div { display: grid; }
.stat-strip b { font: 700 2rem/1 var(--font-heading); color: var(--gold-soft); }
.stat-strip span { font-size: .85rem; color: rgb(255 255 255 / .7); text-transform: uppercase; letter-spacing: .08em; }
@media (min-width: 960px) { .stat-strip { justify-content: flex-start; } }

/* ---------- Sections & cards ---------- */
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }

.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 3vw, 1.75rem);
}
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.card-title-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-title-row h2, .card-title-row h3 { margin: 0; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

/* Explore tiles */
.tile {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 190px; padding: 1.25rem; border-radius: var(--radius); color: #fff; text-decoration: none;
  background: var(--surface-brand); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(var(--scrim) / .05), rgb(var(--scrim) / .88)); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: #fff; }
.tile:hover img { transform: scale(1.05); }
.tile h3 { margin: 0 0 .2rem; font-size: 1.45rem; color: #fff; }
.tile p { margin: 0; font-size: .92rem; color: rgb(255 255 255 / .82); }
.tile .count { position: absolute; top: 1rem; right: 1rem; font: 700 .75rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; background: rgb(0 0 0 / .45); padding: .4rem .6rem; border-radius: 999px; backdrop-filter: blur(4px); }

/* Feature (spotlight) cards */
.feature { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature { grid-template-columns: 220px 1fr; } }
.feature-media img { width: 100%; border-radius: var(--radius-sm); aspect-ratio: 247 / 180; object-fit: cover; background: var(--bg-sunken); }
.feature h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.feature .facts { margin-top: 1rem; }

/* Definition-list facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; font-size: .95rem; }
.facts dt { color: var(--text-muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: .75rem; margin: 0; }
.facts-grid > div { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.facts-grid dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .2rem; }
.facts-grid dd { margin: 0; font-weight: 600; }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 3px; vertical-align: -1px; margin-right: .35rem; border: 1px solid rgb(0 0 0 / .2); }

/* Faction band */
.factions { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .factions { grid-template-columns: 1fr 1fr; } }
.faction {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 1.75rem; color: #fff; text-decoration: none;
  min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow-md);
}
.faction h3 { color: #fff; font-size: 1.9rem; margin: 0 0 .25rem; }
.faction p { margin: 0; color: rgb(255 255 255 / .85); }
.faction:hover { color: #fff; transform: translateY(-2px); }
.faction-sk { background: var(--faction-sk); }
.faction-dl { background: var(--faction-dl); }
.faction .emblem { position: absolute; top: -10px; right: -10px; width: 170px; opacity: .35; }

/* ---------- Slider (scroll-snap) ---------- */
.slider { position: relative; }
.slider-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius);
}
.slider-track::-webkit-scrollbar { display: none; }
.slide { scroll-snap-align: start; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-brand); color: #fff; aspect-ratio: 1170 / 350; min-height: 220px; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; inset: auto 0 0 0; padding: 1.25rem 1.5rem; background: linear-gradient(180deg, transparent, rgb(var(--scrim) / .9)); }
.slide-caption h3 { margin: 0; color: #fff; font-size: 1.5rem; }
.slide-caption p { margin: 0; color: rgb(255 255 255 / .85); font-size: .95rem; }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .9rem; }
.slider-dots { display: flex; gap: .4rem; }
.slider-dots { gap: 0; }
.slider-dots button { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.slider-dots button::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%); border-radius: 999px; background: var(--text-muted); opacity: .45; transition: width .2s, opacity .2s, background-color .2s; }
.slider-dots button[aria-current="true"] { width: 34px; }
.slider-dots button[aria-current="true"]::before { width: 26px; background: var(--accent); opacity: 1; }
.slider-play .i-play { display: none; }
.slider-play[aria-pressed="true"] .i-play { display: block; }
.slider-play[aria-pressed="true"] .i-pause { display: none; }
.slide-link { display: block; height: 100%; color: #fff; text-decoration: none; }
.slide-link:hover { color: #fff; }

/* ---------- Article / long-form layout ---------- */
.layout { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .layout.has-aside { grid-template-columns: minmax(0, 1fr) 300px; } }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 1.75rem); }
.prose { max-width: 72ch; }
.prose p, .prose li { font-size: 1.0625rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.75rem; }
.lead { font-size: 1.2rem; color: var(--text-muted); }

.aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 1rem; }
@media (max-width: 1023px) { .aside { position: static; } }
.aside .card { padding: 1.1rem; }
.aside h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .6rem; }

/* In-page table of contents */
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc li { margin: 0; }
.toc a { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .95rem; }
.toc a:hover { background: var(--bg-sunken); }
.toc a.is-active { background: var(--bg-sunken); box-shadow: inset 3px 0 0 var(--accent); color: var(--text); font-weight: 600; }
.toc .n { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
/* On small screens the TOC becomes a sticky, horizontally scrolling chip bar */
.toc-bar { display: none; }
@media (max-width: 1023px) {
  .toc-bar {
    display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--header-h); z-index: 20;
    margin-inline: calc(var(--gutter) * -1); padding: .6rem var(--gutter); background: var(--bg-header);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  }
  .toc-bar::-webkit-scrollbar { display: none; }
  .aside .toc-card { display: none; }
}

/* Episode list (aside) */
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; counter-reset: ep; }
.ep-list li { margin: 0; }
.ep-list a { display: grid; grid-template-columns: 2rem 1fr; gap: .4rem; padding: .4rem .5rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: .92rem; line-height: 1.3; }
.ep-list a:hover { background: var(--bg-sunken); }
.ep-list a[aria-current="page"] { background: var(--bg-sunken); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.ep-list .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Numbered fact lists */
.list-fancy { list-style: none; padding: 0; counter-reset: item; display: grid; gap: .75rem; }
.list-fancy > li { counter-increment: item; position: relative; padding-left: 2.75rem; margin: 0; }
.list-fancy > li::before {
  content: counter(item); position: absolute; left: 0; top: .05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center; font: 700 .85rem/1 var(--font-body);
  background: var(--bg-sunken);
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
}
.list-fancy ol, .list-fancy ul { margin-top: .5rem; }
.section-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-sunken); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); flex: none; }
.section-icon svg { width: 22px; height: 22px; }

/* Character chips */
.char-grid { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.char-grid li { margin: 0; }
.char-grid .chip svg { width: 15px; height: 15px; opacity: .75; }
.char-grid .chip.is-dropped { border-style: dashed; color: var(--text-muted); }
.char-grid .note { display: block; font-size: .8rem; color: var(--text-muted); white-space: normal; }
.char-grid .has-note { flex-direction: column; align-items: flex-start; border-radius: var(--radius-sm); white-space: normal; max-width: 300px; }
.key { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--text-muted); }
.key span { display: inline-flex; align-items: center; gap: .35rem; }
.key svg { width: 15px; height: 15px; }

/* ---------- Gallery + lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 160px), 1fr)); gap: .6rem; list-style: none; padding: 0; margin: 0; }
.gallery li { margin: 0; }
.gallery a { display: block; position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-sunken); aspect-ratio: 4 / 3; }
.gallery.is-portrait a { aspect-ratio: 3 / 4; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .2s; }
.gallery a:hover img { transform: scale(1.06); }
.gallery a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.gallery li[hidden] { display: none; }
.gallery-more { display: flex; justify-content: center; margin-top: 1rem; }

.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgb(var(--scrim) / .97); color: #fff; }
.lightbox::backdrop { background: rgb(var(--scrim) / .92); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top, .lb-bottom { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; }
.lb-top .lb-count { font-variant-numeric: tabular-nums; color: rgb(255 255 255 / .7); font-size: .9rem; }
.lb-top .spacer { flex: 1; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 .5rem; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgb(0 0 0 / .6); user-select: none; -webkit-user-drag: none; }
.lb-caption { flex: 1; text-align: center; font-size: .95rem; color: rgb(255 255 255 / .85); }
.lightbox .icon-btn { color: #fff; }
.lightbox .icon-btn:hover { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; background: rgb(0 0 0 / .35) !important; }
.lb-prev { left: .75rem; }
.lb-next { right: .75rem; }
@media (max-width: 640px) { .lb-nav { display: none; } }

/* ---------- Toy grid ---------- */
.subnav { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; margin-bottom: 1.5rem; }
.subnav::-webkit-scrollbar { display: none; }
.toy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 200px), 1fr)); gap: clamp(.75rem, 2vw, 1.25rem); list-style: none; padding: 0; margin: 0; }
.toy-grid li { margin: 0; }
.toy-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.toy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--sk) 60%, var(--border)); color: var(--text); }
.toy-card .img { aspect-ratio: 247 / 180; background: var(--bg-sunken); overflow: hidden; }
.toy-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.toy-card:hover img { transform: scale(1.05); }
.toy-card .body { padding: .8rem 1rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.toy-card h3 { margin: 0; font-size: 1.25rem; }
.toy-card .placeholder { display: grid; place-items: center; height: 100%; background: var(--placeholder-bg); }
.toy-card .placeholder img { width: 38%; height: auto; object-fit: contain; opacity: .55; }
.series-block + .series-block { margin-top: clamp(2rem, 5vw, 3rem); }
.series-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.series-head h2 { margin: 0; }
.series-head p { flex-basis: 100%; margin: 0; color: var(--text-muted); }

/* Toy profile */
.profile { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .profile { grid-template-columns: 340px minmax(0, 1fr); } }
.profile-media img { width: 100%; border-radius: var(--radius); background: var(--bg-sunken); box-shadow: var(--shadow-md); }
.rhyme {
  position: relative; margin: 0 0 1.5rem; padding: 1.25rem 1.5rem 1.25rem 3.25rem; border: 0; border-radius: var(--radius);
  background: var(--rhyme-bg);
  border: 1px solid var(--rhyme-border); font-size: 1.2rem; font-style: italic;
}
.rhyme::before { content: "“"; position: absolute; left: .9rem; top: .1rem; font: 700 3.5rem/1 Georgia, serif; color: var(--accent); }
.rhyme cite { display: block; margin-top: .5rem; font-size: .8rem; font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }

/* Review */
.review-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; color: var(--text-muted); font-size: .92rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--avatar-bg); flex: none; }
details.expand > summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--link); margin-top: .5rem; }
details.expand > summary::-webkit-details-marker { display: none; }
details.expand[open] > summary .more { display: none; }
details.expand:not([open]) > summary .less { display: none; }

/* Sibling strip */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.strip a { display: grid; gap: .4rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem; text-align: center; }
.strip img { border-radius: var(--radius-sm); aspect-ratio: 247/180; object-fit: cover; width: 100%; border: 2px solid transparent; }
.strip a[aria-current="page"] img { border-color: var(--accent); }
.strip a:hover img { border-color: var(--border); }

/* ---------- Article ---------- */
.article-head { max-width: 820px; margin: 1rem auto 2rem; text-align: center; }
.article-head h1 { margin-bottom: .75rem; font-size: clamp(2.2rem, 6vw, 3.6rem); }
.byline { display: inline-flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .95rem; flex-wrap: wrap; justify-content: center; }
.byline a { font-weight: 600; }
.article-body { max-width: 72ch; margin-inline: auto; }
.article-body > p:first-of-type::first-letter { font: 700 3.6em/.85 var(--font-heading); float: left; margin: .08em .12em 0 0; color: var(--accent); }
.figure { margin: 2rem 0; }
.figure a { display: block; }
.figure img { margin-inline: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); background: var(--bg-sunken); }
.figure figcaption { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: .6rem; }
.figure-row { display: flex; gap: 1rem; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.figure-row a { flex: 1 1 200px; max-width: 320px; }
.figure-wide { margin-top: 0; }
.callout { display: flex; gap: .9rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--bg-sunken); border: 1px solid var(--border); font-size: .95rem; }
.share { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.share .label { color: var(--text-muted); font-size: .9rem; margin-right: .25rem; }

/* ---------- Prev / next pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block: 2rem; }
.pager a { display: grid; gap: .2rem; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.pager small { color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.pager strong { font-family: var(--font-heading); font-size: 1.2rem; }
.pager .next { text-align: right; grid-column: 2; }
.pager .is-empty { visibility: hidden; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(2.5rem, 6vw, 4rem); background: var(--bg-sunken); border-top: 1px solid var(--border); padding-block: 2.5rem 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand img { width: 180px; margin-bottom: .75rem; }
.site-footer h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .75rem; font-family: var(--font-body); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-block; padding-block: .25rem; color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .875rem; }
.social { display: flex; gap: .25rem; }
.social a { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-muted); }
.social a:hover { color: var(--link); background: var(--bg-elev); }
.social svg { width: 20px; height: 20px; }
.theme-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border); }
.theme-switch button { border: 0; background: none; padding: .35rem .8rem; border-radius: 999px; font: 600 .82rem/1 var(--font-body); color: var(--text-muted); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }


/* ---------- Small utilities (replace former inline styles) ---------- */
.section-tight { padding-top: 0; }
.list-heading { margin-top: .75rem; }
.tagline-quote { margin-bottom: 1rem; }
.author { color: var(--text); }
.chip-name { display: inline-flex; gap: .4rem; align-items: center; }
.badge { vertical-align: middle; }
.cta-inline { margin-top: 1rem; }
.feature-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
@media (min-width: 640px) { .feature.feature-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); } }
.feature-wide .feature-media img { aspect-ratio: 16 / 10; }
.toy-card .body-stacked { display: grid; gap: .25rem; justify-content: stretch; }
.meta { font-size: .88rem; }
.link-card { display: grid; gap: .4rem; text-decoration: none; color: var(--text); }
.link-card:hover { color: var(--text); border-color: var(--accent); }
.link-card strong { font-family: var(--font-heading); font-size: 1.3rem; }
.link-card .muted { font-size: .9rem; }
.swatch[data-colour="red"] { background: #c62828; }
.swatch[data-colour="light-blue"] { background: #7fc8f0; }

/* Hero banner rotation: visible pause control (WCAG 2.2.2) */
.hero-pause {
  position: absolute; top: .75rem; right: .75rem; z-index: 1; width: 36px; height: 36px;
  color: #fff; background: rgb(var(--scrim) / .6); border-color: rgb(255 255 255 / .2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero-pause:hover { background: rgb(var(--scrim) / .8); }
.hero-pause svg { width: 16px; height: 16px; }
.hero-pause .i-play { display: none; }
.hero-pause[aria-pressed="true"] .i-play { display: block; }
.hero-pause[aria-pressed="true"] .i-pause { display: none; }

/* Older browsers without color-mix(): plain token fallbacks (Safari < 16.2, Chrome < 111) */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  :root { --rhyme-bg: var(--bg-elev); --rhyme-border: var(--border); }
  .badge-sk, .badge-dl, .badge-gold { background: var(--bg-sunken); border-color: var(--border); }
  .list-fancy > li::before, .section-icon { background: var(--bg-sunken); }
  .toy-card:hover { border-color: var(--sk); }
}

/* ==========================================================================
   Production additions: components for the page types beyond the six mockups
   (character profiles, listings, article cards, places, tables, 404).
   ========================================================================== */
.page-head { padding-block: 1.25rem 1.5rem; max-width: 62rem; }
.page-head h1 { margin-bottom: .4rem; }
.page-head .lead { max-width: 60ch; margin-bottom: 1rem; }
.page-head .badge { font-size: .8rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-row .label { align-self: center; margin-right: .25rem; color: var(--text-muted); font-size: .85rem; }
.article-tags { margin-top: 1rem; }

/* Article / listing cards: always image-on-top so they work in 2- and 3-column grids */
.teaser { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; align-content: start; }
.teaser-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-sunken); }
.teaser-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.teaser:hover .teaser-media img { transform: scale(1.04); }
.teaser-media.is-empty { display: grid; place-items: center; background: var(--placeholder-bg); }
.teaser-media.is-empty img { width: 34%; height: auto; object-fit: contain; opacity: .55; }
.teaser-body { display: grid; gap: .55rem; align-content: start; padding: 1.1rem 1.25rem 1.25rem; }
.teaser-body > * { margin: 0; }
.teaser h2, .teaser h3 { margin: 0; font-size: 1.3rem; }
.teaser h2 a, .teaser h3 a { color: var(--text); text-decoration: none; }
.teaser h2 a:hover, .teaser h3 a:hover { color: var(--link); }
.teaser .meta { color: var(--text-muted); font-size: .85rem; }

/* Character profile */
.spec-long { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.spec-long h3 { margin-bottom: .5rem; font-size: 1.3rem; }
.link-list { list-style: none; padding: 0; margin: 0; columns: 2 280px; column-gap: 1.5rem; }
.link-list li { break-inside: avoid; margin: 0 0 .1rem; }
.link-list a { display: inline-block; padding-block: .3rem; }
.profile.no-media { grid-template-columns: minmax(0, 1fr); }
.profile-media img { max-width: 340px; margin-inline: auto; }
.profile-extra { margin-top: 1.25rem; }
.ep-list.is-names a { grid-template-columns: minmax(0, 1fr); }
.ep-soon, .nav-soon { display: grid; grid-template-columns: 2rem 1fr; gap: .4rem; padding: .4rem .5rem; font-size: .92rem; line-height: 1.3; color: var(--text-muted); }
.ep-soon .num, .nav-soon .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.nav-soon { padding: .45rem .6rem; }
.toy-card.is-static { cursor: default; }
.toy-card.is-static:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }

/* Tables in rich text (character info, reviews) */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: .6rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text-muted); font-weight: 600; white-space: nowrap; background: var(--bg-sunken); }
.prose tr:last-child th, .prose tr:last-child td { border-bottom: 0; }
.prose td p { margin: 0 0 .5rem; }
.prose td p:last-child { margin-bottom: 0; }

/* Places */
.place h3 { font-size: 1.4rem; margin-bottom: .6rem; }
.place .gallery { margin-top: 1rem; }
.place .prose { max-width: none; }

/* 404 */
.not-found { text-align: center; margin-inline: auto; padding-block: clamp(2rem, 8vw, 5rem); }
.not-found .nf-art { margin: 0 auto 1rem; }
.not-found .lead { margin-inline: auto; }
.nf-cta { justify-content: center; }


/* ==========================================================================
   Touch (adapt): comfortable 44px hit areas wherever the primary input is a finger
   (and on any narrow viewport). Desktop pointer layouts are untouched.
   ========================================================================== */
@media (pointer: coarse), (max-width: 640px) {
  .breadcrumbs a { padding-block: .75rem; }
  .breadcrumbs ol { gap: 0 .5rem; }
  .site-footer ul { gap: 0; }
  .site-footer a { padding-block: .7rem; }
  a.chip, button.chip { min-height: 44px; }
  .toc a, .ep-list a { min-height: 44px; align-items: center; }
  .link-list a { padding-block: .8rem; }
  .nav-menu a { padding-block: .75rem; }
  .icon-btn { width: 44px; height: 44px; }
  .social a { width: 44px; height: 44px; }
  .theme-switch button { min-height: 44px; padding-inline: 1rem; }
  .btn { min-height: 44px; }
  .slider-dots button { width: 32px; height: 44px; }
  .slider-dots button[aria-current="true"] { width: 42px; }
  details.expand > summary { display: inline-block; padding-block: .75rem; }
  .gallery-more .btn { min-height: 48px; }
}

/* ==========================================================================
   Reduced motion (animate): fewer and gentler, not none. Movement (lifts, zooms, slides)
   goes; colour, border, opacity and other state feedback stays so interactions still confirm.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .tile:hover, .toy-card:hover, .pager a:hover, .faction:hover { transform: none; }
  .tile:hover img, .toy-card:hover img, .gallery a:hover img, .teaser:hover .teaser-media img { transform: none; }
  .nav-menu.is-open { animation: none; }
  .nav-trigger svg { transition: none; }
  .slider-dots button::before { transition: opacity .15s linear, background-color .15s linear; }
  .hero-rotator .hero-media img { transition-duration: .3s; }
  .lightbox, .lightbox * { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 1023px) {
  /* the mobile drawer fades instead of sliding */
  .site-nav { transform: none; opacity: 0; transition: opacity .15s linear, visibility .15s linear; }
  .site-nav.is-open { opacity: 1; }
}

/* ==========================================================================
   Hardening: long words/URLs never force sideways scroll, and navigation still works
   without JavaScript (the inline head script adds .js to <html>).
   ========================================================================== */
body { overflow-wrap: break-word; }
.prose a, .card a, .facts dd, .facts-grid dd { overflow-wrap: anywhere; }
.lb-stage img { background: rgb(255 255 255 / .04); }
.lb-error { color: rgb(255 255 255 / .85); padding: 2rem; text-align: center; }
.nav-fallback { display: none; list-style: none; margin: 0; padding: 0; }
html:not(.js) .nav-top, html:not(.js) .menu-toggle, html:not(.js) .theme-toggle, html:not(.js) .theme-switch,
html:not(.js) .nav-drawer-head, html:not(.js) .nav-backdrop { display: none; }
html:not(.js) .site-header .wrap { flex-wrap: wrap; height: auto; padding-block: .6rem; }
html:not(.js) .nav-fallback { display: flex; flex-wrap: wrap; gap: .15rem; }
@media (max-width: 1023px) {
  html:not(.js) .site-nav { position: static; inset: auto; transform: none; visibility: visible; width: auto; flex: 1 1 100%; order: 3;
    background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible; }
}

/* ==========================================================================
   Search, A-Z index, home routes and spotlights
   ========================================================================== */
p, li, blockquote { text-wrap: pretty; }   /* no one-word last lines */
kbd { display: inline-block; min-width: 1.6em; padding: .05rem .4rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-sunken); font: 600 .85em/1.4 var(--font-body); text-align: center; }
html:not(.js) .search-toggle { display: none; }
.section-head .muted { margin: 0; font-size: .95rem; }

/* Search dialog */
.search-dialog {
  width: min(680px, calc(100vw - 1.5rem)); max-height: min(78dvh, 640px); margin: 7vh auto auto; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
}
.search-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.search-dialog::backdrop { background: rgb(var(--scrim) / .6); }
.search-head { display: flex; align-items: center; gap: .5rem; padding: .85rem .85rem .5rem 1rem; }
.search-input {
  flex: 1; min-width: 0; padding: .75rem 1rem; font: 500 1.15rem/1.3 var(--font-body); color: var(--text);
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.search-input::placeholder { color: var(--text-muted); }
.search-status { margin: 0; padding: .25rem 1.25rem .75rem; color: var(--text-muted); font-size: .92rem; }
.search-status .chip { margin: .15rem .15rem 0 0; cursor: pointer; font: inherit; font-size: .875rem; }
.search-results { list-style: none; margin: 0; padding: 0 .5rem .75rem; overflow-y: auto; overscroll-behavior: contain; }
.search-results li { margin: 0; }
.search-results a { display: grid; gap: .2rem; padding: .7rem .85rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.search-results a:hover { background: var(--bg-sunken); color: var(--text); }
.search-results [aria-selected="true"] a { background: var(--bg-sunken); box-shadow: inset 0 0 0 2px var(--accent); }
.sr-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.sr-title { font: 700 1.3rem/1.2 var(--font-heading); }
.sr-kind { flex: none; font: 700 .7rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.sr-desc { color: var(--text-muted); font-size: .92rem; line-height: 1.45; }

/* A-Z index */
.az-letters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.az-letters .chip { min-width: 2.4rem; justify-content: center; }
.az-groups { columns: 3 220px; column-gap: 2rem; }
.az-groups section { break-inside: avoid; margin-bottom: 1.25rem; }
.az-groups h3 { margin: 0 0 .35rem; font-size: 1.6rem; color: var(--accent); }
.az-groups ul { list-style: none; margin: 0; padding: 0; }
.az-groups li { margin: 0; }
.az-groups a { display: inline-block; padding-block: .2rem; }
@media (pointer: coarse), (max-width: 640px) { .az-groups a { padding-block: .6rem; } .az-letters .chip { min-height: 44px; min-width: 44px; } }

/* Home: three routes */
.routes { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .routes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.route { display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; }
.route-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-brand); }
.route-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.route:hover .route-media img { transform: scale(1.04); }
.route-body { display: grid; gap: .6rem; align-content: start; padding: 1.1rem 1.25rem 1.3rem; }
.route-body > * { margin: 0; }
.route-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.route-title h3 { margin: 0; font-size: 2rem; }
.route-title h3 a { color: var(--text); text-decoration: none; }
.route-title h3 a:hover { color: var(--link); }
.route-links { list-style: none; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--border); margin-top: .35rem; }
.route-links li { margin: 0; border-bottom: 1px solid var(--border); }
.route-links a { display: block; padding: .6rem 0; text-decoration: none; font-weight: 600; }
.route-links a:hover { text-decoration: underline; }
@media (pointer: coarse), (max-width: 640px) { .route-links a { padding-block: .85rem; } }
@media (prefers-reduced-motion: reduce) { .route:hover .route-media img { transform: none; } }

/* Home: compact spotlights and story */
.spots .spot { align-content: start; }
.spot-label { margin: 0 0 .75rem; font-size: 1.15rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-body); font-weight: 700; }
.spot-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 1rem; align-items: start; }
.spot-media img { width: 112px; aspect-ratio: 247 / 180; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-sunken); }
.spot-row p { margin: 0 0 .4rem; }
.spot-name { font: 700 1.35rem/1.2 var(--font-heading); }
.spot-name a { color: var(--text); text-decoration: none; }
.spot-name a:hover { color: var(--link); }
.spot-row div > p:last-child { color: var(--text-muted); font-size: .95rem; }
.story { max-width: 78ch; margin-inline: auto; }
