:root {
  --sky: #e4ebf0;
  --paper: #ffffff;
  --ink: #13212c;
  --muted: #56666f;
  --line: #cfd9e0;
  --rain: #2a67a8;
  --rain-soft: #d5e3f1;
  --rain-bar: #9fbfdf;
  --night: #d9e1e8;
  --good: #2c7350;
  --meh: #8a6508;
  --bad: #2a67a8;
  --focus: #f2c230;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky: #0f1a22;
    --paper: #17252f;
    --ink: #e8eef2;
    --muted: #9db0bc;
    --line: #2b3b47;
    --rain: #6fa6e0;
    --rain-soft: #223a52;
    --rain-bar: #3b5f86;
    --night: #13212b;
    --good: #6cc49a;
    --meh: #e0b84e;
    --bad: #6fa6e0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.bar { padding: 14px 0; }
.bar .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.brand { font: 700 1.05rem/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.bar nav a { color: var(--muted); font-size: 0.95rem; }

.crumbs { font-size: 0.9rem; color: var(--muted); margin: 1.25rem 0 0.25rem; }
.crumbs a { color: var(--muted); }

/* The answer */
h1 {
  font: 700 clamp(1.15rem, 3.4vw, 1.35rem)/1.2 var(--display);
  margin: 0.75rem 0 0;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.day { margin: 0; color: var(--muted); }
.answer {
  font: 650 clamp(2rem, 7.2vw, 3.4rem)/1.04 var(--display);
  letter-spacing: -0.03em;
  margin: 1.1rem 0 0.6rem;
  text-wrap: balance;
}
.answer .temps { display: block; font-weight: 450; color: var(--muted); margin-top: 0.4rem; font-size: 0.62em; letter-spacing: -0.015em; }
.answer .temps b { color: var(--ink); font-weight: 650; }
.extras { margin: 0; font-weight: 700; }

/* Rain ribbon: the one thing people should remember */
.ribbon { margin: 2rem 0 0.5rem; }
.ribbon-grid {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  align-items: end;
  gap: 2px;
}
.ribbon-col { display: grid; grid-template-rows: 1.3rem 5.5rem 1.3rem; text-align: center; min-width: 0; }
.ribbon-col .t { font-size: 0.78rem; font-weight: 700; align-self: end; }
.ribbon-col .well { position: relative; background: var(--paper); border-radius: 3px 3px 0 0; overflow: hidden; }
.ribbon-col.dark .well { background: var(--night); }
.ribbon-col .fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--rain-bar);
  height: var(--h);
  border-radius: 3px 3px 0 0;
}
.ribbon-col .fill.likely { background: var(--rain); }
.ribbon-col .h { font-size: 0.72rem; color: var(--muted); padding-top: 0.25rem; }
.ribbon-key { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.ribbon-key i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; vertical-align: -0.1rem; margin-right: 0.35rem; }

/* Verdicts */
h2 { font: 700 1.3rem/1.2 var(--display); letter-spacing: -0.01em; margin: 2.75rem 0 0.9rem; }
.verdicts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0; }
.verdict { background: var(--paper); padding: 1rem 1.1rem 1.1rem; }
.verdict dt { color: var(--muted); font-size: 0.92rem; }
.verdict dd { margin: 0; }
.verdict .a { display: block; font: 700 1.25rem/1.2 var(--display); margin: 0.15rem 0 0.3rem; }
.verdict .a::before { content: ''; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.12rem; background: currentColor; }
.verdict .why { font-size: 0.93rem; color: var(--muted); }
.tone-good .a { color: var(--good); }
.tone-meh .a { color: var(--meh); }
.tone-bad .a { color: var(--bad); }

/* Hourly table */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: 10px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.5rem 0.75rem; text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th { font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 0.85rem; }
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody tr.wet td { background: var(--rain-soft); }
td .ico { margin-right: 0.4rem; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; font: 650 1.2rem/1.3 var(--display); }

/* Town lists */
.towns { list-style: none; padding: 0; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.towns li + li { border-top: 1px solid var(--line); }
.towns a { display: grid; grid-template-columns: 1fr auto 3.2rem; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; text-decoration: none; }
.towns a:hover .name { text-decoration: underline; }
.towns .name { font-weight: 700; }
.towns .short { color: var(--muted); font-size: 0.92rem; text-align: right; }
.towns .hi { font: 650 1.1rem/1 var(--display); text-align: right; }
.towns .hi .ico { font-size: 1rem; margin-right: 0.25rem; }
.towns .line { grid-column: 1 / -1; color: var(--muted); font-size: 0.92rem; margin-top: -0.4rem; }

.towns.plain a { grid-template-columns: 1fr auto; }
.towns .hi:empty, .towns .line:empty { display: none; }
.townlinks { list-style: none; padding: 0; margin: 0; columns: 4 8.5rem; column-gap: 1.25rem; }
.townlinks li { break-inside: avoid; padding: 0.3rem 0; }
.townlinks a { font-weight: 700; }
.regionlinks { color: var(--muted); font-size: 0.92rem; margin: 1rem 0 0; }
.regionlinks a { color: var(--muted); }
.search { margin: 1.5rem 0 0; }
.search label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.search input {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.nation { margin-top: 2.25rem; }
.region-name { font: 700 1rem/1.3 var(--body); color: var(--muted); margin: 1.5rem 0 0.5rem; }
.region-name a { color: var(--muted); }
.empty { color: var(--muted); }

.prose p { max-width: 38rem; }
.mm { color: var(--muted); font-size: 0.85em; margin-left: 0.25rem; }
.loading { color: var(--muted); margin: 1.5rem 0 8rem; }
.error { margin: 1.5rem 0; font-weight: 700; }
.error button, .near {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.9rem; cursor: pointer;
}
.near { margin-top: 0.75rem; }
.nearyou { margin: 1.25rem 0 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1.1rem 1rem; }
.nearyou p { margin: 0; }
.nearyou-line { display: flex; gap: 0.75rem; align-items: center; font: 450 1.2rem/1.3 var(--display); }
.nearyou-line .ico { font-size: 1.9rem; line-height: 1; }
.nearyou-line b { font-weight: 700; }
.nearyou-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.25rem; margin-top: 0.6rem !important; color: var(--muted); font-size: 0.92rem; }
.nearyou-links .go { color: var(--rain); font-weight: 700; }
.nearyou-links button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.nearyou-links button:hover, .locate button:hover { color: var(--ink); }
.locate { color: var(--muted); font-size: 0.92rem; margin: 0.25rem 0 0; }
.locate button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.near:hover, .error button:hover { border-color: var(--ink); }
.intro { color: var(--muted); max-width: 38rem; margin-top: 2.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.updated { color: var(--muted); font-size: 0.9rem; margin-top: 2.5rem; }
footer { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer p { margin: 0.25rem 0; }

@media (max-width: 520px) {
  .verdicts { grid-template-columns: 1fr; }
  th, td { padding: 0.5rem 0.45rem; }
  th:nth-child(4), td:nth-child(4), td .wl { display: none; }
  thead th:nth-child(2) { font-size: 0; }
  .mm { display: none; }
  .ribbon-col .t { font-size: 0.68rem; }
  .ribbon-col .h { font-size: 0.64rem; }
  .towns a { grid-template-columns: 1fr 3.4rem; }
  .towns .short { grid-column: 1; grid-row: 2; text-align: left; margin-top: -0.35rem; }
  .towns .hi { grid-column: 2; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .ribbon-col .fill { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 18ms); transform-origin: bottom; }
  @keyframes rise { from { transform: scaleY(0); } }
}
