/* Front-page ("living lake") stylesheet. Only index.html loads this.
 *
 * The design premise: the lake itself is the hero. Its outline is the real
 * lap-01 geometry projected to SVG, drawn as a glowing line on a dark ground,
 * and the live rider dots sit on that same projection — so the page shows the
 * truth before a single tile of a real map loads.
 */

:root {
  color-scheme: dark;
  --ink: #f3eee0;
  --muted: #aab8b2;
  --forest: #102621;
  --forest-deep: #0b1a16;
  --line: rgba(243, 238, 224, 0.16);
  --sun: #efb94f;
  --blue: #8cced2;
  --lap-orange: #f2913d;
  --lap-lime: #b7d356;
}

* { box-sizing: border-box; }

html { background: var(--forest-deep); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70rem 40rem at 78% -8%, rgba(140, 206, 210, 0.10), transparent),
    radial-gradient(ellipse 50rem 34rem at 8% 32%, rgba(239, 185, 79, 0.07), transparent),
    var(--forest-deep);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }

.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px;
  padding: 10px 14px; color: var(--forest); background: var(--sun);
  border-radius: 999px; text-decoration: none; font-weight: 800;
  transform: translateY(-180%); transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ------------------------------------------------------------------ header */

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; font-weight: 850; letter-spacing: -0.035em; font-size: 1.08rem; }
.brand span { color: var(--sun); }
.language-switcher { display: flex; gap: 4px; }
.language-switcher button {
  min-width: 44px; min-height: 44px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 999px;
  color: var(--muted); background: transparent;
  font: inherit; font-size: 0.76rem; font-weight: 850; cursor: pointer;
}
.language-switcher button.is-active {
  color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, 0.06);
}

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.eyebrow {
  margin: 0 0 14px; color: var(--sun);
  font-size: 0.74rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase;
}

/* --------------------------------------------------------------- lake hero */

.lake-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(40px, 7vw, 90px) 0 clamp(30px, 5vw, 60px);
}

.lake-map { position: relative; }
.lake-map svg { display: block; width: 100%; height: auto; max-height: 68vh; }

.lake-loop { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.lake-loop--halo { stroke: rgba(140, 206, 210, 0.35); stroke-width: 5; }
.lake-loop--dash {
  stroke: var(--blue);
  stroke-width: 2;
  stroke-dasharray: 7 9;
  animation: lake-flow 60s linear infinite;
}
@keyframes lake-flow { to { stroke-dashoffset: -320; } }

.lake-hub-mark circle { fill: var(--sun); stroke: var(--forest-deep); stroke-width: 2.5; }
.lake-hub-mark text {
  fill: var(--sun); font-size: 15px; font-weight: 800;
  text-anchor: end; letter-spacing: 0.08em;
}

/* Live rider dots, drawn by hub.js on the same projection. */
.lake-rider circle {
  stroke: var(--forest-deep); stroke-width: 2.5;
  animation: rider-pulse 2.4s ease-in-out infinite;
}
.lake-rider text {
  fill: var(--ink); font-size: 15px; font-weight: 750;
  paint-order: stroke; stroke: var(--forest-deep); stroke-width: 4px;
}
@keyframes rider-pulse { 50% { r: 9; } }

.lake-status h1 { margin: 0; line-height: 1; }
.live-count strong {
  display: block;
  font-size: clamp(4.4rem, 12vw, 8.6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.live-count strong.is-live { color: var(--sun); }
.live-count strong.is-muted { opacity: 0.35; }
.live-count-label {
  display: block; max-width: 18ch; margin-top: 6px;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem); font-weight: 800;
  letter-spacing: -0.02em; text-wrap: balance;
}
.live-detail {
  min-height: 1.5em; max-width: 46ch; margin: 18px 0 0;
  color: var(--muted); line-height: 1.55;
}
.live-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
.live-actions [hidden] { display: none; }

.button {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 22px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 850; text-decoration: none; cursor: pointer;
}
.button--sun { color: var(--forest); background: var(--sun); }
.button--sun:hover { background: #f6ca6d; }
.button--ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button--ghost:hover { border-color: var(--ink); }
.text-link {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: inherit; font-weight: 750;
  text-decoration: underline; text-underline-offset: 4px;
}
.text-link:hover { color: var(--ink); }

/* ------------------------------------------------------------- beacon form */

.beacon { padding: clamp(20px, 3vw, 30px) 0 clamp(40px, 6vw, 70px); }
.beacon-inner {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(239, 185, 79, 0.07), rgba(255, 255, 255, 0.015));
}
.beacon-inner h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }
.beacon-help { max-width: 62ch; margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

.beacon-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; }
.beacon-field { display: flex; flex-direction: column; gap: 6px; }
.beacon-field span { font-size: 0.82rem; font-weight: 750; color: var(--muted); }
.beacon-field input {
  min-height: 48px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: rgba(0, 0, 0, 0.25);
  font: inherit;
}
.beacon-field input::placeholder { color: rgba(170, 184, 178, 0.55); }
.beacon-field input:focus-visible { outline-offset: 0; }

.beacon-turnstile { margin-top: 14px; min-height: 0; }
.beacon-turnstile:not(:empty) { margin-bottom: 4px; }
.beacon-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 16px; }
.beacon-status { min-height: 1.4em; margin: 12px 0 0; font-weight: 700; }
.beacon-status.is-bad { color: #f0a08a; }
.beacon-status.is-good { color: var(--lap-lime); }

/* ------------------------------------------------------- mobile app story */

.mobile-story {
  padding: clamp(48px, 8vw, 92px) 0;
  border-top: 1px solid var(--line);
}
.mobile-story__intro {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
}
.mobile-story h2 {
  max-width: 12ch; margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 0.98;
  letter-spacing: -0.055em; text-wrap: balance;
}
.mobile-story__lead > p:first-child {
  max-width: 48ch; margin: 0;
  font-size: clamp(1.18rem, 2.2vw, 1.55rem); line-height: 1.5;
  text-wrap: pretty;
}
.mobile-story__status {
  max-width: 54ch; margin: 20px 0 0; padding-left: 18px;
  border-left: 3px solid var(--sun);
  color: var(--muted); line-height: 1.55;
}
.mobile-story__features {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
  margin-top: clamp(34px, 6vw, 64px);
}
.mobile-story__features article {
  min-height: 260px; padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(155deg, rgba(140, 206, 210, 0.07), rgba(255, 255, 255, 0.015));
}
.mobile-story__features article:last-child {
  border-style: dashed;
  background: linear-gradient(155deg, rgba(239, 185, 79, 0.09), rgba(255, 255, 255, 0.015));
}
.mobile-story__tag {
  margin: 0 0 18px; color: var(--blue);
  font-size: 0.72rem; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase;
}
.mobile-story__tag--planned { color: var(--sun); }
.mobile-story__features h3 {
  margin: 0 0 12px; font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  letter-spacing: -0.035em;
}
.mobile-story__features article > p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }

.smart-start {
  display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(30px, 6vw, 76px); align-items: start;
  margin-top: 20px; padding: clamp(28px, 5vw, 48px);
  border-radius: 24px; background: rgba(255, 255, 255, 0.035);
}
.smart-start__heading h3 {
  max-width: 14ch; margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.045em;
}
.smart-start__heading > p:last-child { max-width: 40ch; margin: 18px 0 0; color: var(--muted); line-height: 1.55; }
.smart-start__steps {
  list-style: none; counter-reset: smart-step;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px;
  margin: 0; padding: 0;
}
.smart-start__steps li {
  counter-increment: smart-step;
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  color: var(--muted); line-height: 1.5;
}
.smart-start__steps li::before {
  content: counter(smart-step); display: grid; place-items: center;
  width: 34px; height: 34px; border: 1px solid rgba(239, 185, 79, 0.45); border-radius: 50%;
  color: var(--sun); font-weight: 900; font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .mobile-story__intro, .smart-start { grid-template-columns: 1fr; }
  .mobile-story h2, .smart-start__heading h3 { max-width: 18ch; }
}

@media (max-width: 720px) {
  .mobile-story__features, .smart-start__steps { grid-template-columns: 1fr; }
  .mobile-story__features article { min-height: 0; }
}

/* -------------------------------------------------------------- year cards */

.years { position: relative; padding: clamp(30px, 5vw, 60px) 0; border-top: 1px solid var(--line); }
.years h2, .days h2 {
  margin: 0 0 26px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.year-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; align-items: end; }
/* The connecting thread: a stripe band winding over the card tops, one day
 * growing longer year by year. hub.js draws the paths from the measured
 * staircase, so the band climbs with the cards in every language and width. */
.year-line {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible; opacity: 0.55;
}
.year-line .yl { fill: none; stroke: var(--lap-lime); stroke-width: 1.3; stroke-linecap: round; }
.year-line .yl--lead { stroke: var(--ink); stroke-width: 2; opacity: 0.8; }

.year-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}
/* The staircase: cards sit on a shared baseline and each year is literally a
   bigger card than the one before — a 20,8 km day fits in less space than 203 km.
   --step scales the display type along with the card height. */
.year-card--2023 { --step: 0.7; min-height: 240px; border-color: rgba(170, 184, 178, 0.35); }
.year-card--2024 { --step: 0.84; min-height: 285px; border-color: rgba(140, 206, 210, 0.4); }
.year-card--2026 { --step: 1; min-height: 330px; border-color: rgba(239, 185, 79, 0.4); }
.year-card--2027 { --step: 1.08; min-height: 370px; border-style: dashed; }

.year-label {
  margin: 0; font-size: 0.72rem; font-weight: 850;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted);
}
.year-card--2024 .year-label { color: var(--blue); }
.year-card--2026 .year-label { color: var(--sun); }

.year-card h3 { margin: 0; font-size: calc(clamp(2.6rem, 5vw, 3.6rem) * var(--step, 1)); letter-spacing: -0.06em; line-height: 0.95; }
.year-card h3 a { text-decoration: none; }
.year-card h3 a:hover { color: var(--sun); }

.year-km { margin: 0; color: var(--muted); font-weight: 700; }
.year-km strong {
  font-size: calc(clamp(1.6rem, 3vw, 2.1rem) * var(--step, 1)); font-weight: 900;
  letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.year-card--2023 .year-km strong { color: var(--muted); }
.year-card--2024 .year-km strong { color: var(--blue); }
.year-card--2026 .year-km strong { color: var(--sun); }

.year-copy { margin: 0 0 6px; color: var(--muted); line-height: 1.55; flex-grow: 1; }
.year-card .button { align-self: stretch; }

/* ---------------------------------------------------------------- ride log */

.days { padding: clamp(30px, 5vw, 60px) 0; border-top: 1px solid var(--line); }
.days-sub { max-width: 56ch; margin: -14px 0 24px; color: var(--muted); line-height: 1.55; }

.days-list { list-style: none; margin: 0; padding: 0; }
.days-list li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.days-list .day-date { font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.days-list .day-date a { color: var(--sun); text-decoration: none; }
.days-list .day-date a:hover { text-decoration: underline; text-underline-offset: 4px; }
.days-list .day-who { color: var(--muted); line-height: 1.5; }
.days-list .day-sum {
  font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.days-list .day-sum small { display: block; color: var(--muted); font-weight: 700; }
.days-empty { color: var(--muted); padding: 14px 0; }

/* Year folds: the log spans seasons back to 2021, so each year collapses
 * into its own <details>; the row grid above only styles the inner lists. */
.days-list > .days-year { display: block; padding: 0; border-bottom: none; }
.days-year details { border-bottom: 1px solid var(--line); }
.days-year summary {
  display: flex; align-items: baseline; gap: 12px;
  padding: 16px 0; cursor: pointer; list-style: none;
}
.days-year summary::-webkit-details-marker { display: none; }
.days-year summary::before { content: "▸"; color: var(--muted); }
.days-year details[open] summary::before { content: "▾"; }
.days-year .year-label { font-weight: 850; font-size: 1.15em; font-variant-numeric: tabular-nums; margin-right: auto; }
.days-year .year-stats { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.days-year .days-list { margin: 0 0 6px; padding-left: clamp(14px, 3vw, 26px); }
.days-year .days-list li:last-child { border-bottom: none; }

/* -------------------------------------------------------------- invitation */

.invitation { margin: 20px 0 40px; padding: 34px 0; border-top: 1px solid var(--line); }
.invitation p {
  max-width: 52ch; margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem); line-height: 1.35; font-weight: 700;
  text-wrap: pretty;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto; padding: 0 0 42px;
  display: flex; justify-content: space-between; gap: 20px;
  color: var(--muted);
}
footer a { color: var(--muted); font-weight: 700; }
footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------- breakpoints */

@media (max-width: 900px) {
  .lake-hero { grid-template-columns: 1fr; padding-top: 30px; }
  .lake-map { order: 2; max-width: 440px; }
  .lake-status { order: 1; }
  .year-grid { grid-template-columns: 1fr; align-items: stretch; }
  .year-card { min-height: 0; }
  .year-line { display: none; }
  .beacon-fields { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; }
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .live-actions .button, .beacon-actions .button { width: 100%; }
  .days-list li { grid-template-columns: 1fr auto; }
  .days-list .day-who { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lake-loop--dash, .lake-rider circle { animation: none; }
  * { transition: none !important; }
}

/* --------------------------------------------------------------- heat glow */

/* The ridden-trail glow inside the lake SVG (#lake-heat, drawn by hub.js from
   /heatmap.json). The toggle floats over the map's corner. */
.heat-toggle {
  position: absolute; right: 6px; bottom: 6px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: rgba(11, 26, 22, 0.7);
  font: inherit; font-size: 0.78rem; font-weight: 850; cursor: pointer;
}
.heat-toggle::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  margin-right: 8px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 6px var(--sun);
}
.heat-toggle.is-off { color: rgba(170, 184, 178, 0.55); }
.heat-toggle.is-off::before { background: transparent; box-shadow: none; border: 1px solid var(--muted); }
.heat-toggle:hover { color: var(--ink); }

/* -------------------------------------------------------------------- guide */

/* Three steps: arrive, ride around, enjoy. Numbered by the counter so the
   markup stays a plain list. */
.guide { padding: clamp(30px, 5vw, 60px) 0; border-top: 1px solid var(--line); }
.guide h2 {
  margin: 0 0 26px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
}
.guide-steps {
  list-style: none; counter-reset: step;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px;
  margin: 0; padding: 0;
}
.guide-steps li {
  counter-increment: step;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line); border-radius: 24px;
}
.guide-steps li::before {
  content: counter(step);
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; line-height: 1;
  letter-spacing: -0.05em; color: var(--sun); font-variant-numeric: tabular-nums;
}
.guide-steps h3 { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.4rem); letter-spacing: -0.02em; }
.guide-steps p { margin: 0; color: var(--muted); line-height: 1.55; flex-grow: 1; }

@media (max-width: 900px) {
  .guide-steps { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------- beacon how-to */

/* "Where do I get a Beacon link?" — collapsed by default so the form stays
   two fields and a button. */
.beacon-how { max-width: 62ch; margin-top: 14px; font-size: 0.9rem; }
.beacon-how summary {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); font-weight: 750; cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px;
  list-style: none;
}
.beacon-how summary::-webkit-details-marker { display: none; }
.beacon-how summary::before {
  content: ""; display: inline-block; width: 0; height: 0;
  margin-right: 8px;
  border-left: 6px solid var(--sun); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.beacon-how[open] summary::before { transform: rotate(90deg); }
.beacon-how summary:hover { color: var(--ink); }
.beacon-how ol { margin: 8px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.6; }
.beacon-how li { margin-bottom: 4px; }
.beacon-how li::marker { color: var(--sun); font-weight: 800; }
.beacon-how p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.live-hint { margin: 12px 0 0; font-size: 0.9rem; }
.app-start-qr {
  width: fit-content; display: flex; align-items: center; gap: 14px;
  margin-top: 20px; color: var(--muted); font-size: 0.86rem; font-weight: 750;
  text-decoration: none;
}
.app-start-qr[hidden] { display: none; }
.app-start-qr img { border-radius: 10px; background: #fff; }
.app-start-qr span { max-width: 18ch; line-height: 1.35; }
@media (max-width: 640px) { .app-start-qr { display: none; } }

/* ---------------------------------------------------------- notify toggles */

/* The heat toggle's look, but sitting in normal flow inside .live-actions. */
.notify-toggle, .notify-mute {
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: rgba(11, 26, 22, 0.7);
  font: inherit; font-size: 0.78rem; font-weight: 850; cursor: pointer;
}
.notify-toggle::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  margin-right: 8px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 6px var(--sun);
}
.notify-toggle.is-off { color: rgba(170, 184, 178, 0.55); }
.notify-toggle.is-off::before { background: transparent; box-shadow: none; border: 1px solid var(--muted); }
.notify-toggle.is-denied { color: rgba(170, 184, 178, 0.4); cursor: default; }
.notify-toggle.is-denied::before { background: transparent; box-shadow: none; border: 1px solid rgba(170, 184, 178, 0.4); }
.notify-toggle:hover:not(.is-denied), .notify-mute:hover { color: var(--ink); }
.notify-mute.is-off { color: rgba(170, 184, 178, 0.55); text-decoration: line-through; }
