/* Fredoka is self-hosted (SIL OFL, assets/fonts/OFL.txt): no third-party requests, like the app. */
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(/assets/fonts/Fredoka_600SemiBold.ttf) format("truetype"); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(/assets/fonts/Fredoka_700Bold.ttf) format("truetype"); }

/* Alpine Day (shredmap/DESIGN.md): sky over snow, white panels, ink text, one accent per stat, violet is you.
   Locked to daylight like the app: it is read in sunlight. */
:root {
  color-scheme: light;
  --sky: #2f6cc9; /* top of the pixel sky panorama */
  --sky-tint: #bcd9ef;
  --snow: #eaf2f9;
  --white: #fff;
  --glacier: #dde9f4;
  --line: #cfdbe8;
  --ink: #15233b;
  --slate: #4a5c78;
  --haze: #8797ae;
  --go: #237a36;
  --me: #7048e8;
  --vertical: #1864ab;
  --speed: #b8420a;
  --runs: #0a6f80;
  --distance: #9c36b5;
  --time: #c2255c;
  --lifts: #9c5100;
  --sign-paint: #f59f00; /* trail-sign paint only (closed-terrain rope, terrain park), never UI */
  --shadow-card: 0 4px 12px rgb(21 35 59 / 0.1);
  --shadow-float: 0 3px 10px rgb(21 35 59 / 0.22);
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { background: var(--snow); scroll-behavior: smooth; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--sky-tint); color: var(--ink); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
.dim { color: var(--slate); }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
img, canvas { image-rendering: pixelated; }
main { overflow-x: clip; }

/* Pixel sprite: one cell of a rider sheet at an integer scale, frames stepped in CSS. */
.sprite {
  --cw: 64; --ch: 72; --n: 4; --fps: 6; --row: 0; --s: 2;
  width: calc(var(--cw) * var(--s) * 1px);
  height: calc(var(--ch) * var(--s) * 1px);
  background-repeat: no-repeat;
  background-size: calc(var(--cw) * var(--n) * var(--s) * 1px) auto;
  background-position: 0 calc(var(--row) * var(--ch) * var(--s) * -1px);
  image-rendering: pixelated;
  animation: frames calc(var(--n) / var(--fps) * 1s) steps(var(--n)) infinite;
}
@keyframes frames { to { background-position-x: calc(var(--cw) * var(--n) * var(--s) * -1px); } }

/* ---------- top bar, over the sky ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px max(var(--gutter), env(safe-area-inset-left)) 28px;
  background: linear-gradient(rgb(47 108 201 / 0.85), rgb(47 108 201 / 0));
  pointer-events: none;
}
.top a { pointer-events: auto; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 24px/1 var(--display); }
.mark img { border-radius: 8px; }
.top .mark, .top nav a { color: #fff; }
.top nav { display: flex; gap: 4px; }
.top nav a { font-weight: 700; font-size: 15px; text-decoration: none; padding: 10px 12px; border-radius: 999px; transition: background 160ms; }
.top nav a:hover { background: rgb(255 255 255 / 0.16); }
.share-mini { display: none; pointer-events: auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: #fff; color: var(--go); font: 700 15px var(--display); cursor: pointer; box-shadow: var(--shadow-card); }

/* ---------- hero: the trail map ---------- */
.hero { position: relative; background: var(--sky); }
.map { position: relative; height: max(620px, 100svh); overflow: hidden; touch-action: pan-y; }
#trail { display: block; position: absolute; left: 0; top: 0; cursor: pointer; }
.map-note {
  position: absolute; left: var(--gutter); bottom: 12px;
  font-size: 12px; font-weight: 700; color: var(--slate);
  background: rgb(255 255 255 / 0.9); padding: 4px 10px; border-radius: 999px;
}

.sign {
  position: absolute; z-index: 2; left: clamp(16px, 4vw, 64px); top: clamp(88px, 13vh, 132px);
  width: min(440px, 38vw); padding: 28px 28px 24px;
  background: rgb(255 255 255 / 0.92); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-float);
}
.sign h1 { font-size: clamp(40px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -0.02em; }
.lede { margin-top: 16px; color: var(--slate); font-size: 17px; }

/* The page's one action (the app isn't out yet): Go Green primary pill, as in the app. The stores are a status line. */
.share {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin-top: 24px; padding: 12px 24px;
  border: 0; border-radius: 999px; background: var(--go); color: #fff; font: 700 19px/1 var(--display); cursor: pointer;
  box-shadow: var(--shadow-float); transition: transform 160ms var(--ease), filter 160ms;
}
.share:hover { filter: brightness(1.08); }
.share:active { transform: scale(0.97); }
.share svg { width: 18px; height: 18px; flex: none; }
.soon { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; margin-top: 14px; font-size: 14px; color: var(--slate); }
.soon .store { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.soon svg { width: 10px; height: 13px; }
.copied { min-height: 1.4em; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--go); text-align: center; }

/* The docked rider card (components/RiderCard.tsx): Panel White, 24px corners, grabber, floating shadow. */
.rider-card {
  position: absolute; z-index: 2; right: clamp(16px, 3vw, 48px); top: clamp(88px, 13vh, 132px);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; width: 380px; padding: 18px 18px 16px 14px;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-float);
}
.rider-card::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--line); }
.rc-art { position: relative; width: 128px; height: 132px; display: grid; place-items: end center; }
.rc-art .sprite { position: relative; z-index: 1; margin-bottom: -6px; }
.rc-shadow, .stage-shadow { position: absolute; bottom: 4px; left: 50%; width: 70%; height: 14px; translate: -50% 0; border-radius: 50%; background: rgb(21 35 59 / 0.14); }
.rc-body { min-width: 0; }
.rc-name { font: 700 28px/1.1 var(--display); }
.rc-sub { color: var(--slate); font-size: 15px; }
.rc-status { margin-top: 6px; display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); flex: none; }
.dot.off { background: var(--haze); }
.rc-crew { grid-column: 1 / -1; display: flex; gap: 2px; margin-top: 10px; }
.rc-crew button { flex: none; display: grid; justify-items: center; gap: 3px; width: 52px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform 160ms var(--ease); }
.rc-crew button:active { transform: scale(0.94); }
.chip-ring { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--glacier); box-shadow: inset 0 0 0 2px var(--ring); overflow: hidden; }
.rc-crew button[aria-pressed='true'] .chip-ring { box-shadow: inset 0 0 0 3px var(--ring), 0 0 0 2px #fff, 0 0 0 4px var(--ring); }
.chip-name { font-size: 12px; font-weight: 700; color: var(--slate); }
.rc-crew button[aria-pressed='true'] .chip-name { color: var(--ink); }
.face { position: absolute; left: 50%; top: -3px; translate: -50% 0; width: 64px; height: 72px; background-repeat: no-repeat; background-size: 256px auto; image-rendering: pixelated; }

/* ---------- runs (sections), each led by its trail sign ---------- */
.run {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center;
  max-width: 1200px; margin: 0 auto; padding: clamp(64px, 8vw, 104px) clamp(16px, 4vw, 48px) 0;
}
/* Below the map the page is the run itself: groomed snow down the middle, the forest along both edges. */
.slopes { position: relative; }
.slopes::before, .slopes::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: max(0px, calc((100% - 1200px) / 2 - 24px));
  background: var(--forest) repeat-y; background-size: 192px auto; image-rendering: pixelated; pointer-events: none;
}
.slopes::before { left: 0; background-position: left top; }
.slopes::after { right: 0; background-position: left top; transform: scaleX(-1); }
.run-flip .run-text { order: 2; }
.run-text h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; display: flex; gap: 16px; align-items: flex-start; }
.run-text p { margin-top: 16px; max-width: 34em; color: var(--slate); }
.run-text p:first-of-type { color: var(--ink); }
.run-text .dim { font-size: 15px; }

/* Trail-sign symbols: green circle, blue square, black diamond, the terrain-park oval, and the rope line for closed terrain. */
.sym { flex: none; position: relative; width: 34px; height: 34px; margin-top: 4px; display: inline-grid; place-items: center; }
.sym::after { content: ''; display: block; }
.sym.circle::after { width: 30px; height: 30px; border-radius: 50%; background: var(--go); }
.sym.square::after { width: 28px; height: 28px; background: var(--vertical); }
.sym.diamond::after { width: 23px; height: 23px; background: var(--ink); rotate: 45deg; }
.sym.park::after { width: 34px; height: 22px; border-radius: 11px; background: var(--sign-paint); box-shadow: inset 0 0 0 3px var(--ink); } /* terrain park */
.sym.rope::after { width: 34px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 6' shape-rendering='crispEdges'%3E%3Cpath fill='%2315233b' d='M0 0h17v6H0z'/%3E%3Cpath fill='%23f59f00' d='M1 1h3v4H1zm5 0h3v4H6zm5 0h3v4h-3z'/%3E%3C/svg%3E") center / 100% 100%; }

.panel { background: #fff; border-radius: 18px; box-shadow: var(--shadow-card); padding: 16px; }
.panel-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--slate); }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--go); }
.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* crew list (Crew tab rows) */
.crew-list { padding: 16px 0 4px; }
.crew-list .panel-label { padding: 0 16px 8px; }
.crew-list ul { list-style: none; margin: 0; padding: 0; }
.crew-list li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--glacier); }
.crew-list li:first-child { border-top: 0; }
.avatar { flex: none; position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--glacier); box-shadow: inset 0 0 0 2px var(--ring); overflow: hidden; }
.avatar .face { top: -4px; }
.crew-list .who { flex: 1; min-width: 0; }
.crew-list .who b { display: block; font-size: 17px; }
.crew-list .who span { font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.crew-list .where { font-size: 13px; font-weight: 700; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.crew-list li.me b { color: var(--me); }

/* Day Summary (signature) */
.day { padding: 20px 20px 18px; }
.day-map { display: block; margin-bottom: 18px; border-radius: 12px; image-rendering: pixelated; }
.c-vertical { color: var(--vertical); } .c-time { color: var(--time); } .c-lifts { color: var(--lifts); }
.c-runs { color: var(--runs); } .c-speed { color: var(--speed); } .c-distance { color: var(--distance); }
.day-hero { margin-top: 4px; }
.day-hero .num { font-size: clamp(56px, 7vw, 76px); line-height: 1; letter-spacing: -0.02em; }
.unit { margin-left: 5px; font-size: 15px; color: var(--slate); font-weight: 600; }
.day-meta { margin-top: 6px; font-size: 15px; color: var(--slate); }
.day-meta b { font-weight: 800; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.metrics > div { padding: 0 12px; border-left: 1px solid var(--line); }
.metrics > div:first-child { padding-left: 0; border-left: 0; }
.metrics .num { font-size: 26px; }
.m-label { font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; }
.timeline { position: relative; height: 72px; margin-top: 22px; border-bottom: 2px solid var(--line); }
.timeline i { position: absolute; bottom: 0; width: 7px; margin-left: -3px; background: var(--vertical); border-radius: 3px 3px 0 0; transform-origin: bottom; }
.tl-axis { position: relative; height: 18px; margin-top: 6px; font-size: 12px; color: var(--slate); font-variant-numeric: tabular-nums; }
.tl-axis span { position: absolute; top: 0; translate: -50% 0; white-space: nowrap; }

/* Podium (signature): riders on plinths, top edge in the rider's color. */
.podium-run { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 28px; }
.podium-run .run-text h2 { justify-content: center; }
.podium-run .run-text p { margin-inline: auto; }
.podium-wrap { width: min(640px, 100%); }
.standing { font-size: 15px; color: var(--slate); text-align: center; }
.standing b { color: var(--ink); }
.podium { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 12px; margin: 16px 0 0; padding: 0; }
.podium li { display: grid; justify-items: center; }
.podium .sprite { margin: 0 -24px -10px; position: relative; z-index: 1; } /* the cell has empty sides: let it overhang the column */
.plinth { width: 100%; height: var(--h); background: #fff; border-top: 3px solid var(--c); box-shadow: var(--shadow-card); display: grid; place-items: start center; padding-top: 10px; }
.plinth span { font: 700 34px/1 var(--display); }
.podium p { margin-top: 10px; text-align: center; font-weight: 700; line-height: 1.3; }
.podium p span { font-weight: 400; font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }

/* Locker: your rider on the stage, turned through 8 directions; a shelf of looks. */
.locker { display: grid; gap: 20px; }
.stage { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px 12px 20px; border-radius: 24px; background: linear-gradient(180deg, var(--sky-tint), var(--snow) 70%); }
.stage-art { position: relative; display: grid; place-items: end center; width: 256px; height: 280px; }
.stage-art .sprite { position: relative; z-index: 1; margin-bottom: -14px; }
.stage-shadow { height: 22px; bottom: 6px; }
.turn { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); box-shadow: var(--shadow-card); cursor: pointer; display: grid; place-items: center; transition: transform 160ms var(--ease); }
.turn svg { width: 12px; height: 20px; }
.turn:active { transform: scale(0.94); }
/* The app's rider editor, cut down: a tab strip, the chosen option's name, then tiles showing you wearing each option. */
.locker { gap: 14px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; min-height: 48px; padding: 0 12px; border: 0; background: none; font: 600 15px var(--body); color: var(--slate); cursor: pointer; box-shadow: inset 0 -3px 0 transparent; transition: box-shadow 240ms var(--ease), color 160ms; }
.tabs button[aria-selected='true'] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }
.opts-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--slate); }
.opts-head #opt-name::first-letter { text-transform: uppercase; }
.opts-head #opt-name { display: inline-block; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; min-height: 92px; }
.opt { display: grid; place-items: center; width: 76px; height: 84px; padding: 0; border: 0; border-radius: 18px; background: #fff; box-shadow: var(--shadow-card); cursor: pointer; transition: transform 160ms var(--ease); }
.opt canvas { image-rendering: pixelated; }
.opt canvas[width='32'] { width: 64px; height: 68px; }
.opt:active { transform: scale(0.95); }
.opt[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--go), var(--shadow-card); }
.opt.swatch { width: 52px; height: 52px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(21 35 59 / 0.18), var(--shadow-card); }
.opt.swatch.original { background: #fff; }
.opt.swatch.original::after { content: 'Orig.'; font-size: 11px; font-weight: 700; color: var(--slate); }
.opt.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--go); }
.locker.no-kit .tabs, .locker.no-kit .opts, .locker.no-kit .opts-head { display: none; }

/* Visibility, as the app's Sheet rows. */
.sheet-list { list-style: none; margin: 0; padding: 4px 0; }
.sheet-list li { display: grid; gap: 2px; padding: 14px 20px; border-top: 1px solid var(--glacier); }
.sheet-list li:first-child { border-top: 0; }
.sheet-list b { font-size: 17px; }
.sheet-list em { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--glacier); font: 700 12px var(--body); font-style: normal; color: var(--slate); vertical-align: 2px; }
.sheet-list span { font-size: 15px; color: var(--slate); }

/* ---------- close: the chair crosses, the badges wait ---------- */
.close { position: relative; text-align: center; margin-top: clamp(96px, 12vw, 160px); padding: 290px var(--gutter) 96px; background: linear-gradient(180deg, var(--snow), var(--sky-tint)); overflow: hidden; }
.close h2 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; }
.close > p { margin-top: 14px; color: var(--slate); }
.close .share { width: auto; margin: 28px auto 0; padding-inline: 32px; }
.cable { position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--ink); }
.chair { position: absolute; top: -12px; left: 0; width: 291px; height: 291px; scale: 1; animation: ride 16s linear -5s infinite; }
.chair img { position: absolute; inset: 0; width: 291px; height: 291px; }
.seat { position: absolute; --s: 3 !important; --row: 1; --fps: 5; }
.seat.a { left: 87px; top: 33px; }
.seat.b { left: 3px; top: 33px; }
@keyframes ride { from { translate: -320px 0; } to { translate: calc(100vw + 20px) 0; } }

.foot { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; padding: 28px clamp(16px, 4vw, 48px) 40px; background: var(--sky-tint); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; font-weight: 600; }
.foot nav a { color: var(--slate); padding: 10px 0; }
.foot nav a:hover { color: var(--ink); }

/* ---------- phones: map first, then the sign, then the card ---------- */
@media (max-width: 860px) {
  .map { height: 72svh; min-height: 520px; }
  .top nav a { display: none; }
  .share-mini { display: inline-flex; align-items: center; }
  .sign { position: relative; left: auto; top: auto; width: auto; margin: 10px var(--gutter) 0; padding: 18px 16px 14px; }
  .map-note { bottom: auto; top: 64px; }
  .sign h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.05; }
  .lede { margin-top: 10px; font-size: 15px; line-height: 1.5; }
  .share { min-height: 50px; margin-top: 16px; font-size: 17px; }
  .soon { margin-top: 10px; font-size: 13px; }
  .rider-card { left: var(--gutter); right: var(--gutter); bottom: 10px; width: auto; padding: 12px 10px 8px; gap: 0 10px; border-radius: 20px; }
  .rider-card { top: auto; }
  .rc-art { width: 60px; height: 60px; overflow: hidden; place-items: start center; border-radius: 50%; background: var(--glacier); }
  .rc-art .sprite { position: absolute; left: 50%; top: -16px; translate: -50% 0; margin: 0 !important; } /* head and shoulders at 2x, centered in the circle like the app's avatar */
  .rc-shadow { display: none; }
  .rc-name { font-size: 19px; }
  .rc-sub { font-size: 13px; }
  .rc-status { margin-top: 2px; font-size: 13px; }
  .rc-crew { margin-top: 6px; justify-content: space-between; }
  .rc-crew button { width: 48px; min-height: 44px; gap: 2px; }
  .chip-ring { width: 36px; height: 36px; }
  .chip-ring .face { top: -2px; }
  .chip-name { font-size: 11px; }
  .hero { padding-bottom: 8px; background: linear-gradient(180deg, var(--sky) 0 72svh, var(--snow) 72svh); }
  .run, .podium-run { grid-template-columns: 1fr; gap: 28px; }
  .run-flip .run-text { order: 0; }
  .stage-art { width: 192px; height: 216px; }
  #stage { --s: 3 !important; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sprite, .chair, .live .dot { animation: none; }
  .chair { translate: calc(50vw - 145px) 0; }
}

/* ---------- privacy and support: a reading page under the sky band ---------- */
.doc-page .top { position: static; background: var(--sky); padding-bottom: 16px; }
.doc { max-width: 720px; margin: 0 auto; padding: 48px var(--gutter) 96px; }
.doc h1 { font-size: clamp(36px, 6vw, 52px); line-height: 1.05; margin-bottom: 12px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; }
.doc p, .doc li { margin: 0 0 12px; max-width: 68ch; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--ink); }
.doc .dim { color: var(--slate); }
.doc .card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-card); padding: 18px 20px 6px; margin: 14px 0; }
