/* Characters.biz — design system
   Tokens on :root, dark mode via prefers-color-scheme and [data-theme]. Category accent comes from --hue. */

:root {
  --hue: 230;
  --bg: #faf7f2;
  --bg-2: #f3eee5;
  --surface: #ffffff;
  --ink: #17151f;
  --ink-2: #3b3846;
  --muted: #6a6676;
  --line: #e6dfd3;
  --line-2: #d8cfc0;
  --accent: hsl(var(--hue) 68% 44%);
  --accent-ink: hsl(var(--hue) 70% 32%);
  --accent-soft: hsl(var(--hue) 85% 95%);
  --accent-line: hsl(var(--hue) 60% 85%);
  --shadow: 0 1px 2px rgb(23 21 31 / .05), 0 6px 20px -8px rgb(23 21 31 / .12);
  --shadow-lg: 0 2px 4px rgb(23 21 31 / .06), 0 22px 50px -18px rgb(23 21 31 / .28);
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono-l: 50%;
  --mono-s: 62%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131219; --bg-2: #1a1922; --surface: #1d1c26; --ink: #f2f0f7; --ink-2: #d4d1de; --muted: #a29fb1;
    --line: #2d2b38; --line-2: #3a3747;
    --accent: hsl(var(--hue) 80% 68%); --accent-ink: hsl(var(--hue) 85% 76%);
    --accent-soft: hsl(var(--hue) 35% 17%); --accent-line: hsl(var(--hue) 30% 30%);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -10px rgb(0 0 0 / .5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 24px 60px -20px rgb(0 0 0 / .7);
    --mono-l: 38%; --mono-s: 45%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131219; --bg-2: #1a1922; --surface: #1d1c26; --ink: #f2f0f7; --ink-2: #d4d1de; --muted: #a29fb1;
  --line: #2d2b38; --line-2: #3a3747;
  --accent: hsl(var(--hue) 80% 68%); --accent-ink: hsl(var(--hue) 85% 76%);
  --accent-soft: hsl(var(--hue) 35% 17%); --accent-line: hsl(var(--hue) 30% 30%);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -10px rgb(0 0 0 / .5);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 24px 60px -20px rgb(0 0 0 / .7);
  --mono-l: 38%; --mono-s: 45%;
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
button { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
svg { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

/* ------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 700 20px/1 var(--display); letter-spacing: -.03em; flex-shrink: 0; }
.logo b { color: var(--accent); font-weight: 700; }
.logo-mark { width: 30px; height: 30px; stroke: none; }
.logo-mark * { stroke: none; }
.logo-mark path[stroke] { stroke: var(--bg); }
.nav { flex: 1; min-width: 0; }
.nav-list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-btn { background: none; border: 0; padding: 8px 11px; border-radius: 999px; cursor: pointer; font-weight: 550; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.nav-btn:hover, .nav-item:focus-within .nav-btn, .nav-item.open .nav-btn { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.is-active .nav-btn { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.mega { position: fixed; top: 60px; left: 50%; margin-left: max(-440px, -46vw); width: min(880px, 92vw); max-height: calc(100vh - 80px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 18px; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .16s ease; }
.mega::before { content: ""; position: absolute; inset: -22px 0 auto; height: 22px; }
.nav-item:hover .mega, .nav-item.open .mega { opacity: 1; visibility: visible; transform: none; }
.mega-head { display: grid; gap: 2px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.mega-head strong { font-family: var(--display); font-size: 17px; color: var(--accent-ink); }
.mega-head span { font-size: 14px; color: var(--muted); }
.mega ul { list-style: none; margin: 0; padding: 0; columns: 4 170px; column-gap: 12px; }
.mega a { display: block; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: 15px; break-inside: avoid; }
.mega a:hover, .mega a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
.header-tools { display: flex; gap: 6px; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; justify-content: center; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.icon-btn svg { width: 19px; height: 19px; }
.kbd { font: 600 12px/1 var(--font); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px; color: var(--muted); }
.menu-toggle { display: none; }

@media (max-width: 1060px) {
  .nav { position: fixed; inset: 64px 0 0; background: var(--bg); overflow-y: auto; padding: 12px 16px 40px; display: none; }
  body.menu-open .nav { display: block; }
  body.menu-open { overflow: hidden; }
  .nav-list { flex-direction: column; gap: 4px; }
  .nav-btn { width: 100%; text-align: left; font-size: 18px; padding: 12px 14px; border-radius: 10px; font-family: var(--display); }
  .nav-item.is-active .nav-btn { box-shadow: none; }
  .mega { position: static; width: auto; margin-left: 0; max-height: none; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; margin: 4px 0 10px; }
  .nav-item:hover .mega { display: none; }
  .nav-item.open .mega { display: block; }
  .menu-toggle { display: inline-flex; }
  .kbd { display: none; }
}

/* ------------------------------------------------------------ search */
.search-panel { position: fixed; inset: 0; z-index: 80; background: rgb(10 9 15 / .45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-panel[hidden] { display: none; }
.search-box { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.search-field svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.search-field input { flex: 1; min-width: 0; height: 58px; border: 0; background: none; font-size: 18px; color: var(--ink); outline: none; }
.search-close { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 7px; font-size: 12px; padding: 4px 8px; cursor: pointer; color: var(--muted); }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); }
.search-results .r-title { font-weight: 650; }
.search-results .r-title small { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 13px; }
.search-results .r-desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .r-hit { font-size: 13px; color: var(--accent-ink); }
.search-results .r-empty { padding: 18px 12px; color: var(--muted); }

/* ------------------------------------------------------------ hero */
.hero { position: relative; padding: 34px 0 30px; border-bottom: 1px solid var(--line); background:
  radial-gradient(1000px 300px at 85% -60px, hsl(var(--hue) 90% 70% / .22), transparent 70%),
  radial-gradient(600px 240px at 0% 0%, hsl(calc(var(--hue) + 40) 90% 70% / .12), transparent 70%); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(hsl(var(--hue) 40% 50% / .16) 1px, transparent 1.4px); background-size: 18px 18px; mask-image: linear-gradient(100deg, transparent 45%, #000 100%); -webkit-mask-image: linear-gradient(100deg, transparent 45%, #000 100%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; gap: 28px; }
.hero-profile .hero-grid { grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero-profile .hero-grid { grid-template-columns: 1fr 340px; align-items: start; } }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; margin: 10px 0 14px; max-width: 18ch; }
.hero-home h1 { max-width: 16ch; font-size: clamp(38px, 7.5vw, 74px); }
.lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 62ch; margin: 0 0 18px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 4px; opacity: .5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 5px 10px; border-radius: 999px; text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 14px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta span + span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); margin-right: 12px; }
.meta b { color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.quick li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 14px; box-shadow: var(--shadow); }
.quick a { text-decoration: none; font-weight: 600; }

.infobox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.infobox dl { margin: 14px 0 0; display: grid; gap: 0; }
.infobox dl div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.infobox dt { color: var(--muted); font-weight: 600; }
.infobox dd { margin: 0; }

.home-search { position: relative; max-width: 560px; margin: 6px 0 0; }
.home-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--muted); }
.home-search input { width: 100%; height: 60px; padding: 0 20px 0 52px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 18px; color: var(--ink); box-shadow: var(--shadow); }
.home-search input:focus { outline: 3px solid var(--accent-line); border-color: var(--accent); }

/* ------------------------------------------------------------ layout */
.layout { display: grid; gap: 40px; padding-top: 34px; padding-bottom: 20px; }
.layout.has-toc { grid-template-columns: 1fr; }
@media (min-width: 1060px) {
  .layout.has-toc { grid-template-columns: 230px minmax(0, 1fr); }
}
.prose { min-width: 0; max-width: 820px; }
.layout:not(.has-toc) .prose { margin: 0 auto; }
.toc { display: none; }
@media (min-width: 1060px) {
  .toc { display: block; }
  .toc-inner { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 6px; }
}
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------ prose */
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; margin: 2.2em 0 .55em; padding-top: .2em; }
.prose h3 { font-size: 21px; font-weight: 700; margin: 1.6em 0 .4em; }
.prose h4 { font-size: 17px; margin: 1.3em 0 .3em; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-size: 19px; font-style: italic; color: var(--ink); }
.prose section { margin: 0; }
.legal h2 { font-size: 24px; }

/* intro block */
.intro { font-size: 18.5px; }
.intro p:first-child::first-letter { font-family: var(--display); font-weight: 800; float: left; font-size: 3.3em; line-height: .86; margin: 4px 8px 0 0; color: var(--accent); }

/* callouts */
.note, .tip, .warn { margin: 1.5em 0; padding: 16px 18px 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }
.note::before, .tip::before, .warn::before { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.note::before { content: "Good to know"; }
.tip::before { content: "Tip"; }
.warn::before { content: "Spoiler warning"; }
.warn { border-color: hsl(38 80% 70%); background: hsl(45 100% 94%); }
.warn::before { color: hsl(30 80% 32%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warn { background: hsl(40 40% 15%); border-color: hsl(40 40% 30%); } :root:not([data-theme="light"]) .warn::before { color: hsl(42 90% 70%); } }
:root[data-theme="dark"] .warn { background: hsl(40 40% 15%); border-color: hsl(40 40% 30%); }
:root[data-theme="dark"] .warn::before { color: hsl(42 90% 70%); }

/* key facts */
.facts-box { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.5em 0 2em; }
.facts-box div { flex: 1 1 150px; padding: 14px 16px; box-shadow: 1px 1px 0 var(--line); }
.facts-box dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts-box dd { margin: 4px 0 0; font-weight: 600; color: var(--ink); line-height: 1.35; }

/* ------------------------------------------------------------ character cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 1.2em 0 2em; }
.char { position: relative; display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.char:hover { border-color: var(--accent-line); }
.char > :not(.mono) { grid-column: 2; }
.char .mono { grid-row: 1 / span 2; }
.char h3 { margin: 2px 0 2px; font-size: 19px; }
.char .role { margin: 0 0 8px; font-size: 13.5px; font-weight: 650; color: var(--accent-ink); letter-spacing: .01em; }
.char p { font-size: 15.5px; line-height: 1.55; margin: 0 0 .6em; }
.char p:last-child { margin-bottom: 0; }
.char ul.tags, .char .tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; }
.char .tags li { margin: 0; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.char dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0 0; font-size: 14px; }
.char dt { color: var(--muted); font-weight: 600; }
.char dd { margin: 0; color: var(--ink-2); }
.char a { font-weight: 600; }
.char.featured { grid-column: 1 / -1; border-color: var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.cards.compact .char { padding: 13px 15px; grid-template-columns: 42px 1fr; }
.cards.compact .mono { width: 42px; height: 42px; font-size: 15px; }
.cards.compact .char p { font-size: 14.5px; }
.char[hidden] { display: none; }

.mono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font: 800 18px/1 var(--display); letter-spacing: -.02em; color: #fff; background: linear-gradient(140deg, hsl(var(--mh) var(--mono-s) calc(var(--mono-l) + 8%)), hsl(calc(var(--mh) + 35) var(--mono-s) var(--mono-l))); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .14); }
.mono-xl { width: 76px; height: 76px; font-size: 28px; border-radius: 22px; }

/* roster toolbar (generated by JS for [data-filterable]) */
.roster-tools { position: sticky; top: 72px; z-index: 5; display: grid; gap: 10px; padding: 12px; margin: 1.2em 0 -0.6em; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); }
.roster-tools .rt-row { display: flex; gap: 10px; align-items: center; }
.roster-tools input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 16px; }
.roster-tools input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.roster-tools .rt-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.roster-tools .rt-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.roster-tools .rt-chips::-webkit-scrollbar { display: none; }
.chip-btn { flex-shrink: 0; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.roster-empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 1.2em 0 2em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap caption { text-align: left; padding: 12px 16px 0; font-size: 13px; color: var(--muted); caption-side: bottom; padding-bottom: 12px; }
.table-wrap th, .table-wrap td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap thead th { position: sticky; top: 0; background: var(--bg-2); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--accent-soft); }
.table-wrap td:first-child { font-weight: 600; color: var(--ink); }
tr.is-today { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* ------------------------------------------------------------ A–Z lists */
.az-bar { position: sticky; top: 72px; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; margin: 1.2em 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); }
.az-bar a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.az-bar a:hover { background: var(--accent); color: var(--bg); }
.az h3 { font-size: 30px; color: var(--accent); margin: 1.2em 0 .3em; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.az ul { list-style: none; padding: 0; columns: 2 260px; column-gap: 28px; }
.az li { break-inside: avoid; padding: 7px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.az li small, .az .src { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; margin-left: 4px; }
.badge.b1 { background: hsl(212 85% 94%); color: hsl(212 70% 35%); border-color: hsl(212 60% 85%); }
.badge.b2 { background: hsl(145 60% 92%); color: hsl(145 60% 26%); border-color: hsl(145 40% 80%); }
.badge.b3 { background: hsl(345 85% 94%); color: hsl(345 60% 38%); border-color: hsl(345 60% 86%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.b1, :root:not([data-theme="light"]) .badge.b2, :root:not([data-theme="light"]) .badge.b3 { filter: invert(.88) hue-rotate(180deg); } }
:root[data-theme="dark"] .badge.b1, :root[data-theme="dark"] .badge.b2, :root[data-theme="dark"] .badge.b3 { filter: invert(.88) hue-rotate(180deg); }

/* ------------------------------------------------------------ tier lists */
.tiers { margin: 1.2em 0 2em; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.tier { display: grid; grid-template-columns: 64px 1fr; border-bottom: 1px solid var(--line); }
.tier:last-child { border-bottom: 0; }
.tier-label { display: grid; place-items: center; font: 800 26px/1 var(--display); color: #1a1a1a; }
.tier[data-tier="S"] .tier-label { background: #ff7f7f; }
.tier[data-tier="A"] .tier-label { background: #ffbf7f; }
.tier[data-tier="B"] .tier-label { background: #ffdf7f; }
.tier[data-tier="C"] .tier-label { background: #bfff7f; }
.tier[data-tier="D"] .tier-label { background: #7fbfff; }
.tier ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 12px; margin: 0; align-content: center; }
.tier li { margin: 0; padding: 6px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------ steps / timeline / compare */
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.steps > li { counter-increment: step; position: relative; padding: 14px 16px 14px 60px !important; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 !important; }
.steps > li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--bg); font: 800 15px/1 var(--display); }
.timeline { list-style: none; padding: 0 0 0 22px !important; border-left: 2px solid var(--accent-line); margin-left: 6px !important; }
.timeline > li { position: relative; margin: 0 0 18px !important; }
.timeline > li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.timeline strong:first-child { display: block; font-family: var(--display); color: var(--accent-ink); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.2em 0 2em; }
.compare > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.compare h3, .compare h4 { margin-top: 0; }

/* ------------------------------------------------------------ page cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; margin: 1em 0 2em; }
.pcard { position: relative; display: grid; align-content: start; gap: 6px; padding: 16px 18px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, hsl(var(--hue) 75% 55%), hsl(calc(var(--hue) + 40) 80% 60%)); }
.pcard:hover { transform: translateY(-2px); border-color: hsl(var(--hue) 60% 75%); box-shadow: var(--shadow-lg); }
.pcard-cat { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: hsl(var(--hue) 60% 42%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcard-cat { color: hsl(var(--hue) 80% 72%); } }
:root[data-theme="dark"] .pcard-cat { color: hsl(var(--hue) 80% 72%); }
.pcard-title { font: 700 19px/1.2 var(--display); letter-spacing: -.015em; }
.pcard-blurb { font-size: 14.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pgrid-feature { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }

.related { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 10px; }
.related h2 { font-size: 30px; font-weight: 800; }

/* ------------------------------------------------------------ FAQ */
.faq { margin-top: 2.6em; }
.faq details { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); margin: 0 0 10px; overflow: hidden; }
.faq summary { cursor: pointer; list-style: none; padding: 15px 48px 15px 18px; font-weight: 650; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 400 24px/1 var(--font); color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--ink-2); }
.faq details > div > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ quiz */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 1.4em 0 2em; box-shadow: var(--shadow); }
.quiz-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.quiz-head h3 { margin: 0; }
.quiz-progress { font-size: 14px; color: var(--muted); }
.quiz-bar { height: 6px; background: var(--bg-2); border-radius: 99px; margin: 12px 0 18px; overflow: hidden; }
.quiz-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.quiz-q { font: 700 20px/1.3 var(--display); margin: 0 0 14px; color: var(--ink); }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; padding: 13px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); cursor: pointer; font-size: 16px; color: var(--ink); }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt.right { border-color: hsl(145 55% 45%); background: hsl(145 60% 92%); color: hsl(145 60% 20%); }
.quiz-opt.wrong { border-color: hsl(355 70% 60%); background: hsl(355 90% 95%); color: hsl(355 60% 30%); }
.quiz-explain { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); font-size: 15px; color: var(--ink-2); }
.quiz-next, .btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--bg); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-ghost { background: none; border: 1px solid var(--line-2); color: var(--ink); }
.quiz-result { text-align: center; padding: 10px 0; }
.quiz-score { font: 800 56px/1 var(--display); color: var(--accent); margin: 6px 0; }
.quiz-start p { margin: 6px 0 0; }

/* ------------------------------------------------------------ home */
.home .hero { padding: 54px 0 46px; }
.home-sections { padding-top: 40px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.shelves { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); margin: 16px 0 10px; }
.shelf { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.shelf::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: hsl(var(--hue) 75% 55%); }
.shelf-head h2 { font-size: 23px; margin: 0 0 4px; }
.shelf-head p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.shelf-head a { font-size: 14px; font-weight: 700; color: hsl(var(--hue) 60% 40%); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0 0; }
.chips a { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.chips a:hover { border-color: hsl(var(--hue) 60% 60%); background: hsl(var(--hue) 85% 95%); color: hsl(var(--hue) 70% 30%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chips a:hover { background: hsl(var(--hue) 35% 18%); color: hsl(var(--hue) 85% 80%); } :root:not([data-theme="light"]) .shelf-head a { color: hsl(var(--hue) 80% 72%); } }
:root[data-theme="dark"] .chips a:hover { background: hsl(var(--hue) 35% 18%); color: hsl(var(--hue) 85% 80%); }
:root[data-theme="dark"] .shelf-head a { color: hsl(var(--hue) 80% 72%); }

/* ------------------------------------------------------------ footer */
.site-footer { margin-top: 70px; background: var(--bg-2); border-top: 1px solid var(--line); padding: 48px 0 28px; font-size: 15px; }
.foot-top { display: grid; gap: 36px; }
@media (min-width: 960px) { .foot-top { grid-template-columns: 300px 1fr; } }
.foot-brand p { color: var(--muted); margin: 14px 0; }
.foot-mini, .foot-cols ul, .foot-bottom ul { list-style: none; padding: 0; margin: 0; }
.foot-mini { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.foot-cols h2 { font-size: 14px; letter-spacing: .02em; margin: 0 0 10px; }
.foot-cols li { margin: 4px 0; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.foot-more { display: inline-block; margin-top: 8px; font-weight: 700; }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13.5px; }
.foot-bottom p { margin: 0; max-width: 70ch; }
.foot-bottom ul { display: flex; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------ misc */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; color: var(--ink); }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }
.born-today { margin: 1.2em 0 2em; padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent-line); }
.born-today h3 { margin: 0 0 6px; }
.born-today ul { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .site-header, .site-footer, .toc, .related, .roster-tools, .az-bar, .to-top { display: none !important; } }
.hero-home h1 em { font-style: normal; color: var(--accent); }
.profiles-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.profiles-strip span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.profiles-strip a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 650; text-decoration: none; }
.profiles-strip a::after { content: "→"; opacity: .8; }
.profiles-strip a:hover { filter: brightness(1.08); }
