/* STEUD: ink on bone, like the app (app/src/constants/theme.ts), with cobalt as the one accent.
   One stylesheet for every page. 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;
  --border: #ddd5c6;
  --muted: #6e675c;
  --cobalt: #2447d6;
  --gold: #a67c1e;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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(1120px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.wrap.narrow {
  width: min(720px, 100% - 2 * var(--gutter));
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.92;
  margin: 0;
}

h1 {
  font-size: clamp(56px, 9vw, 96px);
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--cobalt);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.lede {
  margin: 0;
  font-size: clamp(18px, 2vw, 20px);
  color: var(--muted);
  max-width: 30em;
}

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

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

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

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

.site-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  background: rgba(20, 20, 20, 0.07);
}

.site-footer {
  margin-top: 96px;
  padding-block: 28px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover,
.site-footer a[aria-current='page'] {
  color: var(--ink);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding-inline: 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bone);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not([aria-disabled='true']) {
  opacity: 0.86;
}
.button[aria-disabled='true'] {
  cursor: default;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
}

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

/* ---------- Home ---------- */

.hero {
  padding-top: clamp(24px, 6vw, 72px);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(64px, 10vw, 128px);
  line-height: 0.86;
  margin-bottom: 28px;
}

/* Today's 5K, counting down to midnight UTC. */
.live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.live b {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--cobalt);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* An iPhone around a screenshot, with the Dynamic Island a simulator screenshot leaves out. */
.device {
  position: relative;
  justify-self: center;
  width: min(300px, 100%);
  margin: 0;
  padding: 9px;
  border-radius: 50px;
  background: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(20, 20, 20, 0.45);
}
.device img {
  width: 100%;
  height: auto;
  border-radius: 41px;
}
.device::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 31%;
  height: 3.3%;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--ink);
}

/* The four races, in a row. */
.races {
  list-style: none;
  margin: clamp(64px, 9vw, 112px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.races li {
  padding: 28px 24px 0 0;
}
.races li + li {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.races strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(44px, 5vw, 64px);
  line-height: 1;
}
.races span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.races .plus {
  color: var(--gold);
}
.races-note {
  margin: 24px 0 0;
}

/* ---------- Inner pages ---------- */

.page-head {
  padding-block: clamp(32px, 6vw, 72px) 40px;
}
.page-head .meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* The short version, at the top of the privacy policy and the event rules. */
.glance {
  margin: 0 0 48px;
  padding: 28px 30px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
}
.glance p {
  margin: 0;
}

.prose h2 {
  font-size: 32px;
  margin: 48px 0 12px;
}
.prose h3 {
  font-size: 22px;
  margin: 28px 0 8px;
}
.prose p,
.prose li {
  color: #2b2925;
}
.prose ul {
  padding-left: 22px;
}
.prose li {
  margin-bottom: 6px;
}
.prose li::marker {
  color: var(--cobalt);
}

.table-scroll {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.table-scroll th,
.table-scroll td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table-scroll tr:last-child td {
  border-bottom: 0;
}
.table-scroll th {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Support ---------- */

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 28px 30px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--bone);
}
.contact p {
  margin: 0;
  max-width: 28em;
  color: rgba(241, 236, 226, 0.75);
}
.contact strong {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 6px;
}
.contact .button {
  background: var(--bone);
  color: var(--ink);
}

.faq {
  margin-top: 56px;
  border-top: 1px solid var(--border);
}
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-size: 18px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  flex: none;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: var(--cobalt);
  transition: rotate 0.2s ease;
}
.faq details[open] summary::after {
  rotate: 45deg;
}
.faq details p {
  margin: 0 0 22px;
  color: #2b2925;
  max-width: 38em;
}

/* ---------- Team invite and 404 ---------- */

.center {
  text-align: center;
  padding-top: clamp(40px, 9vw, 112px);
}
.center .lede {
  margin-inline: auto;
}
.center .actions {
  justify-content: center;
}

.team-code {
  display: inline-block;
  margin: 8px 0 28px;
  padding: 12px 28px 6px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(64px, 14vw, 120px);
  line-height: 1;
  letter-spacing: 0.08em;
}

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

@media (max-width: 820px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .device {
    width: min(270px, 78%);
  }
  .races {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .races li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .races li:nth-child(n + 3) {
    padding-top: 24px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .glance,
  .contact {
    padding: 22px;
  }
}

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