:root {
  color-scheme: dark;
  --ink: #f4efe5;
  --muted: #b8b0a3;
  --paper: #0d0f12;
  --surface: #16191e;
  --surface-raised: #1d2127;
  --line: #383d45;
  --brand: #d8ab55;
  --accent: #f0c66f;
  --soft: #252a31;
  --danger: #ffb4ab;
  --success: #a8d5b5;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
  --canvas: min(1180px, calc(100% - 2.5rem));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: #ffe0a1; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button, .button-link {
  min-height: 44px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  padding: .62rem 1rem;
  background: var(--brand);
  color: #11100d;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button-link:hover { background: var(--accent); color: #11100d; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  background: var(--accent);
  color: #111;
  padding: .6rem .9rem;
  border-radius: .5rem;
}
.skip-link:focus { transform: none; }

.site-header {
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(13,15,18,.95);
}
.masthead {
  width: var(--canvas);
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: .78rem; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(240,198,111,.7);
  border-radius: 50%;
  color: var(--accent);
  font: 700 .75rem/1 Georgia, serif;
  letter-spacing: .08em;
}
.brand-name { font: 700 1.45rem/1 Georgia, "Times New Roman", serif; letter-spacing: .02em; }
.brand-note { display: none; }
.nav-wrap { border-top: 1px solid rgba(255,255,255,.06); }
.site-nav {
  width: var(--canvas);
  margin: 0 auto;
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.site-nav a {
  display: block;
  flex: 0 0 auto;
  padding: .8rem .9rem .72rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 700;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.site-nav a[href="about.html"] { display: none; }

main { width: var(--canvas); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5.5rem) 0 4rem; }
.page-kicker {
  margin: 0 0 .5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .76rem;
  font-weight: 800;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.12; text-wrap: balance; }
h1 { max-width: 18ch; margin: 0; font-size: clamp(2.5rem, 7vw, 5.8rem); letter-spacing: -.035em; }
h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.4rem); }
h3 { margin: 0; font-size: 1.28rem; }
p { margin: .55rem 0 0; }
.lede { max-width: 68ch; margin-top: 1.25rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.23rem); }
.page-header { margin-bottom: clamp(2rem, 5vw, 4rem); }
.page-header .lede { max-width: 62ch; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  min-height: 440px;
}
.hero-poster {
  position: relative;
  justify-self: end;
  width: min(330px, 100%);
}
.hero-poster::before {
  content: "";
  position: absolute;
  inset: 8% -10% -7%;
  border: 1px solid rgba(216,171,85,.35);
  border-radius: var(--radius);
  z-index: -1;
}
.poster-frame { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.poster-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}
.poster-caption { margin-top: .8rem; color: var(--muted); font-size: .78rem; }

.section { margin-top: clamp(3.5rem, 8vw, 6.5rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.section-head p { max-width: 55ch; color: var(--muted); }
.text-link { font-weight: 750; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0,0,0,.13);
}
.card p, .card li { color: var(--muted); }
.card > :first-child { margin-top: 0; }
.card-link { color: var(--ink); text-decoration-color: rgba(240,198,111,.5); }
.movie-card { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: 1rem; }
.movie-card .poster-frame { border-radius: 11px; align-self: start; }
.movie-card h3 { margin-top: .1rem; }
.watchlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.watchlist-section { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.watchable-card { position: relative; height: 100%; }
body:has(.site-nav a[href="watched.html"][aria-current="page"]):has(#watchable-search) .watchable-card {
  margin-bottom: 1rem;
}
.watchable-card.is-watched,
.collection-card.is-watched,
.year-grid .filmography-card.is-watched {
  position: relative;
  border-color: rgba(86, 196, 126, .62);
  box-shadow: 0 12px 30px rgba(34, 139, 84, .14), inset 0 0 0 1px rgba(86, 196, 126, .12);
}
.watched-ribbon {
  position: absolute;
  top: .7rem;
  left: .7rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: .32rem .62rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: #257a49;
  color: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .32);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.compact-poster { width: 110px; min-height: 165px; }
.poster-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 240px;
  aspect-ratio: 2 / 3;
  padding: 1rem;
  background: linear-gradient(145deg, #222832, #111318);
  color: var(--accent);
  text-align: center;
}
.poster-placeholder span { font: 700 clamp(1.7rem, 4vw, 3.5rem)/1 Georgia, serif; letter-spacing: .08em; }
.poster-placeholder small { margin-top: .7rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.actor-header { padding-top: 1.2rem; }
.back-link { display: inline-block; margin-bottom: 1.1rem; font-weight: 750; }
.research-note { display: grid; grid-template-columns: minmax(240px, .65fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.research-note p:last-child { margin-top: 0; }
.filmography-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.filmography-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.filmography-poster {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #090a0c;
}
.filmography-poster img { width: 100%; height: 100%; object-fit: contain; }
.filmography-copy { display: flex; flex: 1; flex-direction: column; padding: 1.25rem; }
.filmography-copy .text-link { align-self: flex-start; margin-top: auto; padding-top: 1rem; white-space: normal; }
.filmography-copy .role { color: var(--ink); font: 1.04rem/1.45 Georgia, serif; }
.discovery-header { position: relative; }
.discovery-header::after {
  content: "";
  display: block;
  width: min(14rem, 42vw);
  height: 2px;
  margin-top: 2rem;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.discovery-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 1.25rem;
}
.discovery-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(160deg, var(--surface-raised), var(--surface));
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.discovery-card:hover {
  transform: translateY(-5px);
  border-color: rgba(240,198,111,.65);
  box-shadow: 0 22px 48px rgba(0,0,0,.3);
}
.discovery-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.discovery-card-link:hover { color: inherit; }
.cover-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: clamp(190px, 24vw, 260px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #08090b;
}
.cover-collage::after {
  content: "";
  position: absolute;
  inset: 38% 0 0;
  background: linear-gradient(transparent, rgba(13,15,18,.88));
  pointer-events: none;
}
.cover-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.04);
}
.cover-collage img:nth-child(even) { transform: translateY(12px) scale(1.04); }
.discovery-card-copy { padding: 1.45rem; }
.discovery-card-copy h2 { margin-top: .35rem; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.discovery-card-copy p:not(.eyebrow) { min-height: 4.8em; }
.discovery-card-cta {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.25rem;
  color: var(--accent);
  font-weight: 800;
}
.collection-boundary { margin: 0 0 2rem; }
.collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.collection-card .filmography-copy > p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.collection-card .tag-list { margin-top: 1rem; }
.king-header h1 { max-width: 15ch; }
.compact-facts { margin: 1rem 0 0; }
.compact-facts dt { padding-top: .68rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.compact-facts dd { margin: .22rem 0 .68rem; color: var(--ink); }
.warning-note { padding-left: .7rem; border-left: 2px solid var(--brand); color: var(--muted); }
.year-nav {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  overflow-x: auto;
}
.year-nav span { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.year-nav a { padding: .28rem .72rem; border-radius: 999px; background: var(--soft); font-weight: 800; text-decoration: none; }
.year-discovery { scroll-margin-top: 1rem; }
.year-grid { margin-top: 1rem; }
.ranking-number { margin: .35rem 0 0; color: var(--accent); font: 700 clamp(3rem, 7vw, 5.5rem)/1 Georgia, serif; }
.detail-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.detail-section h2 { margin-bottom: .85rem; font-size: clamp(1.45rem, 3vw, 2rem); }
.boundary-note { padding: 1.3rem; border: 1px solid rgba(216,171,85,.45); border-radius: var(--radius); background: var(--surface); }
.boundary-note h2 { margin-top: .2rem; }
.source-list { padding-left: 1.2rem; }
.source-list li { margin: .45rem 0; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.meta { display: flex; flex-wrap: wrap; gap: .45rem .75rem; margin-top: .7rem; color: var(--muted); font-size: .9rem; }
.rating { color: var(--accent); font-weight: 850; }
.card-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin: .75rem 0;
  padding: .7rem .85rem;
  border: 1px solid rgba(240,198,111,.55);
  border-radius: 10px;
  background: rgba(240,198,111,.1);
  box-shadow: inset 0 0 20px rgba(240,198,111,.05);
}
.card-rating span { font-size: 1.18rem; letter-spacing: .08em; }
.card-rating strong { color: var(--ink); font-size: 1rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.tag { padding: .26rem .58rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; }
.status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 750;
}
.status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
.status.ready::before { background: var(--success); }
.status.unknown::before { background: var(--muted); }

.metric { padding: 1.4rem; border-top: 2px solid var(--brand); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.metric strong { display: block; font: 700 2.45rem/1 Georgia, serif; color: var(--accent); }
.metric span { display: block; margin-top: .65rem; color: var(--muted); }
.empty-state { border-style: dashed; background: rgba(29,33,39,.45); }
.empty-state h3 { color: var(--accent); }
.request {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-raised);
}
.request-label { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.request-text { margin: .5rem 0 0; color: var(--ink); font: 600 1rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; user-select: all; }

.filter-bar { display: flex; align-items: end; gap: 1rem; margin: 0 0 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.field { flex: 1; }
.field label { display: block; margin-bottom: .4rem; font-weight: 750; }
.field input, .field select {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .8rem; background: var(--paper); color: var(--ink);
}
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.detail-layout { display: grid; grid-template-columns: minmax(230px, 330px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.detail-copy h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 2rem 0 0; }
.facts div { padding: 1rem 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.facts dd { margin: .35rem 0 0; }
.cast-list { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
.cast-list li { break-inside: avoid; padding: .18rem 0; }
.quote { border-left: 3px solid var(--brand); margin: 0; padding: .35rem 0 .35rem 1.2rem; color: var(--ink); font: 1.2rem/1.55 Georgia, serif; }

.browse-filter {
  position: sticky;
  top: .75rem;
  z-index: 20;
  margin-top: 2rem;
  background: rgba(22, 25, 30, .97);
  box-shadow: var(--shadow);
}
.browse-filter-count { flex: 0 0 auto; min-width: 10.5rem; margin: 0; text-align: right; }
.browse-empty { margin: 0 0 2rem; }
.browse-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.browse-item a { display: grid; gap: .2rem; height: 100%; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; }
.browse-item a:hover { border-color: var(--accent); background: var(--surface-raised); }
.browse-item strong { color: var(--ink); }
.browse-item span { color: var(--muted); font-size: .84rem; }

.season-details { display: grid; gap: .8rem; }
.season-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: clip; }
.season-detail summary { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; padding: 1rem 1.2rem; cursor: pointer; }
.season-detail summary span { color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.season-detail summary strong { color: var(--ink); }
.season-detail-card { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.season-detail-art { align-self: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.5rem 2rem; border-left: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -.36rem; top: .35rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--accent); }
.timeline time { color: var(--muted); font-size: .85rem; }

.site-footer { border-top: 1px solid var(--line); background: #090a0c; }
.footer-inner { width: var(--canvas); margin: 0 auto; padding: 2rem 0 2.5rem; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.footer-copy { max-width: 72ch; color: var(--muted); font-size: .86rem; }
.footer-copy strong { color: var(--ink); }
.build-time { display: block; margin-top: .4rem; color: #8f887d; }

/* Keep the published viewer focused on watchable content, not workspace tooling. */
.request,
.site-footer,
body:has(.site-nav a[href="about.html"][aria-current="page"]) main > .section {
  display: none;
}
.site-footer.is-public { display: block; }
.site-footer.is-public .footer-inner { display: block; }
.public-footer { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.public-footer a { color: var(--accent); font-weight: 700; }
.public-footer a:hover { color: var(--ink); }
body:has(.site-nav a[href="browse.html"][aria-current="page"]) .page-header .lede,
body:has(.site-nav a[href="browse.html"][aria-current="page"]) main > section .section-head > p {
  display: none;
}
body:has(.site-nav a[href="browse.html"][aria-current="page"]) .page-header .lede.is-public-copy {
  display: block;
}

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr minmax(210px, .45fr); gap: 2.25rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(210px, 280px) 1fr; gap: 2rem; }
  .filmography-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watchlist-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  :root { --canvas: calc(100% - 1.5rem); }
  .masthead { min-height: 72px; }
  .brand-note { display: none; }
  main { padding-top: 2.5rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-poster { justify-self: start; width: min(280px, 82%); }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-layout > .poster-column { width: min(280px, 82%); }
  .facts { grid-template-columns: 1fr; }
  .cast-list { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner button { justify-self: start; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .browse-filter { position: static; }
  .browse-filter-count { min-width: 0; text-align: left; }
  .browse-list { grid-template-columns: 1fr; }
  .research-note { grid-template-columns: 1fr; }
  .year-nav { border-radius: var(--radius); }
}

@media (max-width: 560px) {
  h1 { font-size: clamp(2.35rem, 14vw, 3.65rem); }
  .movie-card { grid-template-columns: 90px 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .filmography-grid { grid-template-columns: 1fr; }
  .collection-grid { grid-template-columns: 1fr; }
  .cover-collage { height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .request, .filter-bar, .back-link { display: none !important; }
  main { width: 100%; padding: 0; }
  a { color: #111; text-decoration: none; }
  .card, .poster-frame, .metric { box-shadow: none; background: #fff; border-color: #bbb; break-inside: avoid; }
  .muted, .card p, .card li, .lede, .meta { color: #444; }
  .detail-layout { grid-template-columns: 220px 1fr; }
}
