:root {
  --paper: #fffdfa;
  --ink: #26201c;
  --red: #c8102e;
  --rule: #d9d3cb;
  --tint: #f3eee6;
  --green: #2f6b43;
  --muted: #6e655d;
  --card: #fffefa;
  --card-rule: #ece5d8;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1715;
    --ink: #efe9e1;
    --red: #ff4d5e;
    --rule: #3e3733;
    --tint: #262120;
    --green: #7fc392;
    --muted: #a69b91;
    --card: #2a2522;
    --card-rule: #342e2a;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1715;
  --ink: #efe9e1;
  --red: #ff4d5e;
  --rule: #3e3733;
  --tint: #262120;
  --green: #7fc392;
  --muted: #a69b91;
  --card: #2a2522;
  --card-rule: #342e2a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  padding: 0 16px;
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}
.masthead {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 22px 0 14px; border-bottom: 2px solid var(--ink);
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72, "SOFT" 30; text-decoration: none; color: var(--red);
  display: inline-flex; align-items: center; gap: 10px;
}
.brand .plate { width: 22px; height: 22px; }
.masthead-nav { display: flex; gap: 20px; font-size: 0.95rem; }
.masthead-nav a { text-decoration: none; color: var(--muted); }
.masthead-nav a:hover { color: var(--red); }
main { max-width: 1100px; margin: 0 auto; min-height: 60vh; }
.colophon { max-width: 1100px; margin: 64px auto 40px; border-top: 1px solid var(--rule); padding-top: 14px; color: var(--muted); font-size: 0.85rem; }
.colophon p { max-width: var(--measure); margin: 0; }
.loading, .empty { color: var(--muted); padding: 48px 0; font-family: var(--serif); font-size: 1.2rem; }

/* Index */
.search-hero { padding: 40px 0 18px; }
.search-hero label { display: block; font-family: var(--serif); font-size: 1.1rem; color: var(--muted); margin-bottom: 6px; }
.search-hero input {
  width: 100%; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-variation-settings: "opsz" 144; padding: 4px 0 8px; border-radius: 0;
}
.search-hero input::placeholder { color: var(--rule); }
.filters { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 10px 0 22px; font-size: 0.92rem; }
.filters .group { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.filters .group-name { color: var(--muted); margin-right: 8px; }
.chip {
  border: 1px solid transparent; background: transparent; color: var(--ink); font: inherit;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--rule); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filters select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 6px; }
.result-count { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

.year-group { display: grid; grid-template-columns: 90px 1fr; gap: 0 20px; border-top: 1px solid var(--rule); padding: 14px 0 8px; }
.year-group h2 {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1;
  color: var(--red); font-variation-settings: "opsz" 144; position: sticky; top: 12px; align-self: start;
}
.week-list { list-style: none; margin: 0; padding: 0; }
.week-row {
  display: grid; grid-template-columns: minmax(150px, 1.1fr) 120px minmax(0, 3fr); gap: 0 18px; align-items: baseline;
  padding: 7px 8px; margin: 0 -8px; border-radius: 6px; text-decoration: none;
}
.week-row:hover { background: var(--tint); }
.week-row .loc { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; font-variation-settings: "opsz" 24; }
.week-row .loc small { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-left: 6px; }
.week-row .dates { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.88rem; white-space: nowrap; }
.week-row .people { color: var(--muted); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row .people .w { color: var(--green); font-weight: 600; }
.fmt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; color: var(--red); margin-left: 6px; }

/* Week page */
.back { display: inline-block; margin: 18px 0 8px; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.back:hover { color: var(--red); }
.week-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 40px; align-items: end; padding: 8px 0 20px; border-bottom: 1px solid var(--rule); }
.week-head h1 {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 0.98;
  letter-spacing: -0.02em; font-variation-settings: "opsz" 144, "SOFT" 60;
}
.week-head .sub { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }
.week-head .sub span + span::before { content: " / "; color: var(--rule); }
.week-head .prize { font-family: var(--serif); font-size: 1.3rem; color: var(--red); white-space: nowrap; font-variation-settings: "opsz" 48; }
.synopsis { max-width: var(--measure); font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; margin: 22px 0 8px; font-variation-settings: "opsz" 18; }
.synopsis::before { content: "Channel 4 says: "; color: var(--muted); font-style: italic; }
.section { display: grid; grid-template-columns: 90px 1fr; gap: 0 20px; padding: 28px 0 8px; }
.section > h2 { margin: 2px 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--muted); font-variation-settings: "opsz" 24; }
.plan { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.plan td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.plan td.n { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan td.name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; white-space: nowrap; font-variation-settings: "opsz" 24; }
.plan td.name small { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
.plan td.occ { color: var(--muted); }
.plan td.total { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan .winner td.name, .plan .winner td.total { color: var(--green); }
.plan .bio { color: var(--muted); font-size: 0.88rem; margin-top: 3px; max-width: var(--measure); }
.tag { display: inline-block; font-size: 0.72rem; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); margin-right: 4px; }

.night { display: grid; grid-template-columns: 90px 1fr; gap: 0 20px; padding: 30px 0 16px; border-top: 1px solid var(--rule); }
.night .num {
  font-family: var(--serif); font-weight: 300; font-size: 5rem; line-height: 0.8; color: var(--red);
  font-variation-settings: "opsz" 144, "SOFT" 100; letter-spacing: -0.04em;
}
.night .num small { display: block; font-family: var(--sans); font-size: 0.78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 10px; }
.night h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.15; font-variation-settings: "opsz" 48; }
.night h3 small { font-family: var(--sans); font-weight: 400; font-size: 0.9rem; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.night .aired { color: var(--muted); font-size: 0.88rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.night-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px 36px; margin-top: 14px; }
.prose { max-width: var(--measure); font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; font-variation-settings: "opsz" 18; }
.prose p { margin: 0 0 10px; }
.prose p.c4 { color: var(--muted); font-style: italic; }
.detail { font-size: 0.92rem; margin: 10px 0 0; max-width: var(--measure); }
.detail dt { color: var(--muted); float: left; clear: left; width: 110px; }
.detail dd { margin: 0 0 6px 120px; }
.narrator { border-left: 3px solid var(--red); padding: 2px 0 2px 12px; margin: 10px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.02rem; max-width: var(--measure); }
.narrator::before { content: "Dave Lamb: "; font-style: normal; color: var(--muted); font-family: var(--sans); font-size: 0.85rem; }
/* The menu card: the show opens every night on the host's handwritten card. */
.menu {
  background: var(--card); color: var(--ink); padding: 18px 22px 16px; border-radius: 2px; align-self: start;
  box-shadow: 0 1px 2px rgba(40, 20, 10, 0.10), 0 10px 28px rgba(40, 20, 10, 0.08);
  transform: rotate(-1.4deg); transform-origin: 50% 0;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--card-rule) 31px 32px);
  background-position: 0 14px;
}
.menu:hover { transform: rotate(0deg); }
.menu h4 { margin: 0 0 10px; font-family: var(--hand); font-weight: 600; font-size: 1.6rem; line-height: 1; color: var(--red); }
.menu dl { margin: 0; }
.menu dt { font-family: var(--sans); font-size: 0.72rem; color: var(--muted); margin-top: 10px; }
.menu dd { margin: 0; font-family: var(--hand); font-weight: 500; font-size: 1.5rem; line-height: 1.1; }
.menu dd small { display: block; font-family: var(--sans); color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 3px; }
.menu.none { font-family: var(--hand); font-size: 1.3rem; line-height: 1.2; color: var(--muted); background-image: none; }
.menu-missing { color: var(--muted); font-size: 0.88rem; padding-top: 4px; }

/* The table plan: who sat where, in hosting order clockwise from the top. */
.table-plan { display: block; width: 100%; max-width: 640px; height: auto; margin: 4px 0 18px; overflow: visible; }
.table-plan .top { fill: var(--tint); stroke: var(--rule); stroke-width: 1.5; }
.table-plan .cloth { fill: none; stroke: var(--rule); stroke-dasharray: 2 4; }
.table-plan .seat { cursor: pointer; }
.table-plan .seat circle.plate { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.table-plan .seat circle.rim { fill: none; stroke: var(--rule); }
.table-plan .seat text { font-family: var(--sans); font-size: 13px; fill: var(--ink); }
.table-plan .seat .n { font-family: var(--serif); font-size: 15px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.table-plan .seat .who { font-family: var(--serif); font-weight: 600; font-size: 15px; }
.table-plan .seat .occ { fill: var(--muted); font-size: 11.5px; }
.table-plan .seat.winner circle.plate { stroke: var(--green); stroke-width: 2.5; }
.table-plan .seat.winner .who, .table-plan .seat.winner .n { fill: var(--green); }
.table-plan .seat:hover circle.plate { stroke: var(--red); }
.table-plan .seat:hover .who { fill: var(--red); }
.table-plan .seat:focus-visible { outline: none; }
.table-plan .seat:focus-visible circle.plate { stroke: var(--red); stroke-width: 3; }
.taxi { margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.taxi li { margin-bottom: 6px; }
.taxi b { font-variant-numeric: tabular-nums; color: var(--red); margin-right: 8px; }
.ratings { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.ratings b { color: var(--ink); }
details.notes { margin: 32px 0 0; border-top: 1px solid var(--rule); padding-top: 12px; color: var(--muted); font-size: 0.9rem; }
details.notes summary { cursor: pointer; font-family: var(--serif); font-size: 1rem; color: var(--ink); }
details.notes p { max-width: var(--measure); white-space: pre-wrap; }
.conf { font-size: 0.72rem; color: var(--muted); }

@media (max-width: 760px) {
  .masthead { flex-wrap: wrap; }
  .year-group, .section, .night { grid-template-columns: 1fr; gap: 6px 0; }
  .year-group h2 { position: static; }
  .week-row { grid-template-columns: 1fr; gap: 0; }
  .week-row .people { white-space: normal; }
  .week-head { grid-template-columns: 1fr; }
  .night-body { grid-template-columns: 1fr; }
  .night .num { font-size: 3rem; display: flex; align-items: baseline; gap: 10px; }
  .night .num small { margin: 0; }
  .table-plan { display: none; }
  .plan td.name { white-space: normal; }
  .plan td.total { display: none; }
  .plan .winner td.name::after { content: ' (winner)'; font-family: var(--sans); font-weight: 400; font-size: 0.85rem; }
  .detail dt { float: none; width: auto; }
  .detail dd { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .week-row { transition: background 120ms; }
  .menu { transition: transform 220ms ease-out; }
  /* One moment per week page: guests take their seats in hosting order. */
  .table-plan .seat { animation: sit 420ms ease-out both; animation-delay: calc(var(--i) * 110ms + 80ms); }
  @keyframes sit { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
