:root {
  --forest: #2f4a3a;
  --forest-2: #3e5f4b;
  --amber: #d98e2b;
  --amber-soft: #f3d9a8;
  --cream: #f6efe2;
  --paper: #fffaf0;
  --ink: #2a2620;
  --ink-2: #5d564b;
  --line: #e2d6c0;
  --rust: #a5432a;
  --rust-soft: #f4dcd3;
  --ok: #3d7a4f;
  --caution: #c27c12;
  --closed: #a5432a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 38, 32, .06), 0 4px 14px rgba(42, 38, 32, .06);
  --slab: "Roboto Slab", Rockwell, "Courier New", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1b1e1b;
    --paper: #242824;
    --ink: #efe8da;
    --ink-2: #b4ab9b;
    --line: #363b36;
    --rust-soft: #3a2420;
    --amber-soft: #3a2f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--forest);
  color: #f6efe2;
}
.brand { display: block; line-height: 0; }
.sign { height: 34px; width: auto; }
.sign-bg { fill: #2a4433; stroke: #f6efe2; stroke-width: 2; }
.sign-line { fill: none; stroke: #f6efe2; stroke-width: 1; opacity: .55; }
.sign-text { font: 700 22px var(--slab); fill: #f6efe2; letter-spacing: 1.5px; }
.sign-dot circle { fill: var(--amber); }
.sign-dot path { fill: none; stroke: var(--amber); stroke-width: 2.2; stroke-linecap: round; }
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; opacity: .9; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #7fd18f; box-shadow: 0 0 0 0 rgba(127, 209, 143, .6); animation: pulse 2.4s infinite; }
.status.stale .pulse { background: var(--amber); animation: none; }
.status.offline .pulse { background: #c9c2b4; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 209, 143, .6); } 70% { box-shadow: 0 0 0 8px rgba(127, 209, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 209, 143, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.preview {
  background: var(--amber-soft); color: var(--ink);
  font-size: 12.5px; line-height: 1.35; text-align: center;
  padding: 7px 16px; border-bottom: 1px solid var(--line);
}

main { max-width: 720px; margin: 0 auto; padding: 12px 16px 8px; }

/* ---------- alert banner ---------- */
.alerts:empty { display: none; }
.alerts { display: grid; gap: 8px; margin-bottom: 12px; }
.alert {
  background: var(--rust); color: #fff6f0;
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow);
}
.alert.notice { background: var(--amber); color: #2a1d08; }
.alert summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.alert summary::-webkit-details-marker { display: none; }
.alert-icon { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.alert-title { font: 700 16px/1.3 var(--slab); }
.alert-meta { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.alert-body { margin: 10px 0 2px 32px; font-size: 14.5px; white-space: pre-line; }
.alert-body a { font-weight: 600; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  text-align: left; border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--radius); padding: 12px; min-height: 148px;
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .1s;
}
.tile:active { transform: scale(.985); }
.tile[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.tile:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.tile-title { font: 700 13px var(--slab); text-transform: uppercase; letter-spacing: .8px; color: var(--forest-2); }
@media (prefers-color-scheme: dark) { .tile-title { color: var(--amber); } }
.tile-age { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.tile-age.stale { color: var(--rust); font-weight: 600; }
.tile-body { font-size: 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.big { font: 700 34px/1 var(--slab); }
.big small { font-size: 16px; font-weight: 500; color: var(--ink-2); }
.muted { color: var(--ink-2); font-size: 13px; }
.snowline { display: inline-block; margin-top: 2px; background: var(--amber-soft); border-radius: 6px; padding: 2px 6px; font-size: 12.5px; font-weight: 600; }
.route { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; line-height: 1.3; }
.route b { font-weight: 600; white-space: nowrap; }
.route span.st { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; background: var(--ok); }
.dot.caution { background: var(--caution); }
.dot.closed { background: var(--closed); }
.dot.unknown { background: transparent; border: 1.5px solid var(--ink-2); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.stat b { display: block; font: 700 22px/1.1 var(--slab); }
.stat span { font-size: 11.5px; color: var(--ink-2); }
.event { font-size: 13px; line-height: 1.3; }
.event time { display: block; font-size: 11.5px; font-weight: 600; color: var(--forest-2); text-transform: uppercase; letter-spacing: .3px; }
@media (prefers-color-scheme: dark) { .event time { color: var(--amber); } }
.event + .event { margin-top: 5px; }
.tile-error { color: var(--ink-2); font-size: 13px; }
.skeleton { height: 60px; border-radius: 8px; background: linear-gradient(90deg, var(--line), transparent, var(--line)); background-size: 200% 100%; animation: sk 1.4s infinite; opacity: .6; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- feed ---------- */
.feed-wrap { margin-top: 18px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.feed-head h2 { font: 700 18px var(--slab); margin: 0; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.feed { list-style: none; margin: 0; padding: 0; }
.post { padding: 13px 2px; border-bottom: 1px solid var(--line); }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
.src {
  font-weight: 600; font-size: 11.5px; letter-spacing: .2px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink);
}
.src.weather { border-color: #8fb3c9; }
.src.roads { border-color: var(--amber); }
.src.lifts { border-color: #a9c2d8; }
.src.events { border-color: var(--forest-2); }
.post.sev-1 .src { background: var(--amber-soft); }
.post.sev-2 .src, .post.sev-3 .src { background: var(--rust-soft); border-color: var(--rust); }
.post-title { font: 600 16px/1.35 var(--sans); margin: 0; }
.post-title a { text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-sum { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.post.open .post-sum { -webkit-line-clamp: unset; }
.post-actions { margin-top: 6px; display: flex; gap: 14px; font-size: 13px; }
.post-actions a, .post-actions button { color: var(--forest-2); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
@media (prefers-color-scheme: dark) { .post-actions a, .post-actions button { color: var(--amber); } }
.empty { padding: 24px 4px; color: var(--ink-2); text-align: center; }
.more { display: block; width: 100%; margin: 12px 0; padding: 10px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); cursor: pointer; }
.new-posts { position: sticky; top: 64px; z-index: 5; display: block; margin: 0 auto 8px; background: var(--forest); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; font-size: 13px; box-shadow: var(--shadow); cursor: pointer; }

/* ---------- footer ---------- */
.foot { max-width: 720px; margin: 8px auto 24px; padding: 0 16px; font-size: 12.5px; color: var(--ink-2); }
.mission { font: 500 14px/1.4 var(--slab); color: var(--ink); }
.disclaimer:empty { display: none; }

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile { min-height: 168px; }
}
