/* popcorn.movie — dark only, by design (§12). The site is for watching things
   in a dark room. Palette grounded in projection and film stock, not neon. */

:root {
  /* tokens — the named palette */
  --auditorium: #0e0c10;   /* the room with the lights down */
  --surface:    #171419;   /* seat-row grey */
  --raised:     #201c24;   /* armrest */
  --line:       #2e2833;   /* aisle edge */
  --screen:     #f2ede4;   /* projected off-white */
  --screen-dim: #b9b2a6;   /* screen light falling on faces */
  --faint:      #7d7668;   /* exit-sign distance */
  --amber:      #e0a458;   /* warm house light */
  --gold:       #d4af37;   /* the kernel, the award, the via-dot */
  --box-red:    #b3382e;   /* popcorn-box stripe */
  --slop:       #9aa332;   /* bile green, for certified slop */

  --display: 'Bricolage Grotesque', 'Avenir Next Condensed', system-ui, sans-serif;
  --body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --utility: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;

  --rad: 10px;
  --rad-sm: 6px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--auditorium);
  color: var(--screen);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }

.meta, .count { font-family: var(--utility); font-size: 0.78rem; color: var(--screen-dim); }
.faint { color: var(--faint); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--auditorium) 88%, black);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(6px);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 1.12rem; color: var(--screen); letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.brand:hover { color: var(--gold); }
.nav { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--screen-dim); padding: 6px 10px; border-radius: var(--rad-sm); font-size: 0.92rem; white-space: nowrap; }
.nav a:hover { color: var(--screen); background: var(--raised); }
.nav a.on { color: var(--screen); background: var(--raised); }
.head-spacer { flex: 1; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--raised); color: var(--screen);
  border: 1px solid var(--line); border-radius: var(--rad-sm);
  padding: 8px 14px; font: 500 0.92rem var(--body);
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .06s;
}
.btn:hover { border-color: var(--amber); color: var(--screen); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #241d06; font-weight: 600; }
.btn-gold:hover { background: var(--amber); border-color: var(--amber); color: #241d06; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--screen-dim); }
.btn-quiet:hover { border-color: var(--line); }
.btn-danger { border-color: color-mix(in srgb, var(--box-red) 70%, var(--line)); color: #e28a82; }
.btn-danger:hover { border-color: var(--box-red); }

input[type=text], input[type=url], input[type=email], input[type=number], textarea, select {
  background: var(--surface); color: var(--screen);
  border: 1px solid var(--line); border-radius: var(--rad-sm);
  padding: 9px 12px; font: 400 0.95rem var(--body); width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--amber); outline: none; }
label { display: block; font-size: 0.86rem; color: var(--screen-dim); margin: 14px 0 5px; }
.field-note { font-size: 0.8rem; color: var(--faint); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--rad); padding: 14px 16px; margin: 0 0 14px; }
legend { font-size: 0.85rem; color: var(--screen-dim); padding: 0 6px; }

.err {
  background: color-mix(in srgb, var(--box-red) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--box-red) 55%, var(--line));
  color: #f0b9b3; border-radius: var(--rad-sm);
  padding: 10px 14px; margin: 10px 0; font-size: 0.92rem;
}
.ok {
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  color: var(--gold); border-radius: var(--rad-sm);
  padding: 10px 14px; margin: 10px 0; font-size: 0.92rem;
}

/* ---------- the thumbnail grid: the hero (§12) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px 18px; margin: 18px 0 40px; }
.card { display: block; color: var(--screen); }
.card .thumbwrap { position: relative; border-radius: var(--rad); overflow: hidden; background: var(--surface); aspect-ratio: 16/9; }
.card .thumbwrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .thumbwrap img { transform: scale(1.03); }
.card .runtime { position: absolute; right: 8px; bottom: 8px; background: rgba(10,9,12,.82); color: var(--screen); font-family: var(--utility); font-size: 0.72rem; padding: 2px 7px; border-radius: 4px; }
.card .title { font-weight: 600; font-size: 0.98rem; margin: 10px 0 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .by { font-size: 0.84rem; color: var(--screen-dim); }
.card .verdictline { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* ---------- badges: spend the boldness here (§12) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-weight: 800; letter-spacing: .03em;
  font-size: 0.72rem; padding: 3px 9px; border-radius: 4px; text-transform: uppercase;
}
.badge-fresh { background: linear-gradient(160deg, var(--gold), var(--amber)); color: #241d06; }
.badge-slop { background: var(--slop); color: #14150a; }
.badge-none { background: var(--raised); color: var(--faint); font-weight: 600; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.badge-big { font-size: 1rem; padding: 7px 16px; border-radius: 6px; }
.pct { font-family: var(--utility); font-weight: 500; font-size: 0.82rem; color: var(--screen-dim); }
.pct b { color: var(--screen); font-weight: 500; }

/* verified creator */
.vbadge { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-size: 0.8rem; }
.vbadge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 60%, transparent); }

/* ---------- film page ---------- */
.player { border-radius: var(--rad); overflow: hidden; background: black; aspect-ratio: 16/9; margin: 18px 0; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.film-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: baseline; }
.film-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 4px; align-items: center; }
.film-cols { display: grid; grid-template-columns: 1fr 340px; gap: 34px; margin-top: 8px; }
@media (max-width: 900px) { .film-cols { grid-template-columns: 1fr; } }
.provenance { border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 18px; background: var(--surface); }
.provenance dt { font-family: var(--utility); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-top: 12px; }
.provenance dt:first-child { margin-top: 0; }
.provenance dd { margin: 2px 0 0; font-size: 0.92rem; }
.chip { display: inline-block; background: var(--raised); border: 1px solid var(--line); color: var(--screen-dim); border-radius: 999px; padding: 3px 11px; font-size: 0.8rem; margin: 2px 3px 2px 0; }
a.chip:hover { color: var(--screen); border-color: var(--amber); }

/* ---------- the verdict box + half-star control: signature (§5, §12) ---------- */
.verdict-box { border: 1px solid var(--line); border-radius: var(--rad); background: var(--surface); padding: 18px 20px; }
.verdict-agg { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.verdict-agg .nums { font-family: var(--utility); font-size: 0.85rem; color: var(--screen-dim); }

.stars { display: inline-flex; gap: 2px; }
.stars button {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 34px; height: 34px; position: relative;
  transition: transform .1s ease;
}
.stars button svg { width: 100%; height: 100%; }
.stars button .fill { fill: var(--raised); stroke: var(--line); stroke-width: 1; transition: fill .12s; }
.stars button.half .l { fill: var(--gold); stroke: none; }
.stars button.full .fill { fill: var(--gold); stroke: none; }
.stars button:hover { transform: scale(1.12); }
.stars[data-locked] button { cursor: default; }
.stars[data-locked] button:hover { transform: none; }
.stars-val { font-family: var(--utility); font-size: 0.9rem; color: var(--gold); min-width: 2.4em; display: inline-block; }

.slopnot { display: flex; gap: 10px; margin-top: 14px; }
.slopnot .btn { flex: 1; justify-content: center; font-family: var(--display); font-weight: 600; }
.slopnot .btn.picked-fresh { background: linear-gradient(160deg, var(--gold), var(--amber)); border-color: var(--gold); color: #241d06; }
.slopnot .btn.picked-slop { background: var(--slop); border-color: var(--slop); color: #14150a; }

/* the one orchestrated moment: Q&A reveal after rating submit */
.qa-reveal { animation: qa-in .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes qa-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .qa-reveal { animation: none; }
  .card .thumbwrap img, .stars button { transition: none; }
}

.qa .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.qa .chips label { margin: 0; }
.qa .chips input { position: absolute; opacity: 0; pointer-events: none; }
.qa .chips span { display: inline-block; border: 1px solid var(--line); background: var(--raised); color: var(--screen-dim); border-radius: 999px; padding: 5px 13px; font-size: 0.84rem; cursor: pointer; }
.qa .chips input:checked + span { border-color: var(--gold); color: var(--gold); }
.qa .chips input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- notes ---------- */
.note { border-top: 1px solid var(--line); padding: 14px 0; }
.note .who { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.note .who img { width: 24px; height: 24px; border-radius: 50%; }
.note .who .name { font-weight: 500; font-size: 0.9rem; }
.note .body { font-size: 0.95rem; }
.note .chips { margin-top: 6px; }

/* ---------- shelves (home) ---------- */
.shelf { margin: 34px 0; }
.shelf-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.shelf-head .more { font-size: 0.86rem; color: var(--faint); }
.shelf-head .more:hover { color: var(--amber); }

.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center;
  padding: 44px 0 20px;
}
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; padding-top: 24px; } }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); }
.hero .stance { color: var(--screen-dim); font-size: 1.05rem; max-width: 34em; }
.hero img { border-radius: var(--rad); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.hero .cta { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- festival ---------- */
.fest-head { border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--rad); background: var(--surface); padding: 22px 26px; margin: 22px 0; }
.fest-head .hashtag { font-family: var(--utility); color: var(--amber); }
.fest-card { border: 1px solid var(--line); border-radius: var(--rad); background: var(--surface); padding: 18px 20px; display: block; color: var(--screen); }
.fest-card:hover { border-color: var(--amber); color: var(--screen); }
.fest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }

/* ---------- awards ---------- */
.award-hero { text-align: center; padding: 30px 0 10px; }
.award-hero img { width: min(300px, 60vw); margin: 0 auto; filter: drop-shadow(0 18px 50px rgba(212,175,55,.25)); }
.award-centre {
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background: radial-gradient(ellipse at top, color-mix(in srgb, var(--gold) 9%, var(--surface)), var(--surface) 65%);
  border-radius: var(--rad); padding: 26px 28px; margin: 22px auto; max-width: 760px; text-align: center;
}
.award-centre h2 { font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.award-ring { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.award-cat { border: 1px solid var(--line); border-radius: var(--rad); background: var(--surface); padding: 18px 20px; }
.award-cat h3 { color: var(--amber); }
.nominee { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.nominee:first-of-type { border-top: 0; }
.nominee .win { color: var(--gold); font-family: var(--display); font-weight: 800; font-size: 0.8rem; }
.nominee img { width: 72px; border-radius: 4px; }

/* ---------- tables (admin) ---------- */
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th { text-align: left; font-family: var(--utility); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-section { margin: 30px 0; }
.statrow { display: flex; gap: 26px; flex-wrap: wrap; margin: 16px 0; }
.stat { font-family: var(--utility); }
.stat b { font-size: 1.5rem; color: var(--gold); display: block; font-weight: 500; }

/* ---------- Super Score breakdown ---------- */
.rv { margin-top: 30px; }
.rv-super { font-family: var(--utility); font-size: 0.9rem; color: var(--screen-dim); }
.rv-super b { color: var(--gold); font-size: 1.15rem; font-weight: 500; margin-left: 4px; }
.rv-main { border: 1px solid var(--line); border-radius: var(--rad-sm); background: var(--surface); margin: 8px 0; }
.rv-main summary {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; list-style: none;
}
.rv-main summary::-webkit-details-marker { display: none; }
.rv-main summary::before { content: '▸'; color: var(--faint); font-size: 0.8rem; }
.rv-main[open] summary::before { content: '▾'; }
.rv-main-label { font-family: var(--display); font-weight: 600; }
.rv-right { margin-left: auto; display: flex; gap: 12px; align-items: baseline; }
.rv-mine-avg { color: var(--gold); }
.rv-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; border-top: 1px solid var(--line);
}
.rv-sub { flex: 1; min-width: 220px; }
.rv-sub-label { font-weight: 500; font-size: 0.92rem; margin-right: 8px; }
.rv-def { display: block; font-size: 0.76rem; }
.rv-ctl { display: flex; align-items: center; gap: 6px; }
.stars-sm button { width: 24px; height: 24px; }
.rv-wipe {
  background: none; border: 1px solid transparent; border-radius: var(--rad-sm);
  cursor: pointer; font-size: 0.85rem; padding: 3px 6px; opacity: .45;
}
.rv-wipe:hover { opacity: 1; border-color: var(--line); }
.rv-foot { display: flex; align-items: center; gap: 18px; margin: 14px 0 4px; flex-wrap: wrap; }
.rv-agg { font-size: 0.72rem; }

/* ---------- misc ---------- */
.empty { border: 1px dashed var(--line); border-radius: var(--rad); color: var(--screen-dim); padding: 30px; text-align: center; margin: 20px 0; }
.pagehead { padding: 28px 0 6px; }
.pagehead .sub { color: var(--screen-dim); max-width: 46em; }
.site-foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 26px 0 40px; color: var(--faint); font-size: 0.85rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.site-foot a { color: var(--screen-dim); }
.site-foot a:hover { color: var(--amber); }
.prose { max-width: 46em; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }
.thumb-check { position: relative; display: block; cursor: pointer; }
.thumb-check input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--gold); }
.thumb-check .already { position: absolute; inset: 0; background: rgba(10,9,12,.72); color: var(--gold); display: flex; align-items: center; justify-content: center; font-family: var(--utility); font-size: 0.8rem; border-radius: var(--rad); }
.onboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 18px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; }
.popup-note { font-family: var(--utility); font-size: 0.75rem; color: var(--faint); }
