/* SnowAlert v2 — mobile-first */

:root {
  --ink: #1c2430;
  --ink-soft: #5a6b80;
  --paper: #f6f9fc;
  --card: #ffffff;
  --accent: #2b6cb0;
  --snow: #1a7fc1;
  --line: #dde6ef;
}

* { box-sizing: border-box; }

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;
  background: var(--ink);
  color: #fff;
}
.site-header .brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}
.site-header .tagline { color: #b9c8d8; font-size: 0.85rem; }

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 */
.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.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.resort-card:hover { border-color: var(--accent); }
/* 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 h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.snow-callout { margin: 0.5rem 0 0; color: var(--snow); font-size: 0.9rem; }

/* 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; }
