/* Hallmark · shape: Timetable Front · genre: editorial · theme: Sport (deal 3/3, seed booking-sessions-public-outdoor-1f25) · job: book · draw: manual
 * hero: Banner, the starting blocks printed in the ink under a condensed head and the pool in figures · nav: ink bar, wordmark and three links · footer: colophon with the photo credits · imagery: pool photographs as ink duotones · signature: the day's sessions as a results sheet, times on the stopwatch face, places left in the last column
 * axes: light/display-condensed/chromatic-volt · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V5 · weakest: E, the staff screens share the public sheet; they keep its rules and drop the hero */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --nav-height: 56px;
  --duotone-ink: oklch(16% 0.080 260);
}

body { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-transform: uppercase; line-height: 1.02; }
h1 { font-size: var(--text-display-s); max-width: 18ch; }
h2 { font-size: var(--text-xl); margin: var(--space-xl) 0 var(--space-sm); }
.mono, .time { font-family: var(--font-outlier); font-weight: 500; font-variant-numeric: tabular-nums; }
.muted { color: var(--color-muted); }
.lead { color: var(--color-ink-2); font-size: var(--text-lead); max-width: 52ch; margin-top: var(--space-sm); }
a { text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color var(--dur-short) var(--ease-out); }
a:hover { text-decoration-color: var(--color-accent-deep); }
.link { text-decoration: underline; text-decoration-color: var(--color-accent-deep); }
.skip { position: absolute; left: var(--space-md); top: -100px; z-index: var(--z-modal); padding: var(--space-xs) var(--space-md); background: var(--color-accent); color: var(--color-accent-ink); border-radius: var(--radius-card); }
.skip:focus-visible { top: var(--space-md); }

/* ---- the ink bar ---- */
.topbar { background: var(--color-ink); color: var(--color-paper); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: var(--nav-height); }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); text-transform: uppercase; letter-spacing: 0; color: var(--color-paper); text-decoration: none; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: var(--space-lg); }
.nav a, .nav .linkbtn { color: var(--color-paper); font-size: var(--text-sm); font-weight: 500; text-decoration: none; padding-block: var(--space-2xs); border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--color-accent-deep); }
.nav a[aria-current="page"] { border-bottom-color: var(--color-accent); }
.topbar :focus-visible { outline-color: var(--color-accent); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ---- hero: a banner of the pool printed in the ink ---- */
.hero { position: relative; color: var(--color-paper); background: var(--duotone-ink); }
.hero__photo { position: absolute; inset: 0; margin: 0; overflow: hidden; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.duotone img { filter: grayscale(1) contrast(1.1) brightness(0.95); mix-blend-mode: screen; opacity: 0.38; }
.hero__inner { position: relative; padding-block: var(--space-2xl) var(--space-xl); display: grid; gap: var(--space-md); }
.hero h1 { font-size: var(--text-display); color: var(--color-paper); }
.hero .lead { color: color-mix(in oklab, var(--color-paper) 88%, transparent); }

/* the pool in figures: condensed caps under the bar rule, parted by hairlines */
.race { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: var(--space-lg) 0 0; border-top: var(--rule-bar) solid currentColor; }
.race > div { padding: var(--space-sm) var(--space-md) var(--space-sm) 0; border-right: var(--rule-hair) solid color-mix(in oklab, currentColor 30%, transparent); }
.race > div + div { padding-left: var(--space-md); }
.race > div:last-child { border-right: 0; }
.race dt { font-size: var(--text-sm); font-weight: 500; opacity: 0.8; }
.race dd { margin: var(--space-2xs) 0 0; font-family: var(--font-display); font-weight: 800; font-size: var(--text-display-s); line-height: 1; text-transform: uppercase; }
.race dd.mono { font-family: var(--font-outlier); font-weight: 500; text-transform: none; }
.race--ink { color: var(--color-ink); }

/* ---- the timetable ---- */
.timetable { padding-block: var(--space-xl) var(--space-2xl); }
.stages { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(4.75rem, 1fr); overflow-x: auto; border-top: var(--rule-bar) solid var(--color-rule-2); border-bottom: var(--rule-hair) solid var(--color-rule); }
.stage { display: grid; gap: var(--space-3xs); padding: var(--space-sm) var(--space-xs); text-decoration: none; border-right: var(--rule-hair) solid var(--color-rule); min-height: 44px; }
.stage:hover { background: var(--color-paper-2); }
.stage[aria-current="date"] { background: var(--color-accent); color: var(--color-accent-ink); }
.stage__day { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-lg); line-height: 1; }
.stage__date { font-size: var(--text-xs); font-weight: 500; }
.stage:focus-visible { outline-offset: -3px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); padding-block: var(--space-md); }
.chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); font-size: var(--text-sm); font-weight: 500; text-decoration: none; }
.chips a:hover { border-color: var(--color-ink); }
.chips a[aria-current="page"] { background: var(--color-ink); color: var(--color-paper); border-color: var(--color-ink); }
.sheet__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); align-items: baseline; margin-bottom: var(--space-xs); }
.sheet__day { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-2xl); }

/* results as a sheet: the bar rule opens and closes it */
.results { width: 100%; border-collapse: collapse; border-top: var(--rule-bar) solid var(--color-rule-2); border-bottom: var(--rule-bar) solid var(--color-rule-2); }
.results th, .results td { text-align: left; padding: var(--space-sm) var(--space-md) var(--space-sm) 0; vertical-align: middle; border-bottom: var(--rule-hair) solid var(--color-rule); }
.results thead th { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.results tbody th { font-weight: 500; }
.results tbody th a { font-weight: 600; }
.results .num { text-align: right; white-space: nowrap; }
.results .time { font-size: var(--text-lg); white-space: nowrap; width: 7.5rem; }
.time__end { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.results__area { display: block; font-size: var(--text-sm); font-weight: 400; color: var(--color-muted); }
.results__note { font-size: var(--text-sm); color: var(--color-ink-2); }
.results .places { font-family: var(--font-outlier); font-weight: 500; }
.results .action { text-align: right; width: 1%; white-space: nowrap; padding-right: 0; }
.results tr.is-past td, .results tr.is-past th { color: var(--color-muted); }
.results tr.is-cancelled th, .results tr.is-cancelled td { color: var(--color-muted); }
.results tr.is-cancelled th a { text-decoration: line-through; }
.results tr.is-in { background: var(--color-paper-2); }
.results--quiet { border-top-width: var(--rule-hair); }

/* ---- controls: the volt block and the ink-bordered one ---- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-lg); border: 2px solid var(--color-ink); border-radius: var(--radius-card); background: transparent; color: var(--color-ink); font-family: var(--font-display); font-weight: 800; font-size: var(--text-md); text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-paper-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); color: var(--color-paper); }
.btn--small { min-height: 34px; padding: 0 var(--space-sm); font-size: var(--text-sm); }
.btn--small::before { content: ""; position: absolute; inset: -5px; }
.btn--wide { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn { transition: background-color var(--dur-short) linear; } .btn:active { transform: none; } }

.field { display: grid; gap: var(--space-2xs); }
.field label, .choices legend { font-size: var(--text-sm); font-weight: 500; }
.input { width: 100%; min-height: 44px; padding: 0 var(--space-sm); border: 1px solid var(--color-muted); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); font: 400 var(--text-md)/1.4 var(--font-body); outline: 2px solid transparent; outline-offset: -3px; }
.input.mono { font-family: var(--font-outlier); }
.input:hover { background: var(--color-paper-2); }
.input:focus-visible { outline-color: var(--color-focus); border-color: var(--color-ink); }
.input[aria-invalid="true"] { border-color: var(--color-error); }
.help { min-height: 1lh; font-size: var(--text-sm); color: var(--color-muted); }
.help--error { color: var(--color-error); }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.choice { display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: 0 var(--space-sm); border: 1px solid var(--color-rule); border-radius: var(--radius-card); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--color-ink); background: var(--color-paper-2); }
.choice input { width: 18px; height: 18px; accent-color: var(--color-ink); }
.choice:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---- pages ---- */
.page { padding-block: var(--space-xl) var(--space-2xl); }
.page--narrow { max-width: 34rem; }
.page__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-md); }
.crumbs { display: flex; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-md); }
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-2xl); align-items: start; margin-top: var(--space-md); }
.well { padding: var(--space-lg); background: var(--color-paper-2); border-top: var(--rule-bar) solid var(--color-rule-2); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.well h2 { margin-top: 0; }
.stack { display: grid; gap: var(--space-md); }
.stack + .stack { margin-top: var(--space-sm); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.facts { margin: var(--space-lg) 0 0; border-top: var(--rule-hair) solid var(--color-rule); }
.facts > div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--space-md); padding-block: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); }
.facts dt { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.facts dd { margin: 0; }
.messages { padding-top: var(--space-md); }
.message { padding: var(--space-sm) var(--space-md); border-left: 4px solid var(--color-ink); background: var(--color-paper-2); border-radius: 0 var(--radius-card) var(--radius-card) 0; }
.message--error { border-left-color: var(--color-error); }
.message--success { border-left-color: var(--color-accent-deep); }
.empty { display: grid; gap: var(--space-xs); padding: var(--space-lg); background: var(--color-paper-2); border-radius: var(--radius-card); margin-top: var(--space-md); }
.empty__title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-xl); }

/* the ticket: the code on the stopwatch face, the QR for the gate */
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: center; margin-top: var(--space-lg); padding: var(--space-lg); border-top: var(--rule-bar) solid var(--color-rule-2); border-bottom: var(--rule-bar) solid var(--color-rule-2); }
.ticket__code { font-size: var(--text-display-s); letter-spacing: 0.04em; }
.ticket__what { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-xl); }
.ticket__qr { background: var(--color-paper); }
.cancel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin-block: var(--space-lg); }

/* ---- front desk ---- */
.desk-tabs { display: flex; gap: var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); margin-bottom: var(--space-lg); overflow-x: auto; }
.desk-tabs a { padding-block: var(--space-sm); font-weight: 500; font-size: var(--text-sm); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.desk-tabs a[aria-current="page"] { border-bottom-color: var(--color-ink); }
.pager { display: flex; gap: var(--space-xs); }
.fill { display: inline-block; width: 7rem; height: 10px; vertical-align: middle; margin-right: var(--space-xs); background: var(--color-paper-3); border-radius: 2px; overflow: hidden; }
.fill__bar { display: block; height: 100%; background: var(--color-ink-2); }
.bars { margin: var(--space-lg) 0; display: grid; gap: var(--space-sm); }
.bars__title { font-weight: 500; margin-bottom: var(--space-xs); }
.bars__row { display: grid; grid-template-columns: 13rem minmax(0, 1fr) 4rem; gap: var(--space-sm); align-items: center; border-radius: 2px; }
.bars__row:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.bars__label { font-size: var(--text-sm); font-weight: 500; }
.bars__track { height: 18px; border-left: var(--rule-hair) solid var(--color-rule-2); }
.bars__bar { display: block; height: 100%; background: var(--color-ink-2); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars__row:hover .bars__bar, .bars__row:focus-visible .bars__bar { background: var(--color-ink); }
.bars__value { text-align: right; }
.mail { padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.mail__meta { font-size: var(--text-sm); color: var(--color-muted); }
.mail__subject { font-family: var(--font-body); text-transform: none; font-size: var(--text-md); font-weight: 600; margin: var(--space-2xs) 0; }
.mail__body { margin: 0; white-space: pre-wrap; font: 400 var(--text-sm)/1.55 var(--font-body); color: var(--color-ink-2); }

.footer { margin-top: var(--space-2xl); background: var(--color-paper-2); border-top: var(--rule-bar) solid var(--color-rule-2); }
.footer__inner { padding-block: var(--space-lg) var(--space-xl); display: grid; gap: var(--space-sm); font-size: var(--text-sm); color: var(--color-ink-2); }
.footer__inner p { max-width: 80ch; }
.footer__links { display: flex; gap: var(--space-lg); }
.footer a { text-decoration: underline; text-decoration-color: var(--color-rule); }
.credits { color: var(--color-muted); }

@media (max-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: var(--text-display-s); }
  .bars__row { grid-template-columns: 8rem minmax(0, 1fr) 3rem; }
  .ticket { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .nav { gap: var(--space-md); }
  .results thead { display: none; }
  .results, .results tbody { display: block; }
  .results tr { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-sm); padding-block: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); }
  .results tbody tr > * { border: 0; padding: 0; }
  .results .time { width: auto; grid-row: span 2; }
  .results .num { text-align: left; }
  .results .action { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--space-3xs); }
  .row { grid-template-columns: minmax(0, 1fr); }
}
