@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-latin-wght-normal.woff2') format('woff2-variations'),
       url('fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Registered so the sky can glide between states instead of jumping. */
@property --sky-top { syntax: '<color>'; inherits: false; initial-value: #0c1838; }
@property --sky-mid { syntax: '<color>'; inherits: false; initial-value: #223263; }
@property --sky-bottom { syntax: '<color>'; inherits: false; initial-value: #484c7e; }
@property --glow { syntax: '<color>'; inherits: false; initial-value: rgba(255, 241, 201, 0); }
@property --glow-x { syntax: '<percentage>'; inherits: false; initial-value: 50%; }
@property --glow-y { syntax: '<percentage>'; inherits: false; initial-value: 30%; }

:root {
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.9);
  --text-3: rgba(255, 255, 255, 0.8);
  --line: rgba(255, 255, 255, 0.14);
  --rain: #8fd6ff;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
  background: #0c1838;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--text);
  font: 400 1rem/1.45 var(--font);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safety net: nothing may make a phone swipe the page sideways. `clip`, unlike
     `hidden`, creates no scroll container, so the sticky top bar keeps working. */
  overflow-x: clip;
}

h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-color: rgba(255, 255, 255, 0.4); }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (hover: hover) { a:hover { text-decoration-color: currentColor; } }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── Sky ────────────────────────────────────────────────────────────────── */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at var(--glow-x) var(--glow-y), var(--glow), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
  transition: --sky-top 2.5s ease, --sky-mid 2.5s ease, --sky-bottom 2.5s ease,
              --glow 2.5s ease, --glow-x 2.5s ease, --glow-y 2.5s ease;
}
/* Fine grain keeps the large gradients from banding. */
.sky::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky-flash { position: absolute; inset: 0; background: #e3ebff; opacity: 0; }
.sky-flash.on { animation: flash 0.75s ease-out; }
@keyframes flash {
  0% { opacity: 0; } 7% { opacity: 0.32; } 15% { opacity: 0.04; } 24% { opacity: 0.2; } 100% { opacity: 0; }
}

/* ── Glass ──────────────────────────────────────────────────────────────── */
.glass {
  position: relative;
  isolation: isolate;
  border-radius: var(--r, 1.5rem);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.02) 100%),
    rgba(8, 20, 46, 0.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.7) brightness(0.84);
  backdrop-filter: blur(28px) saturate(1.7) brightness(0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 24px 60px -30px rgba(0, 6, 24, 0.6);
}
/* Specular rim: bright where light would catch the top-left edge. */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.1) 35%,
                              rgba(255, 255, 255, 0.03) 65%, rgba(255, 255, 255, 0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* Soft light that follows the mouse across the panel. */
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(26rem circle at var(--mx, 30%) var(--my, -40%), rgba(255, 255, 255, 0.09), transparent 60%);
  pointer-events: none;
}

.label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font: 500 0.8125rem/1.2 var(--font);
  color: var(--text-2);
  margin: 0 0 0.9rem;
}
.label svg, .place svg, .pill svg {
  width: 1rem; height: 1rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) max(1rem, env(safe-area-inset-right)) 0.6rem max(1rem, env(safe-area-inset-left));
  transition: background-color 0.35s, box-shadow 0.35s;
}
.bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: rgba(8, 20, 46, 0.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: 0 1px 0 var(--line);
  transition: opacity 0.35s;
}
.scrolled .bar::before { opacity: 1; }
.bar-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bar-left { position: relative; flex: 1; min-width: 0; height: 1.5rem; }
.bar-status, .bar-now {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.35s, transform 0.45s var(--ease-out);
}
.bar-status { font-size: 0.8125rem; color: var(--text-2); }
.bar-status.warn { color: #ffd27a; }
.bar-now { opacity: 0; transform: translateY(0.5rem); font-weight: 500; }
.bar-now .t { font-weight: 300; margin-right: 0.5rem; }
.bar-now .c { min-width: 0; margin-left: 0.6rem; font-weight: 400; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.compact .bar-status { opacity: 0; transform: translateY(-0.5rem); }
.compact .bar-now { opacity: 1; transform: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.75rem;
  padding: 0 1.1rem 0 0.9rem;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  font: 500 0.875rem/1 var(--font);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.25s var(--ease-out);
}
@media (hover: hover) { .pill:hover { background: rgba(255, 255, 255, 0.22); } }
.pill:active { transform: scale(0.95); }
.pill[aria-busy="true"] svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) calc(2.5rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left));
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "upper" "tiles" "foot";
}
/* Observation and forecasts get their own grid, so on wide screens the sticky
   observation stops where the forecasts end instead of sliding over the tiles. */
.upper {
  grid-area: upper;
  display: grid;
  gap: inherit;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hero" "hourly" "forecast";
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  grid-area: hero;
  text-align: center;
  padding: 1.25rem 0 2.25rem;
  text-shadow: 0 2px 28px rgba(0, 12, 40, 0.28);
}
.place {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 500 1.25rem/1.2 var(--font);
  letter-spacing: -0.01em;
}
.place svg { width: 1.1rem; height: 1.1rem; }
.temp {
  font-size: clamp(7rem, 32vw, 11rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin: 0.2rem 0 0.15rem;
}
.temp-fig { position: relative; display: inline-block; padding-right: 0.08em; }
.temp .deg { position: absolute; left: 100%; top: 0; margin-left: -0.08em; letter-spacing: 0; }
.cond {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 1.375rem/1.2 var(--font);
  letter-spacing: -0.01em;
}
.cond .glyph { width: 2.4rem; }
.hilo { margin-top: 0.35rem; font-size: 1.0625rem; color: var(--text-2); }
.hilo span + span { margin-left: 1rem; }
.summary {
  max-width: 34ch;
  margin: 0.7rem auto 0;
  font-size: 0.9375rem;
  color: var(--text-2);
  text-wrap: balance;
}
.problem { --r: 1.25rem; margin: 1.25rem auto 0; max-width: 28rem; padding: 1rem 1.2rem; text-align: left; text-shadow: none; }
.problem strong { display: block; font-weight: 500; margin-bottom: 0.25rem; }

.glyph svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ── Next 12 hours ───────────────────────────────────────────────────────── */
.hourly { grid-area: hourly; --r: 1.75rem; padding: 1.1rem 0 0.8rem; min-width: 0; }
.hourly .label { padding: 0 1rem; margin-bottom: 0.5rem; }
.strip-wrap { position: relative; }
.strip {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 3.7rem;
  gap: 0.2rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 1rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
}
.strip::-webkit-scrollbar { display: none; }
.hour {
  position: relative; /* contains the .sr text, which otherwise escapes the scroller and widens the page */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0 0.6rem;
  border-radius: 1.1rem;
  text-align: center;
}
.hour.now { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.h-time { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.hour.now .h-time { color: var(--text); font-weight: 600; }
.hour .glyph { width: 2.1rem; }
.h-pop { display: flex; align-items: center; gap: 0.15rem; height: 0.85rem; font: 600 0.75rem/1 var(--font); color: var(--rain); white-space: nowrap; }
.h-pop svg { width: 0.6rem; height: 0.6rem; fill: currentColor; }
.h-pop.none { visibility: hidden; }
.h-temp { font-size: 1.125rem; letter-spacing: -0.02em; line-height: 1.2; }
.sun-event .h-temp { font-size: 0.75rem; line-height: 1.5rem; color: var(--text-2); }
.strip-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: -1.05rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 20, 46, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
}
@media (hover: hover) { .strip-nav:hover { background: rgba(8, 20, 46, 0.75); } }
.strip-nav.prev { left: 0.35rem; }
.strip-nav.next { right: 0.35rem; }
.strip-nav svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* Touch screens swipe the strip; the arrows are for mouse users. */
@media (hover: none) { .strip-nav { display: none; } }

.g-horizon { stroke: rgba(255, 255, 255, 0.85); stroke-width: 3; stroke-linecap: round; }
.g-arrow { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ── Forecast ───────────────────────────────────────────────────────────── */
.forecast { grid-area: forecast; --r: 1.75rem; padding: 1.1rem 1rem 1rem; min-width: 0; }

/* Each column sits over its own stretch of the chart; dividers run through both. */
.days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.day { padding: 0 0.5rem 0.9rem; border-left: 1px solid var(--line); text-align: center; min-width: 0; }
.day:first-child { border-left-color: transparent; }
.day h3 { font: 500 1rem/1.2 var(--font); letter-spacing: -0.01em; }
.day .date { font-size: 0.8125rem; color: var(--text-3); }
.day .glyph { width: 3rem; margin: 0.55rem auto 0.25rem; }
.pop {
  display: flex; align-items: center; justify-content: center; gap: 0.2rem;
  height: 1rem;
  font: 600 0.8125rem/1 var(--font);
  color: var(--rain);
}
.pop svg { width: 0.7rem; height: 0.7rem; fill: currentColor; }
.pop.none { visibility: hidden; }
.temps { margin-top: 0.5rem; font-size: 1.375rem; letter-spacing: -0.03em; line-height: 1.1; }
.temps .lo { margin-left: 0.45rem; font-weight: 300; color: var(--text-3); }
.range {
  position: relative;
  height: 5px;
  max-width: 6.5rem;
  margin: 0.55rem auto 0.65rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}
.range span {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--from, 0%);
  right: calc(100% - var(--to, 100%));
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c1, #8fd6ff), var(--c2, #ffd36b));
  box-shadow: 0 0 12px -2px var(--c2, #ffd36b);
}
.day .desc { font-size: 0.875rem; line-height: 1.3; text-wrap: balance; }
.day .desc, .day h3, .note, .label, .summary { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.wd-short { display: none; }
.day .meta { margin-top: 0.3rem; font-size: 0.8125rem; line-height: 1.4; color: var(--text-3); }

.gram { margin-top: 0.4rem; }
.gram-plot { position: relative; height: 11.5rem; touch-action: pan-y; }
.gram-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.gram figcaption { margin-top: 0.7rem; font-size: 0.75rem; color: var(--text-3); }

.gram .night { fill: url(#ch-night); }
.gram .divider { stroke: var(--line); stroke-width: 1; }
.gram .base { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.gram .t-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gram .t-glow { fill: none; stroke-width: 7; stroke-linecap: round; opacity: 0.5; }
.gram .bar { fill: url(#ch-rain); }
.gram .bar.maybe { fill: rgba(143, 214, 255, 0.28); }
.gram .tick { fill: var(--text-3); font: 500 11px var(--font); }
.gram .guide { stroke: rgba(255, 255, 255, 0.6); stroke-width: 1; stroke-dasharray: 2 3; }
.gram .dot { fill: #fff; stroke-width: 3; }
.gram .draw { animation: draw 1.6s var(--ease-out) 0.35s both; }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

.readout {
  position: absolute;
  top: 0;
  pointer-events: none;
  padding: 0.35rem 0.6rem;
  border-radius: 0.75rem;
  background: rgba(8, 20, 46, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-size: 0.8125rem;
  line-height: 1.3;
  white-space: nowrap;
}
.readout b { font-weight: 500; }
.readout .r { color: var(--rain); margin-left: 0.35rem; }

/* ── Tiles ──────────────────────────────────────────────────────────────── */
.tiles {
  grid-area: tiles;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.tile { --r: 1.5rem; display: flex; flex-direction: column; min-width: 0; min-height: 11rem; padding: 1rem 1rem 1.1rem; }
.tile.wide { grid-column: span 2; }
.tile .label { margin-bottom: 0.6rem; }
.big { font-size: 2.125rem; font-weight: 300; line-height: 1; letter-spacing: -0.04em; }
.big small { margin-left: 0.2rem; font-size: 0.95rem; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
.note { margin-top: auto; padding-top: 0.8rem; font-size: 0.875rem; line-height: 1.35; color: var(--text-2); text-wrap: pretty; }

.dial { display: block; width: 100%; max-width: 8.25rem; margin: 0 auto; overflow: visible; }
.dial .tk { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.2; }
.dial .tk-major { stroke: rgba(255, 255, 255, 0.8); stroke-width: 2; }
.dial .cp { fill: var(--text-2); font: 600 10px var(--font); }
.dial .needle { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.dial .needle-head { fill: #fff; }
.dial .needle-tail { fill: none; stroke: #fff; stroke-width: 2; }
.dial .hub { fill: rgba(8, 20, 46, 0.55); stroke: rgba(255, 255, 255, 0.18); }
.dial .hub-val { fill: #fff; font: 500 17px var(--font); letter-spacing: -0.03em; }
.dial .hub-unit { fill: var(--text-2); font: 500 9px var(--font); }
.dial .track { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 8; stroke-linecap: round; }
.dial .prog { fill: none; stroke: url(#gr-ring); stroke-width: 8; stroke-linecap: round; }
.dial .marker { stroke: #fff; stroke-width: 4.5; stroke-linecap: round; }
.dial .val { fill: #fff; font: 300 22px var(--font); letter-spacing: -0.04em; }
.dial .unit { fill: var(--text-2); font: 500 10px var(--font); }
.tile-wind .dial, .tile-pressure .dial, .tile-clouds .dial { margin-top: 0.1rem; }

.meter { position: relative; height: 6px; margin-top: 1rem; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.meter span { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #a5e6ff, #3f8cff); }
.meter.vis span { background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), #fff); }

.scale { position: relative; height: 6px; margin-top: 1rem; border-radius: 99px; background: linear-gradient(90deg, #7fb6ff, #8ee3c8, #ffd36b, #ff8f6b); }
.scale.uv { background: linear-gradient(90deg, #5ccf6e, #c9dc4a 22%, #ffd24a 40%, #ff9f43 60%, #ff5a4f 80%, #b879ff); }
.scale i { position: absolute; top: 50%; left: var(--p, 50%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(8, 20, 46, 0.35); }

.sun-wrap { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1.5rem; flex: 1; }
.sun-text { flex: 1 1 10rem; }
.sun-arc { flex: 2 1 16rem; display: block; width: 100%; max-height: 7.5rem; overflow: visible; }
.sun-arc .path { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; }
.sun-arc .past { fill: none; stroke: #ffd36b; stroke-width: 2.5; stroke-linecap: round; }
.sun-arc .horizon { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; }
.sun-arc .ground { fill: rgba(0, 6, 26, 0.22); }
.sun-arc .halo { fill: #ffcf5a; opacity: 0.28; }
.sun-arc .disc { fill: url(#gr-sun); }
.sun-arc .disc.below { fill: rgba(255, 255, 255, 0.7); }
.sun-arc .t { fill: var(--text-3); font: 500 11px var(--font); }

.moon-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem; flex: 1; }
.moon-disc { flex: none; width: 5.5rem; height: 5.5rem; overflow: visible; }
.moon-disc .moon-halo { fill: url(#moon-halo-grad); }
.moon-disc .moon-dark { fill: rgba(200, 212, 240, 0.12); stroke: rgba(255, 255, 255, 0.14); stroke-width: 0.8; }
.moon-disc .moon-lit { fill: url(#gr-moon-lit); }
.moon-disc .moon-mare { fill: rgba(120, 112, 88, 0.17); }
.moon-text { flex: 1 1 8rem; min-width: 0; }
.moon-name { font-size: 1.375rem; font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; }
.moon-share { margin-top: 0.2rem; font-size: 0.875rem; color: var(--text-2); }
.moon-facts { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem 0.75rem; margin: 0.35rem 0 0; }
.moon-facts dt { font-size: 0.75rem; color: var(--text-3); }
.moon-facts dd { margin: 0.1rem 0 0; font-size: 0.9375rem; white-space: nowrap; }
@media (max-width: 25rem) { .moon-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Glyphs ─────────────────────────────────────────────────────────────── */
.g-sun { fill: url(#gr-sun); }
.g-halo { fill: #ffc93d; opacity: 0.2; }
.g-ray { stroke: #ffbd38; stroke-width: 3.2; stroke-linecap: round; }
.g-moon { fill: url(#gr-moon); }
.g-cloud { fill: url(#gr-cloud); }
.g-cloud-2 { fill: url(#gr-cloud-dark); }
.g-shade { fill: #06163a; opacity: 0.14; }
.g-drop { fill: url(#gr-drop); }
.g-flake { stroke: #eaf6ff; stroke-width: 1.8; stroke-linecap: round; }
.g-bolt { fill: url(#gr-bolt); }
.g-fog { stroke: #eef3f8; stroke-width: 3.6; stroke-linecap: round; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.foot { grid-area: foot; padding-top: 0.75rem; text-align: center; font-size: 0.8125rem; line-height: 1.8; color: var(--text-3); }
.foot a { padding-block: 0.7rem; } /* larger tap area without changing the line */
.foot .version { display: block; }
/* The panels render a moment after the first paint; until then the footer would
   sit high up and jump down (a layout shift). */
.wrap:has(.tiles:empty) .foot { visibility: hidden; }

/* ── Larger screens ─────────────────────────────────────────────────────── */
@media (min-width: 46rem) {
  .wrap { gap: 1.25rem; padding-left: max(2rem, env(safe-area-inset-left)); padding-right: max(2rem, env(safe-area-inset-right)); }
  .bar { padding-left: max(2rem, env(safe-area-inset-left)); padding-right: max(2rem, env(safe-area-inset-right)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
  .tile.wide { grid-column: span 3; }
  .forecast { padding: 1.35rem 1.35rem 1.2rem; }
  .day .glyph { width: 3.5rem; }
  .gram-plot { height: 13rem; }
  .hero { padding-top: 2rem; }
}
/* Landscape phones: observation beside the forecasts instead of filling the screen. */
@media (orientation: landscape) and (max-height: 32rem) and (min-width: 36rem) {
  .upper {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    grid-template-areas: "hero hourly" "hero forecast";
    column-gap: 1.25rem;
  }
  .hero { align-self: start; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 4rem); text-align: left; padding: 0.25rem 0 1rem; }
  .temp { font-size: 6rem; margin-left: -0.05em; }
  .summary { margin-left: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.wide { grid-column: span 3; }
}

@media (min-width: 64rem) {
  .wrap { padding-top: 1.5rem; }
  .upper {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: "hero hourly" "hero forecast";
    column-gap: 2rem;
  }
  /* The observation stays in view while the forecasts beside it scroll. */
  .hero { align-self: start; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5rem); text-align: left; padding: 2.5rem 0 1rem; }
  .hourly .label, .strip { padding-inline: 1.35rem; }
  /* Six single tiles in one row, then sun and moon side by side. */
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .strip { scroll-padding-inline: 1.35rem; }
  .temp { font-size: clamp(8rem, 13vw, 12rem); margin-left: -0.06em; }
  .summary { margin-left: 0; }
  .problem { margin-left: 0; }
}
/* Small phones (iPhone SE and narrower): short weekdays, tighter panels. */
@media (max-width: 22.4rem) {
  .bar-now .c { display: none; }
  .wd-long { display: none; }
  .wd-short { display: inline; }
  .forecast { padding-inline: 0.75rem; }
  .tiles { gap: 0.75rem; }
  .tile { padding: 0.85rem 0.8rem 0.95rem; }
}
/* Folded foldables: one column of tiles. */
@media (max-width: 18.75rem) {
  .temps { font-size: 1.125rem; }
  .temps .lo { margin-left: 0.25rem; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile.wide { grid-column: auto; }
}
@media (max-width: 25rem) {
  .pill { width: 2.75rem; padding: 0; justify-content: center; }
  .pill span { display: none; }
  .day { padding-left: 0.3rem; padding-right: 0.3rem; }
}

/* ── First load: one choreographed arrival ──────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .arriving .hero > :not(.problem),
  .arriving .hourly,
  .arriving .forecast,
  .arriving .tile { animation: rise 1s var(--ease-out) both; }
  .arriving .hero > :nth-child(2) { animation-delay: 0.05s; }
  .arriving .hero > :nth-child(3) { animation-delay: 0.12s; }
  .arriving .hero > :nth-child(4) { animation-delay: 0.17s; }
  .arriving .hero > :nth-child(5) { animation-delay: 0.22s; }
  .arriving .hourly { animation-delay: 0.15s; }
  .arriving .forecast { animation-delay: 0.25s; }
  .arriving .tile:nth-child(1) { animation-delay: 0.3s; }
  .arriving .tile:nth-child(2) { animation-delay: 0.35s; }
  .arriving .tile:nth-child(3) { animation-delay: 0.4s; }
  .arriving .tile:nth-child(4) { animation-delay: 0.45s; }
  .arriving .tile:nth-child(5) { animation-delay: 0.5s; }
  .arriving .tile:nth-child(6) { animation-delay: 0.55s; }
  .arriving .tile:nth-child(7) { animation-delay: 0.6s; }
  .arriving .tile:nth-child(8) { animation-delay: 0.65s; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } }

@media (prefers-reduced-motion: reduce) {
  .sky { transition: none; }
  .pill[aria-busy="true"] svg { animation: none; }
}
.tile-uv .big small { margin-left: 0.5rem; }
