/* Layout: one column of panels on a silvery olive-leaf ground; the olive mascot leads, data follows. */
:root {
  --bg: #eceee6;          /* underside of an olive leaf */
  --surface: #f8f9f4;
  --fg: #20251a;
  --muted: #5f6655;
  --line: #d5d9cb;
  --olive: #5c6b1f;       /* green olive */
  --olive-deep: #3b4614;
  --leaf: #8fa07a;
  --shine: #a3b45a;
  --accent: #0b5d7a;      /* the Adriatic, for links */
  --rain: #2f7fd1;
  --chance: #b5651d;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131711; --surface: #1a2017; --fg: #e6eadc; --muted: #a0a993; --line: #2c3527;
    --olive: #8ea33a; --olive-deep: #5f7020; --leaf: #6f8060; --shine: #c2d46e;
    --accent: #5bb6d6; --rain: #6aa9f0; --chance: #e0a060;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131711; --surface: #1a2017; --fg: #e6eadc; --muted: #a0a993; --line: #2c3527;
  --olive: #8ea33a; --olive-deep: #5f7020; --leaf: #6f8060; --shine: #c2d46e;
  --accent: #5bb6d6; --rain: #6aa9f0; --chance: #e0a060;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font-body); }
.wrap {
  max-width: 960px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main.wrap { display: grid; gap: 20px; padding-block: 20px 48px; }

h1, h2 { font-family: var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 900; line-height: 1.05; color: var(--olive-deep); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tagline { margin-top: 4px; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--olive); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.status:empty { display: none; }
.status { color: var(--chance); }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; padding-block: 20px; }
.top-tools { display: flex; gap: 12px; align-items: end; }
.lang-pick { display: flex; gap: 4px; }
.lang-pick button[aria-pressed="true"] { border-color: var(--olive); font-weight: 600; }
.place-pick { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); }
select, button {
  font: inherit; font-size: 1rem; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
}
button { cursor: pointer; font-weight: 600; min-width: 5.5em; }
button:hover, select:hover { border-color: var(--olive); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
:root[data-theme="dark"] h1 { color: var(--shine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h1 { color: var(--shine); } }

/* Hero: mascot + speech bubble */
.now { display: grid; gap: 16px; }
.hero { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 12px 24px; align-items: center; }
.hero-text { display: grid; gap: 16px; min-width: 0; }
.mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.verdict {
  margin: 0; position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px; font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; font-size: clamp(1.1rem, 2.6vw, 1.45rem); line-height: 1.3;
}
.verdict::before {
  content: ""; position: absolute; left: -9px; top: 28px; width: 16px; height: 16px;
  background: var(--surface); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; justify-items: center; }
  .mascot { width: 150px; }
  .hero-text { width: 100%; }
  .verdict::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }
}
.now-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.now-temp { font-family: var(--font-display); font-size: clamp(3.2rem, 11vw, 5rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--olive-deep); }
:root[data-theme="dark"] .now-temp { color: var(--shine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .now-temp { color: var(--shine); } }
.now-temp .unit { font-size: 0.4em; color: var(--muted); vertical-align: top; margin-left: 4px; }
.now-sky { font-size: 1.35rem; font-weight: 600; }
.now-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.now-facts div { background: var(--surface); padding: 10px 14px; }
.now-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.now-facts dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* Mascot animation */
.drop { animation: fall 1.1s linear infinite; }
.drop:nth-of-type(2) { animation-delay: -0.4s; } .drop:nth-of-type(3) { animation-delay: -0.75s; }
.gust { animation: whoosh 1.4s ease-in-out infinite; }
.gust:nth-of-type(2) { animation-delay: -0.5s; }
.bob { animation: bob 3.2s ease-in-out infinite; transform-origin: 80px 150px; }
.shiver { animation: shiver 0.25s linear infinite; transform-origin: 80px 150px; }
@keyframes fall { from { transform: translateY(-14px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(26px); opacity: 0; } }
@keyframes whoosh { 0%, 100% { transform: translateX(-8px); opacity: 0.2; } 50% { transform: translateX(8px); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(3deg); } }
@keyframes shiver { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(1px); } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }

.map { height: min(62vh, 480px); border-radius: 6px; border: 1px solid var(--line); background: var(--bg); z-index: 0; }
:root[data-theme="dark"] .basemap { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .basemap { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); } }
.radar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.radar-controls input[type="range"] { flex: 1 1 200px; accent-color: var(--olive); }
.legend { display: inline-flex; height: 10px; border-radius: 3px; overflow: hidden; }
.legend i { width: 18px; }
/* RainViewer "universal blue" scheme, approximated */
.legend .l1 { background: #88ddee; } .legend .l2 { background: #0099cc; } .legend .l3 { background: #0077aa; }
.legend .l4 { background: #ffaa00; } .legend .l5 { background: #c10000; }
.place-dot { background: var(--olive); border: 2px solid var(--surface); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; transform: rotate(-15deg); }
.place-dot.active { background: var(--chance); }

.chart-scroll { overflow-x: auto; }
#hours-chart svg { display: block; min-width: 620px; width: 100%; height: auto; }
#hours-chart text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
#hours-chart .grid { stroke: var(--line); }
#hours-chart .bar { fill: var(--rain); }
#hours-chart .prob { fill: none; stroke: var(--chance); stroke-width: 2; }
.key { display: inline-block; width: 12px; height: 10px; vertical-align: -1px; }
.key.bar { background: var(--rain); }
.key.line { height: 2px; vertical-align: 3px; background: var(--chance); }

/* Olive rating: five little olives, filled or pale */
.olives { display: inline-flex; gap: 3px; vertical-align: -1px; }
.olives i { width: 9px; height: 12px; border-radius: 50%; background: var(--olive); transform: rotate(-15deg); }
.olives i.off { background: var(--line); }

.days { list-style: none; margin: 0; padding: 0; display: grid; }
.days li { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) auto auto; gap: 2px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.days li:first-child { border-top: 0; }
.days .d-name { font-weight: 600; }
.days .d-sky { min-width: 0; color: var(--muted); }
.days .d-quip { grid-column: 2 / -1; font-size: 0.9rem; font-style: italic; color: var(--olive); }
:root[data-theme="dark"] .days .d-quip { color: var(--shine); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .days .d-quip { color: var(--shine); } }
.days .d-rain, .days .d-temp { font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; text-align: right; }
.days .d-rain { color: var(--rain); }
.days .d-rain.dry { color: var(--muted); }
@media (max-width: 560px) {
  .days li { grid-template-columns: 1fr auto; }
  .days .d-sky { grid-column: 1; grid-row: 2; }
  .days .d-rain { grid-column: 2; grid-row: 2; }
  .days .d-quip { grid-column: 1 / -1; }
}

.sources ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--muted); font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* Footer link to the privacy notice */
.site-foot { padding: 1rem 0 2rem; font-size: 1rem; }
.site-foot a { display: inline-block; padding: 0.75rem 0; }
