/* STEUD: ink on bone paper, like a printed race bib, matching the app (app/src/constants/theme.ts).
   Fonts are served from this site, so no third party sees who visits. */

@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}

:root {
  --ink: #141414;
  --bone: #f1ece2;
  --card: #ffffff;
  --tile: #f7f3eb;
  --beige: #e7e0d3;
  --border: #ddd5c6;
  --muted: #6e675c;
  --cobalt: #2447d6;
  --gold: #a67c1e;
  --green: #1e7b4a;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 20px;
  --gutter: 16px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--cobalt);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: var(--gutter);
  background: var(--ink);
  color: var(--bone);
  padding: 8px 14px;
  z-index: 10;
}

.wrap {
  width: min(1080px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(760px, 100% - 2 * var(--gutter));
}

/* ---------- Type ---------- */

h1,
h2,
h3,
.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.005em;
  margin: 0;
}

h1 {
  font-size: clamp(56px, 11vw, 120px);
}

h2 {
  font-size: clamp(40px, 6.5vw, 64px);
}

h3 {
  font-size: 28px;
}

.label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--muted);
  max-width: 34em;
}

.muted {
  color: var(--muted);
}

/* ---------- Header and footer ---------- */

.site-header {
  padding-block: 20px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  background: var(--beige);
}

.site-footer {
  margin-top: 96px;
  padding-block: 40px 56px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
}

.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding-inline: 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
}

.button.secondary {
  background: var(--beige);
  color: var(--ink);
}

.button[aria-disabled='true'] {
  cursor: default;
}

.button:hover:not([aria-disabled='true']) {
  opacity: 0.88;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ---------- Home: hero ---------- */

.hero {
  padding-block: 48px 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero .lede {
  margin-top: 24px;
}

.store-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* A phone showing the Race tab's 5K card, drawn in HTML so it stays crisp. */
.phone {
  justify-self: center;
  width: min(340px, 100%);
  aspect-ratio: 9 / 18.5;
  background: var(--bone);
  border: 10px solid var(--ink);
  border-radius: 52px;
  padding: 56px 18px 18px;
  position: relative;
  box-shadow: 0 30px 60px -30px rgba(20, 20, 20, 0.45);
  transform: rotate(2deg);
}

.phone::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 96px;
  height: 28px;
  margin-left: -48px;
  background: var(--ink);
  border-radius: 999px;
}

.phone .app-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
}

.phone .app-sub {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 6px 0 16px;
}

.race-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
}

.race-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.race-card .open {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.race-card .open::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  vertical-align: 1px;
}

.race-card .distance {
  font-family: var(--display);
  font-weight: 700;
  font-size: 92px;
  line-height: 0.9;
  margin: 8px 0 14px;
}

.race-card .countdown {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.race-card .start {
  margin-top: 16px;
  background: var(--ink);
  color: var(--bone);
  border-radius: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  padding: 11px;
}

.race-card .label {
  font-size: 10px;
}

/* The result that came in for yesterday's race, under today's. */
.result-card {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 16px;
}

.result-card .label {
  font-size: 10px;
}

.result-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.result-line .place {
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
}

.result-card .track {
  height: 4px;
  border-radius: 2px;
  background: var(--beige);
  margin: 10px 6px;
  position: relative;
}

.result-card .track span {
  position: absolute;
  left: 3%;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cobalt);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  font-size: 13px;
  line-height: 1.2;
}

.result-stats b {
  font-family: var(--display);
  font-size: 22px;
}

.result-stats span:first-child b {
  color: var(--cobalt);
}

/* ---------- Home: sections ---------- */

.section {
  padding-block: 72px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  counter-reset: step;
}

.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--display);
  font-size: 22px;
  margin-bottom: 16px;
}

.steps h3 {
  font-size: 26px;
  margin-bottom: 8px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.races {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.race {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.race .big {
  font-family: var(--display);
  font-weight: 700;
  font-size: 72px;
  line-height: 0.9;
}

.race .when {
  font-weight: 600;
}

.tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tile);
  margin-top: auto;
}

.tag.plus {
  color: var(--gold);
  background: #f6eedb;
}

.tag.free {
  color: var(--green);
  background: #e3f1e8;
}

.events-note {
  margin-top: 16px;
  background: var(--tile);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.feature h3 {
  margin-bottom: 12px;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.mini-board {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  font-size: 15px;
}

.mini-board li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  align-items: center;
}

.mini-board li.you {
  background: var(--tile);
}

.mini-board .time {
  font-family: var(--display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.band {
  background: var(--ink);
  color: var(--bone);
  border-radius: 28px;
  padding: clamp(32px, 6vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.band h2 {
  font-size: clamp(40px, 7vw, 80px);
}

.band .button {
  background: var(--bone);
  color: var(--ink);
}

/* ---------- Text pages (privacy, rules, support) ---------- */

.page-head {
  padding-block: 40px 32px;
}

.page-head .label {
  display: block;
  margin-top: 16px;
}

.prose {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 48px);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 34px;
  margin: 44px 0 12px;
}

.prose h3 {
  font-family: var(--text);
  text-transform: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 28px 0 6px;
}

.prose p,
.prose li {
  color: #2b2925;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--muted);
}

.short {
  background: var(--tile);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 8px;
}

.short p {
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 560px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.email {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  margin: 8px 0 4px;
  word-break: break-word;
}

.email:hover {
  color: var(--cobalt);
}

details {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

details:last-of-type {
  border-bottom: 1px solid var(--border);
}

summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}

details[open] summary::after {
  content: '–';
}

details p {
  margin: 10px 0 0;
}

/* ---------- 404 ---------- */

.not-found {
  padding-block: 96px;
  text-align: center;
}

.not-found .lede {
  margin: 20px auto 0;
}

.not-found .actions {
  justify-content: center;
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
  .phone {
    transform: none;
    width: min(300px, 100%);
  }
  .steps,
  .races {
    grid-template-columns: repeat(2, 1fr);
  }
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .steps,
  .races {
    grid-template-columns: 1fr;
  }
  .site-nav a {
    padding: 6px 10px;
  }
  .section {
    padding-block: 48px;
  }
}

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