/* Wheelieslow — site styles
   Brand colors live in :root. Change --accent to restyle every orange element. */

:root {
  --ground: #EEF0EC;
  --ground-alt: #E3E7E1;
  --surface: #F8F9F6;
  --ink: #14201B;
  --ink-soft: #3E4A44;
  --line: #C9CFC7;
  --accent: #E8562A;
  --accent-ink: #B83C14;   /* accent dark enough for text on light ground */
  --on-accent: #FFFFFF;
  --radius: 10px;
  --maxw: 1120px;
  --narrow: 700px;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--ink); color: var(--ground);
  padding: 10px 14px; border-radius: 6px; z-index: 10;
}
.skip-link:focus { top: 12px; color: var(--ground); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--sans); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; font-style: italic; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow .dot { margin: 0 8px; }

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 40em; margin: 18px 0 0; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--ground);
  position: sticky; top: 0; z-index: 5;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 24px;
  min-height: 68px; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-word { font-size: 1.15rem; letter-spacing: 0.04em; }
.brand-word b { font-weight: 800; font-style: italic; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 10px 12px; border-radius: 8px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.site-nav a:hover { background: var(--ground-alt); color: var(--ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }

/* Buttons */
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  background: var(--ink); color: var(--ground);
  font-weight: 600; text-decoration: none; border-radius: 999px;
  border: 2px solid var(--ink);
}
.button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.button-ghost { background: transparent; color: var(--ink); }
.button-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }

/* Hero */
.hero { padding: clamp(48px, 9vw, 110px) 0 clamp(48px, 8vw, 96px); }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-copy { flex: 999 1 520px; min-width: 0; }
.hero-mark { flex: 1 1 240px; display: flex; justify-content: center; }
.hero-mark svg { width: min(320px, 70vw); height: auto; }

/* Bands */
.band { padding: clamp(48px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--ground-alt); }
.band-tight { padding-top: 24px; border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head .more { font-weight: 600; }
.section-intro { color: var(--ink-soft); margin: -8px 0 24px; }

.page-head { padding: clamp(40px, 7vw, 80px) 0 24px; }
.page-head h1 { max-width: 16em; }
.about-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.about-head > div { flex: 999 1 420px; min-width: 0; }
.about-head svg { flex: 0 0 auto; width: 180px; height: auto; }
.page-404 { text-align: center; padding-bottom: 96px; }
.page-404 svg { margin: 0 auto 24px; }
.page-404 .lede { margin-left: auto; margin-right: auto; }

/* Post cards */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.post-card:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.post-card .eyebrow { margin: 0; }
.post-card-img { aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; margin: -8px -8px 6px; width: calc(100% + 16px); max-width: none; }
.post-card-title { font-size: 1.35rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.post-card-summary { color: var(--ink-soft); font-family: var(--serif); }

/* Races */
.races { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.race {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.race-date {
  flex: 0 0 64px; height: 64px; border-radius: 8px;
  background: var(--ink); color: var(--ground);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.race-month { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.race-day { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.race-body { flex: 999 1 240px; min-width: 0; }
.race-meta { margin: 4px 0 0; color: var(--ink-soft); }
.race-report { display: inline-block; margin-top: 6px; font-weight: 600; }
.race-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; }
.race-countdown { font-size: 0.85rem; color: var(--ink-soft); }
.status {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; border: 1.5px solid var(--ink); color: var(--ink);
}
.status-registered { background: var(--ink); color: var(--ground); }
.status-lottery { border-style: dashed; }
.status-done { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.race-done .race-date { background: var(--ink-soft); }
.fine-print { color: var(--ink-soft); font-size: 0.9rem; margin-top: 20px; }

/* Follow box */
.follow { background: var(--ink); color: var(--ground); border-radius: 16px; padding: clamp(28px, 5vw, 48px); }
.follow p { color: #C9D1CC; max-width: 36em; margin: 12px 0 0; }
.follow .button { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.follow .button:hover { background: var(--ground); border-color: var(--ground); color: var(--ink); }
.follow .button-ghost { background: transparent; border-color: var(--ground); color: var(--ground); }
.follow .button-ghost:hover { background: var(--ground); color: var(--ink); }

/* Posts */
.post { padding: clamp(40px, 7vw, 80px) 24px 0; }
.post-header h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.post-hero { margin: 32px 0 0; }
.post-hero img { border-radius: var(--radius); width: 100%; }
.video { position: relative; aspect-ratio: 16/9; margin-top: 32px; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prose { font-family: var(--serif); font-size: 1.15rem; line-height: 1.7; margin-top: 36px; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 4px solid var(--accent); color: var(--ink-soft); font-style: italic; }
.prose strong { font-weight: 600; }

.post-footer { margin-top: 56px; padding-bottom: 72px; display: grid; gap: 32px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-nav a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; max-width: 48%; }
.post-nav a span { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.post-nav .next { text-align: right; margin-left: auto; }

/* Embeds and photos */
.ride-data { margin-top: 48px; }
.ride-data h2 { font-size: 1.4rem; margin-bottom: 16px; }
.embed-strava { margin: 1.5em 0; max-width: 100%; overflow: hidden; }
.embed-strava iframe { max-width: 100%; }
.prose .video { margin: 1.5em 0; }
.photo { margin: 1.8em 0; }
.prose .photo img { margin: 0; width: 100%; }
.photo figcaption { margin-top: 8px; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); }
.hero-photo { flex: 1 1 340px; margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px; }
.about-photo { flex: 0 0 auto; width: 240px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: var(--ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.footer-copy { width: 100%; margin: 0; color: var(--ink-soft); font-size: 0.85rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .wrap-narrow { padding-left: 16px; padding-right: 16px; }
  .brand-word { font-size: 1rem; }
  .site-nav { width: 100%; margin-left: -12px; }
  .site-header { position: static; }
  .race { gap: 10px 14px; padding: 16px; }
  .race-date { flex-basis: 56px; height: 56px; }
  .race-day { font-size: 1.35rem; }
  .race-body { flex: 1 1 0; }
  .race-side { flex: 0 0 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; margin-left: 0; padding-left: 70px; }
  .hero-mark { order: -1; justify-content: flex-start; }
  .hero-mark svg { width: 140px; }
  .post-nav a { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card { transition: none; }
  .post-card:hover { transform: none; }
}
