/* HYPER RED — base
   Resets, typography scale, focus handling, and the elements that need to
   exist before any layout: skip link, screen-reader-only utility. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Author-level guarantee for JS-driven hidden states, even when a component
   has its own display:flex/grid rule. */
[hidden] { display: none !important; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

p {
  margin: 0 0 var(--sp-3);
  color: var(--text-secondary);
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  /* Baseline reset so a button never falls back to the browser's native
     gray/beveled chrome if a component class forgets to set its own
     background/border — every button class in this project still sets
     its own explicit background, this just removes the fallback. */
  appearance: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Typography scale ---- */
/* Cinematic hero type — the event title on Sign Up, and nothing else.
   Big enough to act as the page's primary graphic, not just a heading. */
.hr-display-hero {
  font-family: var(--font-display);
  font-size: var(--font-size-display-hero);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.92;
}

/* Giant tabular numeral used as a scale/identity device (round number,
   countdown digits) — see .race-brief-bignum. */
.hr-num-giant {
  font-family: var(--font-display);
  font-size: var(--font-size-num-giant);
  font-weight: 800;
  line-height: 0.82;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hr-display-xl { font-family: var(--font-display); font-size: clamp(32px, 5vw, 48px); font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; }
.hr-display-lg { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); font-weight: 700; text-transform: uppercase; letter-spacing: 0.005em; line-height: 1.02; }
.hr-heading    { font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.hr-label      { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); }
.hr-stat       { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1; }
.hr-body       { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }
.hr-meta       { font-size: 13px; color: var(--text-muted); }

/* ---- Technical / race-control micro-typography ----
   Small, deliberately restrained building blocks used across the header,
   race brief, roster and calendar to give the interface a control-room
   vocabulary (section numbering, coordinate-style labels, tabular
   figures) without introducing a second visual language. */

/* Tabular figures for anything that represents a changing number (times,
   counts, countdowns) so digits don't shift width as they update. */
.hr-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* A tiny uppercase system label, e.g. "EVENT CONTROL", "GRID CONTROL" —
   more restrained than .hr-label, meant to sit beside a rule rather than
   stand alone. */
.hr-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--font-size-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.hr-kicker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--hr-red-bright);
  flex-shrink: 0;
}

/* A thin technical divider line, optionally paired with a label riding on
   top of it (see .hr-rule-label). Replaces plain borders in a handful of
   places where a full card boundary would be one rectangle too many. */
.hr-rule {
  border: none;
  border-top: 1px solid var(--hr-line);
  margin: 0;
}

.hr-rule-labeled {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
}

.hr-rule-labeled::before,
.hr-rule-labeled::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hr-line);
}

/* Two-digit section index used ahead of headings ("01", "02"...) to give
   procedural sequences (signup steps, entry docket rows) a timing-board
   feel. Set via the `data-index` attribute so no extra markup is needed. */
.hr-index::before {
  content: attr(data-index);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--hr-red-bright);
  letter-spacing: 0;
  margin-right: 9px;
}

/* ---- Focus ---- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--hr-red-bright);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Screen-reader only ---- */
.sr-only {
  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 ----
   id/href pair is the load-bearing part here: this link's href="#main"
   must always match the <main id="main"> landmark it targets. */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--sp-3);
  z-index: 1000;
  background: var(--hr-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  transition: top var(--dur-base) var(--ease-standard);
}

.skip-link:focus {
  top: var(--sp-3);
}

/* ---- Selection ---- */
::selection {
  background: var(--hr-red);
  color: #fff;
}

/* ---- Scrollbar (webkit) ---- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-1);
}

/* ---- Reduced motion: belt & suspenders on top of tokens.css ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
