@font-face {
  font-family: "Montserrat";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/montserrat-latin-800-normal.woff2") format("woff2");
}

/* ---------- colour tokens: light (default) ---------- */
:root {
  --bg: #f7f8fc; --surface: #ffffff; --surface-2: #eef1fb; --line: #dfe3ee;
  --ink: #14246b; --text: #1d2233; --muted: #5d6579;
  --accent: #e2502f;
  --live: #187349; --live-ink: #ffffff;
  --warn-bg: #fff4dc; --warn-line: #e0a526; --warn-ink: #5a3d00; --warn-edge: #b8860b;
  --shadow: 0 12px 30px -18px rgba(20, 36, 107, .35);
  color-scheme: light;
}

/* ---------- dark: device setting (unless light chosen) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #161b2e; --surface-2: #1f2640; --line: #2a3150;
    --ink: #eef1ff; --text: #d9deee; --muted: #9aa3bd;
    --accent: #ff7a5c;
    --live: #3ccf8e; --live-ink: #062015;
    --warn-bg: #2e2410; --warn-line: #c9921f; --warn-ink: #ffe2a3; --warn-edge: #c9921f;
    --shadow: 0 12px 30px -18px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------- dark: chosen with the toggle ---------- */
/* keep these values identical to the prefers-color-scheme block above */
:root[data-theme="dark"] {
  --bg: #0e1220; --surface: #161b2e; --surface-2: #1f2640; --line: #2a3150;
  --ink: #eef1ff; --text: #d9deee; --muted: #9aa3bd;
  --accent: #ff7a5c;
  --live: #3ccf8e; --live-ink: #062015;
  --warn-bg: #2e2410; --warn-line: #c9921f; --warn-ink: #ffe2a3; --warn-edge: #c9921f;
  --shadow: 0 12px 30px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--ink); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: clamp(20px, 2.6vw, 24px); margin-top: 1.6em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.empty { color: var(--muted); }

/* House rule: if it looks like a button or has an arrow, it can be clicked; information never looks like a button. */
/* text links inside content and footer: always underlined (cards, buttons and nav have a class and opt out) */
main a:not([class]), .site-footer a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
main a:not([class]):hover, .site-footer a:hover { text-decoration-thickness: 2px; }
/* visible keyboard focus everywhere */
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the arrow on clickable rows and cards */
/* drawn with borders (the "›" glyph in the markup is only a no-CSS fallback): same size in every font */
.chevron {
  flex: none; display: inline-block; font-size: 0; width: 10px; height: 10px; margin: 0 5px 0 1px;
  border: solid var(--muted); border-width: 2.5px 2.5px 0 0; border-radius: 1px; transform: rotate(45deg);
  transition: transform .15s ease, border-color .15s ease;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: none; }
.wordmark { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; margin: 0; }
.w-epi { color: var(--ink); }
.w-talk { color: var(--accent); }
.w-com { color: var(--muted); font-size: .62em; }
.site-nav { display: flex; align-items: center; gap: 14px; }
.site-nav a { text-decoration: none; font-weight: 600; white-space: nowrap; padding: 6px 0; text-underline-offset: 9px; text-decoration-thickness: 2px; }
.site-nav a:hover { text-decoration-line: underline; text-decoration-color: var(--line); }
.site-nav a.is-active { text-decoration-line: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 1;
}
.theme-toggle[data-current="auto"] .theme-icon::before { content: "◐"; }
.theme-toggle[data-current="light"] .theme-icon::before { content: "\2600\FE0E"; }
.theme-toggle[data-current="dark"] .theme-icon::before { content: "\263E\FE0E"; }

/* tagline */
.hero { padding: 16px 0 8px; }
.tagline {
  font-family: "Montserrat", sans-serif; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; font-size: clamp(22px, 4.2vw, 40px); margin: 0; color: var(--ink);
}
.tagline span { color: var(--accent); white-space: nowrap; }
.subline { color: var(--muted); font-size: clamp(15px, 2.2vw, 19px); margin: .4em 0 0; }

/* lists */
.room-list, .series-grid, .episode-list { list-style: none; margin: 0; padding: 0; }
.room-list { display: grid; gap: 10px; }
.room-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
/* a room card is one big link: arrow at the end, lifts on hover */
a.room-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "poster text status chev";
  column-gap: 14px; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
a.room-item > .poster { grid-area: poster; }
a.room-item > .room-item-text { grid-area: text; }
a.room-item > .badge { grid-area: status; }
a.room-item > .chevron { grid-area: chev; }
@media (hover: hover) {
a.room-item:hover { border-color: var(--ink); transform: translateY(-1px); }
a.room-item:hover .chevron, .episode-link:hover .chevron { border-color: var(--accent); transform: translateX(3px) rotate(45deg); }
}
.room-item-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.room-item-text strong { color: var(--ink); }
.room-item-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* posters get a frame so they don't glare in dark mode */
.poster { display: block; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.poster-sm { width: 44px; height: 62px; flex: none; }
.poster-md { width: 100%; aspect-ratio: 2 / 3; height: auto; }
.poster-lg { width: 140px; height: 196px; flex: none; }

/* status labels are information: plain text with a coloured dot, never a pill */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.badge-live { color: var(--live); font-weight: 700; }
.badge-soon, .badge-closed { color: var(--muted); }
.badge-soon::before, .badge-closed::before, span.badge-later::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
}
.badge-soon::before { border: 1.5px solid currentColor; }
.badge-closed::before { background: color-mix(in srgb, currentColor 45%, transparent); }
span.badge-later { color: var(--warn-ink); }
span.badge-later::before { background: var(--warn-line); }
/* "Watched it later" link: a small outlined button with an arrow */
a.badge-later {
  gap: 2px; padding: 3px 6px 3px 11px; border-radius: 8px; font-weight: 700;
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-edge);
  transition: background-color .15s ease;
}
a.badge-later .chevron { width: 7px; height: 7px; border-width: 2px 2px 0 0; border-color: currentColor; margin: 0 4px 0 3px; }
a.badge-later:hover { background: color-mix(in srgb, var(--warn-bg) 72%, var(--warn-line)); }
a.badge-later:hover .chevron { transform: translateX(2px) rotate(45deg); }

/* series */
.search { width: 100%; max-width: 420px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; margin-bottom: 20px; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 16px; }
.series-card { display: block; text-decoration: none; color: var(--ink); font-weight: 700; border-radius: 10px; }
.series-card span { display: block; margin-top: 6px; text-underline-offset: .2em; }
.series-card .poster { transition: transform .15s ease, box-shadow .15s ease; }
@media (hover: hover) {
.series-card:hover .poster { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink), var(--shadow); }
.series-card:hover span { text-decoration: underline; }
}
.series-head { display: flex; gap: 20px; align-items: flex-start; }
.summary { max-width: 65ch; }
/* episode row: the row is the link (title, status, arrow); "Watched it later" sits in its own column */
.episode-list li { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; align-items: center; column-gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.episode-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title status chev";
  align-items: center; column-gap: 14px; padding: 9px 10px; margin-left: -10px;
  border-radius: 10px; text-decoration: none; color: var(--ink); transition: background-color .15s ease;
}
.episode-link:hover { background: var(--surface-2); }
.episode-title { grid-area: title; font-weight: 600; }
.episode-link > .badge { grid-area: status; }
.episode-link > .chevron { grid-area: chev; }
.episode-list .badge-later { justify-self: end; }

/* rooms */
.crumbs { font-size: 14px; margin-bottom: 8px; }
.episode-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 16px 0; }
.episode-card h2 { margin-top: 0; font-size: 18px; }
.notice { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.warn-box { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 14px; padding: 20px; }
.warn-box h1 { color: var(--warn-ink); font-size: clamp(22px, 3vw, 28px); }
.button {
  display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: background-color .15s ease, border-color .15s ease;
}
.button:hover { background: color-mix(in srgb, var(--ink) 78%, #000); }

/* coming soon */
.coming-soon { text-align: center; padding: 10vh 0; }
.icon-xl { width: 140px; height: 140px; }
.wordmark-xl { font-size: clamp(36px, 8vw, 64px); margin: .2em 0 .4em; }
.pill { display: inline-block; margin-top: 28px; padding: 8px 18px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 32px; font-size: 14px; }

@media (max-width: 600px) {
  .series-head { flex-direction: column; }
  .poster-lg { width: 110px; height: 154px; }
  .episode-list li { grid-template-columns: minmax(0, 1fr); }
  .episode-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title chev" "status chev"; row-gap: 2px; }
  .episode-list .badge-later { justify-self: start; margin: 0 0 10px; }
  .wordmark { font-size: 19px; }
  .room-list { grid-template-columns: minmax(0, 1fr); }
  .room-item { min-width: 0; max-width: 100%; }
  li.room-item.new-series { flex-wrap: wrap; }
  .new-series .room-item-text { flex: 1 1 calc(100% - 56px); }
  a.room-item { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "poster text chev" "poster status chev"; row-gap: 2px; }
  .room-item .badge { white-space: normal; }
}

/* ---------- forms, accounts, filters, admin (Plan 2) ---------- */
.narrow { max-width: 520px; }
.stack { display: grid; gap: 10px; justify-items: start; }
.stack input:not([type="checkbox"]), .stack select, .inline-form input, .admin-table input, .admin-table select {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); width: 100%; max-width: 420px;
}
label { font-weight: 600; color: var(--ink); }
.small { font-size: 14px; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.form-error { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; }
.or { color: var(--muted); margin: 6px 0; }
button.button { cursor: pointer; font: inherit; font-weight: 700; }
/* secondary: outlined, quieter than the filled primary but still clearly a button */
.button.button-quiet { background: var(--surface); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); box-shadow: none; }
.button.button-quiet:hover { background: var(--surface-2); border-color: var(--ink); }
.button.button-danger { background: #b42318; color: #fff; }
.button.button-danger:hover { background: #8f1c13; }
/* a button that reads as a text link */
.link-button {
  background: none; border: 0; padding: 4px 6px; color: var(--muted); cursor: pointer; font: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.link-button:hover { color: var(--ink); text-decoration-thickness: 2px; }
.invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 18px; }
.invite p { margin: 0; }
.filters { display: grid; gap: 10px; margin-bottom: 20px; }
.filters .search { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pick-card { display: block; position: relative; cursor: pointer; font-weight: 700; color: var(--ink); }
.pick-card input { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; accent-color: var(--accent); z-index: 1; }
.pick-card:has(input:checked) .poster { outline: 3px solid var(--accent); outline-offset: 2px; }
.pick-card span { display: block; margin-top: 6px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.new-series form { margin: 0; }
.follow-list { list-style: none; margin: 0 0 16px; padding: 0; }
.follow-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.follow-list form { margin: 0; }
.follow-name { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; text-decoration: none; font-weight: 700; }
.follow-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.follow-name:hover .follow-title { text-decoration-thickness: 2px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 24px; }
.admin-table th, .admin-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 420px) {
  .site-nav { gap: 8px; font-size: 14px; }
  .w-com { display: none; }
}
