:root {
  color-scheme: light;
  /* tokens shared with aridrennen.com/site.css */
  --page: #fafbfc;
  --card: #ffffff;
  --ink: #101c2c;
  --ink-2: #3e4a59;
  --muted: #71808f;
  --hair: #e2e8ee;
  --hair-2: #cfd8e1;
  --accent: #2c6e9e;
  --accent-soft: #eaf2f8;
  --pink: #c05585;
  --pink-soft: #fbeef4;
  /* data */
  --snow: #2a78d6;
  --level: #eb6834;
  --band: #eef3f8;
  --good: #0ca30c;
  --warn: #9a6408;
  --warn-dot: #fab219;
  --bad: #d03b3b;
  --radius: 14px;
  --font: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); font-weight: 400; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */

.top, main { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 10px;
}
.brand { display: flex; flex-direction: column; gap: 1px; }
.brand .home { font-family: var(--display); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.brand .home::before { content: '← '; }
.brand h1 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.top-right { display: flex; align-items: center; gap: 8px; }
.stamp { color: var(--muted); font-size: 13px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--hair); background: var(--card);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding-bottom: 40px; }
.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.section {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-2); margin: 24px 2px 10px;
}
.cards { display: grid; gap: 12px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.block-head h2 { font-family: var(--display); font-size: 18px; font-weight: 600; }
.block-head h4 { font-size: 14px; font-weight: 700; }
.block-head .muted { font-size: 12.5px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--hair-2); flex: none; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn-dot); }
.dot.bad { background: var(--bad); }
.warn-text { color: var(--warn); }
.note { color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.error { color: var(--bad); margin: 0; }

.skeleton {
  height: 14px; border-radius: 6px; margin: 6px 0;
  background: linear-gradient(90deg, #eef0f3, #f7f8fa, #eef0f3);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

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

.hero { padding: 18px 16px; }
.hero-main { display: flex; align-items: center; gap: 14px; }
.hero-figure {
  font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  color: var(--ink);
}
.hero-text { margin: 0; font-size: 17px; font-weight: 600; }
.hero-sub { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.hero-line {
  display: grid; grid-template-columns: 15px 1fr; align-items: baseline; gap: 8px;
  margin: 12px 0 0; font-size: 14px; color: var(--ink-2);
}
.hero-line svg { width: 15px; height: 15px; color: var(--snow); align-self: center; }
.hero-line .dot { justify-self: center; align-self: center; }
.openings {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 6px;
}
.openings li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 9px; background: var(--page); font-size: 13.5px;
}
.openings li.is-local { background: var(--pink-soft); }
.openings time { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- outlook ---------- */

.seg { display: inline-flex; background: var(--page); border-radius: 9px; padding: 3px; }
.seg button {
  border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.seg button[aria-pressed='true'] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(15 23 42 / 0.1); }
.outlook-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.outlook-bars a {
  display: grid; grid-template-columns: minmax(118px, 36%) 1fr 44px; align-items: center; gap: 10px;
  padding: 6px 4px; border-radius: 8px; color: var(--ink);
}
.outlook-bars a:hover { background: var(--page); text-decoration: none; }
.ob-name { font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--pink); background: var(--pink-soft); padding: 1px 5px; border-radius: 4px;
}
.ob-track { height: 14px; display: block; }
.n-short { display: none; }
.ob-bar { display: block; height: 100%; background: var(--snow); border-radius: 0 4px 4px 0; min-width: 0; }
.ob-val { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- resort card ---------- */

.resort {
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden;
}
.resort > summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.resort > summary::-webkit-details-marker { display: none; }
.resort > summary::after {
  content: ''; width: 8px; height: 8px; flex: none; margin-left: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform 0.15s;
}
.resort[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.r-name { min-width: 0; }
.r-name h3 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.r-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.r-elev::before { content: ' · '; }
.r-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--page); border-radius: 999px; padding: 3px 10px;
}
.pill.open { color: #067a06; background: #eaf7ea; }
.glance { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.resort[open] .glance { display: none; }
.r-body { padding: 0 16px 16px; border-top: 1px solid var(--hair); padding-top: 14px; }

/* report */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--page); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.tile-k { display: block; font-size: 11.5px; color: var(--ink-2); }
.tile-v { display: block; font-size: 22px; font-weight: 700; }
.meta { font-size: 12.5px; color: var(--muted); margin: 8px 0 10px; }
.comment { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.comment summary { cursor: pointer; list-style: none; }
.comment summary::-webkit-details-marker { display: none; }
.comment .clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.comment[open] summary { display: none; }
.comment p { margin: 0; }
.lifts { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lifts li {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--hair); border-radius: 999px; padding: 2px 9px;
}
.lifts li.up { color: var(--ink); }

/* forecast table */
.forecast { margin-top: 4px; }
.days { list-style: none; margin: 0 0 18px; padding: 0; }
.days-head, .day > button {
  display: grid; grid-template-columns: 42px minmax(70px, 1fr) minmax(104px, 1.3fr) 52px 34px;
  align-items: center; gap: 8px;
}
.days-head { font-size: 11px; color: var(--muted); padding: 0 2px 4px; border-bottom: 1px solid var(--hair); }
.days-head span:nth-child(n+4) { text-align: right; }
.day { border-bottom: 1px solid var(--hair); }
.day > button {
  width: 100%; border: 0; background: none; padding: 8px 2px; text-align: left; cursor: pointer;
}
.day > button:hover { background: #fafbfc; }
.d-name { font-weight: 600; font-size: 13.5px; }
.d-name small { color: var(--muted); font-weight: 400; margin-left: 3px; }
.d-snow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.d-track { flex: 1; height: 10px; }
.d-bar { display: block; height: 100%; background: var(--snow); border-radius: 0 4px 4px 0; }
.d-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 30px; }
.d-read { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.d-read svg { width: 14px; height: 14px; flex: none; }
.k-snow .d-read { color: var(--ink); }
.k-snow .d-read svg { color: var(--snow); }
.k-rain .d-read svg, .k-mixed .d-read svg { color: #6b7a90; }
.k-dry .d-read svg { color: var(--hair-2); }
.d-temp, .d-wind { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.d-temp small { color: var(--muted); font-size: 12px; }
.d-wind { color: var(--ink-2); }
.d-more { margin: -2px 0 8px 52px; font-size: 12.5px; color: var(--ink-2); }

/* snow level chart */
.chart-head { margin-bottom: 4px; }
.chart { position: relative; margin: 0 0 16px; min-height: 176px; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart .band { fill: var(--band); }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .edge { stroke: var(--hair-2); stroke-width: 1; }
.chart .axis { stroke: var(--hair-2); stroke-width: 1; }
.chart .edge-label { font-size: 11px; fill: var(--ink-2); }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .level { fill: none; stroke: var(--level); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cursor-line { stroke: var(--ink-2); stroke-width: 1; }
.chart .cursor-dot { fill: var(--level); stroke: var(--card); stroke-width: 2; }
.chart .tip {
  position: absolute; top: -6px; pointer-events: none; transform: translateY(-100%);
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.35;
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
}
.chart .tip span { color: #cbd5e1; }

/* info rows */
.info { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--hair); }
.info li {
  display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--hair); font-size: 13.5px;
}
.i-k { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.i-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.i-v .muted { font-size: 12.5px; }
.i-v.nws, .i-v.road { display: grid; gap: 4px; }
.i-v.road a, .i-v.nws a { justify-self: start; }
.danger {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px;
  font-size: 12px; font-weight: 700; background: var(--page); color: var(--muted);
}
/* North American Public Avalanche Danger Scale colors */
.danger.d1 { background: #50b848; color: #fff; }
.danger.d2 { background: #fff200; color: #1a1a1a; }
.danger.d3 { background: #f7941e; color: #1a1a1a; }
.danger.d4 { background: #ed1c24; color: #fff; }
.danger.d5 { background: #231f20; color: #fff; }

/* webcams */
.cams { margin-bottom: 14px; }
.cam-strip {
  list-style: none; margin: 0 -16px; padding: 0 16px 4px;
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.cam-strip li { flex: 0 0 72%; max-width: 280px; scroll-snap-align: start; }
.cam-strip a { display: block; color: var(--ink-2); }
.cam-strip img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 10px; background: var(--page);
}
.cam-strip span { display: block; font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.links a:hover { text-decoration: none; background: #dbe8f3; }

/* sources */
.sources { margin-top: 28px; font-size: 13px; color: var(--ink-2); }
.sources h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 2px 8px; }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sources li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sources p { margin: 10px 0 0; font-size: 12.5px; }

@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .hero-figure { font-size: 48px; }
  .d-more { margin-left: 50px; }
  .openings { grid-template-columns: 1fr 1fr; }
  .n-full { display: none; }
  .n-short { display: inline; }
  .outlook-bars a { grid-template-columns: 116px 1fr 40px; }
  .r-elev { display: block; }
  .r-elev::before { content: none; }
  .days-head, .day > button {
    grid-template-columns: 44px 1fr 52px 28px;
    grid-template-areas: 'day snow temp wind' 'day read temp wind';
    row-gap: 3px;
  }
  .days-head { grid-template-areas: 'day snow temp wind'; }
  .days-head .h-read { display: none; }
  .d-name, .h-day { grid-area: day; }
  .d-snow, .h-snow { grid-area: snow; }
  .d-read { grid-area: read; font-size: 12.5px; }
  .d-snow { flex-direction: row-reverse; }
  .d-val { min-width: 34px; }
  .d-temp, .h-temp { grid-area: temp; }
  .d-wind, .h-wind { grid-area: wind; }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.spinning svg, .skeleton { animation: none; }
}
.cam-live { margin: 8px 0 0; font-size: 13px; }
.cam-live a { font-weight: 600; }

/* temps & wind by elevation (inside an opened day) */
.d-more p { margin: 6px 0 0; }
.elev { width: 100%; max-width: 440px; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.elev th, .elev td { padding: 5px 6px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); }
.elev thead th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--hair-2); }
.elev tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.elev tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.elev td b { display: block; font-size: 14px; color: var(--ink); }
.elev .e-feel, .elev .e-wind { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.elev .e-na { color: var(--muted); }
.elev tbody tr:last-child th, .elev tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 560px) {
  .d-more .elev { margin-left: -46px; width: calc(100% + 46px); }
}
