/* ==========================================================================
   Running Result — black, red, white.
   ========================================================================== */

/* Tokens (colors, type, spacing) live in /ui/tokens.css, loaded first. */


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

html {
  scroll-behavior: smooth;
  /* Anchors clear the fixed header. */
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--red);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- utilities */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -150%;
  z-index: 100;
  background: var(--red);
  color: var(--on-accent);
  padding: 0.7rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: translate 0.2s var(--ease);
}

.skip-link:focus-visible {
  translate: -50% 0;
}

/* Honeypot field — kept out of the layout and out of the a11y tree. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    backdrop-filter 0.35s var(--ease);
}

.site-header.is-stuck {
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom-color: var(--rule);
}

/* Wordmark left, nav centred on the page, account right. */
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

/* Pinned to their columns: signed out, the nav is gone and Sign up would
   otherwise slide into the middle. */
.site-header__inner > .wordmark {
  grid-column: 1;
  justify-self: start;
}

.site-header__inner > .site-nav {
  grid-column: 2;
}

.site-header__actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.6rem;
  min-width: 0;
}

/* Signed in or out is a class on <html>: set before the first paint by
   /early.js from the last page's answer, then confirmed by main.js. So
   pages never draw Sign up first and swap it out. */
html:not(.is-member) [data-member],
html.is-member [data-auth-login] {
  display: none !important;
}

.user-menu__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--paper);
  font: 500 0.85rem/1 var(--sans);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.user-menu__button:hover,
.user-menu__button:has(+ :popover-open) {
  border-color: var(--rule);
  background: color-mix(in srgb, var(--paper) 4%, transparent);
}

.user-menu__button:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

.user-menu__avatar {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--red);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.user-menu__first {
  overflow: hidden;
  max-width: 9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__caret {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--paper-dim);
}

/* Placed by main.js (top/right) when it opens. */
.user-menu__panel {
  inset: auto;
  min-width: 15rem;
  max-width: calc(100vw - 1rem);
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--ink-raise);
  color: var(--paper);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}

.user-menu__who {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 0.35rem;
  padding: 0.6rem 0.7rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

.user-menu__name {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-menu__email {
  overflow: hidden;
  color: var(--paper-dim);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__item {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  color: var(--paper-dim);
  font-size: 0.85rem;
  text-decoration: none;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: color-mix(in srgb, var(--paper) 6%, transparent);
  color: var(--paper);
  outline: none;
}

@media (max-width: 520px) {
  .user-menu__first {
    display: none;
  }
}

/* The member nav: one quiet pill, the page you're on lit inside it. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 2.5%, transparent);
}

.site-nav__link {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  color: var(--paper-dim);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.site-nav__link:hover {
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 5%, transparent);
}

.site-nav__link:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 1px;
}

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 10%, transparent);
  box-shadow: inset 0 -2px 0 var(--red);
}

/* Too narrow to centre the nav between the other two: it sits beside the
   account instead. */
@media (max-width: 760px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
  }

  .site-nav {
    justify-self: end;
  }

  .site-nav__link {
    padding-inline: 0.7rem;
  }
}

/* A phone can't fit the links beside the wordmark and account, so the
   nav takes its own row beneath them, links shared evenly across it. Pages
   start that much lower (main), as do the sticky bars pinned under the
   header. (Signed out it's only the wordmark and Sign up: one row.) */
@media (max-width: 560px) {
  html.is-member {
    --nav-row: 3.4rem;
    scroll-padding-top: calc(6rem + var(--nav-row));
  }

  .site-header__inner {
    grid-template-rows: 4.5rem auto;
    gap: 0 0.5rem;
  }

  .site-header__inner > .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    margin-bottom: 0.6rem;
  }

  .site-nav__link {
    flex: 1;
    padding-inline: 0.4rem;
    text-align: center;
  }

  .site-header__actions {
    gap: 0.35rem;
  }

  html.is-member main {
    padding-top: var(--nav-row);
  }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  text-decoration: none;
  flex: none;
}

.wordmark__mark {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.wordmark__accent {
  fill: var(--red);
}

.wordmark__text {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.wordmark__thin {
  font-weight: 400;
  color: var(--paper-dim);
}

/* ------------------------------------------------------------------ button */

.btn {
  --btn-bg: var(--red);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.65rem;
  border: 0;
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition:
    background 0.2s var(--ease),
    translate 0.2s var(--ease),
    box-shadow 0.3s var(--ease);
}

.btn:hover:not(:disabled) {
  --btn-bg: var(--red-lift);
  translate: 0 -1px;
  box-shadow: 0 10px 30px -10px var(--red-glow);
}

.btn:active:not(:disabled) {
  translate: 0 0;
}

.btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

.btn--sm {
  padding: 0.62rem 1.15rem;
  font-size: 0.82rem;
  flex: none;
}

.btn--ghost {
  --btn-bg: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.btn--ghost:hover:not(:disabled) {
  --btn-bg: color-mix(in srgb, var(--paper) 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 24%, transparent);
}

.btn--block {
  width: 100%;
}

.btn__spinner {
  display: none;
  width: 0.95em;
  height: 0.95em;
  border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.is-busy .btn__spinner {
  display: block;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(100svh, 56rem);
  padding-top: calc(9rem + env(safe-area-inset-top, 0px));
  padding-bottom: 6rem;
  overflow: hidden;
}

/* Faint running-track lanes sweeping behind the headline. */
.hero__lanes {
  position: absolute;
  inset: -20% -10% auto;
  height: 140%;
  display: grid;
  gap: clamp(3rem, 9vw, 7rem);
  rotate: -14deg;
  pointer-events: none;
}

.hero__lanes span {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--rule-soft) 18%,
    var(--rule-soft) 82%,
    transparent
  );
}

.hero__lanes span:nth-child(3) {
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--red) 35%, transparent) 30%,
    color-mix(in srgb, var(--red) 12%, transparent) 70%,
    transparent
  );
}

.hero::after {
  /* Vignette so the lanes never fight the type. */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 65% at 12% 40%, transparent, var(--ink) 78%);
  pointer-events: none;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--red) 0%, transparent);
  }
}

.hero__title {
  margin: 0;
  max-width: 17ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 8.2vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.028em;
}

/* One line: at every hero size, "running database." (~5.9em) fits its column. */
.hero__title em {
  display: block;
  font-style: italic;
  color: var(--red);
  white-space: nowrap;
}

.hero__lede {
  margin: 1.9rem 0 0;
  max-width: 48ch;
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  line-height: 1.6;
  color: var(--paper-dim);
}

.hero__cta {
  margin-top: 2.75rem;
  max-width: 34rem;
}

/* The course panel fills the right half on wide screens; narrower ones keep
   the hero to the headline and the signup. */
.hero__visual {
  display: none;
}

@media (min-width: 1024px) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2.5rem, 5vw, 4.5rem);
  }

  .hero__title {
    font-size: clamp(2.9rem, 5.6vw, 5.4rem);
  }

  .hero__visual {
    display: block;
  }
}

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

.hero-course {
  margin: 0;
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink-raise) 82%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 40px 90px -50px color-mix(in srgb, var(--red) 45%, transparent);
}

.hero-course__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.hero-course__kicker {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-course__tag {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--paper-faint);
  font: 500 0.66rem/1 var(--mono);
}

.hero-course__map {
  display: block;
  width: 100%;
  height: auto;
}

.hero-course__contour {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
}

.hero-course__contour--index {
  stroke: color-mix(in srgb, var(--paper) 20%, transparent);
}

.hero-course__route-bed {
  fill: none;
  stroke: color-mix(in srgb, var(--paper) 10%, transparent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Drawn on once as the panel appears (pathLength="1" in the markup). */
.hero-course__route {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hero-course-draw 2.6s var(--ease) 0.5s forwards;
}

@keyframes hero-course-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.hero-course__mile circle {
  fill: var(--ink);
  stroke: var(--paper-faint);
  stroke-width: 1;
}

.hero-course__mile text,
.hero-course__line text {
  fill: var(--paper-dim);
  font: 600 8px var(--mono);
  text-anchor: middle;
}

.hero-course__line text {
  fill: var(--paper-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-course__line text[text-anchor="end"] {
  text-anchor: end;
}

.hero-course__line path {
  stroke: var(--paper);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.hero-course__runner circle {
  fill: var(--paper-dim);
}

.hero-course__runner--lead circle {
  fill: var(--red);
}

.hero-course__runner .hero-course__halo {
  fill: var(--red);
  opacity: 0.25;
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-course-pulse 1.6s ease-in-out infinite;
}

@keyframes hero-course-pulse {
  50% {
    opacity: 0.08;
    transform: scale(1.5);
  }
}

.hero-course__profile {
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule-soft);
}

.hero-course__profile svg {
  display: block;
  width: 100%;
  height: 4.5rem;
}

.hero-course__area {
  fill: color-mix(in srgb, var(--red) 14%, transparent);
}

.hero-course__ridge,
.hero-course__tick,
.hero-course__marker {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.hero-course__ridge {
  stroke: var(--red);
  stroke-width: 1.5;
}

.hero-course__tick {
  stroke: var(--rule);
  stroke-dasharray: 2 3;
}

.hero-course__marker {
  stroke: var(--paper);
  stroke-width: 1.5;
}

.hero-course__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.85rem 0 0;
}

.hero-course__stats dt {
  color: var(--paper-faint);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-course__stats dd {
  margin: 0.25rem 0 0;
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .hero-course__route {
    animation: none;
    stroke-dashoffset: 0;
  }

  .hero-course__runner .hero-course__halo {
    animation: none;
  }
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.9rem 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 2.5%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

/* --------------------------------------------------------- subscribe form */

.subscribe__row {
  display: flex;
  gap: 0.6rem;
}

.subscribe__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: color-mix(in srgb, var(--paper) 3.5%, transparent);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.subscribe__input::placeholder {
  color: var(--paper-faint);
}

.subscribe__input:hover {
  border-color: color-mix(in srgb, var(--paper) 20%, transparent);
}

.subscribe__input:focus {
  outline: none;
  border-color: var(--red);
  background: color-mix(in srgb, var(--paper) 6%, transparent);
}

.subscribe__input[aria-invalid="true"] {
  border-color: var(--red);
}

.subscribe--stack {
  display: grid;
  gap: 0.75rem;
}

/* The stacked form's fields sit in the form's own grid. */
.subscribe__fields {
  display: contents;
}

.subscribe__label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.subscribe__note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--paper-faint);
}

.subscribe--stack .subscribe__note {
  margin-top: 0.1rem;
}

.subscribe__status {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  min-height: 1.3em;
  color: var(--paper-dim);
}

.subscribe__status:empty {
  display: none;
}

.subscribe__status.is-error {
  color: #ff6259;
}

.subscribe__status.is-success {
  color: var(--paper);
  font-weight: 500;
}

.subscribe__status.is-success::before {
  content: "→ ";
  color: var(--red);
}

@media (max-width: 560px) {
  .subscribe__row {
    flex-direction: column;
  }

  .subscribe__row .btn {
    width: 100%;
    padding-block: 1rem;
  }
}

/* ------------------------------------------------------------------ stats */

.stats {
  border-block: 1px solid var(--rule);
  background: var(--ink-sink);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: clamp(2.25rem, 4vw, 3.25rem) clamp(0.75rem, 2vw, 1.5rem);
  text-align: center;
  border-left: 1px solid var(--rule-soft);
}

.stat:first-child {
  border-left: 0;
}

.stat__value {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  margin-top: 0.7rem;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

/* Roadmap variant: the band carries phases, not counts. */
.stats--roadmap .stat__value {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.stats--roadmap .stat__label {
  margin-top: 0.85rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--paper-dim);
}

@media (max-width: 760px) {
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(odd) {
    border-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--rule-soft);
  }
}

/* --------------------------------------------------------------- sections */

.section {
  padding-block: clamp(5rem, 12vw, 9rem);
}

.section--tight {
  padding-top: 0;
}

.section__head {
  max-width: 44rem;
  margin: 0 auto clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}

.section__head--left {
  margin-inline: 0;
  text-align: left;
}

.section__kicker {
  margin: 0 0 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}

.section__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.section__title--sm {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
}

.section__title em {
  font-style: italic;
  color: var(--red);
}

.section__lede {
  margin: 1.35rem 0 0;
  font-size: 1.02rem;
  color: var(--paper-dim);
}

/* --------------------------------------------------------------- features */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}

.feature {
  position: relative;
  padding: clamp(1.9rem, 3.5vw, 2.85rem);
  background: var(--ink);
  transition: background 0.3s var(--ease);
}

.feature::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--red);
  scale: 1 0;
  transform-origin: top;
  transition: scale 0.4s var(--ease);
}

.feature:hover {
  background: var(--ink-raise);
}

.feature:hover::before {
  scale: 1 1;
}

.feature__index {
  display: block;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--red);
  margin-bottom: 1.1rem;
}

.feature__title {
  margin: 0 0 0.7rem;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------- coverage */

.states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: clamp(2rem, 4vw, 2.6rem) 0 0;
  padding: 0;
  list-style: none;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 1.5%, transparent);
}

.state__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-faint);
  flex: none;
}

.state__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--paper-dim);
}

.state__status {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

/* Ohio: the state we start with. */
.state--first {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: var(--red-glow);
}

.state--first .state__dot {
  background: var(--red);
  animation: pulse 2.6s ease-out infinite;
}

.state--first .state__name {
  color: var(--paper);
}

.state--first .state__status {
  color: var(--red-lift);
}

.state--ask {
  border-style: dashed;
}

/* ----------------------------------------------------------------- levels */

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: clamp(2rem, 4vw, 2.6rem);
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}

.level {
  padding: clamp(1.6rem, 3vw, 2.25rem);
  background: var(--ink);
  transition: background 0.3s var(--ease);
}

.level:hover {
  background: var(--ink-raise);
}

.level__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.level__scope {
  margin: 0.35rem 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.level p:last-child {
  margin: 0;
  font-size: 0.93rem;
  color: var(--paper-dim);
}

@media (max-width: 760px) {
  .levels {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------- table card */

.table-card {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-sink);
  overflow: hidden;
}

.table-card__bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 2%, transparent);
}

.table-card__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex: none;
}

.table-card__query {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--paper-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-card__meta {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.results {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.results th,
.results td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule-soft);
}

.results thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
  border-bottom-color: var(--rule);
}

.results tbody th {
  font-weight: 500;
  color: var(--paper);
}

.results tbody td {
  color: var(--paper-dim);
}

.results tbody tr:last-child th,
.results tbody tr:last-child td {
  border-bottom: 0;
}

.results tbody tr {
  transition: background 0.2s var(--ease);
}

.results tbody tr:hover {
  background: color-mix(in srgb, var(--paper) 2.5%, transparent);
}

.results .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.results .neg {
  color: var(--red);
}

.results .hot {
  color: var(--paper);
  font-weight: 500;
}

.table-card__foot {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.74rem;
  color: var(--paper-faint);
}

/* ------------------------------------------------------------- newsletter */

.newsletter {
  position: relative;
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(70% 90% at 85% 15%, color-mix(in srgb, var(--red) 10%, transparent), transparent 70%),
    var(--ink-sink);
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
}

.newsletter__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.newsletter__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
}

.newsletter__title em {
  font-style: italic;
  color: var(--red);
}

.newsletter__lede {
  margin: 1.35rem 0 0;
  max-width: 46ch;
  color: var(--paper-dim);
}

.ticks {
  margin: 1.85rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.ticks li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.93rem;
  color: var(--paper-dim);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 1px;
  background: var(--red);
}

.newsletter__form {
  padding: clamp(1.6rem, 3vw, 2.1rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 2%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 880px) {
  .newsletter__inner {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- courses */
/* src/pages/courses/ and src/components/courses/ (and the 404 page's links). */

.not-found .section__lede a,
.courses .section__lede a,
.course a {
  color: var(--paper);
  text-decoration-color: var(--red);
  text-underline-offset: 0.2em;
}

.courses__empty {
  padding: 2rem;
  border: 1px solid var(--rule);
  color: var(--paper-dim);
}

/* Contour lines: the stand-in for a course map. */
.contours {
  display: block;
  width: 100%;
  height: 100%;
}

.contours__line {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.contours__line--index {
  stroke: color-mix(in srgb, var(--red) 45%, transparent);
}

/* The tile. */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink);
  color: inherit;
  text-decoration: none;
  transition: background 0.25s var(--ease);
}

.course-tile:hover {
  background: var(--ink-raise);
}

.course-tile__map {
  position: relative;
  aspect-ratio: 5 / 3;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--ink-sink);
  overflow: hidden;
}

.course-tile:hover .contours__line--index {
  stroke: var(--red);
}

.course-tile__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-dim);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.course-tile__body {
  flex: 1;
  padding: 1.5rem 1.5rem 1.6rem;
}

.course-tile__meta {
  margin: 0 0 0.5rem;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.course-tile__name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.course-tile__layout {
  margin: 0.4rem 0 0;
  color: var(--paper-dim);
  font-size: 0.9rem;
}

.course-tile__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
  margin: 1.4rem 0 0;
}

.course-tile__facts dt,
.course-facts dt {
  color: var(--paper-faint);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.course-tile__facts dd {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* The course page. */
.course__back {
  margin: 0 0 2.5rem;
  font-size: 0.88rem;
}

.course__head {
  margin-bottom: 2rem;
}

.course__tags {
  margin-top: 1.4rem;
}

.course__nav {
  position: sticky;
  top: calc(4.5rem + var(--nav-row, 0px) + env(safe-area-inset-top, 0px));
  z-index: 5;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0.9rem 0;
  overflow-x: auto;
  border-block: 1px solid var(--rule);
  background: var(--ink);
  scrollbar-width: none;
}

.course__nav a {
  flex: none;
  color: var(--paper-dim);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.course__nav a:hover {
  color: var(--paper);
}

.course__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

.course-panel {
  margin-bottom: 1.5rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-sink);
}

.course__grid .course-panel {
  margin-bottom: 0;
}

.course__grid + .course-panel {
  margin-top: 1.5rem;
}

.course-panel--flush {
  padding-inline: 0;
  padding-bottom: 0;
}

.course-panel--flush .course-panel__title {
  padding-inline: clamp(1.4rem, 3vw, 2rem);
}

.course-panel__title {
  margin: 0 0 1.25rem;
  color: var(--paper-dim);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.course-panel__text {
  max-width: 62ch;
  margin: 1.5rem 0 0;
  color: var(--paper-dim);
}

.course-panel__note {
  margin: 0;
  color: var(--paper-faint);
  font-size: 0.9rem;
}

.course-panel--flush .course-panel__note {
  padding: 0 clamp(1.4rem, 3vw, 2rem) 1.6rem;
}

.course-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1.25rem;
  margin: 0;
}

.course-facts dd {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.course-facts--compact {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.course-facts--compact dd {
  font-size: 1rem;
}

.course-facts .is-empty dd {
  color: var(--paper-faint);
  font-family: var(--sans);
  font-size: 0.9rem;
  text-transform: none;
}

.course-map {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 20rem;
  overflow: hidden;
}

.course-map__art {
  position: absolute;
  inset: 0;
}

.course-map__info {
  position: relative;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 85%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.course-map__info .course-panel__title {
  margin-bottom: 0.5rem;
}

.course-map__status {
  margin: 0;
  color: var(--paper);
  font-size: 0.95rem;
}

.course-map__where {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.4rem 0 0;
  color: var(--paper-dim);
  font-size: 0.85rem;
}

.course-map__where .num {
  font-family: var(--mono);
}

.course-profile {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

.course-profile svg {
  display: block;
  width: 100%;
  height: 3rem;
}

.course-profile__base {
  fill: none;
  stroke: var(--rule);
  stroke-dasharray: 4 6;
  vector-effect: non-scaling-stroke;
}

.course-profile p {
  margin: 0.6rem 0 0;
  color: var(--paper-faint);
  font-size: 0.85rem;
}

.course-bests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-bests li {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  background: var(--ink);
}

.course-bests__label {
  color: var(--paper-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.course-bests__time {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.course-bests__where {
  color: var(--paper-dim);
  font-size: 0.8rem;
}

.course .results {
  min-width: 44rem;
}

.course .results td:first-child {
  white-space: nowrap;
}

.course__level {
  margin-left: 0.6rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--paper-faint);
  font-size: 0.68rem;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .course__grid {
    grid-template-columns: 1fr;
  }
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.75rem, 6vw, 4rem);
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2.25rem;
}

.site-footer__brand p {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--paper-faint);
  max-width: 28ch;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.86rem;
}

.site-footer__links a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-footer__links a:hover {
  color: var(--red);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.76rem;
  color: var(--paper-faint);
}

/* --------------------------------------------------------- reveal on scroll */

/* Hidden only when JS is available to reveal it again — without the `js` class
   (no JS at all) the content simply renders. */
.js .reveal {
  opacity: 0;
  translate: 0 18px;
  transition:
    opacity 0.7s var(--ease),
    translate 0.7s var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
  /* Failsafe for the third case: JS is on but main.js failed to load. Cancelled
     below the moment main.js actually runs, so it never fights the real effect. */
  animation: reveal-failsafe 0.01s linear 4s forwards;
}

.js-ready .reveal {
  animation: none;
}

.js .reveal.is-in {
  opacity: 1;
  translate: 0 0;
}

@keyframes reveal-failsafe {
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    translate: none;
  }
}

/* --------------------------------------------------------------- rankings */
/* src/pages/rankings/ and public/rankings/rankings.js. */

.rankings__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-raise);
}

.rankings__views {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--rule);
  border-radius: 2px;
}

.rankings__view {
  position: relative;
}

.rankings__view input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rankings__view span {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--paper-dim);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.rankings__view input:checked + span {
  background: var(--red);
  color: var(--paper);
}

.rankings__view input:focus-visible + span {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

.rankings__field {
  display: grid;
  gap: 0.35rem;
  color: var(--paper-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rankings__field select,
.rankings__field input {
  min-width: 8.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ink-sink);
  color: var(--paper);
  font: 500 0.88rem/1.2 var(--sans);
  letter-spacing: normal;
  text-transform: none;
}

.rankings__field select:focus-visible,
.rankings__field input:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

/* rankings.js redraws on every change; the button is for when it can't. */
.js-ready .rankings__go {
  display: none;
}

.rankings__status {
  margin: 0 0 1.25rem;
  color: var(--paper-dim);
  font-size: 0.9rem;
}

.rankings__status:empty {
  display: none;
}

.rankings__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  color: var(--paper-dim);
}

.rankings__gate p {
  margin: 0;
}

.rankings__results {
  display: grid;
  gap: 1.5rem;
}

.rankings__more {
  margin: 0;
  text-align: center;
}

/* ------------------------------------------------------------------- live */
/* src/pages/live/ and public/live/live.js. */

.live__dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--red);
  vertical-align: 0.05em;
  animation: live-pulse 1.6s var(--ease) infinite;
}

@keyframes live-pulse {
  50% {
    opacity: 0.35;
  }
}

.live__status {
  margin: 0 0 1.25rem;
  color: var(--paper-dim);
  font-size: 0.9rem;
}

.live__status:empty {
  display: none;
}

.live__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  color: var(--paper-dim);
}

.live__gate p {
  margin: 0;
}

.live__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin: 0 0 0.9rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-raise);
}

.live__field {
  display: grid;
  gap: 0.35rem;
  color: var(--paper-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live__field--grow {
  flex: 1 1 14rem;
}

.live__field select,
.live__field input {
  min-width: 9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ink-sink);
  color: var(--paper);
  font: 500 0.88rem/1.2 var(--sans);
  letter-spacing: normal;
  text-transform: none;
}

.live__field select:focus-visible,
.live__field input:focus-visible,
.live-tab:focus-visible,
.live-link:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

.live__updated {
  margin: 0 0 2rem;
  color: var(--paper-faint);
  font-size: 0.78rem;
}

.live__empty {
  padding: 2rem;
  border: 1px solid var(--rule);
  color: var(--paper-dim);
}

.live-day + .live-day {
  margin-top: 2.5rem;
}

.live-day__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font: 400 1.6rem/1.2 var(--serif);
}

.live-day__today {
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--red);
  font: 600 0.65rem/1.4 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-day__meets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-meet {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-sink);
}

.live-meet.is-live {
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
  box-shadow: 0 0 0 1px var(--red-glow), 0 0 28px var(--red-glow);
}

.live-meet__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  color: var(--paper-faint);
  font-size: 0.75rem;
}

.live-meet__timer {
  color: var(--paper-dim);
  font-weight: 500;
}

.live-meet__levels {
  margin-left: auto;
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.live-meet__name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
}

.live-meet__note {
  margin: 0;
  color: var(--paper-faint);
  font-size: 0.8rem;
}

.live-meet__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: auto;
}

.live-link {
  color: var(--paper-dim);
  font-size: 0.8rem;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}

.live-link:hover {
  color: var(--paper);
  text-decoration-color: var(--red);
}

.live-pill {
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--paper-dim);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-pill--live {
  background: var(--red);
  box-shadow: none;
  color: var(--paper);
}

.live-pill--partial {
  box-shadow: inset 0 0 0 1px var(--red);
  color: var(--red-lift);
}

.live-pill--final {
  color: var(--paper);
}

.live-meet__races {
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.8rem;
}

.live-meet__races summary {
  color: var(--paper-dim);
  cursor: pointer;
}

.live-meet__races ol {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0.2rem;
  padding: 0;
  list-style: none;
}

.live-meet__races li {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 0.1rem 0.6rem;
}

.live-race__time {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.live-race__status {
  color: var(--paper-faint);
  font-size: 0.7rem;
}

.live-race__status.is-done {
  color: var(--paper);
}

.live-race__advance {
  grid-column: 2 / -1;
  color: var(--paper-faint);
  font-size: 0.74rem;
}

.live__back {
  margin: 0 0 1.25rem;
}

.live__back a {
  color: var(--paper-dim);
  font-size: 0.85rem;
  text-decoration: none;
}

.live__back a:hover {
  color: var(--paper);
}

.live__meet-head {
  margin-bottom: 1.5rem;
}

.live-meet-head__name {
  margin: 0 0 0.35rem;
  font: 400 clamp(1.6rem, 3vw, 2.2rem) / 1.15 var(--serif);
}

.live-meet-head__meta {
  margin: 0 0 0.8rem;
  color: var(--paper-faint);
  font-size: 0.85rem;
}

.live__events {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.4rem;
  overflow-x: auto;
}

.live-tab {
  display: grid;
  flex: none;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--paper-dim);
  font: 600 0.8rem/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
}

.live-tab[aria-selected="true"] {
  background: var(--red);
  box-shadow: none;
  color: var(--paper);
}

.live-tab__time {
  font: 400 0.7rem/1.2 var(--mono);
  opacity: 0.75;
}

[data-live-meet] rr-athlete-card {
  margin-top: 1.5rem;
}

/* ---------------------------------------------------------------- account */

.account__shell {
  max-width: calc(36rem + 2 * var(--gutter));
}

.account__card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--ink-raise);
}

.account__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.account__field {
  display: grid;
  gap: 0.4rem;
  color: var(--paper-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.account__field input {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ink-sink);
  color: var(--paper);
  font: 500 0.95rem/1.2 var(--sans);
  letter-spacing: normal;
  text-transform: none;
}

.account__field input:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

.account__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.account__status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--paper-dim);
}

.account__status:empty {
  display: none;
}

.account__status.is-error {
  color: #ff6259;
}

.account__status.is-success {
  color: var(--paper);
  font-weight: 500;
}

.account__note {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.85rem;
  line-height: 1.55;
}

.account__note--center {
  text-align: center;
}

.account__warning {
  margin: 0;
  color: #ff6259;
  font-size: 0.82rem;
}

/* Appearance: preset cards, then the three color pickers. */
.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-preset {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--paper-dim);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.theme-preset:hover {
  border-color: color-mix(in srgb, var(--paper) 24%, transparent);
  color: var(--paper);
}

.theme-preset:has(input:checked) {
  border-color: var(--red);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--red);
}

.theme-preset:has(input:focus-visible) {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

.theme-preset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* A tiny page: its background, a line of its text, a dot of its accent. */
.theme-preset__swatch {
  display: block;
  height: 2.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    radial-gradient(circle at 80% 50%, var(--swatch-accent) 0 0.4rem, transparent 0.45rem),
    linear-gradient(var(--swatch-fg), var(--swatch-fg)) 0.6rem 0.85rem / 45% 0.3rem no-repeat,
    linear-gradient(color-mix(in srgb, var(--swatch-fg) 45%, var(--swatch-bg)), color-mix(in srgb, var(--swatch-fg) 45%, var(--swatch-bg))) 0.6rem 1.45rem / 30% 0.3rem no-repeat,
    var(--swatch-bg);
}

.theme-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.theme-color {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--paper-dim);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.theme-color input {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.theme-color input::-webkit-color-swatch-wrapper {
  padding: 0;
}

/* Separate rules: a browser drops a whole selector list over one it doesn't know. */
.theme-color input::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

.theme-color input::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

.theme-color input:focus-visible {
  outline: 2px solid var(--red-lift);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .theme-colors {
    grid-template-columns: 1fr;
  }
}
