/* SnowAlert v2 — mobile-first.
   Winter skins (docs/06 §7): :root is Bluebird (day); html[data-mode=night]
   swaps in the Nightfall palette + component overrides at the end of this
   file. data-mode is set before paint by the inline script in layout. */

:root {
  --ink: #16304a;
  --ink-soft: #5b7a96;
  --paper: #eef6fd;
  --card: #ffffff;
  --accent: #1a6fb0;
  --snow: #1486c9;
  --line: #d3e4f2;
  /* season charts (docs/11) — validated categorical palette on the white card */
  --card-solid: #ffffff;
  --muted: #7d95ab;
  --good: #1b7a3d;
  --grid: #e8f1f9;
  --baseline: #c2d6e8;
  --median-line: #8aa3ba;
  --ghost-line: #b6c9da;
  --band-fill: rgba(91, 122, 150, 0.14);
  --s1: #1a6fb0;
  --s2: #0f9d72;
  --s3: #c98500;
  --s4: #7a4fc9;
  --s5: #d03b3b;
  /* homepage map (docs/06) — land/water/border */
  --map-water: #eaf3fb;
  --map-land: #dbe7f1;
  --map-border: #b6cbdd;
  /* Snowpack-vs-normal map buckets (docs/14; palette CVD-validated) */
  --pct-below2: #d03b3b;
  --pct-below1: #c98500;
  --pct-near: #8aa3ba;
  --pct-above: #1a6fb0;
}

html[data-mode="night"] {
  --ink: #eaf2ff;
  --ink-soft: #9db2d6;
  --paper: #0a1224;
  --card: rgba(28, 42, 72, 0.55);
  --accent: #8fc4ff;
  --snow: #bfe6ff;
  --line: rgba(120, 160, 220, 0.22);
  /* season charts — re-stepped for the Nightfall card surface */
  --card-solid: #141f38;
  --muted: #7e93bb;
  --good: #4fc47e;
  --grid: rgba(120, 160, 220, 0.13);
  --baseline: rgba(120, 160, 220, 0.35);
  --median-line: #6d84a8;
  --ghost-line: #46587a;
  --band-fill: rgba(157, 178, 214, 0.16);
  --s1: #3d8ad2;
  --s2: #1d9e73;
  --s3: #c07f15;
  --s4: #8f78dd;
  --s5: #dd5555;
  --map-water: #0c1730;
  --map-land: #1b2c4a;
  --map-border: #33507e;
  --pct-below2: #c03a3a;
  --pct-below1: #b59010;
  --pct-near: #6d84a8;
  --pct-above: #3d8ad2;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win: author `display` rules (e.g.
   `.resort-card { display: block }`) otherwise override the UA
   `[hidden] { display: none }` and defeat the homepage card/pin filter. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem 1.5rem;
  /* Bluebird sky (docs/06 §7) — the compact header carries the skin on
     inner pages; night override further down. */
  background: linear-gradient(#2f86c9, #62a9dc 70%, #79b6e2);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.site-header > :not(.header-ridge) { position: relative; z-index: 1; }
.header-ridge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 30px;
  opacity: 0.7;
}
.site-header .brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(6, 28, 52, 0.45);
}
.site-header .tagline { color: #e7f3ff; font-size: 0.85rem; text-shadow: 0 1px 6px rgba(6, 28, 52, 0.45); }

main { max-width: 64rem; margin: 0 auto; padding: 1rem 1.2rem 3rem; }

.site-footer {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 1.2rem 2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

h1 { font-size: 1.5rem; margin: 0.8rem 0; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 0.6rem; }
h2 small { color: var(--ink-soft); font-weight: 400; }
.meta { color: var(--ink-soft); font-size: 0.85rem; }
.empty { color: var(--ink-soft); font-style: italic; }

.status {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--line);
  color: var(--ink-soft);
}
.status-open { background: #d8f3dc; color: #1b4332; }
.status-partial { background: #fff3bf; color: #5c4400; }
.status-preseason { background: #e0e7ff; color: #312e81; }
.status-closed { background: #ffe3e3; color: #7d1f1f; }
.status-season_ended { background: #e9ecef; color: #495057; }

/* index */
.region-heading {
  margin: 1.7rem 0 0.7rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.region-heading:first-of-type { margin-top: 0.9rem; }
.resort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.8rem;
}
.resort-card {
  display: block;
  position: relative;  /* containing block for a per-card .overlay-scoped */
  overflow: hidden;    /* clip the celebration to the card */
  padding: 0 0 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(20, 60, 100, 0.05);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.resort-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(20, 80, 140, 0.16);
}
/* Per-card opening/closing-day overlay: confine to the card, keep text on top. */
.overlay.overlay-scoped { position: absolute; z-index: 0; }
.resort-card.has-overlay > :not(.overlay) { position: relative; z-index: 1; }
.resort-card h3 { margin: 0.55rem 0 0.2rem; font-size: 1.05rem; }
.resort-card .body { padding: 0.2rem 1rem 0; }
.snow-callout { margin: 0.5rem 0 0; color: var(--snow); font-size: 0.9rem; font-weight: 600; }

/* ridge banner atop each card (docs/06 §7) — silhouettes in the template,
   colors here so the theme switch restyles them */
/* Explicit width: without it the SVG sizes to its intrinsic 320px (viewBox
   ratio × the 54px height), leaving a white gap on any card wider than
   320px — e.g. the single-column mobile grid. */
.card-ridge { width: 100%; height: 54px; display: block; }
.ridge-sky  { fill: #d6ecfb; }
.ridge-far  { fill: #bcd9f0; }
.ridge-near { fill: #ffffff; }

/* detail: now strip */
.now-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.now-temp { font-size: 1.8rem; font-weight: 700; }
.now-cond { font-size: 1rem; }
.now-wind { color: var(--ink-soft); }

/* vibe overlays — the joy layer's cheese, kept classy by default.
   One block per vibe_tags.overlay_name; the detail template picks the
   wrapper + particle classes. Disabled entirely for reduced-motion users. */
.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}
.overlay-snowfall .flake {
  position: absolute;
  top: -2rem;
  color: #9fd2f0;
  opacity: 0.7;
  animation: snowfall linear infinite;
}
.overlay-snowfall .flake:nth-child(1)  { left: 4%;  font-size: 0.8rem; animation-duration: 11s; animation-delay: 0s; }
.overlay-snowfall .flake:nth-child(2)  { left: 14%; font-size: 1.2rem; animation-duration: 9s;  animation-delay: 2.5s; }
.overlay-snowfall .flake:nth-child(3)  { left: 25%; font-size: 0.7rem; animation-duration: 13s; animation-delay: 1s; }
.overlay-snowfall .flake:nth-child(4)  { left: 36%; font-size: 1.0rem; animation-duration: 10s; animation-delay: 4s; }
.overlay-snowfall .flake:nth-child(5)  { left: 47%; font-size: 0.9rem; animation-duration: 12s; animation-delay: 0.5s; }
.overlay-snowfall .flake:nth-child(6)  { left: 58%; font-size: 1.3rem; animation-duration: 8s;  animation-delay: 3s; }
.overlay-snowfall .flake:nth-child(7)  { left: 68%; font-size: 0.8rem; animation-duration: 14s; animation-delay: 5.5s; }
.overlay-snowfall .flake:nth-child(8)  { left: 78%; font-size: 1.1rem; animation-duration: 9.5s; animation-delay: 1.8s; }
.overlay-snowfall .flake:nth-child(9)  { left: 87%; font-size: 0.7rem; animation-duration: 12.5s; animation-delay: 4.6s; }
.overlay-snowfall .flake:nth-child(10) { left: 95%; font-size: 1.0rem; animation-duration: 10.5s; animation-delay: 2.2s; }

@keyframes snowfall {
  0%   { transform: translateY(-2rem) translateX(0); }
  50%  { transform: translateY(50vh) translateX(1.5rem); }
  100% { transform: translateY(105vh) translateX(-1rem); }
}

/* sun_sparkles (bluebird) — gold glints across the upper sky */
.overlay-sparkles .sparkle {
  position: absolute;
  color: #e9b949;
  opacity: 0;
  animation: twinkle ease-in-out infinite;
}
.overlay-sparkles .sparkle:nth-child(1) { left: 6%;  top: 8%;  font-size: 1.1rem; animation-duration: 2.8s; animation-delay: 0s; }
.overlay-sparkles .sparkle:nth-child(2) { left: 18%; top: 22%; font-size: 0.8rem; animation-duration: 3.4s; animation-delay: 0.9s; }
.overlay-sparkles .sparkle:nth-child(3) { left: 31%; top: 12%; font-size: 1.3rem; animation-duration: 3.0s; animation-delay: 1.7s; }
.overlay-sparkles .sparkle:nth-child(4) { left: 45%; top: 30%; font-size: 0.7rem; animation-duration: 2.6s; animation-delay: 0.4s; }
.overlay-sparkles .sparkle:nth-child(5) { left: 58%; top: 9%;  font-size: 1.0rem; animation-duration: 3.6s; animation-delay: 2.2s; }
.overlay-sparkles .sparkle:nth-child(6) { left: 71%; top: 26%; font-size: 0.9rem; animation-duration: 2.9s; animation-delay: 1.2s; }
.overlay-sparkles .sparkle:nth-child(7) { left: 84%; top: 15%; font-size: 1.2rem; animation-duration: 3.2s; animation-delay: 0.6s; }
.overlay-sparkles .sparkle:nth-child(8) { left: 93%; top: 34%; font-size: 0.8rem; animation-duration: 2.7s; animation-delay: 1.9s; }

@keyframes twinkle {
  0%, 100% { opacity: 0;   transform: scale(0.6); }
  50%      { opacity: 0.8; transform: scale(1); }
}

/* rotating_alarm (storm) — a swiveling beacon plus a sweeping glow up top */
.overlay-alarm::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40vw;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(176, 58, 46, 0.6), transparent);
  animation: alarm-sweep 2.4s linear infinite;
}
.overlay-alarm .beacon {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  font-size: 1.6rem;
  opacity: 0.85;
  animation: alarm-swivel 1.1s ease-in-out infinite alternate;
}
@keyframes alarm-sweep {
  0%   { transform: translateX(-40vw); }
  100% { transform: translateX(100vw); }
}
@keyframes alarm-swivel {
  from { transform: rotate(-16deg); }
  to   { transform: rotate(16deg); }
}

/* frost_breath (arctic) — slow fog puffs rising off the bottom edge */
.overlay-frost .puff {
  position: absolute;
  bottom: -9rem;
  width: 16rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(214, 234, 248, 0.5), transparent);
  filter: blur(6px);
  animation: frost-rise linear infinite;
}
.overlay-frost .puff:nth-child(1) { left: -4%; animation-duration: 16s; animation-delay: 0s; }
.overlay-frost .puff:nth-child(2) { left: 16%; animation-duration: 21s; animation-delay: 5s; }
.overlay-frost .puff:nth-child(3) { left: 35%; animation-duration: 18s; animation-delay: 9s; }
.overlay-frost .puff:nth-child(4) { left: 54%; animation-duration: 22s; animation-delay: 2s; }
.overlay-frost .puff:nth-child(5) { left: 70%; animation-duration: 17s; animation-delay: 12s; }
.overlay-frost .puff:nth-child(6) { left: 88%; animation-duration: 20s; animation-delay: 7s; }
@keyframes frost-rise {
  0%   { transform: translateY(0) scale(0.9);      opacity: 0; }
  25%  { opacity: 0.7; }
  100% { transform: translateY(-65vh) scale(1.15); opacity: 0; }
}

/* puddle_drops (slush) — quick straight drips */
.overlay-drops .drop {
  position: absolute;
  top: -2rem;
  color: #5dade2;
  opacity: 0.65;
  animation: drop-fall linear infinite;
}
.overlay-drops .drop:nth-child(1) { left: 7%;  font-size: 0.8rem; animation-duration: 2.6s; animation-delay: 0s; }
.overlay-drops .drop:nth-child(2) { left: 19%; font-size: 1.0rem; animation-duration: 3.1s; animation-delay: 1.4s; }
.overlay-drops .drop:nth-child(3) { left: 33%; font-size: 0.7rem; animation-duration: 2.9s; animation-delay: 0.7s; }
.overlay-drops .drop:nth-child(4) { left: 47%; font-size: 0.9rem; animation-duration: 2.4s; animation-delay: 2.0s; }
.overlay-drops .drop:nth-child(5) { left: 60%; font-size: 1.1rem; animation-duration: 3.3s; animation-delay: 0.3s; }
.overlay-drops .drop:nth-child(6) { left: 72%; font-size: 0.8rem; animation-duration: 2.7s; animation-delay: 1.8s; }
.overlay-drops .drop:nth-child(7) { left: 84%; font-size: 1.0rem; animation-duration: 3.0s; animation-delay: 1.1s; }
.overlay-drops .drop:nth-child(8) { left: 94%; font-size: 0.7rem; animation-duration: 2.5s; animation-delay: 2.3s; }
@keyframes drop-fall {
  to { transform: translateY(105vh); }
}

/* confetti (opening_day) — tumbling paper bits */
.overlay-confetti .bit {
  position: absolute;
  top: -1rem;
  width: 0.45rem;
  height: 0.75rem;
  opacity: 0.85;
  animation: confetti-fall linear infinite;
}
.overlay-confetti .bit:nth-child(3n+1) { background: #d64541; }
.overlay-confetti .bit:nth-child(3n+2) { background: #2e86c1; }
.overlay-confetti .bit:nth-child(3n)   { background: #f1c40f; }
.overlay-confetti .bit:nth-child(1)  { left: 4%;  animation-duration: 4.2s; animation-delay: 0s; }
.overlay-confetti .bit:nth-child(2)  { left: 13%; animation-duration: 3.6s; animation-delay: 1.1s; }
.overlay-confetti .bit:nth-child(3)  { left: 22%; animation-duration: 4.6s; animation-delay: 0.5s; }
.overlay-confetti .bit:nth-child(4)  { left: 30%; animation-duration: 3.9s; animation-delay: 1.9s; }
.overlay-confetti .bit:nth-child(5)  { left: 39%; animation-duration: 4.4s; animation-delay: 0.2s; }
.overlay-confetti .bit:nth-child(6)  { left: 48%; animation-duration: 3.4s; animation-delay: 1.5s; }
.overlay-confetti .bit:nth-child(7)  { left: 57%; animation-duration: 4.8s; animation-delay: 0.8s; }
.overlay-confetti .bit:nth-child(8)  { left: 66%; animation-duration: 3.7s; animation-delay: 2.2s; }
.overlay-confetti .bit:nth-child(9)  { left: 74%; animation-duration: 4.1s; animation-delay: 0.4s; }
.overlay-confetti .bit:nth-child(10) { left: 82%; animation-duration: 3.5s; animation-delay: 1.7s; }
.overlay-confetti .bit:nth-child(11) { left: 90%; animation-duration: 4.5s; animation-delay: 1.0s; }
.overlay-confetti .bit:nth-child(12) { left: 96%; animation-duration: 3.8s; animation-delay: 2.5s; }
@keyframes confetti-fall {
  0%   { transform: translateY(-1rem) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(540deg); }
}

/* fireworks (closing_day) — soft bursts in the upper sky */
.overlay-fireworks .burst {
  position: absolute;
  opacity: 0;
  animation: firework-burst 3.2s ease-out infinite;
}
.overlay-fireworks .burst:nth-child(1) { left: 12%; top: 14%; font-size: 1.8rem; animation-delay: 0s; }
.overlay-fireworks .burst:nth-child(2) { left: 32%; top: 28%; font-size: 1.3rem; animation-delay: 1.3s; }
.overlay-fireworks .burst:nth-child(3) { left: 52%; top: 10%; font-size: 2.1rem; animation-delay: 2.4s; }
.overlay-fireworks .burst:nth-child(4) { left: 68%; top: 32%; font-size: 1.5rem; animation-delay: 0.7s; }
.overlay-fireworks .burst:nth-child(5) { left: 83%; top: 17%; font-size: 1.9rem; animation-delay: 1.8s; }
.overlay-fireworks .burst:nth-child(6) { left: 24%; top: 44%; font-size: 1.2rem; animation-delay: 2.9s; }
@keyframes firework-burst {
  0%   { opacity: 0; transform: scale(0.3); }
  12%  { opacity: 1; }
  40%  { opacity: 0; transform: scale(1.9); }
  100% { opacity: 0; transform: scale(1.9); }
}

/* dusty_wind (dust_on_crust) — thin tan streaks blowing across */
.overlay-dust .streak {
  position: absolute;
  left: -8rem;
  width: 6rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(176, 141, 87, 0.55), transparent);
  animation: dust-blow linear infinite;
}
.overlay-dust .streak:nth-child(1) { top: 16%; animation-duration: 3.4s; animation-delay: 0s; }
.overlay-dust .streak:nth-child(2) { top: 27%; animation-duration: 4.8s; animation-delay: 1.2s; }
.overlay-dust .streak:nth-child(3) { top: 38%; animation-duration: 3.9s; animation-delay: 2.6s; }
.overlay-dust .streak:nth-child(4) { top: 49%; animation-duration: 5.4s; animation-delay: 0.6s; }
.overlay-dust .streak:nth-child(5) { top: 60%; animation-duration: 3.6s; animation-delay: 3.1s; }
.overlay-dust .streak:nth-child(6) { top: 70%; animation-duration: 4.4s; animation-delay: 1.8s; }
.overlay-dust .streak:nth-child(7) { top: 79%; animation-duration: 5.0s; animation-delay: 0.3s; }
.overlay-dust .streak:nth-child(8) { top: 87%; animation-duration: 4.1s; animation-delay: 2.2s; }
@keyframes dust-blow {
  to { transform: translateX(120vw); }
}

/* rainbow_sparkles (unicorn) — the full-spectrum twinkle */
.overlay-rainbow .sparkle {
  position: absolute;
  opacity: 0;
  animation: twinkle ease-in-out infinite;
}
.overlay-rainbow .sparkle:nth-child(1)  { color: #e74c3c; left: 5%;  top: 10%; font-size: 1.2rem; animation-duration: 2.4s; animation-delay: 0s; }
.overlay-rainbow .sparkle:nth-child(2)  { color: #e67e22; left: 15%; top: 56%; font-size: 0.8rem; animation-duration: 3.1s; animation-delay: 1.1s; }
.overlay-rainbow .sparkle:nth-child(3)  { color: #f1c40f; left: 26%; top: 24%; font-size: 1.0rem; animation-duration: 2.7s; animation-delay: 0.5s; }
.overlay-rainbow .sparkle:nth-child(4)  { color: #2ecc71; left: 37%; top: 70%; font-size: 1.3rem; animation-duration: 3.4s; animation-delay: 1.8s; }
.overlay-rainbow .sparkle:nth-child(5)  { color: #3498db; left: 49%; top: 16%; font-size: 0.9rem; animation-duration: 2.5s; animation-delay: 0.9s; }
.overlay-rainbow .sparkle:nth-child(6)  { color: #8e44ad; left: 60%; top: 48%; font-size: 1.1rem; animation-duration: 3.0s; animation-delay: 2.1s; }
.overlay-rainbow .sparkle:nth-child(7)  { color: #e74c3c; left: 71%; top: 78%; font-size: 0.7rem; animation-duration: 2.8s; animation-delay: 0.3s; }
.overlay-rainbow .sparkle:nth-child(8)  { color: #f1c40f; left: 80%; top: 30%; font-size: 1.2rem; animation-duration: 3.3s; animation-delay: 1.4s; }
.overlay-rainbow .sparkle:nth-child(9)  { color: #2ecc71; left: 89%; top: 62%; font-size: 0.8rem; animation-duration: 2.6s; animation-delay: 2.4s; }
.overlay-rainbow .sparkle:nth-child(10) { color: #3498db; left: 95%; top: 12%; font-size: 1.0rem; animation-duration: 3.2s; animation-delay: 0.7s; }

@media (prefers-reduced-motion: reduce) {
  .overlay { display: none; }
}

/* elevation tabs */
.point-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.8rem 0;
}
.point-tab {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
}
.point-tab small { color: var(--ink-soft); margin-left: 0.3rem; }
.point-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.point-tab.active small { color: #b9c8d8; }

/* stoke / vibe (joy layer) */
.stoke-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.stoke-label { font-size: 1.15rem; font-weight: 700; }
.stoke-source { margin-left: auto; font-size: 0.72rem; color: var(--ink-soft); }
.stoke-dots { display: inline-flex; gap: 0.3rem; }
.stoke-dots .dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--line);
}
.stoke-dots .dot.on { background: var(--snow); }

.vibe-chip {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.72rem;
  background: #e8eef7;
  color: var(--accent);
}

/* vibe accents — the cheese dial goes up later (overlay engine, themes) */
.vibe-powder .stoke-label, .vibe-chip.vibe-powder { color: #1a7fc1; }
.vibe-unicorn .stoke-label, .vibe-chip.vibe-unicorn { color: #8e44ad; }
.vibe-storm .stoke-label, .vibe-chip.vibe-storm { color: #b03a2e; }
.vibe-bluebird .stoke-label, .vibe-chip.vibe-bluebird { color: #1f8a70; }
.vibe-arctic .stoke-label, .vibe-chip.vibe-arctic { color: #34678a; }
.vibe-slush .stoke-label, .vibe-chip.vibe-slush { color: #b9770e; }

/* three-lens strip */
.lens-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.lens {
  padding: 0.7rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  text-align: center;
}
.lens h3 { margin: 0; font-size: 0.78rem; text-transform: uppercase; color: var(--ink-soft); }
.lens-value { margin: 0.3rem 0 0.1rem; font-size: 1.3rem; font-weight: 700; }
.lens-empty .lens-value { color: var(--line); }
.lens-source { margin: 0; font-size: 0.72rem; color: var(--ink-soft); }

/* horizontal card strips */
.card-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}
.hour-card, .day-card {
  flex: 0 0 auto;
  min-width: 6.2rem;
  padding: 0.6rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  scroll-snap-align: start;
}
.hour-card .when, .day-card .when { color: var(--ink-soft); font-size: 0.75rem; }
.hour-card .temp, .day-card .temp { font-weight: 600; }
.hour-card .snow, .day-card .snow { color: var(--snow); font-weight: 600; }
.day-card .wind { color: var(--ink-soft); font-size: 0.75rem; }

/* narrative + discussion */
.narrative-period {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.narrative-period h3 { margin: 0 0 0.25rem; font-size: 0.9rem; }
.narrative-period p { margin: 0; font-size: 0.88rem; }
.narrative-period.night { background: #f0f3f9; }

.discussion .summary { font-size: 0.92rem; }
.afd-body {
  white-space: pre-wrap;
  font-size: 0.78rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.8rem;
  max-height: 28rem;
  overflow-y: auto;
}

.sources ul { padding-left: 1.1rem; font-size: 0.82rem; color: var(--ink-soft); }
.sources .fetched { font-size: 0.75rem; }

/* alerts (docs/10) — subscribe / confirm / manage pages */
.alerts-page { max-width: 34rem; }
.alerts-page h2 { margin-top: 1.6rem; font-size: 1.05rem; }
.alerts-privacy {
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
}
.alerts-notice {
  font-size: 0.9rem;
  background: #eef6ee;
  border: 1px solid #cfe3cf;
  border-radius: 0.5rem;
  padding: 0.6rem 0.9rem;
}
.alerts-form { display: grid; gap: 0.35rem; margin-top: 0.8rem; }
.alerts-form label { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; }
.alerts-form input[type="email"],
.alerts-form select {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--ink);
}
.alerts-btn {
  font: inherit;
  margin-top: 0.8rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.4rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.alerts-btn-small { margin-top: 0; padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.alerts-btn-quiet { background: var(--ink-soft); }
.alerts-btn-danger { background: #a33; }
.alerts-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; }
.alerts-actions form { margin: 0; }
.alerts-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.alerts-table th, .alerts-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.alerts-table form { margin: 0; }
.alerts-pending { color: var(--ink-soft); font-size: 0.8rem; }
.alerts-changes { font-size: 0.92rem; }
.alerts-delete { margin-top: 0.4rem; font-size: 0.88rem; }
.alerts-delete label { display: block; margin-bottom: 0.4rem; }
.alerts-fineprint { font-size: 0.8rem; color: var(--ink-soft); }
.alerts-cta { margin: 1rem 0; }
.alerts-cta a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 0.4rem;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  font-size: 0.9rem;
}
/* honeypot: parked far off-screen, never display:none (some bots skip those) */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* alerts — multi-resort checklist */
.alerts-checklist {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  padding: 0.5rem 0.8rem 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.25rem 0.8rem;
}
.alerts-checklist legend {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0 0.3rem;
}
.alerts-checklist label {
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.checklist-region {
  grid-column: 1 / -1;
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.checklist-region:first-of-type { margin-top: 0.1rem; }

/* ============================================================
   Winter skins (docs/06 §7) — hero, ambient night snow, theme
   toggle, and the Nightfall component overrides. Scenes live in
   templates/_hero.html.jinja; data-mode is set pre-paint.
   ============================================================ */

/* ---- front-page hero ---- */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1200/430;
  max-height: 48vh;
  overflow: hidden;
  background: linear-gradient(#2f86c9 0%, #62a9dc 38%, #a8d3ef 68%, #dcefff 100%);
}
html[data-mode="night"] .hero {
  aspect-ratio: 1200/420;
  max-height: 46vh;
  background: linear-gradient(#0a1430 0%, #14264a 60%, #22335c 100%);
}
.hero .hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: none;
}
html[data-skin="classic"][data-mode="day"] .hero-classic-day,
html[data-skin="classic"][data-mode="night"] .hero-classic-night,
html[data-skin="topographic"][data-mode="day"] .hero-topographic-day,
html[data-skin="topographic"][data-mode="night"] .hero-topographic-night {
  display: block;
}
.hero .brandwrap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.1rem 1.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  background: linear-gradient(transparent, rgba(8, 30, 52, 0.45));
}
html[data-mode="night"] .hero .brandwrap { background: none; }
.hero .brand {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(6, 28, 52, 0.55);
}
html[data-mode="night"] .hero .brand { text-shadow: 0 0 18px rgba(143, 196, 255, 0.7); }
.hero .tagline { color: #e7f3ff; font-size: 0.92rem; text-shadow: 0 1px 6px rgba(6, 28, 52, 0.6); }
html[data-mode="night"] .hero .tagline { color: #cfe0fb; text-shadow: none; }

@keyframes aurora {
  0%, 100% { opacity: 0.45; transform: translateX(-2%); }
  50%      { opacity: 0.8;  transform: translateX(3%); }
}
.aurora { animation: aurora 9s ease-in-out infinite; }
.aurora.a2 { animation-duration: 13s; animation-delay: -3s; }

/* ---- ambient snowfall (night only; markup in layout) ---- */
.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  display: none;
}
html[data-mode="night"] .snow-layer { display: block; }
.snow-layer .ambient-flake {
  position: absolute;
  top: -3vh;
  color: #dbeeff;
  opacity: 0.8;
  animation: ambient-fall linear infinite;
  text-shadow: 0 0 6px rgba(180, 220, 255, 0.5);
}
@keyframes ambient-fall {
  0%   { transform: translateY(-3vh) translateX(0); }
  50%  { transform: translateY(50vh) translateX(2.2vw); }
  100% { transform: translateY(104vh) translateX(-1.4vw); }
}
/* keep page content above the ambient layer */
main, .site-header, .site-footer, .hero { position: relative; z-index: 1; }

/* ---- theme toggle (auto / day / night) ---- */
.theme-toggle {
  margin-left: auto;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.24); }

@media (prefers-reduced-motion: reduce) {
  .snow-layer { display: none !important; }
  .aurora { animation: none; }
  .resort-card, .resort-card:hover { transform: none; transition: none; }
}

/* ---- Nightfall component overrides ---- */
html[data-mode="night"] body {
  background:
    radial-gradient(1200px 500px at 70% -120px, #1a3a5e 0%, transparent 60%),
    radial-gradient(900px 420px at 15% -80px, #27305e 0%, transparent 55%),
    linear-gradient(#0a1224 0%, #0c1730 60%, #0a1426 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

html[data-mode="night"] .site-header {
  background: linear-gradient(#0a1430, #14264a 70%, #22335c);
  border-bottom: 1px solid var(--line);
}
html[data-mode="night"] .site-header .brand {
  text-shadow: 0 0 14px rgba(143, 196, 255, 0.6);
}
html[data-mode="night"] .site-header .tagline {
  color: #cfe0fb;
  text-shadow: none;
}
html[data-mode="night"] .header-ridge { opacity: 0.8; }

/* frosted-glass panels */
html[data-mode="night"] .resort-card,
html[data-mode="night"] .now-strip,
html[data-mode="night"] .stoke-row,
html[data-mode="night"] .lens,
html[data-mode="night"] .hour-card,
html[data-mode="night"] .day-card,
html[data-mode="night"] .narrative-period,
html[data-mode="night"] .afd-body,
html[data-mode="night"] .point-tab,
html[data-mode="night"] .alerts-privacy,
html[data-mode="night"] .alerts-checklist,
html[data-mode="night"] .alerts-form input[type="email"],
html[data-mode="night"] .alerts-form select {
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
html[data-mode="night"] .resort-card {
  border-radius: 0.9rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
html[data-mode="night"] .resort-card:hover {
  box-shadow: 0 14px 36px rgba(40, 90, 160, 0.4);
}
html[data-mode="night"] .card-ridge { opacity: 0.9; height: 50px; }
html[data-mode="night"] .ridge-sky  { fill: #1a2a48; }
html[data-mode="night"] .ridge-far  { fill: #33426e; }
html[data-mode="night"] .ridge-near { fill: #6f7eaa; }

/* status + vibe chips */
html[data-mode="night"] .status { background: rgba(150, 180, 230, 0.16); color: var(--ink-soft); }
html[data-mode="night"] .status-open { background: rgba(70, 200, 130, 0.2); color: #a7f3c8; }
html[data-mode="night"] .status-partial { background: rgba(240, 200, 60, 0.18); color: #f5dd90; }
html[data-mode="night"] .status-preseason { background: rgba(140, 150, 255, 0.18); color: #c3c8ff; }
html[data-mode="night"] .status-closed { background: rgba(230, 110, 90, 0.18); color: #ffb3a3; }
html[data-mode="night"] .status-season_ended { background: rgba(150, 180, 230, 0.14); color: #b6c4dd; }
html[data-mode="night"] .vibe-chip { background: rgba(120, 170, 240, 0.18); color: var(--accent); }
html[data-mode="night"] .vibe-chip.vibe-powder,
html[data-mode="night"] .vibe-powder .stoke-label { color: #bfe6ff; }
html[data-mode="night"] .vibe-chip.vibe-storm,
html[data-mode="night"] .vibe-storm .stoke-label { color: #ffb3a3; }
html[data-mode="night"] .vibe-chip.vibe-bluebird,
html[data-mode="night"] .vibe-bluebird .stoke-label { color: #9ff0cd; }
html[data-mode="night"] .vibe-chip.vibe-arctic,
html[data-mode="night"] .vibe-arctic .stoke-label { color: #bcd9ff; }
html[data-mode="night"] .vibe-chip.vibe-unicorn,
html[data-mode="night"] .vibe-unicorn .stoke-label { color: #d9b8ff; }
html[data-mode="night"] .vibe-chip.vibe-slush,
html[data-mode="night"] .vibe-slush .stoke-label { color: #f0c987; }
html[data-mode="night"] .vibe-powder .stoke-label { text-shadow: 0 0 16px rgba(143, 196, 255, 0.5); }

/* elevation tabs + stoke dots */
html[data-mode="night"] .point-tab.active {
  background: var(--accent);
  color: #0a1224;
  border-color: var(--accent);
  font-weight: 600;
}
html[data-mode="night"] .point-tab.active small { color: #1a3358; }
html[data-mode="night"] .stoke-dots .dot { background: rgba(150, 180, 230, 0.25); }
html[data-mode="night"] .stoke-dots .dot.on {
  background: var(--snow);
  box-shadow: 0 0 8px rgba(143, 196, 255, 0.8);
}

/* misc panels */
html[data-mode="night"] .narrative-period.night { background: rgba(18, 28, 52, 0.6); }
html[data-mode="night"] .narrative-period p { color: #d6e2f4; }
html[data-mode="night"] .lens-empty .lens-value { color: rgba(150, 180, 230, 0.35); }

/* alerts pages: keep button/CTA text readable on the light night accent */
html[data-mode="night"] .alerts-btn,
html[data-mode="night"] .alerts-cta a { color: #0a1224; font-weight: 600; }
html[data-mode="night"] .alerts-btn-quiet { background: rgba(150, 180, 230, 0.35); color: var(--ink); }
html[data-mode="night"] .alerts-btn-danger { background: #e07a6a; color: #2a0f0a; }
html[data-mode="night"] .alerts-notice {
  background: rgba(70, 200, 130, 0.15);
  border-color: rgba(120, 220, 170, 0.35);
}

/* ── season snowpack page (docs/11) ───────────────────────────────────── */
.crumbs { margin: 0.2rem 0 0.6rem; font-size: 0.9rem; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.season-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.season-head h1 { margin: 0.2rem 0; }
.season-picker { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.season-picker label { color: var(--ink-soft); }
.season-picker select {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.25rem 0.5rem;
}
.season-sub { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 1.1rem; }
.chart-sub { color: var(--ink-soft); font-size: 0.82rem; margin: 0 0 0.7rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}
.tiles .tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem 0.75rem;
}
.tiles .label { font-size: 0.76rem; color: var(--ink-soft); }
.tiles .value { font-size: 1.6rem; font-weight: 600; margin-top: 0.1rem; }
.tiles .delta { font-size: 0.76rem; margin-top: 0.15rem; color: var(--ink-soft); }
.tiles .delta.up { color: var(--good); font-weight: 600; }

.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.9rem 1rem 0.6rem;
  margin-bottom: 0.5rem;
}
.chart-card .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  padding: 0 0.1rem 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.chart-card .legend .key { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch-line { width: 16px; height: 0; border-top: 2px solid; border-radius: 2px; }
.swatch-band {
  width: 16px;
  height: 10px;
  border-radius: 2px;
  background: var(--band-fill);
  border: 1px solid var(--line);
}

.chart-wrap { position: relative; }
.chart-wrap .plot { display: block; width: 100%; height: auto; }
.chart-wrap .band { fill: var(--band-fill); stroke: none; }
.chart-wrap .gridline { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .axisline { stroke: var(--baseline); stroke-width: 1; }
.chart-wrap .tick { fill: var(--muted); font-size: 12px; }
.chart-wrap .tick-y { font-variant-numeric: tabular-nums; }
.chart-wrap .end-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.chart-wrap .crosshair { stroke: var(--baseline); stroke-width: 1; display: none; }

.chart-tip {
  position: absolute;
  top: 16px;
  pointer-events: none;
  display: none;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 6px 18px rgba(10, 30, 60, 0.18);
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  z-index: 4;
}
.tip-row { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.1rem; }
.tip-row:first-child { margin-top: 0; }
.tip-key { width: 12px; height: 0; border-top: 2px solid; border-radius: 2px; flex: none; }
.tip-val { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip-name { color: var(--ink-soft); }

.table-view summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.3rem 0.1rem 0.5rem;
}
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; font-size: 0.8rem; margin: 0 0 0.5rem; min-width: 22rem; }
table.data th, table.data td {
  text-align: right;
  padding: 0.3rem 0.7rem;
  border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--ink-soft); font-weight: 600; }

.season-foot { color: var(--muted); font-size: 0.78rem; margin-top: 1.4rem; max-width: 44rem; }

/* "season so far" module on the detail screen */
.season-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 1rem;
  margin: 0.6rem 0;
  text-decoration: none;
  color: inherit;
}
.season-teaser:hover { border-color: var(--accent); }
.season-teaser .st-figure { font-size: 1.5rem; font-weight: 650; color: var(--snow); }
.season-teaser .st-label { font-size: 0.82rem; color: var(--ink-soft); }
.season-teaser .st-cta { margin-left: auto; color: var(--accent); font-size: 0.85rem; font-weight: 600; }

/* ── homepage filter bar (docs/06 homepage) ───────────────────────────── */
.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  padding: 0.6rem 0;
  margin: 0.2rem 0 0.6rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.filter-field { display: inline-flex; align-items: center; gap: 0.4rem; }
.filter-label { font-size: 0.8rem; color: var(--ink-soft); }
.filters select {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.3rem 0.55rem;
}
.chips { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font-size: 0.82rem;
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
html[data-mode="night"] .chip.active { color: #0a1224; }
.filter-count { font-size: 0.8rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.filter-go { font: inherit; font-size: 0.85rem; padding: 0.3rem 0.7rem; border-radius: 0.5rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.filter-empty { color: var(--ink-soft); font-style: italic; margin: 1rem 0; }
.region-section { margin: 0; }

/* ── homepage view toggle + map (docs/06 homepage) ────────────────────── */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 0.5rem; overflow: hidden; }
.vt-btn {
  font-size: 0.82rem;
  padding: 0.28rem 0.7rem;
  background: var(--card-solid);
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--line); }
.vt-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
html[data-mode="night"] .vt-btn.active { color: #0a1224; }

.map-view { position: relative; margin-top: 0.4rem; }
.map-scroll { overflow-x: auto; }
.resort-map {
  display: block;
  width: 100%;
  min-width: 34rem;
  height: auto;
  background: var(--map-water);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.resort-map { cursor: grab; }
.resort-map.dragging { cursor: grabbing; }
#map-zoomable { transition: none; }
.map-land path,
.map-inset .map-land-path {
  fill: var(--map-land);
  stroke: var(--map-border);
  stroke-width: 0.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.map-zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-zoom-controls button {
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink);
  border-radius: 0.4rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(10, 30, 60, 0.12);
}
.map-zoom-controls button:hover { border-color: var(--accent); color: var(--accent); }
.map-inset .inset-box { fill: var(--map-water); stroke: var(--map-border); stroke-width: 1; }
.map-inset .inset-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.pin-hit {
  fill: transparent;
  /* bigger, invisible hit/hover target so small dots are easy to click */
  r: calc(10px / var(--map-zoom, 1));
  cursor: pointer;
}
.pin-mark {
  fill: var(--snow);
  stroke: var(--map-water);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  /* counter-scale the radius by the zoom so dots keep a constant screen size —
     zooming spreads clusters apart instead of inflating the markers. */
  r: calc(3.4px / var(--map-zoom, 1));
  cursor: pointer;
  transition: transform 0.1s ease, fill 0.1s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.map-pin { cursor: pointer; }
.map-pin:hover .pin-mark,
.map-pin:focus .pin-mark {
  fill: var(--accent);
  transform: scale(1.9);
  outline: none;
}
.map-pin:focus-visible .pin-mark { stroke: var(--accent); stroke-width: 1.4; }
.map-attr { color: var(--muted); }
.map-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  background: var(--card-solid);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  box-shadow: 0 6px 18px rgba(10, 30, 60, 0.18);
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  white-space: nowrap;
  z-index: 6;
}
.map-note { color: var(--muted); font-size: 0.8rem; margin: 0.5rem 0.2rem; }

/* ============================================================
   Extensible appearance system (docs/13): skin and lighting mode
   are independent. Structural component rules remain shared.
   ============================================================ */
.appearance-control {
  position: relative;
  margin-left: auto;
  color: #fff;
  z-index: 20;
}
.appearance-control summary,
.alerts-bell-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 2rem;
  background: rgba(7, 27, 48, 0.2);
  color: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 0.83rem;
  font-weight: 650;
  backdrop-filter: blur(8px);
}
.appearance-control summary::-webkit-details-marker { display: none; }
.appearance-control summary:hover,
.appearance-control summary:focus-visible,
.alerts-bell-link:hover,
.alerts-bell-link:focus-visible { background: rgba(255, 255, 255, 0.2); }
.appearance-icon { font-size: 1rem; line-height: 1; }
.appearance-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(7, 25, 45, 0.24);
}
.appearance-menu fieldset {
  border: 0;
  margin: 0 0 0.75rem;
  padding: 0;
}
.appearance-menu legend {
  width: 100%;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.appearance-menu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  cursor: pointer;
}
.appearance-menu input { accent-color: var(--accent); }
.appearance-reset {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.appearance-reset:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Proposal 2 — Modern Topographic. */
html[data-skin="topographic"][data-mode="day"] {
  --ink: #102d46;
  --ink-soft: #55748b;
  --paper: #f3f9fc;
  --card: #ffffff;
  --card-solid: #ffffff;
  --accent: #087fbd;
  --snow: #087fbd;
  --line: #c9dfe9;
  --map-water: #e0f2f8;
  --map-land: #d2e8e9;
  --map-border: #93bcc4;
}
html[data-skin="topographic"][data-mode="night"] {
  --ink: #eef7ff;
  --ink-soft: #a9c5dc;
  --paper: #06152f;
  --card: rgba(13, 42, 75, 0.82);
  --card-solid: #0d2a4b;
  --accent: #62c6ef;
  --snow: #89dcff;
  --line: rgba(105, 188, 225, 0.3);
  --map-water: #071a35;
  --map-land: #12395a;
  --map-border: #2e6487;
}
html[data-skin="topographic"] body {
  background-image:
    linear-gradient(rgba(43, 145, 199, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 145, 199, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}
html[data-skin="topographic"][data-mode="night"] body {
  background:
    radial-gradient(1000px 450px at 70% -100px, rgba(54, 139, 190, 0.25), transparent 60%),
    linear-gradient(#06152f, #071a35 70%, #06142a);
  background-attachment: fixed;
}
html[data-skin="topographic"] .hero {
  aspect-ratio: 1200/430;
  max-height: 48vh;
}
html[data-skin="topographic"] .hero .brandwrap {
  background: linear-gradient(transparent, rgba(4, 25, 43, 0.68));
}
html[data-skin="topographic"] .site-header {
  background: linear-gradient(120deg, #087fbd, #25a4d7 65%, #63c6e8);
}
html[data-skin="topographic"][data-mode="night"] .site-header {
  background: linear-gradient(120deg, #06152f, #102e57 65%, #174568);
}
html[data-skin="topographic"] .resort-card {
  border-radius: 0.85rem;
  box-shadow: 0 5px 18px rgba(16, 62, 88, 0.08);
}
html[data-skin="topographic"] .card-ridge {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
html[data-skin="topographic"][data-mode="day"] .card-ridge {
  background-image: url("/static/skins/topographic/card-ridge-day.svg");
}
html[data-skin="topographic"][data-mode="night"] .card-ridge {
  background-image: url("/static/skins/topographic/card-ridge-night.svg");
}
html[data-skin="topographic"] .card-ridge .ridge-sky { fill-opacity: 0; }
html[data-skin="topographic"][data-mode="day"] .ridge-far { fill: #8fc9e7; }
html[data-skin="topographic"][data-mode="day"] .ridge-near { fill: #f7fcff; }
html[data-skin="topographic"][data-mode="night"] .ridge-far { fill: #274a78; }
html[data-skin="topographic"][data-mode="night"] .ridge-near { fill: #6f91c3; }
html[data-skin="topographic"] .alerts-cta a,
html[data-skin="topographic"] .alerts-btn {
  background: #f47b20;
  color: #17202a;
}
html[data-skin="topographic"] .chip.active,
html[data-skin="topographic"] .vt-btn.active {
  background: #f47b20;
  border-color: #f47b20;
  color: #17202a;
}
html[data-skin="topographic"] .status-open {
  background: #d9f3e4;
  color: #17653a;
}
html[data-skin="topographic"][data-mode="night"] .status-open {
  background: rgba(63, 190, 120, 0.22);
  color: #a4efc4;
}
@media (max-width: 34rem) {
  .appearance-label { display: none; }
  .appearance-control summary { padding-inline: 0.55rem; }
  .alerts-label { display: none; }
  .alerts-bell-link { padding-inline: 0.55rem; }
}

/* ============================================================
   Header snow-alerts control (docs/10 §14) — rides the
   appearance-control pill; the golden flake is the alerts mark.
   ============================================================ */
.alerts-bell-link { text-decoration: none; }
.alerts-bell-link,
.alerts-control { margin-left: 0.5rem; } /* appearance keeps the auto push */
.alerts-control summary { white-space: nowrap; }
.alerts-flake { color: #e8b84b; }
html[data-mode="night"] .alerts-flake {
  text-shadow: 0 0 8px rgba(232, 184, 75, 0.55);
}
.alerts-menu { width: min(16rem, calc(100vw - 2rem)); }
.alerts-menu-item {
  display: block;
  padding: 0.4rem 0.2rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}
.alerts-menu-item:hover { color: var(--accent); }
.alerts-menu .alerts-fineprint { margin: 0.4rem 0 0; }
.alerts-remember { margin: 0.6rem 0 1rem; }
/* Tile flag: gold flake after the resort name once this browser knows an
   active alert exists for it (alerts_state.js unhides). */
.card-alert-flake { margin-left: 0.35rem; font-size: 0.85em; }

/* ============================================================
   Data-perspective pages (docs/14) — The Podium, Race to Open,
   The Almanac, The Scoreboard. Components ride the theme vars.
   ============================================================ */
.perspective-page h2 { margin-top: 2rem; }
.perspective-page h3 { margin: 1rem 0 0.4rem; color: var(--ink-soft); font-size: 0.95rem; }
.perspective-page .tiles { margin-bottom: 0.4rem; }
.perspective-page .tile .label a { color: inherit; text-decoration: none; }
.perspective-page .tile .label a:hover { color: var(--accent); }
.pct-up { color: var(--good); font-weight: 650; }
.pct-down { color: var(--ink); font-weight: 650; }
.race-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 0.6rem;
  font-size: 0.72rem;
  font-weight: 650;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.race-estimated { background: color-mix(in srgb, var(--ink-soft) 14%, transparent); color: var(--ink-soft); }
.muted-note { color: var(--muted); font-size: 0.85em; }
.gantt-bar { fill: var(--s1); }
.gantt-bar:hover { fill: var(--accent); }
.gantt-low { opacity: 0.55; }
.gantt-tick { fill: var(--ink-soft); }
.gantt-label { font-size: 11px; fill: var(--ink); }
.gantt-today { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
.gantt-swatch { background: var(--s1); }

/* Map pins colored by snowpack bucket (docs/14). Colored pins grow to
   4.6px (counter-scaled); 'na' stays small and faint — size + opacity
   separate it from 'near', never color alone. */
.pin-b-below2 { fill: var(--pct-below2); }
.pin-b-below1 { fill: var(--pct-below1); }
.pin-b-near { fill: var(--pct-near); }
.pin-b-above { fill: var(--pct-above); }
circle.pin-b-below2, circle.pin-b-below1, circle.pin-b-near, circle.pin-b-above {
  r: calc(4.6px / var(--map-zoom, 1));
}
.pin-b-na { fill: var(--muted); opacity: 0.55; }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
  margin: 0.5rem 0.2rem 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.map-legend .legend-title { font-weight: 650; color: var(--ink); }
.legend-dot {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  margin-right: 0.28rem;
  vertical-align: -1px;
}
span.legend-dot.pin-b-below2 { background: var(--pct-below2); }
span.legend-dot.pin-b-below1 { background: var(--pct-below1); }
span.legend-dot.pin-b-near { background: var(--pct-near); }
span.legend-dot.pin-b-above { background: var(--pct-above); }
span.legend-dot.pin-b-na { background: var(--muted); opacity: 0.55; }
.this-day {
  margin: 0.6rem 0 1rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.this-day p { margin: 0; }
.this-day strong { color: var(--ink); }
.explore-chips { margin: 0 0 0.9rem; }
.explore-chips .chip { text-decoration: none; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}
.footer-nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { text-decoration: underline; }


/* Mockup fidelity correction — selected Topographic proposal */
.hero:has(.appearance-control[open]),
.site-header:has(.appearance-control[open]) {
  overflow: visible;
  z-index: 30;
}

html[data-skin="topographic"][data-mode="day"] body {
  background: #f5fafd;
}
html[data-skin="topographic"][data-mode="night"] body {
  background:
    radial-gradient(900px 380px at 68% -80px, rgba(42, 104, 157, 0.24), transparent 60%),
    linear-gradient(#06152f, #071a35 72%, #06142a);
  background-attachment: fixed;
}

html[data-skin="topographic"] .hero {
  aspect-ratio: 1200 / 430;
  max-height: 31rem;
  background: #cceaf8;
}
html[data-skin="topographic"][data-mode="night"] .hero { background: #06152f; }
html[data-skin="topographic"] .hero .hero-art {
  object-position: center center;
}
html[data-skin="topographic"] .hero .brandwrap {
  padding: 1.3rem clamp(1.25rem, 3vw, 2.5rem);
  background: none;
  align-items: center;
}
html[data-skin="topographic"][data-mode="day"] .hero .brand {
  color: #102d46;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.95), 0 2px 12px rgba(255, 255, 255, 0.72);
}
html[data-skin="topographic"][data-mode="day"] .hero .tagline {
  color: #244e69;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}
html[data-skin="topographic"][data-mode="night"] .hero .brand {
  color: #f4f8ff;
  text-shadow: 0 2px 18px rgba(0, 8, 22, 0.8);
}
html[data-skin="topographic"][data-mode="night"] .hero .tagline {
  color: #d6e8fa;
  text-shadow: 0 2px 10px rgba(0, 8, 22, 0.9);
}

html[data-skin="topographic"] .appearance-label { display: none; }
html[data-skin="topographic"] .appearance-control summary {
  width: 2.5rem;
  height: 2.5rem;
  justify-content: center;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(8, 36, 58, 0.28);
  box-shadow: 0 4px 16px rgba(4, 22, 38, 0.16);
}
html[data-skin="topographic"][data-mode="day"] .appearance-control summary {
  color: #102d46;
  border-color: rgba(16, 45, 70, 0.24);
  background: rgba(255, 255, 255, 0.76);
}
html[data-skin="topographic"] .appearance-menu {
  border-radius: 0.75rem;
  box-shadow: 0 18px 50px rgba(4, 22, 38, 0.32);
}

html[data-skin="topographic"] main {
  padding-top: 1.3rem;
}
html[data-skin="topographic"] h1 {
  margin-bottom: 1rem;
  font-size: 1.65rem;
  letter-spacing: -0.025em;
}
html[data-skin="topographic"] .filters {
  padding: 0.7rem 0 0.8rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
}
html[data-skin="topographic"] .chip.active,
html[data-skin="topographic"] .vt-btn.active {
  box-shadow: 0 3px 10px rgba(244, 123, 32, 0.2);
}

html[data-skin="topographic"] .resort-grid {
  gap: 1rem;
}
html[data-skin="topographic"] .resort-card {
  padding-bottom: 0;
  border-radius: 0.9rem;
  box-shadow: 0 6px 22px rgba(16, 62, 88, 0.09);
}
html[data-skin="topographic"] .card-ridge {
  width: 100%;
  height: 90px;
  background-size: cover;
  background-position: center;
}
html[data-skin="topographic"] .card-ridge .ridge-sky,
html[data-skin="topographic"] .card-ridge .ridge-far,
html[data-skin="topographic"] .card-ridge .ridge-near {
  fill-opacity: 0;
}
html[data-skin="topographic"] .resort-card .body {
  padding: 0.65rem 1rem 1rem;
}
html[data-skin="topographic"] .resort-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  letter-spacing: -0.012em;
}
html[data-skin="topographic"] .resort-card .meta {
  margin: 0;
}
html[data-skin="topographic"] .snow-callout {
  margin: 0.8rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
html[data-skin="topographic"] .status,
html[data-skin="topographic"] .vibe-chip {
  border-radius: 999px;
  padding-inline: 0.55rem;
}

@media (max-width: 42rem) {
  html[data-skin="topographic"] .hero {
    aspect-ratio: 4 / 3;
  }
  html[data-skin="topographic"] .hero .hero-art {
    object-position: 58% center;
  }
  html[data-skin="topographic"] .hero .brandwrap {
    padding: 1rem;
  }
  html[data-skin="topographic"] .hero .tagline {
    display: none;
  }
}

/* Resort-specific Topographic card art. The generic ridge reserves the
   same 90px slot until the active-mode regional sprite has loaded. */
.resort-art-specific {
  display: none;
}
html[data-skin="topographic"] .resort-card .card-ridge {
  display: block;
  width: 100%;
  height: 90px;
}
html[data-skin="topographic"] .resort-card.resort-art-loaded .card-ridge {
  display: none;
}
html[data-skin="topographic"] .resort-card.resort-art-loaded .resort-art-specific {
  display: block;
  width: 100%;
  height: 90px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* The same active-mode resort fragment becomes the detail-page hero. Classic
   keeps the compact text header; Alpenglow reserves the hero height before
   the sprite loads so the image swap causes no layout shift. */
.resort-header-art {
  display: none;
}
html[data-skin="topographic"] .resort-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(11rem, 28vw, 17rem);
  margin: 0.8rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #168fc5, #8dd4eb);
  box-shadow: 0 8px 26px rgba(16, 62, 88, 0.14);
}
html[data-skin="topographic"][data-mode="night"] .resort-header {
  background: linear-gradient(135deg, #071a35, #174568);
}
html[data-skin="topographic"] .resort-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(transparent 35%, rgba(3, 19, 33, 0.78));
  pointer-events: none;
}
html[data-skin="topographic"] .resort-header-art {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
html[data-skin="topographic"] .resort-header-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(1rem, 3vw, 1.6rem);
}
html[data-skin="topographic"] .resort-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.08;
  text-shadow: 0 2px 12px rgba(3, 19, 33, 0.65);
}
html[data-skin="topographic"] .resort-header .meta {
  margin: 0.45rem 0 0;
  color: #eef9ff;
  text-shadow: 0 1px 8px rgba(3, 19, 33, 0.75);
}
