/* Watch Yonder: the whole stylesheet.
 *
 * Cut down from website-v2's site.css: the same tokens, shell, type,
 * table and state rules, and none of the poster grid, search box or
 * budget meter. Dark only, as v2 was.
 *
 * Conventions kept from v2's AGENTS.md: never colour alone, works
 * with JavaScript off (there is none), empty states say what a screen
 * is for.
 */

:root {
  color-scheme: dark;
  --ink:       #f1f2f4;
  --ink-soft:  #a4abb6;
  --ink-faint: #8b929e;
  --bg:        #0a0b0e;
  --bg-soft:   #14161c;
  --line:      #1e2129;
  --accent:    #ff4d57;  /* 6:1 on --bg; the brand red is too dark for text */
  --measure: 42rem;
  --wide:    64rem;
  --shell:   109rem; /* v2's page width: eight card columns plus gutters */
  --gutter: clamp(1rem, 2.5vw, 2.5rem);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex-shrink: 0; }

.skip {
  position: absolute; left: -9999px;
  background: var(--bg); color: var(--ink);
  padding: .6rem 1rem; border: 2px solid var(--accent); border-radius: 6px;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }
:where(a, summary, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Shell ── */
.bar { border-bottom: 1px solid var(--line); }
.bar-inner, main, .foot-inner { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.bar-inner { padding-block: .85rem; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.tagline { color: var(--ink-faint); font-size: .875rem; }
.bar-search {
  margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: .9375rem;
}
.bar-search:hover { border-color: var(--ink-faint); }
.bar-search .icon { color: var(--ink-faint); }
main { padding-block: 2rem 4rem; }
.foot { border-top: 1px solid var(--line); color: var(--ink-faint); font-size: .875rem; }
.foot-inner { padding-block: 1.5rem 3rem; }
.foot p { max-width: var(--measure); }
.foot-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-block: 0 1rem; }
.foot-nav a { color: var(--ink-soft); }

/* Prose pages (about, 404): one readable column. */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: .5rem; }
.tmdb img { display: block; height: 16px; width: auto; }

/* ── Type ── */
h1 {
  font-size: clamp(1.6rem, 1.15rem + 2vw, 2.35rem);
  line-height: 1.15; letter-spacing: -.025em;
  margin: 0 0 1rem; max-width: var(--measure); text-wrap: balance;
}
h2 { font-size: 1.3rem; letter-spacing: -.015em; margin: 2.5rem 0 .75rem; }
p { max-width: var(--measure); }
.lede { font-size: clamp(1.05rem, .98rem + .4vw, 1.2rem); color: var(--ink-soft); margin-bottom: 1.5rem; }
.note { color: var(--ink-soft); font-size: .9rem; }
.checked { color: var(--ink-faint); font-size: .875rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2.5rem; max-width: none; }
.dash { color: var(--ink-faint); font-size: .875rem; white-space: nowrap; }

/* ── Country switcher: plain links, the current one marked by
      aria-current, and by weight and border as well as colour. ── */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.filters a {
  display: inline-flex; align-items: baseline; gap: .35rem;
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-size: .9375rem;
}
.filters a:hover { color: var(--ink); border-color: var(--ink-faint); }
.filters a[aria-current="page"] { color: var(--ink); border-color: var(--ink); font-weight: 600; background: var(--bg-soft); }
.filters .count { color: var(--ink-faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
/* ── Country and genre dropdowns: each a <details>, so they open
      without script. The button names what it picks and the current
      choice in words; the panel floats over the films below. On a
      phone the panel spans the whole row, not just under its button. ── */
.pickers { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.pick { position: relative; }
.pick summary {
  display: inline-flex; align-items: baseline; gap: .4rem; cursor: pointer; list-style: none;
  padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-soft); color: var(--ink); font-size: .9375rem;
}
.pick summary::-webkit-details-marker { display: none; }
.pick summary:hover, .pick[open] summary { border-color: var(--ink-faint); }
.pick summary .icon { align-self: center; color: var(--ink-faint); }
.pick[open] summary .icon { rotate: 180deg; }
.pick-k { color: var(--ink-faint); font-size: .875rem; }
.pick-v { font-weight: 600; }
.pick .count { color: var(--ink-faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.pick-panel {
  position: absolute; top: calc(100% + .4rem); left: 0; z-index: 5;
  width: min(27rem, calc(100vw - 2 * var(--gutter))); padding: 1rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .55);
}
.pick-h { margin: 0 0 .6rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.pick-panel .filters { margin: 0; }
.pick-panel .filters a[aria-current="page"] { background: var(--bg); }
@media (max-width: 40rem) {
  .pick { position: static; }
  .pick-panel { width: 100%; }
}

.num { text-align: right; font-variant-numeric: tabular-nums; }
.cc {
  display: inline-block; padding: .1rem .45rem; border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); text-decoration: none; font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.cc:hover { border-color: var(--accent); color: var(--accent); }
.pop-text .card-cc { margin-top: .75rem; }

.empty { border: 1px dashed var(--line); border-radius: 8px; padding: 2rem 1.5rem; color: var(--ink-soft); background: var(--bg-soft); max-width: var(--measure); }
.empty h2 { margin-top: 0; color: var(--ink); }

/* ── Search (search.js) and the A to Z ── */
.search { margin: 0 0 1rem; max-width: var(--measure); }
.search[hidden] { display: none; }
.search label { display: block; margin-bottom: .4rem; color: var(--ink-soft); font-size: .9375rem; }
.search-row { display: flex; gap: .5rem; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.0625rem; color: var(--ink);
  padding: .55rem .8rem; border: 1px solid var(--ink-faint); border-radius: 6px; background: var(--bg-soft);
}
.search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search .more-btn { display: inline-flex; align-items: center; gap: .4rem; }
.search-status { color: var(--ink-soft); min-height: 1.5em; }
.search-status:empty { min-height: 0; margin: 0; }
.letters a { min-width: 2.5rem; justify-content: center; }

/* ── Cards ──
   A set number of columns per screen width, rather than auto-fill, so
   "two rows" is a number CSS can count without script: .limit hides
   every card past two rows (the nth-child rules below), and site.js
   takes over from there with "Load more". */
.cards {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; gap: 1.5rem 1rem;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  --cols: 2;
}
.card { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cards > li[hidden] { display: none; }
.cards.limit > li:nth-child(n+5) { display: none; }
@media (min-width: 30rem) { .cards { --cols: 3; } .cards.limit > li:nth-child(n+5) { display: flex; } .cards.limit > li:nth-child(n+7) { display: none; } }
@media (min-width: 44rem) { .cards { --cols: 4; } .cards.limit > li:nth-child(n+7) { display: flex; } .cards.limit > li:nth-child(n+9) { display: none; } }
@media (min-width: 56rem) { .cards { --cols: 5; } .cards.limit > li:nth-child(n+9) { display: flex; } .cards.limit > li:nth-child(n+11) { display: none; } }
@media (min-width: 68rem) { .cards { --cols: 6; } .cards.limit > li:nth-child(n+11) { display: flex; } .cards.limit > li:nth-child(n+13) { display: none; } }
@media (min-width: 80rem) { .cards { --cols: 7; } .cards.limit > li:nth-child(n+13) { display: flex; } .cards.limit > li:nth-child(n+15) { display: none; } }
@media (min-width: 92rem) { .cards { --cols: 8; } .cards.limit > li:nth-child(n+15) { display: flex; } .cards.limit > li:nth-child(n+17) { display: none; } }

.tile {
  display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: .4rem;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-none { display: grid; place-items: center; height: 100%; padding: .75rem; text-align: center; color: var(--ink-faint); font-size: .875rem; }
/* site.js makes the poster a button that opens the details. */
button.tile { padding: 0; font: inherit; color: inherit; cursor: pointer; width: 100%; }
button.tile:hover { border-color: var(--ink-faint); }
button.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-name { font-weight: 600; font-size: .9375rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--ink-faint); font-size: .8125rem; }
.card-cc { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.card-cc .cc { padding: 0 .35rem; font-size: .8125rem; }

.sec + .sec { margin-top: 3rem; }
.sec > h2 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -.02em; line-height: 1.2; }
.more { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0 0 2rem; }
.more-btn, .vpn-btn {
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
  padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--ink-faint);
  background: transparent; color: var(--ink); text-decoration: none;
}
.more-btn { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.more-btn[hidden] { display: none; }

/* ── Details pop-up (site.js), filled from the card's <template>. ── */
/* The dialog is the whole screen, transparent; .pop-box is the panel. */
.pop {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 1rem; border: 0; background: transparent; color: var(--ink);
}
.pop[open] { display: grid; place-items: center; }
.pop-box {
  position: relative; width: min(46rem, 100vw - 10rem); max-height: calc(100dvh - 2rem); overflow: auto;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
}
.pop::backdrop { background: rgb(0 0 0 / .75); }
.pop-body { display: flex; gap: 1.5rem; align-items: flex-start; }
.pop-art { width: 171px; flex: 0 0 171px; border-radius: 6px; }
.pop-text { min-width: 0; }
.pop h2 { margin: 0 0 .25rem; font-size: 1.4rem; line-height: 1.2; }
.pop h3 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin: 1.25rem 0 .5rem; }
.pop-meta { color: var(--ink-soft); margin: 0 0 .5rem; }
.pop-score { margin: 0 0 1rem; color: var(--ink-soft); }
.pop-score strong { color: var(--ink); font-size: 1.1rem; }
.pop-people { margin: 0 0 .35rem; font-size: .9375rem; }
.pop-people span { color: var(--ink-faint); margin-right: .2rem; }
.pop-where { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
/* The watch links: buttons, so they read as the thing to press. The
   play icon and the border carry it as well as the colour. */
.pop-where li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.pop-where .watch {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem; border: 1px solid var(--accent); border-radius: 6px;
  background: rgb(255 77 87 / .12); color: var(--ink);
  font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.pop-where .watch .icon { color: var(--accent); }
.pop-where .watch:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pop-where .watch:hover .icon { color: #fff; }
.watch-code { font-size: .8125rem; color: var(--ink-faint); font-weight: 600; }
.pop-where .watch:hover .watch-code { color: #fff; }
.listed { color: var(--ink-faint); font-size: .875rem; }
.pop-bar { display: flex; align-items: center; gap: .5rem; margin: -.5rem -.5rem 1rem; }
.pop-count { color: var(--ink-faint); font-size: .875rem; font-variant-numeric: tabular-nums; }
.pop-bar .pop-close { margin-left: auto; }

/* Big arrows, pinned to the screen edges at mid-height. */
.pop-nav {
  position: fixed; top: 50%; translate: 0 -50%; z-index: 1;
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .35); border-radius: 50%;
  background: rgb(20 22 28 / .85); color: var(--ink);
}
.pop-nav .icon { width: 1.75rem; height: 1.75rem; }
.pop-nav:hover { border-color: var(--ink); background: var(--bg-soft); }
.pop-prev { left: 1.5rem; }
.pop-next { right: 1.5rem; }
.pop-nav[hidden] { display: grid; visibility: hidden; }
:where(.pop-nav, .pop-close):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 40rem) {
  .pop-box { width: 100%; max-height: calc(100dvh - 6.5rem); align-self: start; }
  .pop-nav { top: auto; bottom: 1rem; translate: none; }
  .pop-prev { left: 1rem; }
  .pop-next { right: 1rem; }
}
@media (max-width: 36rem) {
  .pop-body { flex-direction: column; }
  .pop-art { width: 120px; flex-basis: auto; }
}

/* ── Connection check (site.js). Only ever on screen with script. ── */
.here { margin-left: auto; color: var(--ink-soft); font-size: .875rem; }
.bar-search ~ .here { margin-left: 0; }
/* Narrow screens: Search beside the name, the tagline below both. */
@media (max-width: 40rem) {
  .bar-search { order: 1; }
  .tagline { order: 2; flex-basis: 100%; }
  .here { order: 3; }
}
.vpn {
  width: min(32rem, calc(100vw - 2rem)); padding: 1.5rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-soft); color: var(--ink);
}
.vpn::backdrop { background: rgb(0 0 0 / .75); }
.vpn h2 { margin: 0 0 .5rem; font-size: 1.2rem; display: flex; gap: .5rem; align-items: baseline; }
.vpn .vpn-film { margin: 0 0 .75rem; color: var(--ink-soft); font-weight: 600; }
.vpn p { margin: 0 0 1.25rem; }
.vpn-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.vpn-btn:hover { border-color: var(--ink); }
.vpn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vpn-quiet { border-color: transparent; color: var(--ink-soft); margin-left: auto; }
.vpn-btn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
