/* mainstory.quest — styles ported from the Mainstory.dc.html design.
   Palette, type scale, borders and animations are kept as designed; layout is
   extended with breakpoints the 1440px design preview never had to handle. */

:root {
  /* Gold is the action colour — buttons, the selected day, prices. Plum,
     picked off Luma's hat, is the atmospheric second accent: washes, rules,
     countdowns and the orrery behind everything.

     Gold splits in two because a properly yellow gold can't do both jobs.
       --gold-fill  #e6b731  bright and yellow. Backgrounds only. White text on
                             it is 1.9:1 (illegible), so anything sitting on it
                             uses --on-gold instead — that pairing is 8.8:1.
       --accent     #846400  the same hue driven dark enough to be *text* on
                             paper (4.77:1, clears AA). Prices, numerals, links.
     Keep them in step: shift one hue, shift both.

     --accent is tied to --paper, not independent of it: it was #8f6c00 at
     4.66:1 while the paper was near-white, and moving the paper down to
     parchment cost it 0.45 and dropped it under the 4.5 bar. Anything that
     darkens --paper has to darken --accent and --ink-muted with it. */
  --gold-fill: oklch(0.80 0.15 88);
  --on-gold: oklch(0.24 0.012 70);
  --accent: oklch(0.52 0.115 88);
  --accent-hex: #846400;
  --plum: oklch(0.44 0.15 322);
  --plum-mid: oklch(0.55 0.15 320);
  --plum-soft: oklch(0.68 0.11 318);
  --plum-wash: oklch(0.925 0.024 320);
  --plum-line: oklch(0.6 0.14 320 / 0.28);
  /* Parchment, not white. Everything below that used to be a near-white had to
     come down with it, because those surfaces were tuned as offsets from the
     paper — a "subtle grey" hover at 0.96 sitting on a 0.95 page would read as
     a highlight instead of a press. Order matters more than the values: card
     and masthead sit above the paper, field/sunk/hover sit below it. */
  --paper: oklch(0.95 0.018 85);
  --card: oklch(0.995 0.005 85);
  --ink: oklch(0.24 0.012 70);
  --ink-strong: oklch(0.2 0.012 70);
  --ink-soft: oklch(0.44 0.012 70);
  --ink-muted: oklch(0.53 0.012 70);
  --line: oklch(0.6 0.01 70 / 0.18);
  --line-strong: oklch(0.6 0.01 70 / 0.28);
  --accent-line: oklch(0.7 0.13 88 / 0.55);
  --wash: oklch(0.965 0.04 90);

  /* Ink ladder — one scale from headings down to disabled text. Every greyed
     label in the sheet picks a rung here rather than inventing a lightness, so
     the dark theme only has to invert seven values instead of forty. */
  --ink-2: oklch(0.30 0.012 70);
  --ink-3: oklch(0.37 0.012 70);
  --ink-4: oklch(0.51 0.012 70);
  --ink-faint: oklch(0.74 0.008 70);
  /* Display-face headings. Light mode inherits body ink; dark flips it to gold. */
  --heading: var(--ink);

  /* hairlines and background texture */
  --star: oklch(0.6 0.01 70 / 0.1);
  --dot: oklch(0.55 0.01 70 / 0.18);
  --line-soft: oklch(0.6 0.01 70 / 0.14);
  --line-mid: oklch(0.6 0.01 70 / 0.22);
  --line-hard: oklch(0.6 0.01 70 / 0.35);

  /* surfaces */
  --masthead-bg: oklch(0.965 0.012 85 / 0.92);
  --field: oklch(0.925 0.016 85);
  --sunk: oklch(0.94 0.016 85);
  --row-hover: oklch(0.975 0.012 85);
  --hover: oklch(0.915 0.016 85);
  --hover-strong: oklch(0.89 0.018 85);
  --gold-wash: oklch(0.94 0.05 92);

  /* gold and plum derivatives */
  --accent-hover: oklch(0.5 0.115 88);
  --accent-deep: oklch(0.4 0.08 88);
  --accent-line-soft: oklch(0.7 0.13 88 / 0.45);
  --accent-ring: oklch(0.72 0.13 88 / 0.6);
  --accent-fill-soft: oklch(0.82 0.14 88 / 0.24);
  --gold-glow: oklch(0.80 0.15 88 / 0.32);
  --selection: oklch(0.78 0.13 320 / 0.45);
  --plum-rule: oklch(0.6 0.14 320 / 0.32);
  --brand-word: var(--ink);
  --brand-tld: var(--plum-mid);
  /* The big day numerals down the results list. Same hue and chroma as the
     button gold, driven down in lightness until it clears the 3:1 large-text
     bar — the button's own 0.80 measured 1.62:1 on the parchment, which was
     decorative rather than readable. 0.62 is the brightest value on this hue
     that passes, at 3.17:1. */
  --date-num: oklch(0.62 0.15 88);
  --hat-glow: oklch(0.44 0.15 322 / 0.3);
  --danger: oklch(0.5 0.17 28);

  color-scheme: light;
}

/* ---------- dark theme ----------

   Same two-accent logic as light, re-pointed: the paper goes deep plum and the
   gold stops being only an action colour — it now carries the display headings
   too, which is what --heading exists for.

   Gold flips role between themes. On paper it has to be driven dark
   (--accent #8f6c00) to clear AA as text — 4.66:1. On plum the constraint
   inverts: the gold can go up to the button's own yellow and gets *more*
   contrast, not less, so --accent is raised to meet --gold-fill instead of
   being dimmed away from it. Measured against --paper it lands at 11.7:1, and
   10.6:1 on --card, which is why headings, prices and links can all share it.
   Body copy stays a near-white lavender: gold everywhere would be unreadable
   at paragraph length, so only the display face takes it. */
[data-theme='dark'] {
  --gold-fill: oklch(0.80 0.15 88);
  --on-gold: oklch(0.22 0.02 300);
  --accent: oklch(0.84 0.15 89);
  --accent-hex: #f0c64a;
  --plum: oklch(0.80 0.09 318);
  --plum-mid: oklch(0.74 0.12 318);
  --plum-soft: oklch(0.62 0.12 318);
  --plum-wash: oklch(0.26 0.06 314);
  --plum-line: oklch(0.72 0.12 318 / 0.34);
  --paper: oklch(0.175 0.052 312);
  --card: oklch(0.225 0.048 313);
  --ink: oklch(0.92 0.018 320);
  --ink-strong: oklch(0.84 0.14 89);
  --ink-soft: oklch(0.80 0.022 320);
  --ink-muted: oklch(0.70 0.022 320);
  --line: oklch(0.82 0.05 320 / 0.16);
  --line-strong: oklch(0.82 0.05 320 / 0.28);
  --accent-line: oklch(0.80 0.14 88 / 0.5);
  --wash: oklch(0.28 0.06 310);

  --ink-2: oklch(0.88 0.02 320);
  --ink-3: oklch(0.82 0.02 320);
  --ink-4: oklch(0.72 0.022 320);
  --ink-faint: oklch(0.46 0.03 315);
  --heading: var(--accent);

  --star: oklch(0.9 0.06 320 / 0.14);
  --dot: oklch(0.9 0.06 320 / 0.16);
  --line-soft: oklch(0.82 0.05 320 / 0.12);
  --line-mid: oklch(0.82 0.05 320 / 0.2);
  --line-hard: oklch(0.82 0.05 320 / 0.3);

  --masthead-bg: oklch(0.175 0.052 312 / 0.88);
  --field: oklch(0.235 0.05 313);
  --sunk: oklch(0.205 0.045 313);
  --row-hover: oklch(0.255 0.055 313);
  --hover: oklch(0.27 0.055 313);
  --hover-strong: oklch(0.30 0.06 313);
  --gold-wash: oklch(0.30 0.075 90);

  --accent-hover: oklch(0.90 0.13 90);
  --accent-deep: oklch(0.88 0.12 90);
  --accent-line-soft: oklch(0.80 0.14 88 / 0.4);
  --accent-ring: oklch(0.80 0.14 88 / 0.55);
  --accent-fill-soft: oklch(0.82 0.14 88 / 0.22);
  --gold-glow: oklch(0.80 0.15 88 / 0.34);
  --selection: oklch(0.62 0.13 320 / 0.55);
  --plum-rule: oklch(0.75 0.12 320 / 0.4);
  /* Parchment on the name, gold on the TLD — the reverse of the light theme,
     where the name is ink and .quest is the coloured half. Keeping the accent
     on the shorter word stops the masthead from going mostly gold now that the
     headings below it already are. The parchment is the same value the light
     theme uses for its paper: warm, so it reads as paper beside the gold
     rather than as a cold grey. */
  --brand-word: oklch(0.95 0.018 85);
  --brand-tld: var(--accent);
  /* Dark keeps --accent, which is already the bright gold on plum. */
  --date-num: var(--accent);
  /* Gold, not plum: the hat is mostly purple, so on the plum ground it was
     sinking into the masthead. A warm bloom is the one thing in the palette
     that separates it from the background instead of blending with it. */
  --hat-glow: oklch(0.83 0.16 88 / 0.6);
  --danger: oklch(0.72 0.16 28);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  overflow-x: hidden;
}

::selection { background: var(--selection); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- animations ---------- */

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes pulseDot { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }
/* The portal's 8 frames are not evenly timed — frame 5 (the "!" beat) holds for
   220ms against frame 3's 95ms — so this steps by hand rather than using
   steps(8), which would flatten the beat to a uniform 132ms. Stops and the
   1.06s loop are emitted by make-portal.py; regenerate rather than hand-edit. */
@keyframes portalSpin {
    0.00% { background-position:     0 0; }
   14.15% { background-position:  -20px 0; }
   25.47% { background-position:  -40px 0; }
   35.38% { background-position:  -60px 0; }
   44.34% { background-position:  -80px 0; }
   54.72% { background-position: -100px 0; }
   75.47% { background-position: -120px 0; }
   86.32% { background-position: -140px 0; }
   100%   { background-position: -140px 0; }
}
@keyframes starDrift { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-90px, -150px, 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- background orrery ---------- */

.orrery {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--paper);
}
.orrery__stars {
  position: absolute;
  inset: -10%;
  animation: starDrift 300s linear infinite;
  background-image: radial-gradient(var(--star) 1px, transparent 1.4px);
  background-size: 160px 160px;
}
/* Every 1px line that used to live here — the two spoked dials
   (.orrery__ring, .hero__dial) and the big sweeping .orrery__circle — has been
   cut. At hairline weight against the paper they read as cracks in the
   background rather than as an orrery. The drifting star field is the whole
   backdrop now, and it is enough. */

.shell { position: relative; z-index: 1; }

/* Everything set in the display face is a heading, and headings are the text
   that turns gold in dark mode. Declared once, early, so any rule below that
   sets its own colour (.group__day, .row__title) still wins on source order.
   In light mode --heading resolves to --ink, i.e. exactly the inherited body
   colour these already had. */
.hero h1,
.upcard__title,
.results__title,
.regular__name,
.cta h2,
.detail__hero h1,
.detail__daynum,
.simrow__title,
.page h1,
.page h2 { color: var(--heading); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 40px;
  background: var(--masthead-bg);
  backdrop-filter: blur(14px);
  border-bottom: 3px double var(--line-hard);
}
.masthead__left { display: flex; align-items: center; gap: 32px; min-width: 0; }
.masthead__right { display: flex; align-items: center; flex: 1; justify-content: flex-end; gap: 14px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 9px; flex: none; }
/* Source is 128px; shown at 38 so it stays sharp on 2–3× screens. Left to
   smooth downscaling — nearest-neighbour at 3.4:1 shreds the hat's detail. */
.brand__hat {
  width: 50px;
  height: 50px;
  flex: none;
  margin: -6px 0;            /* let it overhang without growing the masthead */
  animation: bob 3.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 7px var(--hat-glow));
}
/* Two stacked shadows rather than one: a tight core to lift the hat off the
   plum, and a wide halo for the actual glow. A single large-radius shadow at
   this alpha just looks like a smudge. */
[data-theme='dark'] .brand__hat {
  filter: drop-shadow(0 0 4px var(--hat-glow)) drop-shadow(0 2px 14px var(--hat-glow));
}
/* The wordmark is the one place the two theme colours swap sides, so it opts
   out of --heading and drives its two halves from their own tokens. Light:
   ink + plum, as designed. Dark: parchment + gold. */
.brand__word {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-word);
}
.brand__tld { color: var(--brand-tld); }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-4);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { font-weight: 600; color: var(--accent); }

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  max-width: 210px;
  min-width: 0;
  padding: 5px 10px;
  background: var(--field);
  border: 1px solid var(--line-mid);
  border-radius: 2px;
  transition: border-color 0.2s ease;
}
.search:focus-within { border-color: var(--accent-line); }
.search__icon {
  display: flex;
  flex: none;
  color: var(--ink-muted);
  cursor: text;
}
.search input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13.5px;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  padding: 6px 0;
}

.chip-city {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 7px 10px 7px 14px;
  border: 1px solid var(--line-mid);
  border-radius: 3px;
  font-size: 13px;
  color: var(--ink-3);
  transition: border-color 0.2s ease;
}
.chip-city:focus-within { border-color: var(--accent-line); }
/* Native select, restyled rather than replaced: it gets the platform's own
   picker on a phone, which is the right control for two options and needs no
   JS to be accessible. */
.chip-city__select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 18px 0 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  /* Chevron drawn as a background image so it inherits the text colour. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) calc(50% + 1px), calc(100% - 5px) calc(50% + 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.chip-city__select option { color: var(--ink); background: var(--card); }
.chip-city__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  /* 6px of pure decoration — the showy gold can be used freely here. */
  background: var(--gold-fill);
  animation: pulseDot 2.6s ease-in-out infinite;
}

/* Square icon button, sized to match .chip-city beside it. Only the icon for
   the theme you'd be switching *to* is rendered — the moon on paper, the sun
   on plum — so the button always reads as the destination, not the state. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 33px; height: 33px;
  padding: 0;
  cursor: pointer;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--line-mid);
  border-radius: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--hover);
}
.theme-toggle__sun { display: none; }
[data-theme='dark'] .theme-toggle__moon { display: none; }
[data-theme='dark'] .theme-toggle__sun { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn--primary { color: var(--on-gold); background: var(--gold-fill); }
.btn--primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn--ghost { color: var(--ink); background: transparent; border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--hover); }

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding: 58px 40px 40px; text-align: center; }
/* While a filter is on, the hero collapses to a sliver so the results — the
   only thing that responded to the query — are on screen straight away. */
.hero--compact { padding: 0; }
.hero__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero__inner { position: relative; max-width: 700px; }

/* ---------- mascot ---------- */

.hero__mascot { flex: none; }
.mascot {
  width: 256px;
  height: 256px;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mascot__sprite {
  width: 128px;
  height: 128px;
  /* background-image is set from JS — which character loads is picked at
     random per visit. */
  background-repeat: no-repeat;
  background-position: 0 0;
  /* 792 not 768: the packs ship a padded atlas — 128px frames on a 132px grid
     with a 2px margin — and recommend it for web use so neighbouring frames
     can never bleed in. app.js positions with the matching stride and offset;
     the two have to change together. */
  background-size: 792px 792px;
  image-rendering: pixelated;
  /* Integer scale keeps the pixel art crisp — see the packs' READMEs. */
  transform: scale(2);
  transform-origin: center;
  transition: translate 0.18s ease-out;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--plum);
  /* Tighter on the left than the right: the portal is a circle in a square box,
     so its own transparent corners already read as padding. */
  padding: 3px 10px 3px 5px;
  border: 1px solid var(--plum-line);
  border-radius: 3px;
  /* The gap to the headline is NOT set here — `.hero p` below zeroes every
     hero paragraph's margin and outranks this rule (class + element beats a
     lone class), so a margin-bottom on this selector silently does nothing.
     It lives in the pixel-corner block at the end of the sheet, on a selector
     specific enough to win. */
  background: var(--plum-wash);
}
/* The animated portal, in place of the old 4px pulsing dot. The sprite is
   pre-downscaled to 16px by make-portal.py (2x for retina) — deliberately NOT
   a 128px source shrunk by the browser, and deliberately no `pixelated`, which
   only ever applies to upscaling. See README → The portal badge.

   The global prefers-reduced-motion block collapses the animation, which parks
   this at background-position 0 — frame 0, the closed portal. That is the right
   still frame, so no separate reduced-motion rule is needed. */
.hero__badge span {
  width: 20px; height: 20px;
  flex: none;
  background-image: url(assets/portal-strip.png?v=2);
  background-size: 160px 20px;
  background-repeat: no-repeat;
  animation: portalSpin 1.06s step-end infinite;
}
.hero h1 {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 50px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.hero p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}

/* ---------- section furniture ---------- */

.wrap { max-width: 1180px; margin: 0 auto; }

.eyebrow {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before { content: ''; width: 14px; height: 3px; background: var(--plum-mid); }

/* ---------- next up ---------- */

.nextup { padding: 12px 40px 8px; }
.nextup__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.nextup__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.nextup__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.upcard {
  position: relative;
  display: block;
  padding: 20px 22px;
  border-radius: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.upcard:hover { transform: translateY(-3px); border-color: var(--accent-line); }
/* Corner emblem. Absolutely placed so it cannot push the card's text around —
   these cards sit in an auto-fit grid and each one is a different height
   already. pointer-events:none keeps the whole card a single click target. */
.upcard__emblem {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  opacity: 0.9;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.upcard:hover .upcard__emblem { opacity: 1; transform: scale(1.08); }
.upcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.upcard__slot {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* On-today cards shout. The slot text roughly doubles and takes the gold, and
   the card gets a gold edge so the eye lands on it before it reads any words.
   Everything else in the strip stays as it was — this only works as emphasis
   while it is the exception. */
.upcard__slot--today {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}
/* The gold ring was an *outer* box-shadow, which the corner clip removes. The
   outline is the element's own background now — see "pixel corners" below — so
   the today card just changes what that background is. */
.upcard--today {
  background: var(--gold-fill);
  box-shadow: none;
}
.upcard__title {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.upcard__meta { font-size: 13px; color: var(--ink-soft); }
/* Reserve the corner so a long venue name wraps rather than running under
   the emblem. */
.upcard__venue { font-size: 13px; color: var(--ink-muted); padding-right: 52px; }

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  flex: none;
  white-space: nowrap;
}

/* ---------- main listings layout ---------- */

.listings {
  scroll-margin-top: 84px; /* clears the sticky masthead */
  padding: 56px 40px 90px;
  display: grid;
  grid-template-columns: minmax(0, 264px) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}
.sidebar { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }

.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal__month { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.cal__nav { display: flex; gap: 6px; }
.cal__nav button {
  font-family: inherit;
  font-size: 14px;
  width: 27px; height: 27px;
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-mid);
  color: var(--ink-3);
  transition: background 0.2s ease;
}
.cal__nav button:hover:not(:disabled) { background: var(--hover-strong); }
.cal__nav button:disabled { opacity: 0.35; cursor: default; }

.cal__weekdays, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal__weekdays { margin-bottom: 6px; }
.cal__weekdays div {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
}
.cal__cell {
  height: 38px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: inherit;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cal__cell--blank { background: transparent; border: 1px solid transparent; }
.cal__cell--empty { background: var(--sunk); border: 1px solid var(--line-soft); color: var(--ink-faint); cursor: default; }
.cal__cell--has { background: var(--plum-wash); border: 1px solid var(--plum-line); color: var(--ink-strong); cursor: pointer; }
.cal__cell--has:hover { transform: translateY(-2px); }
.cal__cell--sel { background: var(--gold-fill); border: 1px solid var(--gold-fill); color: var(--on-gold); cursor: pointer; }
.cal__cell span { font-size: 12.5px; font-weight: 600; line-height: 1; }
.cal__dots { display: flex; gap: 3px; }
.cal__dots i { width: 4px; height: 4px; border-radius: 50%; display: block; }

.filter-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 11px;
}
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 3px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink-3);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}
.pill:hover { border-color: var(--accent-line); }
.pill[aria-pressed='true'] { background: var(--gold-fill); color: var(--on-gold); border-color: var(--gold-fill); }
/* Free shares the row with the category pills but is an independent toggle
   rather than one-of-N, so it can be lit at the same time as a category. The
   tinted border marks it as a different kind of control. A divider would have
   been clearer still, but the row wraps, and a wrapped divider lands at the
   start of a line and reads as a mistake. */
.pill--free { border-color: var(--accent-line-soft); color: var(--accent); }
.pill--free[aria-pressed='true'] { color: var(--on-gold); }

.results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.results__title {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}
.results__meta { display: flex; align-items: center; gap: 12px; }
.results__count { font-size: 13px; color: var(--ink-4); }
.results__clear {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
}
.results__clear:hover { background: var(--hover); }

.groups { display: flex; flex-direction: column; gap: 44px; }
.group__head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.group__date { display: flex; align-items: baseline; gap: 10px; }
.group__day {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--date-num);
}
.group__month { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.group__dow { font-size: 14px; color: var(--ink-4); }
.group__countdown {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plum);
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--plum-wash);
}
/* Matches .upcard__slot--today, so a day heading and a card for the same event
   carry the same weight. --accent on --gold-wash rather than the plum pair,
   because the plum wash is what every other day already uses. */
.group__countdown--today {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--gold-wash);
  padding: 4px 12px;
}
.group__rule { flex: 1; height: 1px; min-width: 40px; background: linear-gradient(90deg, var(--plum-rule), transparent); }
.group__list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.row:hover {
  background: var(--row-hover);
  border-left-color: var(--accent);
  transform: translateX(3px);
}
.row__when { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.row__title {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink-strong);
  transition: color 0.25s ease;
}
.row:hover .row__title { color: var(--accent-hover); }
.row__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.row__venue { font-size: 13px; color: var(--ink-4); }
.row__price { font-size: 13px; font-weight: 600; color: var(--accent); }
/* The listing emblem, leading the row. Replaces the old "!" glyph, so the
   circular chip that framed a single character is gone — these are illustrated
   marks with their own silhouette and internal gold, and a border fought them.

   Smoothed, NOT `image-rendering: pixelated`, for the same reason the hat logo
   is: these are 128px sources shown at 48px, and nearest-neighbour at a ~2.7:1
   downscale drops two pixels in every three at uneven intervals, which is what
   made the emblems muddy at 34px. Pixelated is for upscaling — it is correct on
   .mascot__sprite, which is scaled up 2×, and wrong here.

   align-self:start so it sits with the title rather than floating to the
   vertical centre of a two-line row. */
.row__bang {
  width: 48px;
  height: 48px;
  flex: none;
  align-self: start;
  opacity: 0.92;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.row:hover .row__bang { opacity: 1; transform: scale(1.12); }

.expand {
  width: 100%;
  margin-top: 34px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--accent-line-soft);
  padding: 15px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.expand:hover { background: var(--hover); transform: translateY(-1px); }
.expand--less { background: transparent; border-color: var(--line-strong); color: var(--ink-3); }

.empty { text-align: center; padding: 70px 20px; color: var(--ink-4); font-size: 14px; }

/* ---------- regulars ---------- */

.regulars { padding: 0 40px 80px; }
.regulars__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.regulars__note { font-size: 12.5px; color: var(--ink-muted); }
.regulars__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.regular {
  display: block;
  padding: 18px 20px;
  border-radius: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.regular:hover { transform: translateY(-3px); border-color: var(--plum-line); }
.regular__name {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.regular__when {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--plum-mid);
  margin-bottom: 8px;
}
.regular__what { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.regular__area { font-size: 12.5px; color: var(--ink-muted); margin-top: 8px; }

/* ---------- CTA ---------- */

.cta {
  position: relative;
  padding: 66px 40px;
  text-align: center;
  border-top: 1px solid var(--plum-line);
  background: var(--plum-wash);
}
.cta h2 {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 31px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}
.cta p { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 24px; }
.cta .btn { font-size: 14px; padding: 12px 26px; }

/* ---------- detail page ---------- */

.detail { max-width: 1080px; margin: 0 auto; padding: 32px 40px 90px; animation: fadeUp 0.35s ease both; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-4);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}
.back:hover { color: var(--ink); }

.detail__hero {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  padding: 44px;
  margin-bottom: 34px;
  background: var(--plum-wash);
  border: 1px solid var(--plum-line);
}
.detail__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 64px 64px;
  opacity: 0.5;
  pointer-events: none;
}
.detail__heroinner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
/* The same emblem as the listing row, at display size. Grouped with the title
   rather than dropped straight into .detail__heroinner, whose space-between
   would have pushed it to the far left and stranded it away from the words. */
.detail__lead {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  min-width: 0;
}
.detail__emblem {
  width: 112px;
  height: 112px;
  flex: none;
  /* Smoothed, as in .row__bang — see the note there. */
  /* Sits with the title block, not the baseline of the h1's last line. */
  align-self: center;
}
.detail__tags { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.detail__countdown {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum);
}
.detail__hero h1 {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 560px;
  text-wrap: pretty;
}
.detail__when { text-align: right; }
.detail__dow { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.detail__daynum { font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.detail__monthyear { font-size: 22px; font-weight: 600; color: var(--ink-2); }
.detail__time { font-size: 14px; color: var(--ink-3); margin-top: 8px; }

.detail__body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.detail__body p { font-size: 16px; line-height: 1.75; color: var(--ink-soft); margin: 0 0 24px; text-wrap: pretty; }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.taglist span { font-size: 12.5px; padding: 6px 13px; border-radius: 3px; border: 1px solid var(--line-mid); color: var(--ink-soft); }

.factbox {
  position: sticky;
  top: 96px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 24px;
}
.factbox__rows { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.factbox__k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-muted); margin-bottom: 4px; }
.factbox__v { font-size: 14.5px; font-weight: 600; }
.factbox__sub { font-size: 13.5px; color: var(--ink-soft); }
.factbox__sub a { text-decoration: underline; text-underline-offset: 2px; }
.factbox__sub a:hover { color: var(--accent); }
.factbox .btn { width: 100%; font-size: 14px; padding: 12px; margin-bottom: 10px; }
.factbox__source { font-size: 11.5px; color: var(--ink-muted); margin-top: 14px; line-height: 1.5; }
.factbox__source a { text-decoration: underline; text-underline-offset: 2px; }

.similar { margin-top: 64px; }
.similar__list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.simrow {
  display: grid;
  grid-template-columns: minmax(0, 112px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.simrow:hover { transform: translateX(4px); border-color: var(--accent-line); }
.simrow__date { font-size: 15px; font-weight: 600; }
.simrow__cd { font-size: 12px; color: var(--ink-muted); }
.simrow__title {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.simrow__time { font-size: 13px; color: var(--ink-4); }

/* ---------- submit / about ---------- */

.page { max-width: 720px; margin: 0 auto; padding: 64px 40px 100px; animation: fadeUp 0.35s ease both; }
.page--narrow { max-width: 620px; }
.page__bang {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 32px var(--gold-glow);
  margin-bottom: 14px;
  animation: bob 3.6s ease-in-out infinite;
  text-align: center;
}
.page h1 {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 31px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}
.page h2 {
  font-family: 'Bricolage Grotesque', 'Archivo', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 34px 0 10px;
}
.page p, .page li { font-size: 15px; line-height: 1.7; color: var(--ink-soft); text-wrap: pretty; }
.page p { margin: 0 0 14px; }
.page ul { margin: 0 0 14px; padding-left: 20px; }
.page a.inline { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  padding: 11px 13px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }

/* ---------- city request picker ----------

   auto-fill rather than a fixed column count, so the grid reflows from four
   columns to one without breakpoints. The whole label is the hit target — a
   14px checkbox alone is a miserable thing to tap. */
.cityset { border: 0; margin: 0 0 4px; padding: 0; }
.cityset__legend {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 0 8px;
}
.cityset__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.citypick {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--card);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.citypick:hover { border-color: var(--accent); }
.citypick input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; margin: 0; cursor: pointer; }
/* :has so the whole chip fills in, not just the box — the selected set has to be
   readable at a glance when you have ticked six of thirty-one. */
.citypick:has(input:checked) { border-color: var(--accent); background: var(--gold-wash); }
.citypick:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.field textarea { min-height: 110px; resize: vertical; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .btn { padding: 13px; font-size: 14px; }
.form__note { font-size: 12.5px; color: var(--ink-muted); line-height: 1.6; }
.form__status { font-size: 13.5px; line-height: 1.6; margin: 0; }
.form__status:empty { display: none; }
.form__status--ok {
  padding: 12px 14px;
  border-radius: 3px;
  background: var(--gold-wash);
  border: 1px solid var(--accent-line);
  color: var(--accent-deep);
  font-weight: 600;
}
.form__status--err { color: var(--danger); font-weight: 600; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn:disabled:hover { transform: none; filter: none; }

.notice {
  padding: 14px 16px;
  border-radius: 3px;
  background: var(--gold-wash);
  border: 1px solid var(--accent-line);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--accent-deep);
}

/* ---------- footer ---------- */

/* ---------- ensembles ---------- */

/* Shared: scale to the container, never past their natural size (they are
   already only 900px wide, and upscaling this artwork looks soft). */
.ensemble {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
}
/* The action piece closes every page, just above the footer. Not pinned to the
   bottom of the viewport — it belongs to the end of the content. */
.ensemble-band {
  padding: 8px 40px 0;
  display: flex;
  justify-content: center;
}
.ensemble--action { max-width: 760px; }
/* The family piece leads the About page. */
.ensemble--family { max-width: 620px; margin-bottom: 26px; }

.footer {
  padding: 28px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-muted);
}
.footer__links { display: flex; gap: 20px; }
.footer__links a { transition: color 0.2s ease; }
.footer__links a:hover { color: var(--ink-2); }

/* Gold-tinted rather than solid gold: a filled gold button here would compete
   with Submit an Event in the masthead, which is the one action the site
   actually wants. It fills in on hover, so it still reads as a button. */
.coffee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 15px;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--gold-wash);
  border: 1px solid var(--accent-line-soft);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.coffee:hover {
  background: var(--gold-fill);
  border-color: var(--gold-fill);
  color: var(--on-gold);
  transform: translateY(-1px);
}

/* ---------- breakpoints ---------- */

@media (max-width: 1080px) {
  .listings { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; gap: 32px; }
  .sidebar > * { flex: 1 1 280px; }
  .detail__body { grid-template-columns: 1fr; }
  .factbox { position: static; }
}

@media (max-width: 860px) {
  .masthead { flex-wrap: wrap; padding: 14px 20px; gap: 12px; }
  .masthead__left { gap: 18px; width: 100%; justify-content: space-between; }
  .masthead__right { flex-wrap: wrap; }
  /* The masthead is the most crowded strip on a phone, and a permanently open
     search box was most of the problem. It collapses to the same 33px square as
     the theme toggle and only claims a row once focused — tapping the magnifier
     label focuses the input, which is what :focus-within keys off. 16px on the
     input is deliberate: anything smaller and iOS zooms the page on focus. */
  .search {
    flex: none;
    width: 33px;
    height: 33px;
    max-width: none;
    padding: 0;
    justify-content: center;
    overflow: hidden;
  }
  .search input { width: 0; flex: none; padding: 0; font-size: 16px; }
  .search:focus-within {
    flex: 1 1 100%;
    width: auto;
    padding: 5px 10px;
    justify-content: flex-start;
  }
  .search:focus-within input { width: auto; flex: 1; padding: 6px 0; }
  .hero { padding: 32px 20px 28px; }
  .hero h1 { font-size: 34px; }
  /* Side by side leaves the headline barely 200px on a phone — stack instead,
     at 1× so the pixel grid stays sharp. */
  .hero__stage { flex-direction: column; gap: 0; }
  .mascot { width: 128px; height: 128px; }
  .mascot__sprite { transform: scale(1); }
  .nextup, .listings, .regulars, .cta, .detail, .page, .footer { padding-left: 20px; padding-right: 20px; }
  .ensemble-band { padding: 4px 20px 0; }
  .detail__hero { padding: 26px; }
  .detail__hero h1 { font-size: 28px; }
  .detail__lead { gap: 16px; }
  .detail__emblem { width: 76px; height: 76px; }
  .detail__heroinner { gap: 20px; }
  .detail__when { text-align: left; }
  .detail__daynum { font-size: 34px; }
  /* The emblem stays on a phone. It was hidden here when it was a "!" — pure
     decoration not worth the width — but it now says what kind of event the
     listing is, which is worth more on a small screen, not less. */
  .row { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 16px 18px; }
  .row__bang { width: 42px; height: 42px; }
  .row__title { font-size: 17px; }
  .simrow { grid-template-columns: minmax(0, 96px) minmax(0, 1fr); }
  .simrow__time { display: none; }
  .form__row { grid-template-columns: 1fr; }
  .footer { justify-content: flex-start; }
}

@media (max-width: 520px) {
  /* Brand + nav stop fitting on one line around here; let the nav drop rather
     than push the page wider than the screen. Wrapping makes the bar ~124px
     tall, which is too much to keep pinned on a phone — so it scrolls away
     here and the listings get the full screen. */
  .masthead { position: static; padding: 12px 16px; }
  .listings { scroll-margin-top: 12px; }
  .masthead__left { flex-wrap: wrap; gap: 10px 16px; }
  .brand__word { font-size: 18px; }
  .brand__hat { width: 42px; height: 42px; }
  .nav { gap: 16px; }
  .nav a { font-size: 13px; }
  /* The city chip used to be hidden here to buy room. It stays now: with two
     cities it is a control, and hiding it would strand phone readers in
     whichever city they last chose. The space comes from the Submit button
     shortening to just "Submit" instead. */
  .chip-city { padding: 6px 8px 6px 11px; }
  .btn--primary { padding: 9px 14px; }
  .btn__long { display: none; }
  .hero { padding: 24px 16px 24px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .nextup, .listings, .regulars, .cta, .detail, .page, .footer { padding-left: 16px; padding-right: 16px; }
  .ensemble-band { padding: 0 16px; }
  .ensemble--family { margin-bottom: 18px; }
  .listings { padding-top: 32px; }
  .group__day { font-size: 26px; }
  /* Two columns all the way down — the emblem never stacks above the title. */
  .row { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .row__bang { width: 40px; height: 40px; }
  /* Comfortable thumb targets in the date grid. */
  .cal__cell { height: 44px; }
  .pill { padding: 9px 14px; }
  .results__head { gap: 8px; }
}

/* ---------- pixel corners ----------

   Boxes step at the corners instead of rounding: two steps, which reads as a
   rounded corner drawn at low resolution. Cards and rows step at 3px, the small
   chips at 2px, so the effect scales with the box rather than overwhelming the
   little ones.

   Three things here are load-bearing and easy to undo by accident:

   1. **`clip-path` alone is not enough on a bordered box.** It clips the border
      away at exactly the corners the effect is meant to show, leaving the box
      looking unfinished rather than pixelated. So .upcard and .row carry the
      outline colour as their own background and an inset ::before paints the
      fill, both clipped to the same shape — the outline then follows the steps.
      The chips have no border, so they only need the shape.

   2. **The shape cannot be one custom property driven by a step-size variable.**
      A var() nested inside another custom property resolves against the element
      the property is *declared* on (:root), where the step size does not exist,
      so the whole value goes invalid and clip-path silently computes to `none` —
      no corners at all, and no error anywhere. Hence two literal polygons.

   3. **Anything painted outside the border box is clipped**, and that includes
      the global :focus-visible ring, which uses outline-offset: 3px. Clipped
      boxes swap it for an inset box-shadow; without that, keyboard focus is
      invisible on every card and row. */
:root {
  --px-corner-3: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px),
    calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
  --px-corner-2: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px),
    calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
}

.upcard, .row {
  position: relative;
  border: 0;
  border-radius: 0;
  background: var(--line);
  clip-path: var(--px-corner-3);
}
.upcard::before, .row::before {
  content: '';
  position: absolute;
  /* inset:0 with a real border, NOT inset:1px. The outline used to be the 1px
     GAP between this layer and the element's background behind it, and a gap is
     only as reliable as the sub-pixel maths: three viewport widths in four give
     these cards a fractional right edge, and at a fractional offset a one-pixel
     gap can round away to nothing — which is why the right-hand line went
     missing on some desktops and never on retina. A painted border always
     renders. The element's background still shows through at the stepped
     corners, where the clip cuts this layer and its border away. */
  inset: 0;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--line);
  clip-path: var(--px-corner-3);
  z-index: 0;
}
/* Lift the content above that inset fill. Both boxes contain only elements — no
   bare text nodes — or the text would sit behind it. */
.upcard > *, .row > * { position: relative; z-index: 1; }
/* The emblem is absolutely placed; the rule above would drop it back into flow
   and land it on top of the venue line. */
.upcard__emblem { position: absolute; z-index: 1; }

.tag, .group__countdown, .hero__badge {
  border-radius: 0;
  clip-path: var(--px-corner-2);
}

/* The today ring was an outer box-shadow, which the clip removes; it becomes
   the outline colour instead. */
.upcard--today { background: var(--gold-fill); box-shadow: none; }

.upcard:focus-visible, .row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Breathing room under the portals badge. It needs `.hero p.hero__badge` rather
   than `.hero__badge`: `.hero p { margin: 0 }` is class + element and outranks a
   lone class, so the badge's own margin-bottom never took effect — the tight gap
   there was that override winning, not a chosen value. */
.hero p.hero__badge { margin-bottom: 25px; }

/* ---------- this week in review ----------

   The call to action, then the reel itself. Two layouts from one set of
   scenes: portrait stacks everything, and from 860px the feature scene turns
   into a row and the glance list into two columns, so a wide screen is not
   asked to read a phone-shaped column down its middle.

   Sizes follow the sheet's own rule on pixel art: `pixelated` only where the
   art is scaled UP by a whole number (the mascot at 3x, the feature emblem at
   2x). The card emblems and the small hat are downscales and stay smoothed. */
/* Inside .hero__inner rather than a sibling of the hero, so it centres on the
   TEXT column. On desktop the mascot sits to the left of that column, which
   puts the copy's centre ~130px right of the page's — a button centred on the
   page read as misaligned under the headline. Inheriting the column's box
   keeps the two in step at every width, with no offset to maintain. */
.reel-cta { display: flex; justify-content: center; margin-top: 24px; }
.reel-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 13px/1 'Archivo', system-ui, sans-serif;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--gold-wash);
  border: 1px solid var(--gold-fill); border-radius: 0;
  clip-path: var(--px-corner-2);
  padding: 13px 22px; cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.reel-btn:hover { background: var(--accent-fill-soft); transform: translateY(-1px); }
.reel-btn__play {
  width: 0; height: 0; flex: none;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

body.reel-open { overflow: hidden; }

.reel {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  /* Opaque by default. A translucent backdrop is only safe when the stage
     reliably covers the screen, which on a phone it does not — see the note on
     .reel__stage. Desktop puts the blur back, where the reel is a panel and
     seeing the page around it is the point. */
  background: var(--paper);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reel__stage {
  position: relative; overflow: hidden;
  width: min(100vw, calc(100vh * 9 / 16));
  /* dvh, not vh. On a phone the visible area grows and shrinks as the browser
     toolbar hides, and 100vh does not track it — the stage ended up shorter
     than the screen, opening a gap at the top through which the page behind
     (hero mascot included) was visible. dvh follows the real viewport; the vh
     line above it is the fallback for browsers without dvh. */
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 108px 30px 76px; box-sizing: border-box; text-align: center;
}

/* progress: one tick per scene, the live one filling over its own duration */
.reel__bar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 4px; z-index: 3; }
.reel__tick { flex: 1; height: 3px; background: var(--line-strong); overflow: hidden; }
.reel__tick.is-done { background: var(--gold-fill); }
.reel__tick.is-live::after {
  content: ''; display: block; height: 100%; width: 100%;
  background: var(--gold-fill); transform-origin: left;
  animation: reelTick var(--dur, 2s) linear both;
}
@keyframes reelTick { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.reel__close {
  position: absolute; top: 26px; right: 16px; z-index: 3;
  width: 34px; height: 34px; line-height: 1;
  background: transparent; color: var(--ink-muted);
  border: 1px solid var(--line-strong); cursor: pointer; font-size: 14px;
}
.reel__close:hover { color: var(--ink); border-color: var(--accent); }

.reel__chrome {
  position: absolute; top: 34px; left: 0; right: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  /* mounted once when the reel opens, so this runs once: the payload gets the
     first beat to itself and the branding follows it in */
  animation: fadeIn 0.45s ease 0.5s backwards;
}
.reel__brand { display: inline-flex; align-items: center; gap: 9px; }
.reel__brand img { width: 30px; height: 30px; }     /* downscale: smoothed */
.reel__brand b {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 17px; color: var(--brand-word);
}
.reel__brand i { font-style: normal; color: var(--brand-tld); }
.reel__citychip {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); background: var(--gold-wash);
  border: 1px solid var(--gold-fill); padding: 5px 13px; clip-path: var(--px-corner-2);
}

.reel__scene { display: contents; }
.reel .anim { animation: riseIn 0.5s cubic-bezier(.2,.9,.3,1) backwards; }
.reel .anim--pop { animation: popIn 0.42s cubic-bezier(.2,1.3,.4,1) backwards; }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }

/* intro */
/* Sized at 2x directly rather than scaled with a transform.
   A transform:scale()'d box running an infinite animation inside an
   overflow:hidden parent is exactly the shape that leaves a ghost layer on iOS
   Safari: the compositor keeps painting the old layer after its node is gone,
   so the mascot stayed on screen over the following scene. Chromium never
   reproduces it, which is why it only ever showed up on a phone.

   Doubling the box and the background instead means no transform, no separate
   compositing layer, and the same crisp integer upscale — 128px art at 256px,
   which is what `pixelated` is for. */
.reel__mascot { width: 256px; height: 256px; display: grid; place-items: center; margin-bottom: 18px; }
.reel__sprite {
  width: 256px; height: 256px;
  background-repeat: no-repeat;
  background-size: 1584px 1584px;                /* 792 x 2 */
  image-rendering: pixelated;
  animation: reelIdle 1s step-end infinite;
}
/* Idle is row 0, four frames, on the padded 132px grid with its 2px margin —
   every figure doubled to match the 2x background above. */
@keyframes reelIdle {
  0%   { background-position: -4px -4px; }
  25%  { background-position: -268px -4px; }
  50%  { background-position: -532px -4px; }
  75%  { background-position: -796px -4px; }
  100% { background-position: -4px -4px; }
}
/* The hook carries the whole proposition in one line — how many, so the first
   frame answers "why should I care" before anything else loads. The brand and
   the city chip fade in just behind it (see .reel__chrome) rather than opening
   the reel, because a feed gives you about a second to be worth watching and a
   wordmark does not earn it. */
.reel__hook {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: clamp(58px, 17vw, 108px); line-height: 0.86;
  /* --date-num, not --gold-fill. The display gold is a background colour: it
     measures 1.62:1 on the light parchment, so this headline was illegible in
     light mode. --date-num is the token that exists for exactly this — big
     gold numerals driven down until they clear the 3:1 large-text bar (3.17:1
     light), and it resolves to the bright accent on the dark theme. */
  color: var(--date-num); letter-spacing: -0.03em;
  /* wraps rather than overflowing: "geeky events" is long enough that a narrow
     phone would otherwise push it past the edge */
  display: flex; align-items: baseline; justify-content: center;
  flex-wrap: wrap; gap: 0 0.16em;
}
.reel__hook span {
  font-size: 0.32em; text-transform: uppercase; letter-spacing: 0.08em;
}
.reel__where {
  margin-top: 14px;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: clamp(24px, 6.4vw, 34px); line-height: 1.06; color: var(--ink);
}
/* The city is the line's payload — it answers "is this for me?" — so it takes
   the readable gold rather than the display gold above it. --accent is the
   token tuned to pass as text on both themes; --gold-fill is not. */
.reel__where em {
  font-style: normal; color: var(--accent);
}
.reel__dates { margin-top: 16px; font-size: 19px; font-weight: 700; color: var(--ink-2); }
.reel__count { margin-top: 8px; font-size: 13px; color: var(--ink-muted); letter-spacing: 0.04em; }

/* the week at a glance */
.reel__head {
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 18px;
}
.reel__list { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.reel__card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  padding: 11px 13px; clip-path: var(--px-corner-3);
  text-decoration: none; color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.reel__card:hover { border-color: var(--accent); background: var(--row-hover); }
.reel__feature { text-decoration: none; color: inherit; }
.reel__more {
  margin-top: 16px; font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.reel__card img { width: 34px; height: 34px; flex: none; }   /* downscale: smoothed */
.reel__day {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 22px;
  color: var(--date-num); line-height: 1; min-width: 40px;
}
.reel__day small { display: block; font-size: 9px; font-weight: 600; color: var(--ink-4); letter-spacing: 0.1em; }
.reel__cardtext { min-width: 0; }
.reel__cardtitle { display: block; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.18; }
.reel__cardvenue { display: block; font-size: 11.5px; color: var(--ink-muted); margin-top: 3px; }

/* one event */
.reel__feature { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.reel__emblem { width: 128px; height: 128px; image-rendering: pixelated; }  /* 1:1, crisp */
.reel__tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 5px 12px; margin-bottom: 12px; clip-path: var(--px-corner-2);
}
.reel__title {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: clamp(24px, 6.5vw, 34px); line-height: 1.06; color: var(--ink);
}
.reel__when { margin-top: 16px; font-size: 17px; font-weight: 700; color: var(--accent); }
.reel__venue { margin-top: 7px; font-size: 14px; color: var(--ink-2); }
.reel__price { margin-top: 11px; font-size: 12.5px; color: var(--ink-muted); letter-spacing: 0.05em; }

/* sign-off */
.reel__hat { width: 96px; height: 96px; margin-bottom: 14px; }   /* downscale: smoothed */
.reel__word {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 34px; color: var(--brand-word); letter-spacing: -0.02em;
}
.reel__word i { font-style: normal; color: var(--brand-tld); }
.reel__line { margin-top: 12px; font-size: 17px; color: var(--ink-2); }

/* ---------- desktop: stop pretending the screen is a phone ---------- */
@media (min-width: 860px) {
  .reel {
    background: oklch(0.08 0.03 312 / 0.92);
    backdrop-filter: blur(6px);
  }
  .reel__stage {
    width: min(1100px, 94vw);
    height: min(660px, 88vh);
    padding: 104px 64px 64px;
    clip-path: var(--px-corner-3);
  }
  .reel__city { font-size: clamp(60px, 7vw, 92px); }
  .reel__dates { font-size: 24px; }
  /* the feature becomes a row: mark on the left, the facts beside it */
  .reel__feature { flex-direction: row; gap: 46px; text-align: left; align-items: center; }
  .reel__emblem { width: 192px; height: 192px; flex: none; }
  .reel__title { font-size: clamp(32px, 3.4vw, 46px); }
  .reel__when { font-size: 21px; }
  .reel__venue { font-size: 16px; }
  /* and the glance list into two columns, so ten events still read at a glance */
  .reel__list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .reel__card { padding: 12px 14px; }
}
