:root {
  --bg: #07111f;
  --bg-soft: #0d1b2f;
  --panel: #10213a;
  --panel-2: #142844;
  --text: #f7fbff;
  --muted: #c7d2e5;
  --subtle: #94a8c4;
  --line: #31435f;
  --brand: #7dd3fc;
  --brand-strong: #38bdf8;
  --gold: #ffd166;
  --accent: #c4b5fd;
  --focus: #ffd166;
  --danger: #ffb4c0;
  --ok: #86efac;
  --shadow: 0 24px 60px rgb(0 0 0 / 0.28);
  --radius-lg: 28px;
  --radius-md: 18px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fffaf0;
    --bg-soft: #f5efe4;
    --panel: #ffffff;
    --panel-2: #f2eadf;
    --text: #172033;
    --muted: #41516b;
    --subtle: #5f708a;
    --line: #c9d2df;
    --brand: #005e8f;
    --brand-strong: #014f7a;
    --gold: #8a5700;
    --accent: #5b21b6;
    --focus: #7c3aed;
    --danger: #9f1239;
    --ok: #166534;
    --shadow: 0 24px 60px rgb(40 30 20 / 0.14);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #fffaf0;
  --bg-soft: #f5efe4;
  --panel: #ffffff;
  --panel-2: #f2eadf;
  --text: #172033;
  --muted: #41516b;
  --subtle: #5f708a;
  --line: #c9d2df;
  --brand: #005e8f;
  --brand-strong: #014f7a;
  --gold: #8a5700;
  --accent: #5b21b6;
  --focus: #7c3aed;
  --danger: #9f1239;
  --ok: #166534;
  --shadow: 0 24px 60px rgb(40 30 20 / 0.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 15% 0%, rgb(125 211 252 / 0.22), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgb(255 209 102 / 0.14), transparent 32rem),
    linear-gradient(145deg, var(--bg), var(--bg-soft));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
a:hover { color: var(--brand); }
p, h1, h2, h3, a, dd, dt, td, th, strong { overflow-wrap: anywhere; }
img, svg { max-width: 100%; height: auto; }
button, input, select { font: inherit; }
button, .button, nav a, input, select, .chip, .tag-link { min-height: 44px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--gold);
  color: #06101e;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #07111f;
  font-weight: 1000;
  letter-spacing: -0.04em;
}
.brand strong { display: block; line-height: 1.1; overflow-wrap: anywhere; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 1px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  padding: 9px 12px;
  font-weight: 800;
  text-decoration: none;
}
.site-nav a[aria-current="page"], .site-nav a:hover, .theme-toggle:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}
.theme-toggle { cursor: pointer; background: transparent; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; min-width: 0; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(280px, 0.64fr);
  gap: 22px;
  padding: clamp(38px, 7vw, 82px) 0 34px;
}
.surface, .hero-copy, .stat-panel, .panel, .browser, .item-hero, .notice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.055), rgb(255 255 255 / 0.025)), var(--panel);
  box-shadow: var(--shadow);
}
.hero-copy { padding: clamp(26px, 5vw, 54px); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.38rem, 7vw, 5.3rem); letter-spacing: -0.07em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.45rem); letter-spacing: -0.045em; }
h3 { font-size: 1.08rem; letter-spacing: -0.018em; }
.lede { max-width: 780px; color: var(--muted); font-size: clamp(1.04rem, 2vw, 1.24rem); }
.hero-search, .search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-search { margin: 26px 0 18px; }
.field { display: grid; gap: 7px; color: var(--muted); font-weight: 850; }
.hero-search .field, .search-row .field { flex: 1 1 260px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 12px 14px;
}
.button, button, .chip, .tag-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 850;
  text-decoration: none;
}
button { cursor: pointer; }
.button.primary, button.primary { border-color: transparent; background: linear-gradient(135deg, var(--brand-strong), var(--accent)); color: #ffffff; }
.hero-actions, .item-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-panel { padding: 22px; display: grid; gap: 12px; align-content: center; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.035); }
.stat strong { display: block; font-size: clamp(1.7rem, 4vw, 2.9rem); line-height: 1; }
.stat span { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-stats .stat strong { font-size: 1.4rem; }
.section, .page { padding: 34px 0; }
.page { padding-bottom: 70px; }
.section-head { max-width: 760px; margin-bottom: 18px; }
.section-head.split { display: flex; align-items: end; justify-content: space-between; gap: 16px; max-width: none; }
.section-head p, .card p, .muted, .page-title p, .note { color: var(--muted); }
.page-title { max-width: 850px; margin: 34px 0 22px; }
.page-title h1 { font-size: clamp(2.1rem, 5vw, 4.5rem); }
.shelf-grid, .card-grid, .pathway-grid { display: grid; gap: 16px; }
.shelf-grid, .pathway-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shelf-card, .pathway-card, .card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  overflow: clip;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.shelf-card, .pathway-card { min-height: 170px; padding: 20px; justify-content: space-between; }
.shelf-card:hover, .pathway-card:hover, .card:hover { transform: translateY(-3px); border-color: var(--brand); }
.shelf-card span, .pathway-card span { color: var(--gold); font-weight: 950; }
.shelf-card strong, .pathway-card strong { font-size: 1.33rem; letter-spacing: -0.03em; }
.shelf-card small, .pathway-card small { color: var(--muted); font-size: 0.95rem; }
.meta-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.meta-strip span, .status-badge { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted); font-size: 0.84rem; background: rgb(255 255 255 / 0.035); }
.status-badge.core { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.status-badge.review { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.editorial-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.editorial-map div { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgb(255 255 255 / 0.035); }
.editorial-map strong { display: block; font-size: 1.6rem; line-height: 1; }
.spotlight-list { display: grid; gap: 12px; }
.spotlight-list a { display: block; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgb(255 255 255 / 0.035); text-decoration: none; }
.spotlight-list small { display: block; color: var(--muted); margin-top: 3px; }
.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgb(125 211 252 / 0.18), rgb(255 209 102 / 0.13));
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.93; }
.media-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 32px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.68);
  color: #fff;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 950;
}
.card-body { padding: 18px; flex: 1; }
.card h3 a { text-decoration: none; }
.card-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.tag-row, .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row { margin-top: 12px; }
.tag-link, .chip {
  min-height: 34px;
  border-radius: 999px;
  color: var(--muted);
  background: rgb(255 255 255 / 0.035);
  font-size: 0.84rem;
  padding: 6px 10px;
}
.chip[aria-pressed="true"], .chip.active { background: var(--brand); border-color: transparent; color: #06101e; }
.notice-card { padding: 18px; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.notice-card strong { color: var(--gold); }
.two-column, .content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.two-column > *, .content-grid > *, .browser > *, .hero > *, .item-hero > * { min-width: 0; }
.panel { padding: 22px; min-width: 0; }
.prose p, .prose li, .prose dd, .prose td { color: var(--muted); }
.prose code { border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; background: var(--bg-soft); color: var(--text); }
.browser { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; padding: 18px; }
.filters { display: grid; gap: 17px; align-content: start; }
.filter-group strong { display: block; margin-bottom: 8px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.results-bar output { font-weight: 950; }
.empty-state { padding: 42px; text-align: center; border: 1px dashed var(--line); border-radius: 24px; color: var(--muted); }
[hidden] { display: none !important; }
.timeline-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.timeline-list li { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgb(255 255 255 / 0.035); }
.timeline-list time { color: var(--gold); font-weight: 900; font-size: 0.9rem; }
.timeline-list a { font-weight: 900; text-decoration: none; }
.timeline-list p { margin: 4px 0 0; }
.timeline-list .badge { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted); font-size: 0.84rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tag-link { min-height: 40px; }
.tag-size-1 { font-size: 0.85rem; }
.tag-size-2 { font-size: 0.92rem; }
.tag-size-3 { font-size: 1rem; }
.tag-size-4 { font-size: 1.08rem; }
.tag-size-5 { font-size: 1.16rem; }
.item-hero { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: center; padding: clamp(22px, 5vw, 42px); margin-top: 34px; }
.item-cover { margin: 0; border: 1px solid var(--line); border-radius: 24px; overflow: clip; background: var(--bg-soft); }
.item-cover img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.item-cover figcaption { padding: 10px; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.82rem; overflow-wrap: anywhere; }
.embed-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 18px; overflow: clip; background: var(--bg-soft); }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-placeholder { position: static; display: grid; place-items: center; min-height: 240px; padding: 24px; text-align: center; }
.embed-placeholder p { max-width: 560px; margin-inline: auto; }
.player-shell { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr); gap: 16px; align-items: start; }
.player-stage { border: 1px solid var(--line); border-radius: 22px; padding: 14px; background: var(--bg-soft); min-width: 0; }
.player-stage video, .player-stage audio, .player-stage iframe, .player-stage img { width: 100%; border: 0; border-radius: 16px; background: #000; }
.player-stage video { aspect-ratio: 16 / 9; display: block; }
.player-stage audio { display: block; min-height: 54px; background: transparent; }
.player-stage iframe { min-height: min(72vh, 760px); background: #fff; }
.player-stage img { display: block; max-height: 720px; object-fit: contain; background: var(--panel-2); }
.playlist { display: grid; gap: 8px; max-height: min(72vh, 760px); overflow: auto; padding-right: 4px; }
.playlist-button { justify-content: start; text-align: left; display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "icon title" "icon meta"; gap: 2px 8px; width: 100%; border-radius: 16px; }
.playlist-button span { grid-area: icon; align-self: start; }
.playlist-button strong { grid-area: title; overflow-wrap: anywhere; }
.playlist-button small { grid-area: meta; color: var(--muted); }
.playlist-button[aria-current="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 18%, var(--panel-2)); }
.fact-list { display: grid; gap: 10px; margin: 16px 0 0; }
.fact-list div { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fact-list dt { color: var(--muted); font-weight: 900; }
.fact-list dd { margin: 0; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; }
caption { padding: 12px 14px; text-align: left; color: var(--muted); font-weight: 850; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
th { color: var(--gold); font-size: 0.83rem; letter-spacing: 0.08em; text-transform: uppercase; }
td { overflow-wrap: anywhere; }
.quality-list { display: grid; gap: 12px; }
.quality-list article { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgb(255 255 255 / 0.035); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.prev-next a { border: 1px solid var(--line); border-radius: 18px; padding: 14px; color: var(--muted); text-decoration: none; background: var(--panel); }
.site-footer { width: min(1180px, calc(100% - 32px)); margin: 42px auto 24px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; color: var(--muted); }
.site-footer strong { color: var(--text); }
.footer-links { display: flex; gap: 10px; flex-wrap: wrap; align-content: start; justify-content: end; }
.footer-links a { color: var(--text); font-weight: 850; text-decoration: none; }
.medical-notice { margin-top: 10px; color: var(--gold); font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 980px) {
  .hero, .two-column, .content-grid, .browser, .item-hero, .player-shell { grid-template-columns: 1fr; }
  .shelf-grid, .pathway-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editorial-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-cover { max-width: 360px; }
}
@media (max-width: 680px) {
  body { overflow-x: hidden; }
  main, .site-footer { width: min(100% - 24px, 1180px); }
  .site-header { flex-wrap: wrap; padding-inline: 12px; }
  .brand { flex: 1 1 auto; }
  .brand strong { font-size: 0.96rem; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .site-nav a { flex: 0 0 auto; }
  h1 { letter-spacing: -0.045em; }
  .hero { padding-top: 24px; }
  .shelf-grid, .pathway-grid, .card-grid, .prev-next, .editorial-map { grid-template-columns: 1fr; }
  .timeline-list li { grid-template-columns: 1fr; }
  .fact-list div { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: start; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .button, button, .chip, .tag-link, nav a, input, select { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
