/* ==================================================================
   lily.zyli.cz: a resume laid out as a trail map.
   Difficulty markings follow the real North American convention:
   green circle, blue square, black diamond, double black diamond.
   ================================================================== */
:root {
  --nav-h: 108px;
  --cable-h: 0px;
  --topbar-h: 104px;
  --radius: 16px;
  --wrap: 1140px;

  --bg-1: #f6f2fd;
  --bg-2: #ded4f2;
  --bg-3: #c1b2e6;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.6);
  --ink: #0e2637;
  --ink-2: #4a6a80;
  --ink-3: #7b98ac;
  --line: rgba(14, 38, 55, 0.14);
  --line-strong: rgba(14, 38, 55, 0.28);

  --pine: #5b4bb5;
  --blue: #9b7bf5;
  --green: #2f9e57;
  --black: #16202a;
  --hot: #7a5af0;
  --glow: rgba(199, 182, 255, 0);

  --map-peak-1: #e8f4ff;
  --map-peak-2: #b9d7ef;
  --map-ground: #a9cde9;

  --shadow: 0 20px 44px -26px rgba(10, 40, 60, 0.5);
  --shadow-soft: 0 10px 24px -18px rgba(10, 40, 60, 0.5);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body[data-theme="night"] {
  --bg-1: #120c26;
  --bg-2: #1b1235;
  --bg-3: #251847;
  --surface: rgba(13, 34, 53, 0.82);
  --surface-solid: #0e2537;
  --surface-2: rgba(18, 44, 66, 0.6);
  --ink: #e9f3fc;
  --ink-2: #9dbdd4;
  --ink-3: #6d8ea6;
  --line: rgba(233, 243, 252, 0.14);
  --line-strong: rgba(233, 243, 252, 0.3);
  --pine: #b9a5ff;
  --blue: #c4b0ff;
  --green: #4fd18a;
  --black: #cfe3f2;
  --hot: #a78bfa;
  --glow: rgba(199, 182, 255, 0.5);
  --map-peak-1: #123c5a;
  --map-peak-2: #0a2438;
  --map-ground: #0a2033;
  --shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 12px 26px -18px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-top: 0;
  color: var(--ink);
  font: 400 16.5px/1.65 var(--font-body);
  background:
    radial-gradient(1200px 700px at 50% -10%, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background 400ms ease, color 300ms ease;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

canvas#snowfall {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

main, .topbar, .foot { position: relative; z-index: 2; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 120;
  background: var(--surface-solid); color: var(--ink); padding: 10px 14px;
  border: 2px solid var(--ink); font-weight: 600;
}
.skip:focus { left: 10px; top: calc(var(--cable-h) + 8px); }

/* ---------- placeholder guard ---------- */
.placeholder-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: #c81e1e; color: #fff; text-align: center;
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.3);
}
.placeholder-banner b { font-weight: 800; }

/* anchors and the gondola both land the section clear of the sticky header */
main > section, .story, #top, #work, #training, #gear, #apres, #snow {
  scroll-margin-top: calc(var(--topbar-h) + 14px);
}

/* ---------- the gondola ----------
   The line carries nothing but the cable and the car. Every stop the car
   makes lives on the row underneath it, and the car lines up horizontally
   with whichever one you are on. The wordmark is the stop for the bio. */
.gondola-line { position: relative; height: 52px; flex: none; }
.cable-wire {
  position: absolute; left: -22px; right: -22px; top: 26px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(96, 106, 120, 0.28), rgba(96, 106, 120, 0.72), rgba(96, 106, 120, 0.28));
}
body[data-theme="night"] .cable-wire {
  background: linear-gradient(90deg, rgba(190, 198, 210, 0.24), rgba(190, 198, 210, 0.66), rgba(190, 198, 210, 0.24));
}
.gondola-cabin {
  position: absolute; top: 17px; left: 0; transform: translateX(-50%); z-index: 3;
  transition: left 0.55s cubic-bezier(0.4, 0.05, 0.2, 1);
  width: 30px; height: 34px; pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(4, 18, 31, 0.22));
}
.gondola-cabin svg { display: block; width: 100%; height: 100%; }

.gondola-row { display: flex; align-items: center; gap: 18px; height: 52px; flex: none; }
.gondola-runs { display: flex; align-items: center; gap: 9px; }
.gondola-sections { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.gondola-stop {
  position: relative; width: 25px; height: 25px; padding: 0; border: 0; background: none;
  cursor: pointer; transition: transform 0.2s ease;
}
.gondola-stop svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gondola-stop .sign { transform-box: fill-box; transform-origin: center; transition: transform 0.25s ease; }
.gondola-stop:hover .sign, .gondola-stop.is-active .sign { transform: scale(1.34); }
.gondola-stop:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 6px; }
/* no outline: the header is white, so a white stroke only shrinks the shape */
.sign--green  { fill: #1f9d55; stroke: none; }
.sign--blue   { fill: #1f6fd0; stroke: none; }
.sign--black  { fill: #141c26; stroke: none; }
.sign--double { fill: #141c26; stroke: none; }
.sign--start  { fill: #0e2637; stroke: #fff; stroke-width: 2.6; }
/* at night the theme's --black is already light ink (the difficulty badges use
   it), so the two dark signs follow it instead of vanishing into a dark header */
body[data-theme="night"] .sign--black,
body[data-theme="night"] .sign--double { fill: var(--black); }

.gondola-row { position: relative; }
.gondola-brand {
  position: absolute; left: 50%; top: 0; height: 52px; transform: translateX(-50%);
  display: flex; align-items: center; padding: 0 20px;
  font-family: var(--font-display); font-weight: 800; font-size: 27px;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink);
  transition: color 0.2s ease;
}
.gondola-brand span { color: var(--hot); }
.gondola-brand.is-active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; text-decoration-color: var(--hot); }

.gondola-section {
  position: relative; font-family: var(--font-display); font-weight: 400; font-size: 16px;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2);
  white-space: nowrap; transition: color 0.2s ease;
}
.gondola-section:hover { color: var(--ink); }
.gondola-section.is-active { color: var(--ink); font-weight: 700; }

/* the last stop is the live conditions, hers and Houston's for reference */
.gondola-weather {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  margin-left: 20px; padding-left: 20px; border-left: 1px solid var(--line-strong);
  line-height: 1.2;
}
.gw-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin: 0; min-width: 150px;
}
.gw-row b, .gw-row > span:first-child {
  font-family: var(--font-display); font-weight: 400; font-size: 12.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.gw-row--link b { font-weight: 700; font-size: 14px; letter-spacing: 0.04em; color: var(--ink); }
.gw-row--link:hover b { color: var(--hot); }
.gw-row--link.is-active b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--hot); }
.gw-row > span:last-child {
  font-family: var(--font-display); font-weight: 400; font-size: 13.5px;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.gw-row--link > span:last-child { font-size: 16px; font-weight: 700; color: var(--ink); }

/* the opening card is the introduction, so the name carries it */
.story-card.is-intro { padding: 26px 26px 24px; }
.story-card.is-intro .story-title {
  font-size: clamp(38px, 3.6vw, 54px); line-height: 0.98; letter-spacing: -0.025em;
  margin: 2px 0 10px;
}
.story-card.is-intro .story-kicker { letter-spacing: 0.28em; }
.story-card.is-intro .story-org {
  font-size: 15px; letter-spacing: 0.02em; color: var(--ink); margin-bottom: 12px;
}
.story-card.is-intro .story-body { font-size: 15.5px; }
.story-card.is-intro .story-commentary {
  font-size: 19px; border-top: 0; padding-top: 4px; margin-top: 10px;
}

/* the numbers behind the descent, and the line that sums it up */
.story-stats { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 5px; }
.story-stats li {
  position: relative; padding-left: 17px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2);
}
.story-stats li::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--hot);
}
.story-commentary {
  margin: 13px 0 0; padding-top: 11px; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.3; color: var(--ink);
}
.gear-proof {
  margin: 5px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2);
  padding-left: 15px; position: relative;
}
.gear-proof::before {
  content: ""; position: absolute; left: 1px; top: 6px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--hot);
}

/* the trail sign in a run card, in place of the boxed number */
.story-num .chip.chip--sign { width: 24px; height: 24px; padding: 0; background: none; border: 0; border-radius: 0; color: inherit; }
.chip--sign svg { display: block; width: 100%; height: 100%; }

/* ---------- elevation gauge ---------- */
.gauge {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  height: 430px;
  pointer-events: none; padding: 12px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.62); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 26px -16px rgba(30, 20, 60, 0.7);
}
body[data-theme="night"] .gauge {
  background: rgba(20, 14, 40, 0.62); border-color: rgba(199, 182, 255, 0.28);
}
.gauge-track {
  width: 8px; height: 34vh; border-radius: 6px;
  background: rgba(122, 90, 240, 0.16); overflow: hidden; position: relative;
}
.gauge-track i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(0deg, var(--blue), var(--pine));
  border-radius: 6px; transition: height 120ms linear;
}
.gauge-read {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em;
  color: var(--ink-2); text-transform: uppercase; writing-mode: vertical-rl;
  inline-size: 62px; display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.gauge-read b { color: var(--ink); font-size: 17px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  /* its own height, never var(--topbar-h): board.js measures this element and
     publishes the result as --topbar-h, so reading it back here would be a
     loop that sticks the header at whatever width it was measured at */
  height: 104px;
  display: flex; flex-direction: column;
  padding: 0 22px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink);
}
.brand span { color: var(--hot); }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 20px; margin-left: auto; }
.topnav a {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-2);
}
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topbar-tools { display: flex; gap: 8px; margin-left: 8px; }
.tool {
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink-2);
}
.tool:hover { color: var(--ink); border-color: var(--ink-2); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--surface-solid); border-color: var(--ink); }

/* ---------- typography ---------- */
.section-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 5vw, 46px); line-height: 1;
  letter-spacing: 0.01em; text-transform: uppercase;
  margin: 0 0 10px;
}
.section-sub { margin: 0 0 26px; color: var(--ink-2); max-width: 62ch; }
.kicker {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--hot); margin: 0 0 8px;
}

section {
  position: relative;
  max-width: calc(var(--wrap) + 48px);
  margin: 0 auto;
  padding: 76px 24px;
}

/* ---------- hero ---------- */
/* ---------- the full page map story ---------- */
.story {
  position: relative; max-width: none; padding: 0;
  height: calc(var(--steps, 11) * 74vh);
  background: #ede8f9;
}
/* the photograph runs the full height of the viewport and the bare cable and
   header float over its top, so the car hangs over the mountain. A fixed
   stage height keeps the deck framing, and therefore which stickers are in
   view, the same on every screen. */
.stage {
  position: sticky; top: var(--topbar-h);
  height: calc(100dvh - var(--topbar-h));
  min-height: 480px;
  overflow: hidden; background: #ede8f9;
}
.map-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: pan-y; }
/* print surface: fine paper grain over the sheet, generated by the browser */
.map-viewport::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: multiply; opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.map-viewport.is-grabbing { cursor: grabbing; }
.trailmap-svg { width: 100%; height: 100%; display: block; }

.story-ui { position: absolute; inset: 0; pointer-events: none; }

.story-card {
  position: absolute; left: 20px; bottom: 20px; width: min(440px, calc(100% - 40px));
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 15px; padding: 20px 22px 22px;
  box-shadow: 0 30px 60px -34px rgba(8, 34, 52, 0.8);
  opacity: 0; transform: translateY(16px); transition: opacity 0.45s ease, transform 0.45s ease;
  /* the cards are stacked in the same box: only the one you can see may take
     a tap, or the invisible ones swallow everything aimed at the board */
  pointer-events: none;
}
.story-card.is-active, body:not(.js) .story-card:first-of-type { pointer-events: auto; }
.story-card.is-active { opacity: 1; transform: none; }
body:not(.js) .story-card:first-of-type { opacity: 1; transform: none; }
body[data-theme="night"] .story-card { background: rgba(9, 24, 38, 0.94); }

.story-num {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 8px;
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-2);
}
.story-kicker { min-width: 0; }
.story-num .chip {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 14px; letter-spacing: 0;
}
.story-num .chip.life { background: var(--pine); }
.story-title {
  margin: 0 0 4px;
  font-family: var(--font-display); font-size: clamp(24px, 2.5vw, 32px);
  text-transform: uppercase; line-height: 1.03; letter-spacing: 0.01em;
}
.story-org { margin: 0; color: var(--ink-2); font-size: 15px; }
.story-period {
  margin: 2px 0 12px; font-family: var(--font-display); font-size: 13.5px;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
}
.story-body { margin: 0; color: var(--ink-2); font-size: 14.6px; line-height: 1.5; }
.story-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.story-tags li {
  font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
}
.story-cta { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.story-cta a, .story-cta button {
  cursor: pointer; font-family: var(--font-display); font-size: 14px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 9px 15px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink);
}
.story-cta a:hover, .story-cta button:hover { text-decoration: none; border-color: var(--ink); }

/* ---------- the WebGL band behind the about section ---------- */
.band { position: relative; max-width: none; padding: 0; overflow: hidden; }
#terrain { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.2) 36%, rgba(233,244,253,0.88) 100%);
}
body[data-theme="night"] .hero-scrim {
  background: linear-gradient(180deg, rgba(6,23,38,0.68) 0%, rgba(6,23,38,0.3) 38%, rgba(6,23,38,0.92) 100%);
}
.band-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
  padding-top: 96px; padding-bottom: 96px;
}
.hud-card h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(52px, 11vw, 104px); line-height: 0.92;
  letter-spacing: -0.005em; text-transform: uppercase; margin: 0 0 12px;
}
.tagline { font-size: 20px; color: var(--ink-2); margin: 0 0 20px; max-width: 30ch; }
.hero-conditions {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; color: var(--ink-2); margin: 0 0 22px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); color: var(--ink);
  font-size: 14.5px; font-weight: 500; background: var(--surface-2);
}
.pill:hover { text-decoration: none; border-color: var(--ink-2); transform: translateY(-1px); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.pill[data-icon="instagram"] .pill-dot { background: var(--hot); }
.pill[data-icon="gondola"] .pill-dot { background: var(--pine); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.button {
  display: inline-block; cursor: pointer;
  font-family: var(--font-display); font-size: 17px; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700;
  padding: 13px 24px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--surface-solid);
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button--ghost { background: transparent; color: var(--ink); }
.button:focus-visible, .tool:focus-visible, .filter:focus-visible, .swatch:focus-visible,
.graphic-btn:focus-visible, .pill:focus-visible { outline: 3px solid var(--hot); outline-offset: 2px; }

.hero-board { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-board .board-art { width: 138px; height: 230px; }
.portrait-frame {
  width: 168px; height: 168px; border-radius: 50%; padding: 6px;
  background: var(--surface-solid);
  box-shadow: 0 16px 34px -16px rgba(10, 40, 60, 0.65), 0 0 0 2px var(--line-strong);
}
.portrait { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.board-art { width: 190px; height: 320px; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px) rotate(-1.2deg); } }
.board-deck { fill: var(--deck, #2f7fd1); transition: fill 300ms ease; }
.board-outline { fill: none; stroke: var(--ink); stroke-width: 2.4; opacity: 0.9; }
.board-bindings rect { fill: var(--ink); opacity: 0.7; }
.board-name {
  font-family: var(--font-display); font-size: 19px; letter-spacing: 0.18em;
  text-transform: uppercase; margin: 0; color: var(--ink-2);
}
.customizer {
  text-align: center; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.customizer-label {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px;
}
.swatches { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  background: var(--swatch); border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.graphics { display: flex; gap: 8px; justify-content: center; }
.graphic-btn {
  cursor: pointer; font-size: 12.5px; padding: 6px 11px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink-2);
}
.graphic-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface-solid); border-color: var(--ink); }

/* ---------- about ---------- */
.about-lede { font-size: 21px; line-height: 1.55; color: var(--ink); max-width: 46ch; margin: 0 0 18px; }
.about-body { color: var(--ink-2); max-width: 68ch; margin: 0 0 14px; }

/* ---------- snow report ---------- */
.snow-status {
  display: inline-block; font-size: 14px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px;
  background: var(--surface-2); margin-bottom: 24px;
}
.snow-status.is-live { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 40%, transparent); }
.snow-status.is-error { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 45%, transparent); }
.region + .region { margin-top: 40px; }
.region-title {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.mountain-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(272px, 100%), 1fr)); gap: 18px;
}
.mountain {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.mountain:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mountain.is-home { border-color: var(--hot); }
.mtn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mtn-head h3 {
  font-family: var(--font-display); font-size: 23px; letter-spacing: 0.02em;
  text-transform: uppercase; margin: 0; line-height: 1.06;
}
.mtn-town { margin: 0; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.mtn-live { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 12px; }
.mtn-temp { font-family: var(--font-display); font-size: 42px; line-height: 1; font-weight: 700; }
.mtn-desc { font-size: 13.5px; color: var(--ink-2); text-transform: lowercase; }
.mtn-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.mtn-stats div { display: flex; flex-direction: column; gap: 2px; }
.mtn-stats dt {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.mtn-stats dd { margin: 0; font-family: var(--font-display); font-size: 17px; letter-spacing: 0.02em; }
.powder { display: flex; gap: 4px; margin-bottom: 12px; }
.powder i {
  width: 14px; height: 14px; opacity: 0.25;
  background: var(--blue);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.powder i.on { opacity: 1; }
.forecast { display: flex; align-items: flex-end; gap: 6px; height: 44px; margin-bottom: 12px; }
.fc-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.fc-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--blue); min-height: 2px; opacity: 0.85; }
.fc-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.mtn-character { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.mtn-flags {
  margin: 0; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- trail map ---------- */
.map-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-soft);
}
.map-art { width: 100%; height: auto; display: block; }
.map-ground { fill: var(--map-ground); }
.map-snowcap { fill: var(--map-peak-1); }
.map-snowcap, .map-ground { transition: fill 300ms ease; }
.trail { fill: none; stroke-width: 5; stroke-linecap: round; opacity: 0.9; transition: stroke-width 140ms ease; }
.trail--green { stroke: var(--green); }
.trail--blue { stroke: var(--blue); }
.trail--black { stroke: var(--ink); }
.trail--double { stroke: var(--hot); }
.map-runs a:hover .trail { stroke-width: 9; }
.trail-label {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.16em;
  fill: var(--ink); text-transform: uppercase; pointer-events: none;
}
.lift { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 6 7; fill: none; }
.map-summit, .map-base {
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.22em;
  fill: var(--ink-3); text-transform: uppercase; text-anchor: middle;
}
.map-legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 18px;
  margin: 14px 0 0; padding: 14px 4px 2px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.map-legend li { display: flex; align-items: center; gap: 8px; }

/* ---------- difficulty badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.badge i { display: block; width: 15px; height: 15px; }
.badge--green i { background: var(--green); border-radius: 50%; }
.badge--blue i { background: var(--blue); border-radius: 2px; }
.badge--black i { background: var(--black); transform: rotate(45deg); border-radius: 2px; }
.badge--double i { background: var(--ink); transform: rotate(45deg); border-radius: 2px; width: 13px; height: 13px; }

/* ---------- runs ---------- */
.runs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; align-items: center; }
.filter {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 42px; height: 38px; padding: 0 12px; cursor: pointer;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink-2);
}
.filter:hover { color: var(--ink); }
.filter.is-active { background: var(--ink); color: var(--surface-solid); border-color: var(--ink); }
.filter.is-active .badge--black i, .filter.is-active .badge--double i { background: var(--surface-solid); }
.filter.is-active .badge--green i { background: var(--green); }

.run-list { list-style: none; margin: 0; padding: 0; }
.run { display: grid; grid-template-columns: 44px 1fr; gap: 18px; }
.run + .run { margin-top: 8px; }
.run-rail { position: relative; display: flex; justify-content: center; }
.rail-line {
  width: 3px; border-radius: 3px; background: var(--line-strong);
  margin-top: 26px; margin-bottom: -8px;
}
.run:last-child .rail-line { background: linear-gradient(180deg, var(--line-strong), transparent); }
.run.is-hidden { display: none; }
.run-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-soft); margin-bottom: 18px;
  flex: 1; transition: transform 160ms ease, box-shadow 160ms ease;
}
.run-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.run-head { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: start; }
.run-head h3 {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.01em;
  text-transform: uppercase; margin: 0 0 3px; line-height: 1.06;
}
.run-head .badge { margin-top: 4px; }
.run-org { margin: 0; color: var(--ink-2); font-size: 15px; }
.dot-sep { color: var(--ink-3); }
.run-period {
  margin: 4px 0 0; font-family: var(--font-display); font-size: 15px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.run-body { margin: 14px 0 0; color: var(--ink-2); max-width: 72ch; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 0; padding: 0; }
.tags li {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.empty-note { color: var(--ink-3); font-style: italic; margin-top: 18px; }

/* ---------- training ---------- */
.lesson-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px;
}
.lesson {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-soft);
}
.lesson-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.lesson-top h3 {
  font-family: var(--font-display); font-size: 22px; text-transform: uppercase;
  letter-spacing: 0.01em; margin: 0; line-height: 1.1;
}
.lesson-org { margin: 0; color: var(--ink-2); }
.lesson-period {
  margin: 2px 0 10px; font-family: var(--font-display); font-size: 14px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.lesson-notes { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- gear ---------- */
.gear-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 22px; }
.gear-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-soft);
}
.gear-title {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px;
}
.gear-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.gear-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.gear-name { font-weight: 600; font-size: 15.5px; }
.gear-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gear-bar i {
  display: block; height: 100%; width: var(--level, 0%);
  background: linear-gradient(90deg, var(--blue), var(--pine));
  border-radius: 999px;
  animation: grow 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes grow { from { width: 0; } }
.gear-detail { margin: 7px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- après ---------- */
.apres-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow); text-align: center;
}
.apres-headline { font-size: 22px; margin: 0 0 8px; color: var(--ink); }
.apres-note { color: var(--ink-2); margin: 0 auto 22px; max-width: 52ch; }
.apres-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.apres-links { justify-content: center; }

/* ---------- footer ---------- */
.foot {
  text-align: center; padding: 44px 24px 60px; color: var(--ink-3);
  border-top: 1px solid var(--line); font-size: 14px;
}
.foot p { margin: 0 0 6px; }
.foot-note { color: var(--ink-3); }
.foot-hint b { color: var(--ink-2); letter-spacing: 0.1em; }
/* the hint is also the button on a touch screen, so it has to look tappable */
.foot-hint { cursor: pointer; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 150; margin: 0; padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--surface-solid);
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; transition: opacity 220ms ease, transform 220ms ease;
  box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .gauge { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-board { order: -1; }
  .board-art { width: 140px; height: 236px; }
}

@media (max-width: 780px) {
  section { padding: 54px 18px; }
  .run { grid-template-columns: 22px 1fr; gap: 10px; }
  .run-head { grid-template-columns: 20px 1fr; }
  .run-period { grid-column: 2; margin-top: 6px; }
  .run-card { padding: 18px; }
  .apres-card { padding: 26px 20px; }
  .mtn-stats { grid-template-columns: repeat(2, 1fr); }
  .mtn-stats dt { font-size: 10.5px; }
  .fc-label { font-size: 10.5px; }
  .story-tags li { font-size: 11.5px; }
  .map-legend { gap: 12px; }
}

/* ---------- the header on phones and small tablets ----------
   The desktop header is one row: the stops, the centred wordmark, the section
   links and the conditions. At 390px that row is 669px of unshrinkable
   content, so it used to push the page 315px wide and cut the conditions off;
   by 900px the centred wordmark has begun to collide with the links. Below
   that width the cable and its stops keep the first row, where the cabin
   rides, and the wordmark, links and conditions move to a second row beneath.
   The links sit in a minmax(0, 1fr) column, so they scroll sideways instead of
   widening the page. */
@media screen and (max-width: 900px) {
  :root { --cable-h: 30px; --topbar-h: 125px; }
  .topbar {
    height: auto;
    padding: 4px max(14px, env(safe-area-inset-left)) 8px max(14px, env(safe-area-inset-right));
  }
  .gondola-line { height: var(--cable-h); }
  .cable-wire { top: 8px; left: -6px; right: -6px; height: 2.5px; }
  .gondola-cabin { top: 3px; width: 23px; height: 27px; }

  .gondola-row {
    display: grid; align-items: center; height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "runs runs runs" "brand sections weather";
    column-gap: 10px; row-gap: 6px;
  }
  .gondola-runs {
    grid-area: runs; justify-content: flex-start; gap: 12px;
    padding: 4px 0;
  }
  .gondola-stop { width: 25px; height: 25px; }
  /* the sign keeps its drawn size, the finger gets 45x45 to land on; the row
     padding and gap above keep that target out of the nav row */
  .gondola-stop::after { content: ""; position: absolute; inset: -10px; }
  .gondola-stop:hover .sign, .gondola-stop.is-active .sign { transform: scale(1.2); }

  .gondola-brand {
    grid-area: brand; position: static; transform: none;
    height: auto; padding: 3px 0; font-size: 23px;
  }
  .gondola-sections {
    grid-area: sections; margin-left: 0; justify-self: end; gap: 12px;
    min-width: 0; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* sit against the conditions when the links fit, and start at the left
       edge of their own column (never over the wordmark) when they do not */
    justify-content: safe end;
  }
  .gondola-sections::-webkit-scrollbar { display: none; }
  .gondola-section { font-size: 15px; padding: 10px 0; }

  .gondola-weather { grid-area: weather; margin-left: 0; padding-left: 10px; gap: 1px; }
  .gw-row { min-width: 0; gap: 9px; }
  /* the conditions are a link to the full report: a 16px line is too small to
     tap, so it gets the same invisible 45px skirt as the stops */
  .gw-row--link { position: relative; }
  .gw-row--link::after { content: ""; position: absolute; inset: -12px -8px; }
  .gw-row b, .gw-row > span:first-child { font-size: 10.5px; }
  .gw-row > span:last-child { font-size: 12px; }
  .gw-row--link b { font-size: 12px; }
  .gw-row--link > span:last-child { font-size: 13px; }
}

/* a phone is narrow enough that the stops can space out along the whole cable;
   a tablet would just look sparse, so there they stay left-aligned */
@media (max-width: 600px) {
  .gondola-runs { justify-content: space-between; gap: 4px; }
}

/* a 320-360px phone needs the header a notch tighter still */
@media (max-width: 380px) {
  .gondola-brand { font-size: 20px; }
  .gondola-section { font-size: 13px; }
  .gondola-sections { gap: 8px; }
  .gondola-weather { padding-left: 8px; }
  .gw-row { gap: 6px; }
  .gw-row b, .gw-row > span:first-child { font-size: 11px; }
  .gw-row > span:last-child { font-size: 12px; }
  .gw-row--link b { font-size: 11.5px; }
  .gw-row--link > span:last-child { font-size: 13px; }
  .gondola-runs { gap: 2px; }
  section { padding: 46px 14px; }
  .story-card { padding: 14px 14px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .board-art { animation: none; }
  .dot-live { animation: none; }
  .gear-bar i { animation: none; }
  * { transition: none !important; }
}

/* the paper grain over the map viewport must stay still */
@media (prefers-reduced-motion: reduce) {
  .map-viewport::after { animation: none; }
}

/* ---------- print: the actual resume ---------- */
@media print {
  body { background: #fff; color: #000; padding: 0; }
  /* the pinned gradient layer is screen-only; fixed elements can repeat on
     every printed page */
  body::before { display: none !important; }
  canvas#snowfall, .cable, .gauge, .topbar, .map-wrap, .placeholder-banner, .toast, .customizer,
  .foot-hint, .hero-cta, .snow-report, .hero-board { display: none !important; }
  section { padding: 14px 0; break-inside: avoid; }
  .section-title { font-size: 24px; }
  a { color: #000; text-decoration: none; }
  .run-card, .lesson, .gear-group, .apres-card { border: 0; box-shadow: none; padding: 0; }
  .run-list, .lesson-list, .gear-groups { display: block; }
  .run { grid-template-columns: 1fr; }
  .run-rail { display: none; }
}

/* ---------- season history ---------- */
.history {
  margin-top: 34px; padding: 24px 24px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.history-title {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.02em;
  text-transform: uppercase; margin: 0 0 6px;
}
.history-chart {
  display: flex; align-items: stretch; gap: 16px;
  height: 240px; margin: 22px 0 10px; padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
/* the fill is a percentage of the 1fr plot row, so the value and the labels
   sit outside the bar instead of stealing its height */
.hbar {
  flex: 1; height: 100%; display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 7px; justify-items: center;
}
.hbar-value { font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.hbar-fill {
  width: 100%; align-self: end; border-radius: 8px 8px 0 0; min-height: 4px;
  background: linear-gradient(180deg, var(--blue), var(--pine));
  transition: height 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hbar-fill.is-best { background: linear-gradient(180deg, var(--hot), #4a2fb0); }
.hbar-label {
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.1em; color: var(--ink-2);
}
.hbar-days { font-size: 11.5px; color: var(--ink-3); }
.history-note { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; }

@media (max-width: 780px) {
  .history-chart { height: 190px; gap: 10px; }
  .hbar-value { font-size: 14px; }
  .hbar-days { display: none; }
}

/* ---------- the work ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-soft);
}
.stat b {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 6vw, 64px); line-height: 0.95; color: var(--ink);
}
.stat span { font-family: var(--font-display); font-size: 13.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.work-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.work-card {
  position: relative; overflow: hidden; border-radius: 14px;
  background: var(--surface-solid); box-shadow: var(--shadow-soft);
}
.work-card img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
.work-card:hover img { transform: scale(1.07); }
.work-card span {
  position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px;
  font-size: 12.5px; line-height: 1.3; color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}
.work-credit { margin: 18px 0 0; color: var(--ink-2); font-size: 14.5px; }
.collab-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.collab-row li {
  font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2);
}

@media (max-width: 1080px) { .work-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px) {
  .work-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-grid { padding-top: 60px; padding-bottom: 60px; }
  .portrait-frame { width: 132px; height: 132px; }
}

/* ---------- trail map artwork: printed resort map conventions ---------- */
.trailmap-svg .massif-outline { fill: none; stroke: #b3d0e8; stroke-width: 2; }
/* the hillshade is a lit fractal surface multiplied over the snow ramp */
.massif-shade { mix-blend-mode: multiply; opacity: 0.2; }
.massif-forms { mix-blend-mode: multiply; opacity: 0.32; }
.forest-floor { fill: #173d2e; }
.hatch-edge { fill: none; stroke: #cfa945; stroke-width: 3; stroke-dasharray: 14 12; opacity: 0.75; }
.hatch-label {
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 24px;
  letter-spacing: 0.12em; fill: #8a6520; text-anchor: middle;
  paint-order: stroke; stroke: #ffffff; stroke-width: 8; stroke-linejoin: round;
}
.boundary { fill: none; stroke-width: 6; stroke-dasharray: 26 16; stroke-linecap: round; opacity: 0.9; }
.boundary--red { stroke: #b3221c; }
.boundary--yellow { stroke: #e0b02c; }
.elevation circle { fill: #ffffff; stroke: #35566f; stroke-width: 3; }
.elev-label {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.16em;
  fill: #2f5570; paint-order: stroke; stroke: #ffffff; stroke-width: 7;
}
.elev-value {
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 25px;
  fill: #14314b; paint-order: stroke; stroke: #ffffff; stroke-width: 7;
}
/* ink weight: nothing on a printed sheet is perfectly straight */
/* the unlabelled pistes that make the mountain read as a ski area */
.bg-verge { fill: none; stroke: #9db8d0; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; }
.bg-piste { fill: none; stroke: #f6fafd; stroke-linecap: round; stroke-linejoin: round; opacity: 0.62; }
.trail-group.is-dim .piste { opacity: 0.9; }

.piste-edge { fill: none; stroke: #9fbdd6; stroke-width: 58; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; filter: url(#softEdge); }
.massif-outline { filter: url(#wobble); }
.canopy { isolation: isolate; }
.trailmap-svg .range { opacity: 0.92; }
.trailmap-svg .sky, .trailmap-svg .sun, .trailmap-svg .valley { pointer-events: none; }
#tree .tree-lit { fill: #ffffff; opacity: 0.2; }
#tree .tree-dark { fill: #06180f; opacity: 0.22; }

/* --- pistes --- */
.trail-group { cursor: pointer; }
.trail-group .hit { fill: none; stroke: rgba(0, 0, 0, 0); stroke-width: 70; stroke-linecap: round; }
/* the run is the gap in the canopy: the piste is only a whisper of groomed
   surface, so the massif hillshade reads straight through the corridor */
.piste-edge { fill: none; stroke: #c9dcec; opacity: 0; stroke-width: 54; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; }
.piste { fill: none; stroke: #ffffff; stroke-width: 48; stroke-linecap: round; stroke-linejoin: round; opacity: 1; }
/* the difficulty centreline is the one crisp thing on the run */
.trail-line { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.trail-line.green { stroke: #1f9d55; }
.trail-line.blue { stroke: #1a72cf; }
.trail-line.black { stroke: #141d26; }
.trail-group.is-hover .piste { stroke: #fffdf2; }
.trail-group.is-active .piste-edge { opacity: 1; stroke: #e8a33d; filter: none; }
.trail-group.is-active .piste { stroke: #fffaf0; }
.trail-group.is-dim { opacity: 0.62; }
.trail-group.is-life .piste-edge { stroke: #bfe3cf; }
.trail-group.is-life .trail-line { stroke-dasharray: 26 14; }

/* --- dirt bands at the foot of the massif --- */
/* fill comes from the inline attribute on each path; these are hooks only */
.dirt-band { }
.dirt-band-group { }
.dirt-edge { fill: none; stroke: #7d5c3c; stroke-width: 4; opacity: 0.45; filter: url(#softEdge); }

.trail-name {
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase;
  fill: #14314b; paint-order: stroke; stroke: #ffffff; stroke-width: 8; stroke-linejoin: round;
}
.trail-meta {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 17.5px; letter-spacing: 0.07em; fill: #54748d;
  paint-order: stroke; stroke: #ffffff; stroke-width: 7; stroke-linejoin: round;
}
/* lettering that follows the run, sized for reading at print scale */
.trail-name--curve { font-size: 40px; letter-spacing: 0.03em; stroke-width: 13; }
.trail-group:has(.trail-name--curve) .trail-name:not(.trail-name--curve) { display: none; }
.trail-number text {
  font-family: var(--font-display); font-size: 25px; font-weight: 700; fill: #ffffff; text-anchor: middle;
}

/* --- lifts --- */
.lift-casing { fill: none; stroke: #ffffff; stroke-width: 17; stroke-linecap: round; }
.lift-line { fill: none; stroke: #b3221c; stroke-width: 9; stroke-linecap: round; }
.lift-group.gondola .lift-line { stroke-width: 11; }
.lift-group.surface .lift-line { stroke-dasharray: 10 14; }
.lift-tower circle { fill: #8f1d18; stroke: #ffffff; stroke-width: 2.5; }
.lift-tower text { font-family: var(--font-display); font-size: 14px; fill: #ffffff; text-anchor: middle; }
.lift-banner rect { fill: #b3221c; stroke: #ffffff; stroke-width: 2.5; }
.lift-banner text {
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 23px;
  letter-spacing: 0.07em; text-transform: uppercase; fill: #ffffff; text-anchor: middle;
}
.lift-cabin rect { fill: #b3221c; stroke: #ffffff; stroke-width: 2.5; }
.lift-window { fill: #dff0fb; }

/* --- ground furniture --- */
.catwalks path { fill: none; stroke: #1f9d55; stroke-width: 6; stroke-dasharray: 22 16; stroke-linecap: round; }
.roads path { fill: none; stroke: #e2b878; stroke-width: 15; stroke-linecap: round; }
.roads path { stroke: #d8ab63; }
.glade-outline { fill: none; stroke: #3f8f68; stroke-width: 4; stroke-dasharray: 18 14; }
.facility rect { }
.facility-label {
  font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: 0.1em;
  fill: #1f3d55; paint-order: stroke; stroke: #ffffff; stroke-width: 7; stroke-linejoin: round;
}
.place rect { fill: #2f6fb5; stroke: #ffffff; stroke-width: 3; }
.place text {
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 26px;
  letter-spacing: 0.09em; fill: #ffffff; text-anchor: middle;
}
.route-line { fill: none; stroke: #e8a33d; stroke-width: 8; stroke-dasharray: 24 18; stroke-linecap: round; opacity: 0.96; }

/* --- callouts and headers --- */
.callout rect { stroke: #ffffff; stroke-width: 3; }
.callout--info rect { fill: #1b7fc4; }
.callout--warn rect { fill: #cf3b2f; }
.callout text {
  font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: 0.09em;
  fill: #ffffff;
}
.home-mountains .hm-title {
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 34px;
  letter-spacing: 0.12em; fill: #2b5878; paint-order: stroke; stroke: #ffffff; stroke-width: 9;
}
.home-mountains .hm-line {
  font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: 0.1em;
  fill: #4d7791; paint-order: stroke; stroke: #ffffff; stroke-width: 7;
}
.map-title-main {
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 96px;
  letter-spacing: 0.02em; fill: #10314c; paint-order: stroke; stroke: #ffffff; stroke-width: 16; stroke-linejoin: round;
}
.map-title-sub {
  font-family: var(--font-display); font-weight: 700; font-size: 27px; letter-spacing: 0.22em;
  fill: #3a6f92; paint-order: stroke; stroke: #ffffff; stroke-width: 9;
}

/* --- legend --- */
.legend-box { fill: rgba(255, 255, 255, 0.97); stroke: #35566f; stroke-width: 4; }
.legend-title {
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 40px;
  letter-spacing: 0.14em; fill: #10314c;
}
.legend-col {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.16em; fill: #6b8ba3;
}
.legend-row text { font-family: var(--font-display); font-weight: 700; font-size: 22px; fill: #16324a; }
.gullies path { fill: none; stroke: #cfe3f3; stroke-width: 13; stroke-linecap: round; opacity: 0.55; }
.legend-note { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: 0.05em; fill: #7090a8; }
.s-lift { fill: none; stroke: #b3221c; stroke-width: 9; }
.s-lift-tick { fill: none; stroke: #ffffff; stroke-width: 9; stroke-dasharray: 4 12; }
.s-lift.s-surface { stroke-dasharray: 9 12; }
.s-cabin { fill: #b3221c; stroke: #ffffff; stroke-width: 2; }
.s-road { fill: none; stroke: #d8ab63; stroke-width: 13; stroke-linecap: round; }
.s-catwalk { fill: none; stroke: #1f9d55; stroke-width: 6; stroke-dasharray: 18 13; stroke-linecap: round; }
.s-line { fill: none; stroke-width: 5; stroke-linecap: round; }
.s-route { fill: none; stroke: #e8a33d; stroke-width: 8; stroke-dasharray: 20 15; stroke-linecap: round; }
.s-glade { fill: none; stroke: #3f8f68; stroke-width: 4; stroke-dasharray: 16 12; }
.s-life { fill: none; stroke: #1f9d55; stroke-width: 6; stroke-dasharray: 22 14; }
.s-num { font-family: var(--font-display); font-size: 17px; font-weight: 700; fill: #ffffff; text-anchor: middle; }

.compass-ring { fill: rgba(255, 255, 255, 0.94); stroke: #35566f; stroke-width: 4; }
.compass-needle { fill: #b3221c; }
.compass-n { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 40px; fill: #35566f; text-anchor: middle; }

.trail-group:focus-visible { outline: none; }
.trail-group:focus-visible .piste-edge { stroke: #e8a33d; }

@media (max-width: 900px) {
  .story { height: calc(var(--steps, 11) * 82vh); }
  .story-card { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 15px 16px 16px; }
  .story-title { font-size: 22px; }
  .story-org { font-size: 14px; }
  /* 13.6px is a desktop caption size; on a phone it is the body copy */
  .story-body { font-size: 14.4px; line-height: 1.5; }
  .story-stats li { font-size: 13.5px; }
  .story-period { margin-bottom: 9px; }
  .story-tags { margin-top: 10px; }
  .story-cta { margin-top: 12px; }
  .story-rail {
    top: 10px; right: 50%; transform: translateX(50%);
    flex-direction: row; flex-wrap: nowrap; gap: 4px; justify-content: center;
    max-width: calc(100% - 16px);
  }
  .story-dot { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
  .map-tools { bottom: auto; top: 46px; right: 10px; }
  .map-btn { min-width: 38px; height: 38px; font-size: 16px; padding: 0 10px; }
  .map-btn--wide { font-size: 12px; }
  .map-hint { display: none; }
}

/* night mode: the map is a printed sheet, so it stays lit, but the paper
   and the controls have to keep enough contrast against a dark page */
body[data-theme="night"] .trailmap-svg { filter: brightness(0.92) saturate(0.95); }
body[data-theme="night"] .story-dot { background: rgba(255, 255, 255, 0.92); color: #0f2231; }
body[data-theme="night"] .story-dot.is-active { background: #0f2231; color: #ffffff; }
body[data-theme="night"] .story-dot.is-life.is-active { background: var(--pine); color: #ffffff; }
body[data-theme="night"] .map-btn { background: rgba(255, 255, 255, 0.92); color: #0f2231; }
body[data-theme="night"] .map-hint { background: rgba(255, 255, 255, 0.86); color: #17364c; }

/* ---------- the sticker board hero ---------- */
.board-viewport {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 0%, #f3eefc 0%, #d9cff2 42%, #b5a4e2 100%);
}
body[data-theme="night"] .board-viewport {
  background: radial-gradient(120% 90% at 30% 0%, #241a44 0%, #170f31 50%, #0e0920 100%);
}
/* The hero is one SVG: the photograph and everything drawn on it share a
   coordinate space, so the stickers cannot drift out of register with the deck. */
.board-viewport { position: absolute; inset: 0; overflow: hidden; background: #0b2033; }
.boardmap-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}

/* ---------- stickers: white die-cut vinyl with the mark printed on it ---------- */
.sticker { cursor: pointer; }
.sticker-pop {
  transform-box: fill-box; transform-origin: center;
  transform: scale(0.25) rotate(-16deg); opacity: 0;
  transition: transform 0.45s cubic-bezier(0.18, 1.5, 0.36, 1), opacity 0.22s ease, filter 0.3s ease;
}
.sticker.is-on .sticker-pop { transform: scale(1) rotate(0deg); opacity: 1; }
.sticker-mono { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.02em; }
.sticker:focus-visible { outline: none; }

/* the sticker for the run you are reading peels off the deck: bigger, tipped
   forward, with a white lip catching the light and a long cast shadow */
.sticker.is-active .sticker-pop {
  transform: scale(2.15) rotate(-5deg) translateY(-34px);
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95))
          drop-shadow(0 22px 24px rgba(4, 18, 31, 0.85));
}
.sticker.is-active { z-index: 3; }

/* anchors and the gondola both land the section clear of the sticky header */
main > section, .story, #top, #work, #training, #gear, #apres, #snow {
  scroll-margin-top: calc(var(--topbar-h) + 14px);
}

/* ---------- the gondola ---------- */
.gondola-cable { fill: none; stroke: #2c3d51; stroke-width: 7; opacity: 0.85; }
.gondola-tower { opacity: 0.9; }
.gondola-car {
  transform: translate(1968px, calc(1700px + var(--ride, 0) * -1000px));
  transition: transform 0.55s cubic-bezier(0.4, 0.05, 0.2, 1);
}
.piste { filter: drop-shadow(0 5px 7px rgba(4, 18, 31, 0.5)); }

/* ---------- the legend lives on the left ---------- */
.story .story-card {
  left: 22px; right: auto; top: 22px; bottom: auto;
  width: min(438px, calc(100% - 44px));
  background: rgba(255, 255, 255, 0.94);
}
.story-card .story-org { margin-top: 2px; }

@media (max-width: 1100px) {
  .story .story-card { width: min(380px, calc(100% - 40px)); }
}
@media (max-width: 900px) {
  /* the card is anchored to the top on small screens, so the tally has to keep
     the bottom corner or the two collide over the board. Capped so a tablet
     still shows the board beside it rather than a full-width sheet.
     (The tally's own bottom/left are set further down, after its base rule.) */
  .story .story-card { left: 12px; right: 12px; width: auto; max-width: 540px; top: 14px; }
}

/* deck */
.deck { stroke: none; }
.deck-shadow { fill: rgba(12, 42, 66, 0.20); }
.deck-rim { stroke: #0d3f7d; stroke-width: 7; }
.deck-rim-inner { stroke: rgba(255, 255, 255, 0.5); stroke-width: 3; }
.deck-stripe { fill: rgba(255, 255, 255, 0.16); }
.deck-shine { opacity: 0.9; }
.deck-lines path { fill: none; stroke: rgba(255, 255, 255, 0.13); stroke-width: 3; }
.binding { fill: #22303f; stroke: #101a24; stroke-width: 4; }
.binding-strap { fill: #38495c; }

/* rider */
.rider-shadow { fill: rgba(12, 42, 66, 0.16); }
.rider-body { fill: #1d2a3a; }
.rider-belly { fill: #f6f9fc; }
.rider-head { fill: #1d2a3a; }
.rider-face { fill: #f6f9fc; }
.rider-beak { fill: #f2921f; }
.rider-eye { fill: #ffffff; }
.rider-pupil { fill: #14212e; }
.rider-wing { fill: #1d2a3a; }
.rider-hat { fill: #cf3b2f; }
.rider-hat-band { fill: #f2f5f8; }
.rider-pompom { fill: #f2f5f8; }
.rider-scarf { fill: #2f9e57; }
.rider-scarf-tail { fill: #26834a; }
.rider-foot { fill: #f2921f; }

/* stickers: earned ones pop on, the rest wait */
.sticker { cursor: pointer; }
.sticker-pop {
  transform-box: fill-box; transform-origin: center;
  transform: scale(0.2) rotate(-18deg); opacity: 0;
  transition: transform 0.42s cubic-bezier(0.18, 1.45, 0.36, 1), opacity 0.2s ease;
}
.sticker.is-on .sticker-pop { transform: scale(1) rotate(0deg); opacity: 1; }
.sticker.is-on:hover .sticker-pop { transform: scale(1.07) rotate(2deg); }
.sticker-cut { filter: drop-shadow(0 4px 6px rgba(10, 30, 50, 0.35)); }
.sticker-initials {
  font-family: var(--font-display); font-weight: 800; fill: #ffffff; letter-spacing: 0.02em;
}
.sticker-sub {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.13em;
  fill: rgba(255, 255, 255, 0.82);
}
.sticker--life .sticker-cut { stroke-dasharray: 9 7; }
.sticker:focus-visible { outline: none; }
.sticker:focus-visible .sticker-cut { stroke: #e8a33d; }

/* the running tally, which makes the board read as a score */
.board-tally {
  position: absolute; left: 22px; bottom: 22px; transform: none;
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; padding: 8px 16px 8px 10px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-size: 12.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 10px 24px -14px rgba(8, 34, 52, 0.6);
}
.board-tally::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--hot) calc(var(--board-filled, 0) * 1turn), rgba(14, 38, 55, 0.14) 0);
  -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px);
  mask: radial-gradient(circle, transparent 6px, #000 6.5px);
}
.board-tally b { font-weight: 800; font-size: 15px; color: var(--ink); }
.board-tally b { font-family: var(--font-display); font-size: 19px; }
body[data-theme="night"] .board-tally { background: rgba(9, 24, 38, 0.86); color: #d6e6f3; }


/* ---------- season passes (training) ---------- */
.pass-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.pass {
  display: grid; grid-template-columns: 74px 1fr; position: relative;
  background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 20px 40px -30px rgba(40, 24, 90, 0.7);
}
/* the stub, separated by a perforation */
.pass-stub {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: linear-gradient(160deg, #a78bfa 0%, #7a5af0 55%, #5b3fd0 100%);
  color: #fff; padding: 16px 6px;
}
.pass-stub::after {
  content: ""; position: absolute; right: -1px; top: 0; bottom: 0; width: 2px;
  background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9) 0 1.5px, transparent 1.6px);
  background-size: 2px 9px;
}
.pass-kind { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.85; writing-mode: vertical-rl; }
.pass-year { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.pass-body { padding: 18px 20px 16px; min-width: 0; }
.pass-title {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 800;
  font-size: 21px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink);
}
.pass-org { margin: 0 0 3px; font-size: 14px; color: var(--ink); }
.pass-valid {
  margin: 0 0 10px; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}
.pass-notes { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.pass-code { display: flex; align-items: flex-end; gap: 2px; height: 20px; opacity: 0.55; }
.pass-code i { display: block; height: 100%; background: var(--ink); }

/* ---------- the pack (gear) ---------- */
.pack-groups { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.pack-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pack-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.pack-tick {
  width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; position: relative;
  background: linear-gradient(160deg, #a78bfa, #7a5af0); border: 1.5px solid #5b3fd0;
}
.pack-tick::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(40deg);
}
.pack-main { min-width: 0; }
.pack-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 7px; }
.pack-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); }
.pack-worn {
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pack-bar { height: 6px; border-radius: 999px; background: rgba(122, 90, 240, 0.16); overflow: hidden; }
.pack-bar i {
  display: block; height: 100%; width: var(--level, 0%); border-radius: 999px;
  background: linear-gradient(90deg, var(--pine), var(--hot));
}
.pack-proof {
  margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2);
  padding-left: 15px; position: relative;
}
.pack-proof::before {
  content: ""; position: absolute; left: 1px; top: 6px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--hot);
}
.pack-detail { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
@media (max-width: 640px) {
  .pass { grid-template-columns: 58px 1fr; }
  .pass-year { font-size: 22px; }
}

/* ==================================================================
   phones and small tablets: the things a desktop sheet forgets
   ================================================================== */
@media screen and (max-width: 900px) {
  /* background-attachment: fixed is janky on mobile Safari and repaints badly
     on a 14,000px page, so the same gradient is pinned in its own layer
     instead, which paints identically but scrolls for free */
  body { background: var(--bg-3); }
  body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(1200px 700px at 50% -10%, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
  }
  /* the viewport can now sit under the notch and the home indicator */
  .foot { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 32px); }
  .board-tally { left: max(12px, env(safe-area-inset-left)); bottom: 12px; }
  .story .story-card {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
  }
}

/* a viewport shorter than the card is tall (a phone on its side, a short
   browser window) cannot show the whole card and the tally at once: the card
   scrolls inside the stage and the tally steps aside */
@media screen and (max-height: 560px) {
  .stage { min-height: 0; }
  .story .story-card {
    max-height: calc(100% - 26px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .board-tally { display: none; }
}
@media screen and (max-width: 900px) and (max-height: 560px) {
  .story .story-card { top: 10px; padding: 12px 14px 13px; }
}

/* touch screens have no hover, so a tapped card must not stay lifted */
@media screen and (hover: none) {
  a:hover { text-decoration: none; }
  .work-card:hover img { transform: none; }
  .mountain:hover, .run-card:hover { transform: none; box-shadow: var(--shadow-soft); }
  .pill:hover, .button:hover { transform: none; }
  .sticker.is-on:hover .sticker-pop { transform: scale(1) rotate(0deg); }
  /* and the tap flash is replaced by a short press state */
  .gondola-stop:active .sign { transform: scale(1.2); }
}

/* no grey tap flash on the controls; manipulation also stops the browser
   waiting 300ms for a possible double-tap zoom before it dispatches the click */
a, button, [role="button"], summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ==================================================================
   the phone hero: the board stays pinned, the card becomes a strip
   ------------------------------------------------------------------
   On a wide screen the cards float over the photograph while you scroll the
   runs. On a phone a card tall enough to hold the text would cover most of
   Lily and the board. So below the desktop breakpoint the photograph keeps the
   whole stage and fills with stickers as you ride, while the active card
   shrinks to a strip along the bottom: kicker, role, place and a Details
   button. Tapping the strip opens that card, in full, as a sheet. Nothing
   covers the photograph except the strip.
   ================================================================== */

/* the strip only exists on phones; board.js builds it and the sheet */
.board-strip { display: none; }

@media screen and (max-width: 900px) {
  .story { height: calc(var(--steps, 11) * 72vh); }
  .stage {
    position: sticky; top: var(--topbar-h);
    height: calc(100dvh - var(--topbar-h)); min-height: 0;
    overflow: hidden; background: #0b2033;
  }
  .board-viewport { position: absolute; inset: 0; height: auto; border-bottom: 0; }
  .story-ui { position: absolute; inset: 0; display: block; padding: 0; }
  /* with JS the cards are replaced by the strip and its sheet; without it the
     first card still shows over the photograph, as on the desktop */
  body.js .story .story-ui .story-card { display: none; }
  .story .story-ui .board-tally { display: none; }

  .board-strip {
    position: absolute; left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 6; display: flex; align-items: center; gap: 12px;
    width: calc(100% - 24px); padding: 11px 13px; border-radius: 16px;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px -22px rgba(4, 18, 31, 0.85);
    font-family: var(--font-body); color: var(--ink); text-align: left; cursor: pointer;
  }
  body[data-theme="night"] .board-strip { background: rgba(9, 24, 38, 0.94); }
  .bs-progress {
    flex: none; display: inline-flex; align-items: baseline; gap: 2px;
    padding: 5px 8px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface-2);
    font-family: var(--font-display); font-size: 15px; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .bs-progress i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
  .bs-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .bs-kicker {
    font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .bs-title {
    font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.06;
    letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .bs-org {
    font-size: 12px; line-height: 1.3; color: var(--ink-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .bs-action {
    flex: none; display: inline-flex; align-items: center; gap: 3px;
    font-family: var(--font-display); font-size: 12.5px; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--hot);
  }
  .bs-action svg { width: 12px; height: 12px; }
  /* once the ride is over the stage scrolls away, so the strip goes with it */
  .board-strip.is-off { display: none; }
}

/* ---------- the details sheet, built by board.js ---------- */
.board-sheet { position: fixed; inset: 0; z-index: 220; display: flex; align-items: flex-end; justify-content: center; }
.board-sheet[hidden] { display: none; }
.board-sheet-scrim {
  position: absolute; inset: 0; background: rgba(4, 18, 31, 0.58);
  opacity: 0; transition: opacity 0.24s ease;
  /* the page behind must not take the drag on a touch screen */
  touch-action: none;
}
.board-sheet-panel {
  position: relative; width: min(100%, 620px); max-height: 86dvh; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-solid); color: var(--ink);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -24px 60px rgba(4, 18, 31, 0.45);
}
.board-sheet.is-open .board-sheet-scrim { opacity: 1; }
.board-sheet.is-open .board-sheet-panel { transform: none; }
.board-sheet-grip {
  display: block; width: 46px; height: 4px; border-radius: 3px;
  background: var(--line-strong); margin: -6px auto 14px;
}
.board-sheet-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink);
  font-size: 15px; line-height: 1; cursor: pointer;
}
/* the close button sits where the card's difficulty chip would be, so the
   chip row keeps clear of it */
.board-sheet-card .story-num { margin-bottom: 10px; padding-right: 52px; }
.board-sheet-card .story-num .chip { flex: none; }
.board-sheet-card .story-title { font-size: 30px; }
.board-sheet-card .story-org { font-size: 15px; }
.board-sheet-card .story-period { margin-bottom: 14px; }
.board-sheet-card .story-body { font-size: 15.5px; }
.board-sheet-card .story-commentary { margin-top: 16px; }
.board-sheet-card .story-tags { margin-top: 16px; }
.board-sheet-card .story-cta { margin-top: 20px; }
html.sheet-open, body.sheet-open { overflow: hidden; }

