/* fullcastlibrary.com: one stylesheet, no framework. Colours from the Full Cast bookplate
   avatar (paper, navy ink, oxblood red). Light + dark follow the OS; the header toggle sets
   html[data-theme] and wins. Every animation is off under prefers-reduced-motion. */
:root {
  --bg: #f5efe1;
  --bg-2: #efe6d2;
  --surface: #fcf9f2;
  --ink: #1b2436;
  --muted: #586379;
  --accent: #8a2320;
  --accent-2: #b5483b;
  --accent-ink: #ffffff;
  --line: #dccfb4;
  --focus: #1c5fd1;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 14px rgba(40, 30, 10, .07);
  --shadow-lift: 0 4px 10px rgba(40, 30, 10, .10), 0 18px 38px rgba(40, 30, 10, .14);
  --radius: 14px;
  --radius-s: 9px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --bg-2: #171c25; --surface: #1b212d; --ink: #ece5d4; --muted: #a8b0c2;
    --accent: #eba597; --accent-2: #d9826f; --accent-ink: #14181f; --line: #2f384a; --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-lift: 0 6px 14px rgba(0, 0, 0, .35), 0 20px 40px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161d; --bg-2: #171c25; --surface: #1b212d; --ink: #ece5d4; --muted: #a8b0c2;
  --accent: #eba597; --accent-2: #d9826f; --accent-ink: #14181f; --line: #2f384a; --focus: #8ab4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lift: 0 6px 14px rgba(0, 0, 0, .35), 0 20px 40px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.18; font-weight: 700; letter-spacing: -.005em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: .5em 0 .25em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 2.6rem 0 .8rem; }
h2::after { content: ""; display: block; width: 2.4rem; height: 3px; margin-top: .45rem; border-radius: 2px; background: var(--accent); opacity: .8; }
p { text-wrap: pretty; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: .5rem 1rem; z-index: 20; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .85rem; color: var(--muted); }

/* sticky mini header */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), background-color .35s var(--ease);
}
header.site.scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.12rem; margin-right: auto; }
.brand img { border-radius: 50%; width: 36px; height: 36px; box-shadow: var(--shadow); }
header.site ul { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .3rem; margin: 0; padding: 0; }
header.site nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: .35rem .6rem; border-radius: 999px; display: inline-block; transition: background-color .2s var(--ease); }
header.site nav a:hover { background: var(--bg-2); }
header.site nav a[aria-current="page"] { background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--accent); }
button.theme { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .25s var(--ease), background-color .2s; }
button.theme:hover { transform: rotate(-18deg); background: var(--bg-2); }
button.theme .i-moon { display: none; }
:root[data-theme="dark"] button.theme .i-sun { display: none; }
:root[data-theme="dark"] button.theme .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button.theme .i-sun { display: none; }
  :root:not([data-theme="light"]) button.theme .i-moon { display: block; }
}
@media (max-width: 719px) {
  header.site { position: static; }
  .bar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  header.site ul { flex-wrap: nowrap; }
  header.site nav a { padding: .3rem .5rem; font-size: .92rem; white-space: nowrap; }
  .brand span { font-size: 1rem; }
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "\203A"; margin-right: .3rem; }
.crumbs a { color: var(--muted); }

main { padding-bottom: 4rem; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.22rem); max-width: 44rem; color: var(--ink); }
.frame { font-family: var(--serif); font-style: italic; font-size: 1.12rem; color: var(--muted); max-width: 42rem; border-left: 3px solid var(--accent); padding: .1rem 0 .1rem 1rem; margin: 1rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0; }
.more { margin-top: 1rem; }

/* buttons */
.cta { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: center; margin: 1.1rem 0; }
.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--accent); color: var(--accent-ink); padding: .62rem 1.15rem; border-radius: 999px; text-decoration: none; font-weight: 650; border: 1px solid var(--accent); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; }
.btn.ghost:hover { background: var(--surface); }

/* home hero */
.hero { display: grid; gap: 2rem; align-items: center; padding: 1.5rem 0 1rem; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 3rem; padding: 2.5rem 0 1.5rem; } }
.hero h1 { margin-top: .3em; }
.stats { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; color: var(--muted); font-size: .95rem; }
.stats strong { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; color: var(--ink); }
.collage { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; transform: rotate(-3deg); }
.collage li { border-radius: var(--radius-s); overflow: hidden; box-shadow: var(--shadow-lift); background: var(--line); aspect-ratio: 16 / 9; animation: rise .8s var(--ease) both; }
.collage li:nth-child(3n+2) { transform: translateY(1.1rem); }
.collage li:nth-child(2) { animation-delay: .08s; } .collage li:nth-child(3) { animation-delay: .16s; }
.collage li:nth-child(4) { animation-delay: .24s; } .collage li:nth-child(5) { animation-delay: .32s; }
.collage li:nth-child(6) { animation-delay: .4s; }
.collage img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) { .collage { grid-template-columns: repeat(3, 1fr); transform: none; } .collage li:nth-child(n+4) { display: none; } .collage li:nth-child(3n+2) { transform: none; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

/* section reveal (site.js adds .reveal-on only when it can also add .in) */
.reveal-on .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-on .reveal.in { opacity: 1; transform: none; }

/* book page */
.player { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0 0; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.unavailable { display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); padding: 1rem; aspect-ratio: auto; min-height: 10rem; box-shadow: none; }
.bookhead h1 { margin-top: .6em; }
.kind { display: block; font-size: .45em; font-weight: 500; color: var(--muted); font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; margin-top: .5rem; }
.sub, .stamps { margin: .2rem 0; color: var(--muted); }
.sub { font-size: 1.1rem; color: var(--ink); }
article.book section > p, main > section > p, main > p { max-width: 46rem; }

/* cast: portrait cards */
ul.castgrid { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { ul.castgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { ul.castgrid { grid-template-columns: repeat(3, 1fr); } }
.castcard { display: grid; grid-template-columns: 84px 1fr; gap: .9rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.castcard:hover, .castcard:focus-within { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.castcard .portrait { border-radius: var(--radius-s); overflow: hidden; aspect-ratio: 192 / 203; background: var(--line); }
.castcard .portrait img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.castcard:hover .portrait img, .castcard:focus-within .portrait img { transform: scale(1.07); }
.castcard .ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font: 700 1.8rem var(--serif); }
.castcard h3 { margin: .05rem 0 .3rem; font-size: 1.12rem; }
.castcard .voice { margin: 0; font-size: .93rem; line-height: 1.55; color: var(--muted); }
@media (min-width: 1000px) {
  .castcard { grid-template-columns: 96px 1fr; }
}

details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 600; }
dl.bits dt { font-weight: 600; margin-top: .6rem; }
dl.bits dd { margin: 0; max-width: 46rem; }
ol.chapters { columns: 2 16rem; column-gap: 2rem; padding-left: 0; list-style: none; margin: 0; }
ol.chapters li { break-inside: avoid; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
ol.chapters a { text-decoration: none; display: block; }
ol.chapters a:hover { text-decoration: underline; }
ol.chapters time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: .5rem; font-size: .9em; }
.sibs { list-style: none; padding: 0; }
dl.facts { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .55rem 1.4rem; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; max-width: 52rem; }
dl.facts dt { font-weight: 600; color: var(--muted); font-size: .92rem; }
dl.facts dd { margin: 0; }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: .5rem; } }

/* book cards */
ul.cards { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding-bottom: .8rem; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover, .card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card > a { display: block; text-decoration: none; color: var(--ink); }
.card > a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link target */
.card > a:focus-visible { outline: none; }
.card:has(> a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card .cover { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--line); }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover img, .card:focus-within img { transform: scale(1.06); }
.card .t { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; line-height: 1.25; padding: .75rem .9rem .1rem; }
.card p { margin: .1rem .9rem; font-size: .9rem; }
.card .by { color: var(--ink); }
.card .meta, .card .ch, .card .date { color: var(--muted); }

ul.channels, ul.links { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
ul.channels li, ul.links li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
ul.channels li:hover, ul.links li:hover, ul.channels li:focus-within, ul.links li:focus-within { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
ul.channels .avatar { border-radius: 50%; float: left; margin: 0 .9rem .4rem 0; box-shadow: var(--shadow); }
ul.channels h3, ul.links h3 { margin: 0 0 .3rem; font-size: 1.12rem; }
ul.channels p, ul.links p { margin: .2rem 0; font-size: .92rem; }
.empty { color: var(--muted); }
.note { background: var(--surface); border-left: 4px solid var(--accent); padding: .7rem 1rem; border-radius: 4px; max-width: 46rem; }
ol.steps { counter-reset: s; list-style: none; padding: 0; max-width: 46rem; }
ol.steps li { counter-increment: s; position: relative; padding: .2rem 0 .9rem 3rem; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 .95rem var(--serif); }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 1.6rem 0 2.4rem; font-size: .92rem; color: var(--muted); }
footer.site p { margin: .35rem 0; }
footer.site .fbrand { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.chanhead { display: flex; align-items: center; gap: 1rem; }
.chanhead .avatar { border-radius: 50%; flex: none; }
ul.links h2.h3 { margin: 0 0 .3rem; font-size: 1.12rem; }
ul.links h2.h3::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .card:focus-within, .castcard:hover, .castcard:focus-within, .btn:hover,
  ul.channels li:hover, ul.links li:hover, ul.channels li:focus-within, ul.links li:focus-within { transform: none; }
  .card:hover img, .card:focus-within img, .castcard:hover .portrait img, .castcard:focus-within .portrait img { transform: none; }
  button.theme:hover { transform: none; }
  .reveal-on .reveal { opacity: 1; transform: none; }
}
@media print { header.site { position: static; } .reveal-on .reveal { opacity: 1; transform: none; } }

/* YouTube action row under the player / on series pages */
.ytrow { display: flex; flex-wrap: wrap; gap: .6rem .7rem; align-items: center; margin: 1rem 0 0; }
.btn.yt { background: #0f0f0f; border-color: #0f0f0f; color: #fff; }
:root[data-theme="dark"] .btn.yt { background: #f1f1f1; border-color: #f1f1f1; color: #0f0f0f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.yt { background: #f1f1f1; border-color: #f1f1f1; color: #0f0f0f; } }
