/* Design tokens.
   ==============
   Every colour, size, space and radius in this project resolves to something
   here. Nothing downstream writes a raw hex value or a magic pixel: a stylesheet
   where `.filters` says `padding: .9rem` and `.venue-card` says `padding: 1rem`
   has two paddings that were meant to be one, and no way to tell which was the
   accident.

   The structure follows **Material 3**, because the brief asks for it and because
   its two-layer idea earns its keep: a *reference* layer of raw tonal steps that
   nothing outside this file uses, and a *system* layer of semantic names that
   everything else does. Change the brand colour and you change one reference
   step; change what "the surface a card sits on" means and you change one system
   token. Neither requires touching a component.

   What is deliberately **not** Material: the look. This is a dense list read on a
   phone at a tram stop, not an Android settings screen — so no filled containers
   everywhere, no floating action button, and elevation used sparingly, where
   something genuinely sits above something else. Material's discipline, this
   site's face. */

:root {
  /* -- Reference: tonal palettes ------------------------------------------
     Steps are M3 tone numbers (0 black … 100 white). Only the system layer
     below reads these; components never do. */

  /* The brand: a Viennese terracotta, the red of a Gürtel brick arch. */
  --ref-primary-10: #3d0f04;
  --ref-primary-20: #5c1a0a;
  --ref-primary-30: #7d2711;
  --ref-primary-40: #b23a1f;
  --ref-primary-60: #d9603f;
  --ref-primary-80: #ef7a58;
  --ref-primary-90: #f6e9e5;
  --ref-primary-95: #fbf2ef;

  /* Neutral, warmed very slightly so paper reads as paper and not as grey. */
  --ref-neutral-0:  #000000;
  --ref-neutral-6:  #101012;
  --ref-neutral-10: #16161a;
  --ref-neutral-17: #232327;
  --ref-neutral-22: #2c2c31;
  --ref-neutral-30: #46464c;
  --ref-neutral-40: #5c5c66;
  --ref-neutral-50: #6b6b76;
  --ref-neutral-60: #85858f;
  --ref-neutral-70: #9a9aa4;
  --ref-neutral-90: #e2e2dc;
  --ref-neutral-94: #efefe9;
  --ref-neutral-96: #f5f5f0;
  --ref-neutral-98: #fbfbf9;
  --ref-neutral-100: #ffffff;

  /* -- System: what things mean ------------------------------------------- */

  /* Surfaces, as M3's container ladder. The higher the number, the closer to
     the reader — which is how the app bar and the cards separate themselves
     from the page without a single border. */
  --surface: var(--ref-neutral-98);
  --surface-container-low: var(--ref-neutral-96);
  --surface-container: var(--ref-neutral-94);
  --surface-container-high: var(--ref-neutral-90);
  /* A concert's card (ADR-105): the container step in both schemes. The low step was
     1.06:1 against the page in the light scheme and almost the page itself in the dark. */
  --surface-card: var(--surface-container);

  --on-surface: var(--ref-neutral-10);
  --on-surface-variant: var(--ref-neutral-50);

  --primary: var(--ref-primary-40);
  --on-primary: var(--ref-neutral-100);
  --primary-container: var(--ref-primary-90);
  --on-primary-container: var(--ref-primary-20);

  --outline: var(--ref-neutral-60);
  --outline-variant: var(--ref-neutral-90);

  /* -- Status ---------------------------------------------------------------
     The dashboard's vocabulary, and semantic rather than decorative: these say
     *healthy*, *needs looking at* and *broken*, which is the only thing the
     source list is for. Here rather than in a second stylesheet, because there
     is one site and the back of it is not a different product.

     `-soft` is the container; the plain name is the text on it -- the same
     pairing as `--primary` / `--primary-container`. */
  --ok: #2f6f4e;
  --ok-soft: #e4f0e8;
  --warn: #8a5a00;
  --warn-soft: #f8eddb;
  --bad: #a32a1c;
  --bad-soft: #f8e6e2;
  --off: var(--ref-neutral-50);
  --off-soft: #ececea;

  /* A concert card that is not as it reads is tinted (ADR-106): *alarm* where there is no
     concert on this date (cancelled, postponed), *caution* where there is one with a
     qualification (sold out, a replacement date, another building). Caution is the soft
     container above; the dark scheme follows it. On a tint the grey text steps darker in the
     light scheme -- `--on-surface-variant` was 4.36:1 on the alarm fill and the caution
     badge's `--warn` 4.24:1 on its pill -- and stays as it is in the dark, which passed
     everywhere.

     **Alarm has a fill of its own in the light scheme** (CIE76 against the plain card,
     #efefe9, normal / simulated deuteranopia / protanopia): `--bad-soft` was 6.8 / 2.3 / 2.3,
     a reader who cannot tell red from green saw almost no card at all, and amber was 7.4 / 7.5 /
     6.8. #f3d3cc is 14.1 / 8.8 / 9.0, and 12.0 / 6.9 / 8.8 from the caution fill, so the two
     tints stay apart. On it the title is 12.9:1, the grey 4.72:1, and the badge -- a darker
     red than `--bad`, which fell to 4.08:1 on its pill -- 4.83:1. The dark scheme keeps
     `--bad-soft`: 12.9 / 10.7 / 8.6 against the plain card, with the grey 5.9:1 and the
     badge 4.85:1. */
  --card-alarm: #f3d3cc;
  --card-caution: var(--warn-soft);
  --on-card-alarm: #8f2216;
  --on-card-caution: #744b00;
  --on-card-variant: var(--ref-neutral-40);
  /* How much of its tone the header badge's pill mixes over the card's fill: the ground
     the badge text's contrast above was measured on. */
  --card-flag-tone: 0.16;

  /* -- Spacing: a 4px grid -------------------------------------------------
     Named by step rather than by size, so "one notch tighter" is a token away
     and never a guess. Everything in the site lands on one of these. */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */

  /* -- Shape --------------------------------------------------------------- */
  --shape-xs: 4px;
  --shape-sm: 8px;
  --shape-md: 12px;
  --shape-lg: 16px;
  --shape-full: 999px;

  /* -- Type ----------------------------------------------------------------
     M3's roles, cut down to the seven this site actually uses. A scale with
     sizes nobody reaches for is a scale that invites inventing an eighth.

     16px body is not a preference: it is the smallest size iOS will not zoom a
     focused input to, and anything less makes the page lurch on a tap. */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* For the machine's own artefacts: ids, endpoints, timings, errors. */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-headline: 1.6rem;      /* page titles */
  --text-deck-title: 1.4rem;    /* a card's name in the deck (T-170): the loudest thing
                                   on it at every width -- the page title's size shrinks
                                   on a phone (below) and this must not */
  --text-title-lg: 1.15rem;     /* card and section headings */
  --text-title: 1rem;
  --text-body: 1rem;            /* the list itself */
  --text-body-sm: 0.9rem;       /* supporting lines under a title */
  --text-label: 0.85rem;        /* chips, buttons, field labels */
  --text-label-sm: 0.75rem;     /* badges, the smallest thing that is still read */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.55;

  /* Uppercase micro-labels: day headings, badges, card headings. */
  --tracking-wide: 0.05em;

  /* -- Elevation -----------------------------------------------------------
     Three levels, used where something genuinely sits above something else --
     the app bar over a scrolling list, a menu over a page. Not for decoration:
     a card that floats for no reason is a card that has stopped meaning
     anything by floating. */
  --elevation-0: none;
  --elevation-1: 0 1px 2px rgb(0 0 0 / 0.08), 0 1px 3px 1px rgb(0 0 0 / 0.06);
  --elevation-2: 0 1px 2px rgb(0 0 0 / 0.10), 0 2px 6px 2px rgb(0 0 0 / 0.08);

  /* -- State layers --------------------------------------------------------
     M3 expresses hover, focus and press as a translucent layer of the *content*
     colour over the component. Kept as opacities so a component mixes its own
     rather than hard-coding a second colour it then has to keep in step. */
  --state-hover: 0.08;
  --state-focus: 0.12;
  --state-pressed: 0.16;

  /* -- Motion --------------------------------------------------------------- */
  --motion-short: 120ms;
  --motion-medium: 200ms;
  /* One breath of a mark that says something is on its way (the count while the rest loads). */
  --motion-pulse: 900ms;
  --motion-easing: cubic-bezier(0.2, 0, 0, 1);

  /* -- Layout --------------------------------------------------------------- */
  /* The page frame, and the app bar's own width too: one cap, so the bar ends on the
     page's own edge (T-170, ADR-103). `88rem` is 1,408px, 1,376 of content inside the
     16px padding; below it nothing is capped and the frame is the viewport. The bar does
     not fill it -- from `64rem` up it holds four labelled destinations, the heart, the
     region landmarks, settings and the language (964px) -- and its own width is not what
     the cap is for. */
  --measure: 88rem;
  /* The keyboard's focus ring: 2px wide, 2px off its control. A control against the edge of
     a box that scrolls has no room outside it, because `overflow-y: auto` clips at the
     padding box (WCAG 2.4.7): there the ring is drawn inward by its own width instead. */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  /* How far a dotted or underlined text sits below its baseline, in the text's own size. */
  --underline-offset: 0.2em;
  /* The concert's facts column: 352px inside the card's own padding is 320, which holds
     "Spittelauer Lände 12, Stadtbahnbögen 331/333," on two lines and every other venue's
     address and a date with its time on one (ADR-118). The venue page's own is `--aside-width`. */
  --facts-width: 22rem;
  /* A venue's facts beside its programme, from `64rem` (ADR-104; a concert's are `--facts-width`): 320px, which holds a
     website's address on two lines and a room's name with its count, and leaves the
     programme 648px at the step itself, where a row is wider than a phone's. */
  --aside-width: 20rem;
  /* The least tall Discover's card may be, where the viewport leaves less than that
     (a phone on its side): the deck is as tall as the screen minus the bar, and below
     this it stops shrinking and the page scrolls instead (T-170). */
  --deck-min-height: 24rem;
  /* And the most: a card is as tall as what it says, so a deck taller than a card and
     its controls is blank page under them (T-170). 28rem and not 26: a card with eight
     genres and a status badge is 342px tall in Noto Sans and 370px in DejaVu Sans (CI's
     fallback), which filled a 364px track and ran the heart into the card's padding. */
  --deck-max-height: 28rem;
  /* A card's run of tags shows at most two rows of pills (T-256): a pill is
     `--text-label-sm` at a line-height of 1.5 in a 1px border, 20px in any font, and the
     rows are `--space-2` apart, so two rows and their gap are 48px and a third would begin
     at 56. The half gap of slack is what keeps the second row whole when the pills round
     up a fraction; the third is clipped whole. Eight genres and a status line ran the
     card's foot 10px out of a 320px phone's card in Noto and 31px in DejaVu. */
  --deck-tags-max-height: calc((var(--text-label-sm) * 1.5 + 2px) * 2 + var(--space-2) * 1.5);
  /* How wide a column of running text gets -- prose, not the page frame that
     `--measure` bounds. Four pages had invented this themselves (40rem,
     38rem, 44rem) before it had a name. */
  --measure-prose: 40rem;
  /* A form's width, not a paragraph's -- the sign-in is one field and one
     button, and folding it into `--measure-prose` would be naming two
     different things after one measurement. */
  --measure-form: 28rem;
  /* The app bar's height. Two rules depend on it and neither owned it: the bar is
     one thumb-sized control between two paddings, and the sticky day heading
     below has to come to rest *under* it. That offset was written by hand as
     `3.5rem` with the comment "clears the app bar", and it did not -- 56px
     against a 61px bar, so the top 5px of every date sat behind the bar for the
     whole scroll (T-062). The bar's separator is a shadow rather than a border
     for the same reason: a shadow takes no layout space, so the bar is exactly
     this tall and the offset needs no correction term. */
  --app-bar-height: calc(var(--touch-target) + var(--space-2) * 2);
  /* The sticky day heading's height: a label line between two paddings, and no rule --
     the cards are filled surfaces, so a line under the date only added noise.
     Nothing sizes the heading to it -- it is what the heading measures -- so it is
     named for the one rule that needs the number: the scroll offset that keeps a
     focused title clear of the bar *and* the heading stuck beneath it (T-214, SC 2.4.11). */
  --day-heading-height: calc(var(--text-label) * var(--leading-normal) + var(--space-2) * 2);
  /* The venue card's programme has a date where the list has a clock, and a date
     is not a fixed width: "Mo, 1. Mai." and "Mi, 22. Sep." differ by a digit, so
     five rows sized to their own content start the titles at five places. Wide
     enough for the longest either locale writes. */
  --date-column: 6rem;
  /* What a night is guessed to cost before it has been seen (`.day`, T-278): a row of cards
     with its gap, and the whole of a night when the page cannot read how many cards it holds.
     One figure for every width: a row is as tall as its tallest card, so three narrow cards
     side by side measure what one phone card does -- 142px at 390 and 145px at 1,280, live
     programme, 2026-11-24 (a single laptop card is 124px, which was the wrong unit).
     Estimates, not the cards' own sizes: `content-visibility` swaps them for the measured
     height once the night has been drawn. */
  --card-estimate: 8.875rem;
  --day-estimate: 14rem;
  /* The room a card's focus ring needs beyond the card: the ring's width and its offset. */
  --focus-ring-reach: calc(var(--focus-ring-width) + var(--focus-ring-offset));
  /* A status dot: how current a venue's programme is, on the venue overview.
     Its own token because the dot and the gap it keeps from the name are the
     same measurement in two rules, and a dot that drifts off the baseline of
     the heading it sits on is what it looks like when they part. */
  /* The month grid (calendar.js, T-016) ------------------------------------
     How busy a night is, as five steps of the accent mixed into the surface
     behind the count. Five because it is about the most a reader ranks at a
     glance and the fewest that still separates a quiet Tuesday from a full
     Saturday; the exact number is printed in the pill either way, so the scale
     is a shape to scan and never the only statement of the fact.

     Not a linear ramp: the low steps are spread further apart than the high
     ones, because the difference between one concert and three is the one a
     reader is actually looking for, and between eleven and fourteen there is
     none worth drawing. The fourth step sits at 86% because its text is the
     accent's own, which only reaches 4.5:1 once the ground is that dark (4.76:1
     light, 4.80:1 dark; at 68% it was 3.46 and 3.54, T-214). */
  --density-1: 12%;
  --density-2: 26%;
  --density-3: 44%;
  --density-4: 86%;
  --density-5: 100%;

  /* A cell is a touch target first, and on the narrowest phones that is a floor
     the geometry cannot quite reach: seven 44px cells are 308px of grid, which a
     320px phone does not have once the page has margins at all. Measured, the
     grid gave 34px at 320, 40px at 360 and 44px at 390; the phone rule beside
     `.calendar-grid` drops the gap and most of the card's padding, which buys 45
     at 360 and 390 and 40 at 320 (T-062). It grows once there is real room,
     because at 44px the number and the count are as tight as they can be read. */
  --calendar-cell: var(--touch-target);
  --calendar-cell-wide: 3.5rem;

  /* The count pill's floor, so "3" and "16" line up down a column instead of
     making every row a different ragged width. */
  --calendar-pill: 1.6rem;

  --dot: 0.5rem;
  --touch-target: 2.75rem;  /* 44px, the smallest a thumb hits reliably */
  --chip-target-fine: 2.25rem; /* 36px: a chip where no pointer is coarse -- a mouse or trackpad only, never a screen that can also be touched (ADR-137); never under WCAG 2.5.8's 24px. Every other chip stays --touch-target */
  --filter-search-max: 22rem; /* 352px: the search field beside the time and type groups on a wide filter bar -- a search is one word, and the row's width goes to filters (T-265, ADR-137) */
  --presenter-max-width: 6.5rem; /* 104px: the longest the presenter's pill on a card's bottom line grows, so a long name (`Danubian Dub Soundsystem`) does not take the venue's room (T-181, ADR-134; it was the room a 360px row left a whole first genre) */
  --presenter-min-width: 3rem; /* 48px: the least the pill is squeezed to -- it gives way before the venue's name does, and then the house's name gives way, never the room (ADR-134) */

  /* The count on the app bar's heart (T-081). A disc rather than a pill: it holds
     one or two digits and "99+" beyond that, so it grows sideways from a floor
     rather than being sized for the widest case. 17px is the largest it can be
     without eating into the 44px target it sits on top of. */
  --pip: 1.05rem;
  --text-pip: 0.65rem;
}

/* A page's name, on a phone -------------------------------------------------
   `Konzerte und Clubnächte in Wien` takes two lines at 1.6rem at *every* phone
   width, and the pair cost 88px of the 519px that stood between the top of the
   front page and its first concert (T-062). Measured: one line needs 20px at
   390 and 360, and 18px at 320, so one step to 1.125rem covers every phone and
   is still two steps above the body.

   The size moves and the rule does not: `h1` still says `--text-headline` in one
   place, which is design.md's *One size, set once*. The heading is not dropped on
   a phone, because there it is the only visible thing naming the site -- the
   wordmark in the bar is icon-only, its word `visually-hidden`.

   2026-10-21 (T-212): on the front page the title now shares its line with the other
   city's name, so at 360 it breaks after "in" and takes two lines, where "one line at 390
   and 360" above was true of the title alone. 390 and 430 still hold it on one; 320 took
   two before the link was there. The step is unchanged.

   2026-10-28 (T-246): a section heading (`--text-title-lg`, 1.15rem) outranked the page's
   own `<h1>` at 1.125rem on a phone -- *Line-up* above the concert's facts and *Weitere
   Termine* both did. Below the same breakpoint `.section-heading` (style.css) takes one step
   down to `--text-title` (1rem), which is still above the body. It also reaches `/saved`'s headings, as intended. */
@media (max-width: 30rem) {
  :root { --text-headline: 1.125rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    /* The ladder inverts: in the dark, *closer* means lighter. Only the system
       layer moves -- every component below is already written in terms of it. */
    --surface: var(--ref-neutral-6);
    --surface-container-low: var(--ref-neutral-10);
    --surface-container: var(--ref-neutral-17);
    --surface-container-high: var(--ref-neutral-22);

    --on-surface: #ececeb;
    --on-surface-variant: var(--ref-neutral-70);

    --primary: var(--ref-primary-80);
    --on-primary: var(--ref-primary-10);
    --primary-container: var(--ref-primary-20);
    --on-primary-container: var(--ref-primary-90);

    --outline: var(--ref-neutral-50);
    --outline-variant: var(--ref-neutral-30);

    --ok: #74c898;
    --ok-soft: #17281f;
    --warn: #dfae5f;
    --warn-soft: #2a2115;
    --bad: #f0836b;
    --bad-soft: #2e1a16;
    --off: var(--ref-neutral-70);
    --off-soft: var(--ref-neutral-17);

    --card-alarm: var(--bad-soft);
    --on-card-alarm: var(--bad);
    --on-card-caution: var(--warn);
    --on-card-variant: var(--ref-neutral-70);

    /* Shadows do almost nothing on a dark surface; the container ladder is
       what separates layers there, so elevation stops pretending. */
    --elevation-1: none;
    --elevation-2: none;
  }
}
