/* Hallmark · genre: playful · macrostructure: Stat-Led · theme: Hum · enrichment: none · nav: N1 · footer: Ft8
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4
 * Everesting on Foot — cream paper, pear/cyan/coral accents, Plus Jakarta Sans.
 * Route colours (8 variations) are data colours from challenge.json, not theme accents. */

:root {
  --color-paper: oklch(97% 0.012 95);
  --color-paper-2: oklch(94% 0.016 95);
  --color-paper-3: oklch(91% 0.020 95);
  --color-ink: oklch(20% 0.012 250);
  --color-accent: oklch(86% 0.18 95);        /* pear — primary action */
  --color-accent-deep: oklch(72% 0.16 95);   /* pear edge for the push button */
  --color-accent-2: oklch(66% 0.18 235);     /* sky-cyan — links, community */
  --color-accent-3: oklch(68% 0.24 18);      /* coral — the one big moment */
  --color-mint: oklch(80% 0.16 150);         /* success only */
  --color-focus: oklch(55% 0.19 235);
  --color-sky: #e1ded9;              /* the illustration's sky, sampled */

  --font-display: "Plus Jakarta Sans", "Geist", ui-rounded, system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Geist", system-ui, sans-serif;
  --font-label: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --space-2xs: 0.5rem; --space-xs: 0.75rem; --space-sm: 1rem;
  --space-md: 1.5rem; --space-lg: 2rem; --space-xl: 3rem;
  --space-2xl: 4.5rem; --space-3xl: 6rem;

  --text-sm: 0.875rem; --text-base: 1rem; --text-md: 1.25rem;
  --text-lg: 1.5625rem; --text-xl: 1.9531rem;
  --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  --text-figure: clamp(4.5rem, 12vw + 1rem, 10rem);

  --radius-card: 20px; --radius-pill: 999px; --radius-input: 12px;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 220ms;

  --shell: 1020px;
  --page-gutter: 20px;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  overflow-wrap: anywhere;
  min-width: 0;
}

a { color: oklch(48% 0.16 235); }

.event-title { padding-block: var(--space-md); }
.event-title h1 { margin: 0; font-size: clamp(1.65rem, 5vw, 2.35rem); }
.event-title p { margin: 5px 0 0; max-width: 68ch; color: oklch(20% 0.012 250 / 0.72); font-size: var(--text-sm); }

/* one shell width model everywhere — bands carry only background + block padding */
.section {
  max-width: var(--shell);
  margin-inline: auto;
  padding: var(--space-2xl) var(--page-gutter);
}
.section--band { max-width: none; padding-inline: 0; }
.section--band > .band-inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.mono-label {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-ink);
  opacity: 0.62;
}

/* highlighter that follows the text across wraps */
.hl {
  background-image: linear-gradient(var(--hl, oklch(86% 0.18 95 / 0.55)) 0 0);
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  background-position: 0 82%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-bottom: 0.02em;
}

/* ---------- buttons — the Hum push system ---------- */

.btn {
  --btn-face: var(--color-accent); --btn-ink: var(--color-ink);
  --btn-edge: var(--color-accent-deep); --btn-cast: oklch(76% 0.20 95 / 0.45);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.8rem 1.4rem; font-weight: 600; font-family: var(--font-body);
  font-size: var(--text-base); border: 0; border-radius: var(--radius-pill);
  color: var(--btn-ink); background: var(--btn-face); cursor: pointer;
  position: relative; isolation: isolate; text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 0 0 var(--btn-edge), 0 6px 12px -3px var(--btn-cast);
  transform: translateY(0);
  transition: transform 140ms cubic-bezier(0.2,0.7,0.3,1), box-shadow 140ms cubic-bezier(0.2,0.7,0.3,1), background-color 160ms;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 0 var(--btn-edge), 0 12px 22px -4px var(--btn-cast); }
.btn:active { transform: translateY(3px);  box-shadow: 0 1px 0 0 var(--btn-edge), 0 2px 6px -2px var(--btn-cast); transition-duration: 70ms; }
.btn:focus-visible { outline: 3px solid color-mix(in oklch, var(--btn-edge) 70%, var(--color-focus)); outline-offset: 3px; }

.btn--outline {
  --btn-face: transparent; --btn-edge: transparent; --btn-cast: transparent;
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
  transition: background-color 160ms, transform 140ms cubic-bezier(0.2,0.7,0.3,1);
}
.btn--outline:hover { background: var(--color-paper-2); transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--color-ink); }
.btn--outline:active { transform: translateY(2px); }

/* ---------- nav (N1 — wordmark + 2 links) ---------- */

.nav {
  display: flex; align-items: center; gap: var(--space-md);
  max-width: var(--shell); margin-inline: auto;
  padding: var(--space-sm) var(--page-gutter);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: var(--text-md); letter-spacing: -0.02em;
  color: var(--color-ink); text-decoration: none;
}
.nav-links { margin-left: auto; display: flex; gap: var(--space-md); }
.nav-links a {
  color: var(--color-ink); text-decoration: none; font-weight: 600;
  font-size: var(--text-sm); white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms;
}
.nav-links a:hover { border-bottom-color: var(--color-accent-2); }
.nav-links a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }

/* the character — a small CSS mountain with a flag that waves on hover */
.peak { position: relative; width: 30px; height: 26px; flex: none; }
.peak .slope {
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 0;
  border-left: 15px solid transparent; border-right: 15px solid transparent;
  border-bottom: 22px solid var(--color-accent);
  transform-origin: 50% 100%;
  animation: peak-breathe 4s ease-in-out infinite;
}
.peak .flag {
  position: absolute; top: -4px; left: 14px;
  width: 2px; height: 10px; background: var(--color-ink);
}
.peak .flag::after {
  content: ""; position: absolute; top: 0; left: 2px;
  width: 0; height: 0;
  border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
  border-left: 7px solid var(--color-accent-3);
  transform-origin: left center;
}
.wordmark:hover .peak .flag::after { animation: flag-wave 600ms var(--ease-spring); }
@keyframes peak-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.05); } }
@keyframes flag-wave { 0% { transform: rotate(0); } 30% { transform: rotate(-24deg); } 65% { transform: rotate(14deg); } 100% { transform: rotate(0); } }

/* star-burst micro-celebration (fired on the live CTA click) */
.star-burst {
  position: absolute; width: 24px; height: 24px; z-index: 5;
  background:
    linear-gradient(90deg, transparent 47%, var(--color-accent-3) 47% 53%, transparent 53%),
    linear-gradient(0deg,  transparent 47%, var(--color-accent-3) 47% 53%, transparent 53%);
  animation: star-burst 420ms ease-out forwards;
  pointer-events: none;
}
@keyframes star-burst {
  0%   { transform: scale(0) rotate(0deg);    opacity: 1; }
  60%  { transform: scale(1.2) rotate(35deg); opacity: 0.9; }
  100% { transform: scale(1.4) rotate(45deg); opacity: 0; }
}

/* ---------- hero (Stat-Led, off-centre) ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: end;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.figure-wrap { min-width: 0; }
.figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-figure);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
  background-image: linear-gradient(oklch(68% 0.24 18 / 0.30) 0 0);
  background-repeat: no-repeat;
  background-size: 100% 0.12em;
  background-position: 0 90%;
}
.figure .unit { font-size: 0.36em; font-weight: 600; letter-spacing: -0.01em; margin-left: 0.06em; }

.hero-words h1 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.6rem, 2.4vw + 0.6rem, 2.4rem);
}
.hero-words .sub {
  margin: 0 0 var(--space-md);
  color: oklch(20% 0.012 250 / 0.78);
  font-size: var(--text-base);
  max-width: 42ch;
}
.hero-ctas { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; }

.hero-aside {
  grid-column: 1 / -1;
  justify-self: start;
  margin: var(--space-sm) 0 0;
  font-family: var(--font-label);
  font-size: 12px;
  color: oklch(20% 0.012 250 / 0.85);
  background: oklch(97% 0.012 95 / 0.8);
  backdrop-filter: blur(3px);
  padding: 8px 14px;
  border-radius: var(--radius-input);
  transform: rotate(-1.2deg);
  transform-origin: left center;
  max-width: 46ch;
}

/* stat strip under the hero — real numbers, tick-up on view */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: oklch(20% 0.012 250 / 0.14);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-top: var(--space-lg);
}
.stat-strip > div { background: var(--color-paper); padding: var(--space-sm) var(--space-md); }
.stat-strip dt {
  font-family: var(--font-label); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: oklch(20% 0.012 250 / 0.62);
}
.stat-strip dd {
  margin: 4px 0 0; font-weight: 700; font-size: var(--text-xl);
  letter-spacing: -0.02em; line-height: 1.1;
}
.stat-strip dd small { font-size: 0.5em; font-weight: 500; color: oklch(20% 0.012 250 / 0.65); margin-left: 2px; }

/* ---------- live band (pear tint) ---------- */

.band--pear { background: var(--color-paper-2); }
.band--cyan { background: oklch(66% 0.18 235 / 0.10); }

.live-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-head h2 { margin: 0; font-size: var(--text-lg); }
.live-when { font-family: var(--font-label); font-size: 12px; color: oklch(20% 0.012 250 / 0.6); }

.live-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: oklch(20% 0.012 250 / 0.3); flex: none;
}
.live-dot.on {
  background: var(--color-mint);
  box-shadow: 0 0 0 0 oklch(80% 0.16 150 / 0.6);
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse {
  70% { box-shadow: 0 0 0 9px oklch(80% 0.16 150 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(80% 0.16 150 / 0); }
}

.live-status { margin: var(--space-xs) 0 0; font-size: var(--text-md); font-weight: 500; }
.live-hint { margin: var(--space-xs) 0 0; font-size: var(--text-sm); color: oklch(20% 0.012 250 / 0.66); max-width: 62ch; }

.lap-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: var(--space-md);
}
.lap-summary strong {
  font-size: clamp(3.5rem, 10vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.lap-summary span { font-size: var(--text-md); font-weight: 650; }
.lap-count { margin: var(--space-sm) 0 0; font-size: var(--text-md); font-weight: 700; }
.distance-count { margin: 0; font-size: var(--text-md); font-weight: 700; }

.progress {
  position: relative; margin: var(--space-sm) 0 0; height: 30px;
  background: var(--color-paper);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 0 0 1.5px oklch(20% 0.012 250 / 0.15);
}
.progress-bar {
  height: 100%; width: 0%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width 0.6s var(--ease-snap);
}
.progress-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-label); font-size: 12px; font-weight: 600;
}

/* ---------- comments band (cyan) ---------- */

.comments h2 { margin: 0 0 var(--space-2xs); font-size: var(--text-lg); }
.comments .note { margin: 0 0 var(--space-md); color: oklch(20% 0.012 250 / 0.72); max-width: 60ch; }

/* ---------- map ---------- */

.map-section { margin: 0; }
#map {
  height: min(68vh, 580px);
  background: var(--color-paper-2);
  z-index: 0;
}
.leaflet-container { font: inherit; background: oklch(94% 0 0); }

/* Basemap in black and white so the eight route colours carry the map.
   Tiles are <img> in their own pane; the SVG route overlay is untouched. */
.leaflet-tile-pane { filter: grayscale(1) contrast(1.06) brightness(1.04); }
.map-pin { background: none; border: none; }
.map-pin svg { display: block; filter: drop-shadow(0 1px 2px oklch(20% 0.012 250 / 0.35)); }

.leaflet-tooltip {
  background: var(--color-ink); border: none; color: var(--color-paper);
  box-shadow: 0 2px 8px oklch(20% 0.012 250 / 0.3);
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px;
}
.leaflet-tooltip-top::before { border-top-color: var(--color-ink); }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--color-paper); color: var(--color-ink); }
.leaflet-control-attribution { background: oklch(97% 0.012 95 / 0.88) !important; font-size: 10px; }
.leaflet-bar a, .leaflet-control-layers { background: var(--color-paper); color: var(--color-ink); }
.leaflet-bar a:hover { background: var(--color-paper-2); }
.leaflet-control-layers-list { font-size: 13px; }

.map-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: var(--shell); margin-inline: auto;
  padding: var(--space-sm) var(--page-gutter) 0;
}
.legend-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-paper); color: var(--color-ink);
  box-shadow: inset 0 0 0 1.5px oklch(20% 0.012 250 / 0.16);
  border: 0; border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background-color 160ms, transform 140ms cubic-bezier(0.2,0.7,0.3,1);
}
.legend-btn:hover { background: var(--color-paper-2); transform: translateY(-1px); }
.legend-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.legend-btn[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); box-shadow: none; }
.legend-btn .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-hint {
  max-width: var(--shell); margin: 8px auto 0; padding: 0 var(--page-gutter);
  font-size: 12px; color: oklch(20% 0.012 250 / 0.58);
}

/* ---------- lap plan ---------- */

.plan-section h2 { margin: 0 0 var(--space-2xs); font-size: var(--text-xl); }
.plan-section .note { margin: 0; color: oklch(20% 0.012 250 / 0.75); max-width: 68ch; }

.plan-scroll { overflow-x: auto; margin-top: var(--space-md); border-radius: var(--radius-card); }
.plan {
  width: 100%; border-collapse: collapse;
  background: var(--color-paper);
  box-shadow: inset 0 0 0 1.5px oklch(20% 0.012 250 / 0.12);
  border-radius: var(--radius-card);
  overflow: hidden; font-size: 14px;
}
.plan th {
  text-align: left; font-family: var(--font-label); font-size: 10px;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: oklch(20% 0.012 250 / 0.6);
  padding: 12px 16px; border-bottom: 1.5px solid oklch(20% 0.012 250 / 0.12);
  white-space: nowrap;
}
.plan td { padding: 10px 16px; border-bottom: 1px solid oklch(20% 0.012 250 / 0.08); white-space: nowrap; }
.plan tr:last-child td { border-bottom: none; }
.plan .mono { font-family: var(--font-label); font-size: 13px; }
.plan tr.past-target td { background: oklch(68% 0.24 18 / 0.10); font-weight: 600; }

.v-chip {
  display: inline-block; font-family: var(--font-label); font-size: 11px;
  font-weight: 700; color: var(--color-ink);
  padding: 3px 10px; border-radius: var(--radius-pill);
}

.summit-note {
  margin: var(--space-sm) 0 0; font-size: var(--text-sm);
  color: oklch(20% 0.012 250 / 0.7); max-width: 62ch;
}

/* ---------- variation cards (colour-shift grid, data colours) ---------- */

.vars-head h2 { margin: 0 0 var(--space-2xs); font-size: var(--text-xl); }
.vars-head .note { margin: 0 0 var(--space-md); color: oklch(20% 0.012 250 / 0.72); max-width: 60ch; }

#variations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--space-md);
}

.day {
  --tint: transparent;
  background: color-mix(in oklch, var(--color-paper) 94%, var(--tint));
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px -16px oklch(20% 0.012 250 / 0.15);
  padding: var(--space-md);
  scroll-margin-top: 16px;
  min-width: 0;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms, background-color 220ms;
}
.day:hover {
  transform: translateY(-4px);
  background: color-mix(in oklch, var(--color-paper) 88%, var(--tint));
  box-shadow: 0 18px 40px -18px oklch(20% 0.012 250 / 0.22);
}

.day-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.day-num {
  font-family: var(--font-label); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; padding: 5px 12px;
  border-radius: var(--radius-pill); color: var(--color-ink); flex: none;
}
.day h2 { margin: 0; font-size: var(--text-md); flex: 1 1 auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px; margin: var(--space-sm) 0 0;
}
.stat {
  background: var(--color-paper);
  box-shadow: inset 0 0 0 1px oklch(20% 0.012 250 / 0.10);
  border-radius: var(--radius-input);
  padding: 10px;
}
.stat .k {
  font-family: var(--font-label); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: oklch(20% 0.012 250 / 0.58); white-space: nowrap;
}
.stat .v { font-weight: 700; font-size: var(--text-base); margin-top: 2px; }
.stat .v small { font-size: 0.68em; font-weight: 500; color: oklch(20% 0.012 250 / 0.6); }

.note { margin: var(--space-sm) 0 0; color: oklch(20% 0.012 250 / 0.75); font-size: var(--text-sm); }

/* ---------- elevation profile ---------- */

.profile {
  margin: var(--space-sm) 0 0; position: relative;
  border-radius: var(--radius-input);
  background: var(--color-paper);
  box-shadow: inset 0 0 0 1px oklch(20% 0.012 250 / 0.1);
  padding: 10px 10px 4px;
  touch-action: pan-y;
}
.profile svg { display: block; max-width: 100%; }
.profile .axis-label { fill: oklch(20% 0.012 250 / 0.55); font-size: 10px; font-family: var(--font-label); }
.profile .grid-line { stroke: oklch(20% 0.012 250 / 0.1); stroke-width: 1; }

.readout {
  position: absolute; top: 8px; right: 10px;
  font-family: var(--font-label); font-size: 12px;
  background: var(--color-ink); color: var(--color-paper);
  border-radius: 8px; padding: 4px 8px;
  pointer-events: none; opacity: 0; transition: opacity 120ms;
}
.readout.on { opacity: 1; }
.profile-hint { margin: 6px 2px 0; font-size: 11px; color: oklch(20% 0.012 250 / 0.55); }

/* ---------- download link ---------- */

.dl {
  display: inline-flex; align-items: center; gap: 9px;
  margin: var(--space-sm) 0 0;
  font-weight: 600; font-size: var(--text-sm);
  color: var(--color-ink); text-decoration: none;
  padding: 9px 16px; border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
  white-space: nowrap;
  transition: background-color 160ms, transform 140ms cubic-bezier(0.2,0.7,0.3,1);
}
.dl:hover { background: var(--color-paper-3); transform: translateY(-1px); }
.dl:active { transform: translateY(1px); }
.dl:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.dl svg { flex: none; }
.dl-size { font-weight: 400; opacity: 0.6; font-size: 12px; }

/* ---------- footer (Ft8 marquee) ---------- */

.footer { margin-top: var(--space-2xl); background: var(--color-ink); color: var(--color-paper); }
.marquee { overflow: hidden; padding: var(--space-md) 0; white-space: nowrap; }
.marquee-track {
  display: inline-block;
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-md); letter-spacing: 0.02em;
  animation: marquee 28s linear infinite;
}
.marquee-track .sep { color: var(--color-accent); margin: 0 0.8em; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.footer-meta {
  max-width: var(--shell); margin-inline: auto;
  padding: 0 var(--page-gutter) var(--space-lg);
  font-size: 12px; color: oklch(97% 0.012 95 / 0.6);
}
.footer-meta a { color: oklch(80% 0.12 235); }

/* ---------- motion & responsive ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .marquee-track { animation: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 700px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .section { padding-block: var(--space-xl); }
  .hero-aside { transform: none; }
}
@media (max-width: 560px) {
  :root { --page-gutter: 16px; }
  .nav-links { gap: var(--space-sm); }
}

/* ---------- lap sign-ups ---------- */

.crew-cell { display: flex; align-items: center; gap: 10px; }
.crew-names { font-size: 13px; font-weight: 500; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
.join-link {
  margin-left: auto;
  font-family: var(--font-label); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-ink); text-decoration: none;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 2px 0 0 var(--color-accent-deep);
  white-space: nowrap;
  transition: transform 140ms cubic-bezier(0.2,0.7,0.3,1), box-shadow 140ms cubic-bezier(0.2,0.7,0.3,1);
}
.join-link:hover { transform: translateY(-1px); box-shadow: 0 3px 0 0 var(--color-accent-deep); }
.join-link:active { transform: translateY(1px); box-shadow: 0 0 0 0 var(--color-accent-deep); }
.join-link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- cheer wall ---------- */

.wall-form {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px -16px oklch(20% 0.012 250 / 0.15);
  padding: var(--space-md);
  max-width: 560px;
}
.wall-row { display: flex; gap: var(--space-sm); align-items: center; }
.wall-form input[type="text"], .wall-form textarea {
  width: 100%; font: inherit; color: var(--color-ink);
  background: var(--color-paper);
  border: 1.5px solid oklch(20% 0.012 250 / 0.16);
  border-radius: var(--radius-input);
  padding: 10px 12px;
}
.wall-form textarea { margin-top: var(--space-sm); resize: vertical; }
.wall-form input:focus, .wall-form textarea:focus { outline: 2px solid var(--color-focus); border-color: transparent; }
#wall-website { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wall-actions { margin-top: var(--space-sm); flex-wrap: wrap; }
.wall-photo-btn { cursor: pointer; }
.wall-feedback { margin: var(--space-xs) 0 0; font-size: var(--text-sm); color: var(--color-accent-3); font-weight: 500; min-height: 1.2em; }

.wall-posts {
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--space-md);
  align-items: start;
}
.wall-card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px -16px oklch(20% 0.012 250 / 0.18);
  padding: var(--space-sm);
  min-width: 0;
  transition: transform 220ms var(--ease-spring);
}
/* polaroid tilt — alternating, straightens on hover */
.wall-card:nth-child(3n)   { transform: rotate(-1.1deg); }
.wall-card:nth-child(3n+1) { transform: rotate(0.9deg); }
.wall-card:hover { transform: rotate(0) translateY(-3px); }
.wall-img {
  width: 100%; max-width: 100%; height: auto; display: block;
  border-radius: var(--radius-input);
}
.wall-msg { margin: var(--space-xs) 0 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.wall-meta { margin: var(--space-2xs) 0 0; font-size: 12px; color: oklch(20% 0.012 250 / 0.6); }

/* ---------- bare-bones additions ---------- */

.join-bar { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); flex-wrap: wrap; }
.join-bar input {
  font: inherit; color: var(--color-ink); background: var(--color-paper);
  border: 1.5px solid oklch(20% 0.012 250 / 0.16);
  border-radius: var(--radius-input); padding: 10px 12px; max-width: 260px; width: 100%;
}
.join-bar input:focus { outline: 2px solid var(--color-focus); border-color: transparent; }
.join-link { border: 0; font-family: var(--font-label); cursor: pointer; }
.join-link[disabled] { opacity: 0.5; cursor: wait; }
td.crew-names { font-size: 13px; font-weight: 500; white-space: normal; min-width: 12ch; max-width: 30ch; }

.footer-simple {
  padding-block: var(--space-lg);
  font-size: 13px; color: oklch(20% 0.012 250 / 0.6);
}
.footer-simple p { margin: 0 0 4px; }
.footer-name { font-weight: 700; color: var(--color-ink); font-size: var(--text-base); }

/* ---------- hero: the Everest illustration ---------- */

/* Pawel's traced-Everest artwork. Text lives in the flat grey sky at the top;
   the peak fills the lower half. A gradient overlay fades the snowy foot of
   the illustration into the page paper so the seam never shows. */
.hero-band {
  position: relative;
  /* --color-sky matches the illustration's own sky, so the painted image and
     the extended band above it read as one surface. */
  background-color: var(--color-sky);
  background-image: url("everest-bg.jpg");
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: clip;
}
.hero-band::before {
  content: "";
  position: absolute; inset: 0;
  background: oklch(97% 0.012 95 / 0.45); /* paper veil — keeps the art soft */
  pointer-events: none;
}
.hero-band::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 70px;
  background: linear-gradient(to bottom, transparent, var(--color-paper));
  pointer-events: none;
}
/* Content overlays the art; keep just enough peak visible below the text. */
.hero { padding-bottom: clamp(90px, 14vw, 200px); }
.hero > * { position: relative; z-index: 1; }

/* ---------- Pawel photo in the live band ---------- */

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
}
.live-photo {
  margin: 0;
  background: var(--color-paper);
  border-radius: var(--radius-input);
  box-shadow: 0 10px 26px -14px oklch(20% 0.012 250 / 0.28);
  padding: 6px;
  transform: rotate(1.4deg);
  transition: transform 220ms var(--ease-spring);
  max-width: 320px;
  justify-self: end;
}
.live-photo--small { max-width: 220px; }
.live-photo:hover { transform: rotate(0); }
.live-photo img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-input);
}
.live-photo figcaption {
  padding: 8px 6px 2px;
  font-family: var(--font-label);
  font-size: 11px;
  color: oklch(20% 0.012 250 / 0.62);
}
@media (max-width: 700px) {
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-photo { justify-self: start; max-width: 180px; }
}

/* ---------- calories + biomechanics facts ---------- */

.live-cal {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-sm);
  color: oklch(20% 0.012 250 / 0.75);
  max-width: 62ch;
}

.facts { padding-block: var(--space-md) var(--space-lg); }
.fact-card {
  background: oklch(74% 0.16 305 / 0.12); /* lavender — the occasional accent */
  border-radius: var(--radius-card);
  padding: var(--space-sm) var(--space-md);
  max-width: 720px;
}
.fact-card .mono-label { margin: 0 0 6px; display: block; }
.fact-card p { margin: 0 0 var(--space-xs); font-size: var(--text-base); font-weight: 500; line-height: 1.5; }

.objective {
  margin: 0 0 var(--space-md);
  font-size: var(--text-base);
  font-weight: 600;
  max-width: 44ch;
}

/* ---------- bottom photo strip ---------- */

.gallery { padding-top: 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-md);
  align-items: center;
}
.gallery-card {
  margin: 0;
  background: var(--color-paper);
  border-radius: var(--radius-input);
  box-shadow: 0 12px 30px -16px oklch(20% 0.012 250 / 0.3);
  padding: 6px;
  transition: transform 220ms var(--ease-spring);
  min-width: 0;
}
.gallery-card:nth-child(1) { transform: rotate(-1.2deg); }
.gallery-card:nth-child(2) { transform: rotate(0.8deg); }
.gallery-card:nth-child(3) { transform: rotate(-0.6deg); }
.gallery-card:hover { transform: rotate(0) translateY(-3px); }
.gallery-card img {
  width: 100%; height: auto; display: block;
  border-radius: 8px;
}

/* ---------- nav buttons + hero date ---------- */

.btn--sm { padding: 0.45rem 1rem; font-size: var(--text-sm); }
.hero-date { margin: 0 0 var(--space-2xs); font-weight: 700; opacity: 0.8; }
@media (max-width: 560px) {
  .btn--sm { padding: 0.4rem 0.8rem; font-size: 13px; }
}

.live-pace {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  max-width: 62ch;
}

/* ---------- mobile optimization pass ---------- */

/* Sticky nav so Track Pawel / Leave a comment are always one tap away. */
.nav-wrap {
  position: sticky; top: 0; z-index: 1000;
  background: oklch(97% 0.012 95 / 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid oklch(20% 0.012 250 / 0.08);
}

@media (max-width: 700px) {
  /* Portrait phones: fill the hero with the artwork instead of leaving a
     flat band below the image's bottom edge. */
  .hero-band { background-size: cover; background-position: center; }

  /* Bigger tap targets */
  .join-link { padding: 9px 16px; font-size: 12px; }
  .legend-btn { padding: 9px 14px; }

  /* Denser table so more fits before horizontal scroll */
  .plan th { padding: 10px 10px; }
  .plan td { padding: 9px 10px; }

  #map { height: min(60vh, 520px); }
}

@media (max-width: 600px) {
  /* Collapse the wordmark to the mountain mark so both nav buttons fit. */
  .wordmark-text { display: none; }
  .nav { gap: var(--space-sm); }
  .nav-links { gap: var(--space-2xs); }
}
