/* lane0, v3 "Plain": page layout and type. Tokens in tokens.css; spec in ../README.md §3–§4. */

/* Small text grey; tokens' --ink-3 is the same #72716c (4.7:1, AA). */
:root { --ink-3-text: var(--ink-3); }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

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

::selection { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); color: var(--ink); }   /* a wash, not a fill */

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-small)/1 var(--font-sans);
}
.skip:focus { top: 12px; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top ---------- */

.top { padding: 18px var(--margin) 0; }

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  font: 400 var(--fs-small)/1.4 var(--font-sans);
}
.nav a { color: var(--ink); }

/* Links: a 1px underline slides in from the left on hover. It is a solid-colour background layer (not a
   visible gradient) so it follows wrapped lines. Prose links keep a faint resting rule under it. */
.nav a, .prose a:not(.pill) {
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 2px;
  transition: background-size 240ms var(--ease);
}
.nav a:hover, .prose a:not(.pill):hover { background-size: 100% 1px; }

.mark {
  margin: 64px 0 0;
  display: flex;
  justify-content: center;
  line-height: 0;
}
.mark a { display: inline-block; color: var(--ink); text-decoration: none; }
.mark-svg { display: block; height: 40px; width: auto; overflow: hidden; }

/* The zero is a lane: once on load, and on hover, a small accent car drives down it and out. */
.mark-car { fill: var(--accent); transform: translateY(0); }
.mark.is-run .mark-car { animation: mark-run 680ms cubic-bezier(.45, 0, .3, 1) both; }
@keyframes mark-run { to { transform: translateY(772px); } }   /* counter top to just past its bottom */

/* ---------- Column ---------- */

main { padding: 88px var(--margin) 0; }

.col {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}

.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }

.prose em { font-style: italic; color: var(--ink); }

.prose a:not(.pill) {
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--rule-2), var(--rule-2));
  background-size: 0 1px, 100% 1px;
  padding-bottom: 1px;
}
.prose a:not(.pill):hover { background-size: 100% 1px, 100% 1px; }

h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font: 400 var(--fs-h2)/1.3 var(--font-sans);
  letter-spacing: -0.005em;
}

section.col { margin-top: 72px; }

/* ---------- Race ---------- */

.race {
  margin: 56px auto 0;
  max-width: var(--wide);
}
.lz-race { min-height: 120px; }

.caption {
  margin-top: 16px;
  color: var(--ink-3-text);
  font: 400 var(--fs-small)/1.5 var(--font-sans);
}

/* ---------- The numbers ---------- */

.numbers {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.numbers th, .numbers td {
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  font-weight: 400;
}
.numbers th:first-child { text-align: left; }
.numbers thead th {
  padding-top: 0;
  color: var(--ink-3-text);
  font: 400 0.8125rem/1.4 var(--font-sans);
  border-bottom-color: var(--rule-2);
}
.numbers td:nth-child(2) { width: 28%; }
.numbers td:nth-child(3) { width: 32%; }
.numbers .us th, .numbers .us td { color: var(--ink); font-weight: 500; }
.numbers .us th { position: relative; }
.numbers .us th::before {             /* lane0's lane marker, outside the column edge */
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 2px;
  height: 14px;
  margin-top: -7px;
  border-radius: 1px;
  background: var(--accent);
}

/* ---------- Button ---------- */

.pill {
  display: inline-block;
  margin-top: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #ebebe7;
  color: var(--ink);
  font: 400 var(--fs-small)/1.4 var(--font-sans);
  text-decoration: none;
}
.pill:hover { background: #e2e2dd; }
.pill-arrow {
  display: inline-block;
  margin-left: 7px;
  transition: transform var(--dur) var(--ease);
}
.pill:hover .pill-arrow { transform: translateX(3px); }

/* ---------- Footer ---------- */

.foot {
  width: min(var(--wide), 100% - 2 * var(--margin));
  margin: 160px auto 0;
  padding: 28px 0 48px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3-text);
  font: 400 0.8125rem/1.6 var(--font-sans);
}
.foot p { margin: 0; max-width: var(--col); }
.foot .copy { margin-top: 40px; }

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

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .top { padding-top: 16px; }
  .nav { gap: 20px; }
  .mark { margin-top: 48px; }
  .mark-svg { height: 32px; }
  main { padding-top: 56px; }
  .race { margin-top: 40px; }
  section.col { margin-top: 56px; }
  h2 { font-size: 1.25rem; }
  .foot { margin-top: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .mark.is-run .mark-car { animation: none; }
  .nav a, .prose a:not(.pill), .pill-arrow { transition: none; }
}
