/* BCDB: an animation archive. Warm paper, quiet rules, serif headings; the cartoon art supplies the colour. */
:root {
    --paper: #faf6ee;
    --panel: #fffdf8;
    --ink: #1f1c1a;
    --ink-soft: #645d55;
    --rule: #e3dac8;
    --rule-strong: #cdbfa6;
    --teal: #0e5a61;
    --teal-dark: #093e43;
    --red: #b0372c;
    --gold: #c2932f;
    --frame: #ece4d3;
    --radius: 6px;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); overflow-wrap: break-word; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.4rem; margin-top: 2.4rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule-strong); position: relative; }
h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 3px; background: var(--red); }
h3 { font-size: 1.08rem; margin-top: 1.5rem; }
p { margin: 0 0 .9em; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
section[id], h2[id] { scroll-margin-top: 16px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 12px; }

/* Header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--rule-strong); box-shadow: inset 0 -3px 0 var(--gold); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 10px; padding-bottom: 13px; }
.brand { display: block; line-height: 0; }
.brand img { height: 62px; width: auto; display: block; mix-blend-mode: multiply; }
.search { display: flex; flex: 1 1 300px; max-width: 480px; margin-left: auto; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; min-height: 44px; border: 1px solid var(--rule-strong); border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius); background: #fff; color: var(--ink); }
.search button, .button { font: 600 .95rem var(--sans); padding: 10px 18px; min-height: 44px; border: 1px solid var(--teal); background: var(--teal); color: #fff;
    border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.button { border-radius: var(--radius); }
.search button:hover, .button:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }

main.wrap { padding-top: 26px; padding-bottom: 80px; min-height: 60vh; }

/* Home */
.hero { padding: 6px 0 0; }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: .2em; }
.lede { color: var(--ink-soft); max-width: 62ch; margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 0; padding: 0; list-style: none;
    border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); }
.stats li { padding: 12px 16px; border-left: 1px solid var(--rule); }
.stats li:first-child { border-left: 0; }
.stats strong { display: block; font: 700 1.45rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stats span { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.directory { list-style: none; margin: 14px 0 0; padding: 0; columns: 3 250px; column-gap: 32px; }
.directory li { break-inside: avoid; }
.directory a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; min-height: 44px;
    border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.directory a strong { font: 700 1.05rem var(--serif); color: var(--teal); }
.directory a:hover strong { color: var(--red); }
.directory a span { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Artwork: whole image inside a consistent frame, never cropped */
.frame { display: grid; place-items: center; position: relative; aspect-ratio: 4 / 3; background: var(--frame); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
img.stand-in { filter: grayscale(.7) opacity(.7); }
.no-img { font: 700 .8rem var(--serif); letter-spacing: .14em; color: var(--rule-strong); }

.card-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 22px; }
.card-grid a { color: var(--ink); text-decoration: none; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; min-height: 44px; }
.card-grid .card-text { display: block; min-width: 0; }
.card-grid strong { display: block; font: 700 .98rem/1.25 var(--serif); }
.card-grid span.year { display: block; font-size: .8rem; color: var(--ink-soft); }
.card-grid a:hover strong { color: var(--red); }
.card-grid a:hover .frame { border-color: var(--rule-strong); }
.h2-note { font: 400 .9rem var(--sans); color: var(--ink-soft); margin-left: 8px; }

/* Studio and series tiles */
.tile-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 18px; }
.tile-grid a { display: block; text-decoration: none; color: var(--ink); }
.tile-grid strong { display: block; font: 700 1rem/1.25 var(--serif); margin-top: 8px; color: var(--teal); }
.tile-grid a:hover strong { color: var(--red); }
.tile-grid a:hover .frame { border-color: var(--rule-strong); }
.tile-grid .count { font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.two-col .tile-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.child-grid.thumbs li { align-items: center; padding: 5px 0; }
.child-grid.thumbs a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.child-grid.thumbs .frame { flex: 0 0 52px; width: 52px; }

/* Page heads */
.crumbs { font-size: .88rem; margin-bottom: 14px; display: flex; flex-wrap: wrap; row-gap: 2px; color: var(--ink-soft); }
.crumbs > * + *::before { content: "/"; margin: 0 8px; color: var(--rule-strong); }
.page-head { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.page-head > div { flex: 1 1 320px; min-width: 0; }
.poster-wrap { margin: 0; flex: 0 0 auto; width: min(320px, 100%); }
.poster-wrap .frame { aspect-ratio: auto; min-height: 120px; padding: 6px; background: var(--panel); border-color: var(--rule-strong); }
.poster-wrap .frame img { position: static; width: auto; height: auto; max-width: 100%; max-height: 440px; }
.poster-wrap.small { width: min(190px, 46%); }
.poster-wrap figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 0 0 .9em; font-size: .93rem; color: var(--ink-soft); }
.meta span + span::before { content: "·"; margin: 0 9px; color: var(--rule-strong); }
.meta a { color: var(--teal); }
.aka { margin-bottom: .35em; font-size: .97rem; }
.makers { margin: .7em 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: .97rem; }
.makers dt { color: var(--ink-soft); }
.makers dd { margin: 0; }
.prose { max-width: 70ch; }
.prose li { margin-bottom: .2em; }
.prose h4 { margin: 1em 0 .3em; font: 700 1rem var(--serif); }
.prose.two-up { max-width: none; columns: 2 380px; column-gap: 44px; }
.prose.two-up li { break-inside: avoid-column; }

.jump { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 18px 0 0; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .92rem; }
.jump span { color: var(--ink-soft); margin-right: 4px; align-self: center; }
.jump a { padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; text-decoration: none; background: var(--panel); min-height: 36px; display: inline-flex; align-items: center; }
.jump a:hover { border-color: var(--teal); color: var(--teal-dark); }

/* Lists */
.child-grid, .cartoon-list, .gallery, .plain { list-style: none; margin: 0; padding: 0; }
.child-grid { columns: 3 260px; column-gap: 32px; margin-top: 10px; }
.child-grid li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.child-grid .muted { font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cartoon-list { margin-top: 8px; }
.cartoon-list li { display: grid; grid-template-columns: 124px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.cartoon-list h3 { margin: 0 0 .2em; font-size: 1.1rem; }
.cartoon-list h3 a { text-decoration: none; }
.cartoon-list h3 a:hover { text-decoration: underline; }
.cartoon-list .meta { margin-bottom: .3em; font-size: .85rem; }
.thumb { text-decoration: none; }
.blurb { margin: 0; font-size: .93rem; color: var(--ink-soft); }

/* Cartoon page */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 44px; }
.side-col { margin-top: 2.4rem; }
.facts { margin: 0; background: var(--panel); border: 1px solid var(--rule); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.facts dd { margin: 0 0 .75em; font-weight: 600; overflow-wrap: anywhere; }
.facts dd:last-child { margin-bottom: 0; }
.facts-stats { margin: 1.2rem 0; border-top-color: var(--red, #b3312c); }
.facts-stats .small { font-weight: 400; }
.credit-group { margin-top: 1.1rem; }
.credit-group h3 { font: 600 .76rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--red); margin: 0 0 2px; }
.credits { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; margin: 0; border-top: 1px solid var(--rule); }
.credits dt, .credits dd { padding: 7px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.credits dt { color: var(--ink-soft); font-size: .92rem; padding-right: 16px; }
.plain li { padding: 3px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; margin-top: 14px; }
.gallery a { text-decoration: none; display: block; }
.gallery span { display: block; font-size: .84rem; color: var(--ink-soft); margin-top: 6px; }
.review { border-left: 3px solid var(--gold); padding-left: 16px; margin: 20px 0; }
.review h3 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

.prev-next, .pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.prev-next a { text-decoration: none; padding: 8px 0; max-width: 46%; }
.prev-next span:last-child { text-align: right; margin-left: auto; }
.pager a, .pager .disabled { padding: 9px 16px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--radius);
    text-decoration: none; background: var(--panel); color: var(--teal); font-weight: 600; }
.pager .disabled { color: var(--ink-soft); opacity: .45; }
.pager a:hover { border-color: var(--teal); }

/* Person page */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 10px; }
.tabs a { padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: 999px; text-decoration: none;
    color: var(--ink); background: var(--panel); font-weight: 600; font-size: .93rem; }
.tabs a span { color: var(--ink-soft); font-weight: 400; margin-left: 6px; }
.tabs a.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.tabs a.active span { color: #cfe6e4; }
.filmography { width: 100%; border-collapse: collapse; font-size: .95rem; }
.filmography th { text-align: left; font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); border-bottom: 1px solid var(--rule-strong); padding: 8px 12px 8px 0; }
.filmography td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.filmography td:first-child { width: 4.2em; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.filmography td a.series { color: var(--ink-soft); }
.filmography td a.series:hover { color: var(--red); }

.site-footer { border-top: 3px solid var(--gold); background: #24201d; color: #efe7d6; padding: 26px 0; font-size: .92rem; }
.site-footer p { margin: 0 0 .3em; }
.site-footer .muted { color: #b8ae9d; }

@media (max-width: 900px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cols { grid-template-columns: 1fr; gap: 0; }
    .side-col { margin-top: 1.6rem; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    .wrap { padding-left: 16px; padding-right: 16px; }
    .bar { gap: 8px; padding-top: 8px; }
    .brand img { height: 48px; }
    .search { flex-basis: 100%; max-width: none; }
    main.wrap { padding-top: 18px; padding-bottom: 56px; }
    .card-grid { grid-template-columns: 1fr; gap: 6px; }
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats li:nth-child(3) { border-left: 0; }
    .stats li:nth-child(n+3) { border-top: 1px solid var(--rule); }
    .stats strong { font-size: 1.25rem; }
    .cartoon-list li { grid-template-columns: 96px 1fr; gap: 12px; }
    .credits { grid-template-columns: 1fr; }
    .credits dt { border-bottom: 0; padding-bottom: 0; }
    .credits dd { padding-top: 2px; }
    .poster-wrap { width: 100%; }
    .poster-wrap.small { width: 46%; }
    .makers { grid-template-columns: 1fr; }
    .makers dt { margin-top: .4em; }
    .filmography th:nth-child(3), .filmography td:nth-child(3) { display: none; }
    .prev-next { flex-direction: column; align-items: stretch; }
    .prev-next a { max-width: none; }
    .prev-next span:last-child { text-align: left; margin-left: 0; }
}
