/* Plot Roast — site styles */
:root {
  color-scheme: dark;
  --bg: #0E1116; --surface: #161B22; --surface-2: #1F2630; --ink: #ECEFF3; --muted: #9AA4B2; --line: #28303B;
  --accent: #F2A93B; --accent-ink: #1A1204; --accent-soft: rgba(242,169,59,.14);
  --yes: #3FBF7F; --yes-soft: rgba(63,191,127,.15); --no: #EF6B5E; --no-soft: rgba(239,107,94,.15);
  --mid: #E3B341; --mid-soft: rgba(227,179,65,.15);
  --shadow: 0 2px 10px rgba(0,0,0,.35);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #E9ECF0; --ink: #12161C; --muted: #5B6573; --line: #D8DDE3;
    --accent: #B87400; --accent-ink: #FFFFFF; --accent-soft: rgba(184,116,0,.12);
    --yes: #1D7A4A; --yes-soft: #DCEFE4; --no: #B8382E; --no-soft: #F6DFDC; --mid: #8A6A12; --mid-soft: #F3EBD3;
    --shadow: 0 1px 3px rgba(18,22,28,.08), 0 6px 18px rgba(18,22,28,.06);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 99; }
.skip:focus { left: 8px; }
h1, h2, h3 { text-wrap: balance; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 10px 16px; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); color: var(--accent-ink); border-color: var(--accent); }
.btn-lg { padding: 13px 20px; font-size: 16px; }
.btn-danger { color: var(--no); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; color: var(--ink); line-height: 1; }
.logo.small { font-size: 20px; }
.logo-mark { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--accent) 0 75%, transparent 75% 100%); box-shadow: inset 0 0 0 4px var(--bg); outline: 2px solid var(--accent); outline-offset: -2px; flex: none; }
.search { position: relative; flex: 1 1 280px; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; }
.search:focus-within { border-color: var(--accent); }
.search svg { color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; outline: none; width: 100%; padding: 10px 0; }
.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.main-nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--muted); }
.main-nav a:hover { color: var(--ink); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

/* Typeahead */
.ta { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; }
.ta a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; text-decoration: none; }
.ta a:hover, .ta a[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.ta img, .ta .ta-ph { width: 32px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--surface-2); flex: none; }
.ta span { color: var(--muted); font-size: 14px; }
.ta .ta-all { justify-content: center; color: var(--accent); font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); }

/* Hero */
.hero { padding-block: 56px 36px; background: radial-gradient(1000px 360px at 15% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: end; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(44px, 7vw, 86px); line-height: .9; margin: 0; letter-spacing: .005em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; margin: 16px 0 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.hero-stats div { background: var(--surface); padding: 16px 18px; }
.hero-stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.hero-stats dd { margin: 4px 0 0; font-family: var(--display); font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1; }

/* Shelves (horizontal rows) */
.shelf { padding-block: 22px; }
.shelf-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 12px; }
.shelf-head h2, .page-head h1, .genre-links h2, .cta-band h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 0; }
.shelf-head h2 { font-size: 30px; }
.shelf-note { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.see-all { font-weight: 600; text-decoration: none; color: var(--accent); white-space: nowrap; }
.shelf-scroll { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scroll-padding-inline: max(20px, calc((100vw - 1200px) / 2)); }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 16px; padding-bottom: 8px; width: max-content; max-width: none; padding-inline: max(20px, calc((100vw - 1200px) / 2)); }
.shelf-track .card { scroll-snap-align: start; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 16px; }
.card { display: block; text-decoration: none; min-width: 0; }
.card-poster { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface-2); box-shadow: var(--shadow); }
.card-poster .poster-img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .poster-img { transform: scale(1.03); }
.card-poster .chip { position: absolute; left: 8px; bottom: 8px; }
.card-title { font-weight: 600; margin-top: 10px; line-height: 1.3; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover .card-title { color: var(--accent); }
.card-sub { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.poster-fallback { display: flex; align-items: flex-end; padding: 14px; background: linear-gradient(160deg, #2b3440, #151a21); color: #fff; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: .95; height: 100%; width: 100%; }

/* Verdict chips */
.chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; letter-spacing: .01em; backdrop-filter: blur(6px); }
.card-poster .chip { background: rgba(14,17,22,.82); color: #fff; }
.card-poster .chip-good { color: #7EE2AF; } .card-poster .chip-bad { color: #FF9A8F; } .card-poster .chip-mid { color: #F4CD6A; } .card-poster .chip-new { color: #D6DCE4; }
.chip-good { background: var(--yes-soft); color: var(--yes); }
.chip-bad { background: var(--no-soft); color: var(--no); }
.chip-mid { background: var(--mid-soft); color: var(--mid); }
.chip-new { background: var(--surface-2); color: var(--muted); }

/* Page heads, filters, tabs */
.page-head { padding-block: 36px 18px; }
.page-head h1 { font-size: clamp(38px, 5vw, 56px); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.filters select, .field input, .field textarea, .field select, .suggest-row input, .admin-filter input, .admin-filter select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.count { color: var(--muted); margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.tabs span { font-size: 13px; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 32px 12px; }
.pager-info { color: var(--muted); font-variant-numeric: tabular-nums; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 15px; background: var(--surface); }
.pill:hover { border-color: var(--accent); }
.genre-links { padding-block: 24px 48px; }
.genre-links h2 { font-size: 30px; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-block: 28px; padding-block: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band h2 { font-size: 34px; }
.cta-band p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }

/* Movie page */
.movie-hero { position: relative; padding-block: 40px 28px; overflow: hidden; }
.movie-backdrop { position: absolute; inset: 0; background-size: cover; background-position: center 25%; opacity: .22; filter: blur(2px) saturate(1.1); mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%); }
.movie-grid { position: relative; display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.movie-poster { border-radius: 12px; overflow: hidden; aspect-ratio: 2/3; box-shadow: 0 10px 40px rgba(0,0,0,.45); background: var(--surface-2); }
.movie-poster .poster-img { width: 100%; height: 100%; object-fit: cover; }
.movie-info h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(40px, 5.5vw, 68px); line-height: .92; margin: 0; }
.movie-meta { color: var(--muted); margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.movie-meta a { color: var(--muted); }
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 6px; }
.badge-row { margin: 12px 0 0; }
.overview { max-width: 66ch; margin: 16px 0 0; font-size: 17px; }
.ending { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 560px; box-shadow: var(--shadow); }
.ending-top { display: flex; align-items: center; gap: 18px; }
.ending-pct { font-family: var(--display); font-weight: 900; font-size: 72px; line-height: .85; font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.ending-label { color: var(--muted); margin-bottom: 6px; }
.bar { height: 10px; border-radius: 999px; overflow: hidden; display: flex; background: var(--surface-2); margin-top: 18px; }
.bar i { display: block; height: 100%; transition: width .35s ease; }
.bar-y { background: var(--yes); } .bar-n { background: var(--no); }
.ending-count { color: var(--muted); font-size: 14px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.vote-box { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 16px; }
.vote-box.closed { text-align: left; }
.vote-q { font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vote { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--line); background: transparent; border-radius: 10px; padding: 14px 16px; font-weight: 700; font-size: 18px; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
.vote:active { transform: scale(.98); }
.vote-yes:hover, .vote-yes[aria-pressed="true"] { border-color: var(--yes); color: var(--yes); }
.vote-no:hover, .vote-no[aria-pressed="true"] { border-color: var(--no); color: var(--no); }
.vote-yes[aria-pressed="true"] { background: var(--yes-soft); }
.vote-no[aria-pressed="true"] { background: var(--no-soft); }
.vote:disabled { opacity: .5; cursor: wait; }

/* Rate mode */
.rate { padding-block: 32px 48px; }
.rate-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.rate-head h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(38px, 5vw, 56px); line-height: 1; margin: 0; }
.rate-progress { margin: 0; color: var(--muted); }
.rate-progress strong { font-family: var(--display); font-size: 40px; color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 6px; }
.rate-stage { display: grid; place-items: center; margin-top: 24px; min-height: 480px; }
.rate-card { width: min(100%, 720px); display: grid; grid-template-columns: 240px 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); animation: pop .22s ease; }
.rate-card.skeleton { height: 400px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.rate-card .poster-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; }
.rate-card h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 40px; line-height: .95; margin: 4px 0 6px; }
.rate-card .meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.rate-card p { color: var(--muted); }
.rate-card .q { color: var(--ink); font-weight: 700; font-size: 20px; margin-top: 18px; }
.rate-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; max-width: 720px; margin: 18px auto 0; }
.rate-actions kbd { font-family: var(--body); font-size: 12px; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; opacity: .6; }
.skip-btn { padding: 14px 18px; }
.rate-done { text-align: center; padding: 40px 16px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* My ratings */
.my-item { display: grid; gap: 6px; }
.my-vote { font-size: 13px; font-weight: 700; }
.my-vote-yes { color: var(--yes); } .my-vote-no { color: var(--no); }

/* Suggest */
.suggest-search label, .field label { display: block; font-weight: 600; margin-bottom: 6px; }
.suggest-row { display: flex; gap: 10px; }
.suggest-row input { flex: 1; }
.suggest-results { display: grid; gap: 10px; margin-top: 18px; }
.sr-item { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sr-item img, .sr-item .ta-ph { width: 46px; height: 69px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.sr-item .muted { color: var(--muted); font-size: 14px; }
.manual { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.manual summary { cursor: pointer; font-weight: 600; }
.field { margin-top: 14px; }
.field input, .field textarea, .field select { width: 100%; }
.form-msg { font-weight: 600; min-height: 1.5em; margin-top: 16px; }
.form-msg.err { color: var(--no); }
.form-msg.ok { color: var(--yes); }

/* Prose (about) */
.prose { padding-block: 36px 56px; }
.prose h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 52px; line-height: 1; margin: 0 0 16px; }
.prose h2 { font-size: 22px; margin-top: 32px; }
.prose p, .prose li { max-width: 66ch; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 32px; padding-block: 32px 40px; color: var(--muted); font-size: 14px; }
.foot-row { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 24px; align-items: start; }
.site-foot nav { display: flex; flex-direction: column; gap: 6px; }
.site-foot a { text-decoration: none; }
.tmdb-credit img { height: 14px; width: auto; margin-bottom: 8px; }

/* TV */
.kind-tag { position: absolute; right: 8px; top: 8px; background: rgba(14,17,22,.82); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(6px); }
.kind-label { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; }
.movie-info .eyebrow a { color: inherit; text-decoration: none; }
.movie-info .eyebrow a:hover { text-decoration: underline; }
.seasons { padding-block: 22px; }
.season-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.season-list a { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.season-list a:hover { border-color: var(--accent); }
.season-list a[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); }
.season-thumb { width: 48px; flex: none; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.season-thumb .poster-img { width: 100%; height: 100%; object-fit: cover; }
.season-thumb .poster-fallback span { font-size: 9px; }
.season-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.season-body span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.suggest-row select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .movie-grid { grid-template-columns: 1fr; }
  .movie-grid { gap: 24px; }
  .movie-poster { width: min(240px, 60%); }
  .foot-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .head-row { gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .main-nav { order: 2; width: 100%; margin: 0; justify-content: space-between; flex-wrap: nowrap; }
  .main-nav a { padding: 6px 5px; font-size: 14px; white-space: nowrap; }
  .suggest-row { flex-wrap: wrap; }
  .suggest-row input { flex-basis: 100%; order: 2; }
  .suggest-row .btn { order: 3; }
  .shelf-track { padding-inline: 16px; }
  .shelf-scroll { scroll-padding-inline: 16px; }
  .hero { padding-block: 32px 24px; }
  .hero-stats dd { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px 12px; }
  .shelf-track { grid-auto-columns: 136px; gap: 12px; }
  .rate-card { grid-template-columns: 1fr; }
  .rate-card .poster-img { width: 55%; margin: 0 auto; }
  .rate-card h2 { font-size: 32px; }
  .rate-actions { grid-template-columns: 1fr 1fr; }
  .rate-actions .skip-btn { grid-column: 1 / -1; grid-row: 2; }
  .ending-pct { font-size: 60px; }
  .vote { font-size: 17px; padding: 13px; }
}
@media (max-width: 420px) {
  .logo { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
