/* ===========================================================================
   Weather network — visual system v2.
   Concept: "Atmosphere, lived in." The page is a sky you stand inside,
   with the city's data floating in it. No glass cards everywhere. Type
   does the heavy lifting. One number breathes. The rest gets out of the way.
   ========================================================================= */

/* ---------- Reset + base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-feature-settings: "ss01", "cv11", "ss02";
  line-height: 1.5;
  color: var(--ink);
  background: #050816;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

/* ---------- Tokens ---------- */
:root {
  --ink:   #f3f5fb;
  --ink-2: rgba(243,245,251,.72);
  --ink-3: rgba(243,245,251,.42);
  --ink-i: 251, 254, 255;     /* light-on-dark */

  --brand-color: #0066cc;

  /* Sky palette tokens — overridden per [data-time-period] below */
  --sky-1: #050816;
  --sky-2: #0d1235;
  --sky-3: #1a2256;
  --sky-glow: rgba(255,200,140,0);
  --moon-opacity: 1;
  --stars-opacity: 1;
  --cloud-1: rgba(255,255,255,.06);
  --cloud-2: rgba(255,255,255,.03);

  /* Temperature warmth (set per element) drives subtle hue shifts */
  --warmth: .5;

  --shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  --r-1: 12px;
  --r-2: 22px;

  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --pad-y: clamp(1.5rem, 4vw, 3rem);
}

/* ---------- Time-of-day palettes ---------- */
body.time-night {
  --sky-1: #02040d;
  --sky-2: #07103a;
  --sky-3: #1a2562;
  --moon-opacity: 1;
  --stars-opacity: 1;
}
body.time-dawn {
  --sky-1: #1a1240;
  --sky-2: #843757;
  --sky-3: #ff9d56;
  --moon-opacity: .25;
  --stars-opacity: .15;
  --sky-glow: rgba(255,170,110,.45);
}
body.time-day {
  --sky-1: #135fbf;
  --sky-2: #2d8ee0;
  --sky-3: #9bd3ff;
  --moon-opacity: 0;
  --stars-opacity: 0;
  --sky-glow: rgba(255,225,170,.7);
  --cloud-1: rgba(255,255,255,.85);
  --cloud-2: rgba(255,255,255,.55);
  --ink:   #0a1530;
  --ink-2: rgba(10,21,48,.72);
  --ink-3: rgba(10,21,48,.45);
  --ink-i: 9, 18, 36;       /* dark-on-light during day */
}
body.time-dusk {
  --sky-1: #1c1138;
  --sky-2: #b3486f;
  --sky-3: #f5b34a;
  --moon-opacity: .35;
  --stars-opacity: .25;
  --sky-glow: rgba(255,160,100,.55);
}

/* Weather overlays */
body.weather-rainy   { --sky-2: color-mix(in srgb, var(--sky-2) 70%, #2a3245 30%); }
body.weather-stormy  { --sky-1: #08051a; --sky-2: #2a153d; --sky-3: #2a1444; }
body.weather-snowy   { --sky-3: color-mix(in srgb, var(--sky-3) 55%, #ffffff 45%); }
body.weather-foggy   { --sky-2: color-mix(in srgb, var(--sky-2) 55%, #707a85 45%); --sky-3: color-mix(in srgb, var(--sky-3) 50%, #d3d9e0 50%); }

/* ---------- Atmosphere (fixed background) ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Mouse parallax: --mx and --my are set by JS in the [-1, 1] range */
  --mx: 0;
  --my: 0;
}
.sky {
  position: absolute; inset: -6%;
  background: linear-gradient(180deg,
    var(--sky-1) 0%,
    var(--sky-2) 55%,
    var(--sky-3) 100%);
  transform: translate(calc(var(--mx) * -28px), calc(var(--my) * -16px));
  transition: background 1.6s cubic-bezier(.4,0,.2,1);
}
.sky-glow {
  position: absolute;
  top: 30%; left: 50%;
  width: 80vmax; height: 80vmax;
  transform: translate(calc(-50% + var(--mx) * 60px), calc(-50% + var(--my) * 40px));
  background: radial-gradient(circle, var(--sky-glow) 0%, transparent 60%);
  opacity: .8;
  transition: background 1.6s ease, opacity 1.6s ease;
}

/* Stars */
.stars {
  position: absolute; inset: 0;
  opacity: var(--stars-opacity);
  transition: opacity 1.6s ease;
  transform: translate(calc(var(--mx) * -22px), calc(var(--my) * -12px));
}
.star {
  position: absolute;
  width: 1.5px; height: 1.5px;
  border-radius: 50%;
  background: #fff;
  top: calc((var(--i) * 137) % 100 * 1%);
  left: calc((var(--i) * 271) % 100 * 1%);
  opacity: calc(.25 + (var(--i) % 9) * .085);
  animation: twinkle calc(3s + (var(--i) % 6) * .8s) ease-in-out infinite;
  animation-delay: calc(var(--i) * -71ms);
}
.star:nth-child(11n) { width: 2.5px; height: 2.5px; }
.star:nth-child(7n)  { width: .8px;  height: .8px; }
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.6); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* Sun */
.sun {
  position: absolute;
  top: 14%; right: 10%;
  width: clamp(140px, 22vw, 320px);
  aspect-ratio: 1;
  opacity: 0;
  transition: opacity 2s ease, transform 2s ease;
  transform: translate(calc(var(--mx) * 50px), calc(var(--my) * 30px));
}
body.time-day .sun  { opacity: 1; }
body.time-dawn .sun { opacity: .9; top: 42%; right: 18%; }
body.time-dusk .sun { opacity: .9; top: 42%; right: 16%; }
.sun-halo {
  position: absolute; inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,225,170,.55) 0%, rgba(255,180,90,.18) 30%, transparent 60%);
  filter: blur(4px);
  animation: pulse 8s ease-in-out infinite;
}
.sun-core {
  position: absolute; inset: 25%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7d2, #ffd070 55%, #ff9d3a 100%);
  box-shadow: 0 0 80px rgba(255,200,140,.6);
  animation: corePulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes corePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* Moon */
.moon {
  position: absolute;
  top: 14%; right: 14%;
  width: clamp(110px, 14vw, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e7e8ee 60%, #aab0c5 100%);
  box-shadow: inset -12px -10px 35px rgba(20,30,60,.5);
  opacity: var(--moon-opacity);
  transition: opacity 1.6s ease;
  transform: translate(calc(var(--mx) * 40px), calc(var(--my) * 24px));
}
.moon-halo {
  position: absolute; inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,228,255,.18), transparent 65%);
  z-index: -1;
}

/* Clouds */
.clouds { position: absolute; inset: 0; transform: translate(calc(var(--mx) * -45px), calc(var(--my) * -22px)); transition: transform .15s ease-out; }
.cloud {
  position: absolute;
  width: 360px; height: 110px;
  background:
    radial-gradient(ellipse at 25% 65%, var(--cloud-1) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, var(--cloud-1) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 60%, var(--cloud-2) 0%, transparent 55%);
  filter: blur(3px);
  animation: drift 110s linear infinite;
  opacity: .7;
}
.cloud-a { top: 12%; left: -25%; transform: scale(1.5); animation-duration: 130s; opacity: .55; }
.cloud-b { top: 24%; left: -35%; transform: scale(1.0); animation-duration: 90s;  animation-delay: -25s; }
.cloud-c { top: 40%; left: -28%; transform: scale(1.3); animation-duration: 100s; animation-delay: -55s; opacity: .6; }
.cloud-d { top: 55%; left: -45%; transform: scale(.8);  animation-duration: 75s;  animation-delay: -10s; }
.cloud-e { top: 70%; left: -30%; transform: scale(1.1); animation-duration: 85s;  animation-delay: -40s; opacity: .5; }
@keyframes drift { to { transform: translateX(150vw) scale(var(--cs, 1)); } }

body.weather-clear .clouds  { opacity: .25; }
body.weather-partly-cloudy .clouds { opacity: .9; }
body.weather-cloudy .clouds { opacity: 1; }
body.weather-rainy .clouds, body.weather-stormy .clouds, body.weather-snowy .clouds, body.weather-foggy .clouds { opacity: .95; }

/* Static cloud anchored near the sun position. Visible only when the
   weather indicates clouds present, so partly-cloudy / cloudy days
   actually look cloudy rather than spotless. */
.cloud-near-sun {
  position: absolute;
  top: 10%;
  right: 6%;
  width: 480px; height: 150px;
  transform: scale(1.1);
  filter: blur(2px);
  opacity: 0;
  animation: none;
  transition: opacity 1.6s ease, transform 12s ease-in-out infinite alternate;
}
body.weather-partly-cloudy .cloud-near-sun { opacity: .85; }
body.weather-cloudy        .cloud-near-sun { opacity: 1; transform: scale(1.3); }
body.weather-rainy         .cloud-near-sun { opacity: 1; }
body.weather-stormy        .cloud-near-sun { opacity: 1; }
body.weather-snowy         .cloud-near-sun { opacity: 1; }
@keyframes nearSunDrift {
  0% { transform: translateX(0) scale(1.1); }
  100% { transform: translateX(-30px) scale(1.15); }
}
body.weather-partly-cloudy .cloud-near-sun,
body.weather-cloudy .cloud-near-sun { animation: nearSunDrift 18s ease-in-out infinite alternate; }

/* Rain */
.rain { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
body.weather-rainy .rain, body.weather-stormy .rain { opacity: 1; }
.drop {
  position: absolute;
  top: -10%;
  left: calc((var(--i) * .714%));
  width: 1px; height: 18px;
  background: linear-gradient(to bottom, transparent, rgba(180,210,255,.55));
  animation: fall calc(.6s + (var(--i) % 11) * .12s) linear infinite;
  animation-delay: calc(var(--i) * -47ms);
  transform: rotate(8deg);
}
.drop:nth-child(7n) { height: 12px; opacity: .6; }
@keyframes fall { to { transform: translateY(120vh) rotate(8deg); } }

/* Snow */
.snow { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
body.weather-snowy .snow { opacity: 1; }
.flake {
  position: absolute;
  top: -10%;
  left: calc((var(--i) * 1.428%));
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  filter: blur(.4px);
  animation:
    snowfall calc(11s + (var(--i) % 7) * 1.4s) linear infinite,
    sway calc(4s + (var(--i) % 5) * .7s) ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -200ms), calc(var(--i) * -100ms);
}
.flake:nth-child(3n) { width: 3px;  height: 3px; opacity: .55; }
.flake:nth-child(5n) { width: 7px;  height: 7px; }
@keyframes snowfall { to { transform: translateY(120vh); } }
@keyframes sway     { to { margin-left: 50px; } }

/* Lightning */
.lightning { position: absolute; inset: 0; background: white; opacity: 0; pointer-events: none; }
body.weather-stormy .lightning { animation: flash 9s ease-in infinite; }
@keyframes flash {
  0%, 90%, 100% { opacity: 0; }
  91% { opacity: .85; }
  92% { opacity: .15; }
  93% { opacity: .9; }
  94% { opacity: 0; }
}

/* Fog */
.fog { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background:
    linear-gradient(transparent 25%, rgba(220,225,235,.45) 50%, transparent 75%),
    linear-gradient(transparent 50%, rgba(220,225,235,.32) 70%, transparent 90%);
  filter: blur(20px);
  transition: opacity 1.6s ease;
}
body.weather-foggy .fog { opacity: .35; }
body.time-day.weather-foggy .fog { opacity: .25; }

/* Subtle film grain so the page never feels sterile */
.grain {
  position: absolute; inset: 0;
  opacity: .04;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}
body.time-day .grain { mix-blend-mode: multiply; opacity: .025; }

/* ---------- Site header (minimal) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 1rem var(--pad-x);
  display: flex;
  background: linear-gradient(180deg, rgba(0,0,0,.18), transparent);
  pointer-events: none;
}
body.time-day .site-header { background: linear-gradient(180deg, rgba(255,255,255,.18), transparent); }
.header-inner {
  display: flex; flex: 1; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto;
  pointer-events: auto;
}
.brand-link {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700;
  letter-spacing: -.015em;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-color);
  box-shadow: 0 0 16px var(--brand-color);
  animation: dotPulse 4s ease-in-out infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .7; transform: scale(.85); } }
.brand-logo { font-size: 1.05rem; }

/* Floating unit toggle, bottom-right */
.unit-toggle {
  position: fixed;
  bottom: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  display: inline-flex;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  overflow: hidden;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04);
}
body.time-day .unit-toggle {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(0, 0, 0, .12);
}
.unit-toggle button {
  padding: .55rem 1rem;
  color: rgba(255,255,255,.7);
  transition: color .25s ease, background .25s ease;
  letter-spacing: .02em;
  font-weight: 600;
}
body.time-day .unit-toggle button { color: rgba(0,0,0,.55); }
.unit-toggle button[aria-pressed="true"] {
  color: #fff;
  background: var(--brand-color);
}
body.time-day .unit-toggle button[aria-pressed="true"] { color: #fff; }

/* ---------- Main + hero ---------- */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-x) var(--pad-y);
}

.hero {
  min-height: clamp(70svh, 78svh, 82svh);
  padding: var(--pad-y) 0 calc(var(--pad-y) * 1.5);
  display: grid;
  align-content: center;
  row-gap: clamp(1rem, 2.4vw, 2rem);
  position: relative;
  animation: heroIn 1.1s cubic-bezier(.16,.74,.22,1) both;
}
@keyframes heroIn {
  0%   { opacity: 0; transform: translateY(20px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .65rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.eyebrow-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(var(--ink-i), .08);
  border: 1px solid rgba(var(--ink-i), .14);
  color: var(--ink-2);
  font-size: .95rem;
  transition: background .2s ease, transform .2s ease;
}
.eyebrow-back:hover { background: rgba(var(--ink-i), .16); transform: translateX(-2px); }
.eyebrow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-color);
  box-shadow: 0 0 10px var(--brand-color);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.hero[data-state="located"] .eyebrow-dot { animation-duration: 5s; }

.hero-title {
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .92;
  background: linear-gradient(180deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 78%, transparent) 110%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 30px rgba(0,0,0,.35));
}
body.time-day .hero-title { filter: drop-shadow(0 2px 12px rgba(255,255,255,.5)); }

.hero-region {
  font-size: clamp(.85rem, 1.2vw, 1rem);
  color: var(--ink-2);
  letter-spacing: .02em;
  max-width: 36ch;
}

/* Side-by-side: current temp on the left, hourly ribbon on the right (limited
   visible width, draggable). Stacks vertically on mobile. */
.hero-now {
  display: grid;
  grid-template-columns: minmax(auto, max-content) 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: stretch;
  padding-top: clamp(.4rem, 1.2vw, .8rem);
  min-width: 0;
}
@media (max-width: 760px) {
  .hero-now { grid-template-columns: 1fr; gap: 1rem; }
}

.hero-temp {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .25rem;
  min-width: 0;
}
.temp-value {
  font-size: clamp(3.8rem, 11vw, 8.5rem);
  font-weight: 200;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 70%, transparent) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.35));
  animation: tempBreathe 7s ease-in-out infinite;
}
body.time-day .temp-value { filter: drop-shadow(0 3px 14px rgba(255,255,255,.4)); }
@keyframes tempBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }

.weather-label {
  font-size: clamp(.9rem, 1.3vw, 1.15rem);
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -.005em;
  text-transform: lowercase;
}

/* ---------- Hourly ribbon — artistic, draggable ---------- */
.hourly-ribbon {
  position: relative;
  min-width: 0;
  /* Limit visibility — desktop: ~5 cards, mobile: ~3.5 cards */
  max-width: 100%;
  align-self: center;
}
.hourly-ribbon[hidden] { display: none; }
.hourly-ribbon::before,
.hourly-ribbon::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 36px;
  pointer-events: none;
  z-index: 2;
}
.hourly-ribbon::before { left: 0;  background: linear-gradient(90deg, var(--sky-2, transparent) 0%, transparent 100%); opacity: .6; }
.hourly-ribbon::after  { right: 0; background: linear-gradient(270deg, var(--sky-2, transparent) 0%, transparent 100%); opacity: .6; }
body.time-day .hourly-ribbon::before,
body.time-day .hourly-ribbon::after { opacity: .3; }

.hours {
  display: flex;
  gap: clamp(.4rem, .8vw, .6rem);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: .25rem .25rem .5rem;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  scroll-behavior: smooth;
}
.hours.dragging { cursor: grabbing; scroll-behavior: auto; }
.hours::-webkit-scrollbar { display: none; }

.hour {
  /* Hue gradient driven by --hour-warmth (0=cold, 1=hot).
     Cold ≈ 215 (blue), warm ≈ 25 (amber/red). */
  --hue: calc(220 - var(--hour-warmth, .5) * 220);
  --sat: 70%;

  scroll-snap-align: start;
  flex: 0 0 92px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  gap: .35rem;
  padding: .85rem .55rem .7rem;
  height: 138px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% -20%, hsl(var(--hue) var(--sat) 65% / .35) 0%, transparent 70%),
    linear-gradient(165deg,
      hsl(var(--hue) var(--sat) 50% / .22) 0%,
      hsl(var(--hue) var(--sat) 30% / .08) 100%);
  border: 1px solid hsl(var(--hue) var(--sat) 55% / .28);
  text-align: center;
  font-variant-numeric: tabular-nums;
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .25s ease;
  animation: hourIn .7s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(var(--hi, 0) * 30ms + 300ms);
  isolation: isolate;
}
/* Night palette: deeper, more violet */
.hour[data-is-day="0"] {
  --sat: 55%;
  background:
    radial-gradient(ellipse at 50% -20%, hsl(calc(var(--hue) - 30) 60% 55% / .25) 0%, transparent 70%),
    linear-gradient(165deg,
      hsl(calc(var(--hue) - 30) 50% 25% / .35) 0%,
      hsl(calc(var(--hue) - 40) 60% 12% / .25) 100%);
  border-color: hsl(calc(var(--hue) - 30) 50% 40% / .35);
}
/* Specular highlight at top */
.hour::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsl(0 0% 100% / .08) 0%, transparent 35%);
  pointer-events: none;
}
.hour:nth-child(1) { --hi: 0; } .hour:nth-child(2) { --hi: 1; } .hour:nth-child(3) { --hi: 2; }
.hour:nth-child(4) { --hi: 3; } .hour:nth-child(5) { --hi: 4; } .hour:nth-child(6) { --hi: 5; }
.hour:nth-child(7) { --hi: 6; } .hour:nth-child(8) { --hi: 7; } .hour:nth-child(9) { --hi: 8; }
.hour:nth-child(10){ --hi: 9; } .hour:nth-child(11){ --hi: 10; } .hour:nth-child(12){ --hi: 11; }
.hour:nth-child(13){ --hi: 12; } .hour:nth-child(14){ --hi: 13; } .hour:nth-child(15){ --hi: 14; }
.hour:nth-child(16){ --hi: 15; } .hour:nth-child(17){ --hi: 16; } .hour:nth-child(18){ --hi: 17; }
.hour:nth-child(19){ --hi: 18; } .hour:nth-child(20){ --hi: 19; } .hour:nth-child(21){ --hi: 20; }
.hour:nth-child(22){ --hi: 21; } .hour:nth-child(23){ --hi: 22; } .hour:nth-child(24){ --hi: 23; }
.hour:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px hsl(var(--hue) var(--sat) 50% / .25);
  border-color: hsl(var(--hue) var(--sat) 60% / .55);
}
@keyframes hourIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

/* Icon: top, larger, colored to the warmth hue */
.hour-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  color: hsl(var(--hue) var(--sat) 75%);
  filter: drop-shadow(0 1px 4px hsl(var(--hue) var(--sat) 50% / .35));
  flex-shrink: 0;
}
.hour[data-is-day="0"] .hour-icon { color: hsl(calc(var(--hue) - 30) 50% 78%); }
.hour-icon svg { width: 100%; height: 100%; }

/* Temp: middle, big, dominant */
.hour-temp {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.025em;
  line-height: 1;
}

/* Rain: tiny, blue */
.hour-rain {
  font-size: .65rem;
  color: hsl(210 80% 75%);
  font-weight: 600;
  letter-spacing: -.005em;
  background: hsl(210 50% 30% / .35);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Time: bottom */
.hour-time {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.hero-stats {
  /* Used only on the home where data is JS-injected. Grid of inline stats. */
  display: none;
}

/* ---------- Stat cards (city page) — meaningful, contextual ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(.6rem, 1.2vw, 1rem);
  margin-top: clamp(1rem, 2.5vw, 2rem);
}
.stat-card {
  position: relative;
  padding: clamp(.95rem, 1.4vw, 1.25rem);
  border-radius: var(--r-1);
  background:
    linear-gradient(180deg, rgba(var(--ink-i), .055), rgba(var(--ink-i), .02));
  border: 1px solid rgba(var(--ink-i), .08);
  display: flex; flex-direction: column;
  gap: .65rem;
  min-height: 140px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .25s ease, background .25s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(var(--ink-i), .18); }

.stat-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem;
}
.stat-key {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
}
.stat-sub {
  font-size: .82rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.005em;
}
.stat-big {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  font-weight: 200;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-unit { font-size: .55em; color: var(--ink-3); margin-left: .15em; font-weight: 400; letter-spacing: 0; }

/* Sun-arc card */
.sun-arc { width: 100%; max-height: 100px; display: block; margin-top: auto; }
.sun-dot { filter: drop-shadow(0 0 8px rgba(255,200,90,.7)); }
.moon-dot { filter: drop-shadow(0 0 6px rgba(220,228,255,.5)); }

/* Severity color tokens */
.stat-card[data-severity="low"]        { --sev-1: #4ade80; --sev-2: #16a34a; }
.stat-card[data-severity="moderate"]   { --sev-1: #facc15; --sev-2: #ca8a04; }
.stat-card[data-severity="high"]       { --sev-1: #fb923c; --sev-2: #ea580c; }
.stat-card[data-severity="very-high"]  { --sev-1: #f87171; --sev-2: #dc2626; }
.stat-card[data-severity="extreme"]    { --sev-1: #c084fc; --sev-2: #9333ea; }
.stat-card[data-severity="dry"]        { --sev-1: #fb923c; --sev-2: #ea580c; }
.stat-card[data-severity="comfortable"]{ --sev-1: #4ade80; --sev-2: #16a34a; }
.stat-card[data-severity="humid"]      { --sev-1: #facc15; --sev-2: #ca8a04; }
.stat-card[data-severity="muggy"]      { --sev-1: #f87171; --sev-2: #dc2626; }
.stat-card[data-severity="calm"]       { --sev-1: #4ade80; --sev-2: #16a34a; }
.stat-card[data-severity="light"]      { --sev-1: #4ade80; --sev-2: #16a34a; }
.stat-card[data-severity="breezy"]     { --sev-1: #facc15; --sev-2: #ca8a04; }
.stat-card[data-severity="strong"]     { --sev-1: #fb923c; --sev-2: #ea580c; }
.stat-card[data-severity="gale"]       { --sev-1: #f87171; --sev-2: #dc2626; }
.stat-card[data-severity="storm"]      { --sev-1: #c084fc; --sev-2: #9333ea; }

.stat-card[data-severity] .stat-sub { color: var(--sev-1); font-weight: 600; }
.stat-card[data-severity] { box-shadow: inset 0 -2px 0 0 var(--sev-1, transparent); }

.severity-bar {
  position: relative;
  width: 100%;
  height: 6px;
  margin-top: auto;
}
.severity-track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ade80, #facc15, #fb923c, #f87171, #c084fc);
  opacity: .4;
}
.severity-thumb {
  position: absolute;
  top: 50%;
  left: var(--pos, 0);
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--sev-1, var(--ink));
  box-shadow: 0 0 10px var(--sev-1, var(--ink)), 0 0 0 2px rgba(var(--ink-i), .12);
  transition: left .6s cubic-bezier(.2,.7,.3,1);
}
.uv-bar .severity-track       { background: linear-gradient(90deg, #4ade80 0%, #facc15 25%, #fb923c 50%, #f87171 65%, #c084fc 90%); }
.humidity-bar .severity-track { background: linear-gradient(90deg, #fb923c, #4ade80 35% 55%, #facc15 75%, #f87171); }

/* Wind compass */
.wind-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wind-compass {
  position: relative;
  width: 56px; height: 56px;
  flex-shrink: 0;
}
.compass-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(var(--ink-i), .25);
}
.compass-arrow {
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 32px;
  margin-left: -2px; margin-top: -16px;
  background: linear-gradient(180deg, var(--sev-1, var(--brand-color)) 0% 50%, rgba(var(--ink-i), .25) 50% 100%);
  border-radius: 2px;
  transform-origin: 50% 50%;
  transition: transform .8s cubic-bezier(.2,.7,.3,1);
}
.compass-arrow::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--sev-1, var(--brand-color));
}

/* ---------- Outfit + AdSense block ---------- */
.outfit {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: var(--r-2);
  background:
    linear-gradient(135deg, rgba(var(--ink-i), .07), rgba(var(--ink-i), .02));
  border: 1px solid rgba(var(--ink-i), .1);
  display: grid;
  gap: 1rem;
}
.outfit-head { display: grid; gap: .25rem; }
.outfit-key {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
}
.outfit-label {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
  background: linear-gradient(90deg, var(--brand-color) 0%, color-mix(in srgb, var(--brand-color) 50%, transparent) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.outfit-desc { color: var(--ink-2); font-size: .92rem; margin: 0; }

.outfit-items {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.outfit-items li {
  padding: .45rem .9rem;
  border-radius: 999px;
  background: rgba(var(--ink-i), .07);
  border: 1px solid rgba(var(--ink-i), .12);
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.005em;
}

/* ---------- Sponsored product cards (placeholder until AdSense) ---------- */
.outfit-shop {
  margin-top: .25rem;
  padding: clamp(1rem, 1.6vw, 1.4rem);
  border-radius: var(--r-1);
  background: rgba(var(--ink-i), .04);
  border: 1px solid rgba(var(--ink-i), .1);
  display: grid;
  gap: 1rem;
}
.shop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.shop-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--ink-3);
  padding: .2rem .55rem;
  border: 1px solid rgba(var(--ink-i), .2);
  border-radius: 999px;
}
.shop-sub { font-size: .85rem; color: var(--ink-2); }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(.6rem, 1vw, .9rem);
}
.shop-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: .7rem;
  padding: .75rem .85rem;
  background: rgba(var(--ink-i), .055);
  border: 1px solid rgba(var(--ink-i), .1);
  border-radius: var(--r-1);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
  cursor: pointer;
}
.shop-card:hover {
  transform: translateY(-2px);
  background: rgba(var(--ink-i), .1);
  border-color: var(--brand-color);
}
.shop-thumb {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-color) 18%, transparent), rgba(var(--ink-i), .04));
  color: var(--brand-color);
}
.shop-thumb svg { width: 36px; height: 36px; }
.shop-body { min-width: 0; }
.shop-brand {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-3);
  margin: 0;
  font-weight: 600;
}
.shop-name {
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink);
  margin: .15rem 0 .15rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-price {
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand-color);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.shop-cta {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-2);
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--ink-i), .2);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.shop-card:hover .shop-cta {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.hero-clock {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.hero-clock::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-color);
  margin-left: .5rem;
  vertical-align: middle;
  animation: dotPulse 2s ease-in-out infinite;
}

.hero-locate {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  background: rgba(var(--ink-i), .08);
  border: 1px solid rgba(var(--ink-i), .14);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 500;
  transition: background .25s ease, transform .2s ease;
}
.hero-locate:hover { background: rgba(var(--ink-i), .16); transform: translateY(-1px); }
.locate-icon {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}
.locate-icon::before {
  content: '';
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* Hero search (home only) */
.hero-search {
  position: relative;
  max-width: 460px;
  margin-top: .5rem;
}
.hero-search input {
  width: 100%;
  padding: .85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--ink-i), .15);
  background: rgba(var(--ink-i), .07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .25s ease, background .25s ease;
}
.hero-search input::placeholder { color: var(--ink-3); }
.hero-search input:focus {
  outline: 0;
  border-color: var(--brand-color);
  background: rgba(var(--ink-i), .12);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: color-mix(in srgb, var(--sky-2) 80%, #000 30%);
  border: 1px solid rgba(var(--ink-i), .2);
  border-radius: var(--r-1);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-height: 320px; overflow-y: auto;
  z-index: 60;
}
.search-results li {
  padding: .65rem 1rem;
  cursor: pointer;
  transition: background .15s ease;
  color: #fff;
  font-size: .95rem;
}
.search-results li:hover, .search-results li.active { background: rgba(255,255,255,.08); }
.search-results li small { display: block; opacity: .55; font-size: .78rem; margin-top: 2px; }

/* Locating-state UI on home */
.hero-home[data-state="locating"] .hero-region { opacity: 0; transform: translateY(-4px); transition: opacity .3s ease, transform .3s ease; }
.hero-home[data-state="locating"] .hero-temp,
.hero-home[data-state="locating"] .hero-stats { display: none; }
.hero-home[data-state="located"] .hero-region { opacity: 1; transform: none; }
.hero-home[data-state="located"] .hero-locate { display: none; }
.hero-home[data-state="located"] .hero-search { display: none; }
.hero-home[data-state="failed"] .hero-temp,
.hero-home[data-state="failed"] .hero-stats { display: none; }
.hero-home[data-state="failed"] .hero-region { opacity: 1; }

/* ---------- 7-day strip ---------- */
.forecast-7day {
  margin-top: clamp(1rem, 3vw, 2rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid rgba(var(--ink-i), .1);
}
.daily-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(.4rem, .8vw, .8rem);
  counter-reset: day;
}
.day {
  --warm-tint: hsla(calc(220 - var(--day-warmth, .5) * 220), 80%, 60%, .15);
  display: grid;
  align-content: space-between;
  gap: .4rem;
  padding: clamp(.85rem, 1.4vw, 1.2rem) clamp(.6rem, 1vw, 1rem);
  border-radius: var(--r-1);
  background:
    linear-gradient(180deg, rgba(var(--ink-i), .055), rgba(var(--ink-i), .02)),
    var(--warm-tint);
  border: 1px solid rgba(var(--ink-i), .08);
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), background .35s ease, border-color .35s ease;
  animation: dayIn .8s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(var(--i, 0) * 50ms + 200ms);
}
.day::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 120%, var(--warm-tint), transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
}
.day:nth-child(1) { --i: 1; }
.day:nth-child(2) { --i: 2; }
.day:nth-child(3) { --i: 3; }
.day:nth-child(4) { --i: 4; }
.day:nth-child(5) { --i: 5; }
.day:nth-child(6) { --i: 6; }
.day:nth-child(7) { --i: 7; }
.day:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--ink-i), .18);
}
.day:hover::before { opacity: 1; }
@keyframes dayIn {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.day-name {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.day-cond {
  font-size: .78rem;
  color: var(--ink-2);
  text-transform: lowercase;
  letter-spacing: -.005em;
  /* Truncate gracefully on narrow columns */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-bar {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand-color) 65%, transparent),
    color-mix(in srgb, var(--brand-color) 30%, transparent)
  );
  opacity: .6;
}
.day-temps {
  display: flex; align-items: baseline; gap: .45rem;
  font-variant-numeric: tabular-nums;
}
.day-high {
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
.day-low {
  font-size: .9rem;
  color: var(--ink-3);
  letter-spacing: -.01em;
}

@media (max-width: 720px) {
  .daily-strip {
    grid-auto-flow: column;
    grid-auto-columns: 38vw;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: .5rem;
  }
  .day { scroll-snap-align: start; }
}

/* ---------- Featured cities chips (home) ---------- */
.featured {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid rgba(var(--ink-i), .1);
}
.city-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.city-chip {
  display: inline-flex; align-items: baseline; gap: .55rem;
  padding: .65rem 1.1rem;
  border-radius: 999px;
  background: rgba(var(--ink-i), .055);
  border: 1px solid rgba(var(--ink-i), .12);
  color: var(--ink);
  font-size: .92rem;
  letter-spacing: -.01em;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.city-chip:hover {
  background: rgba(var(--ink-i), .12);
  border-color: var(--brand-color);
  transform: translateY(-1px);
}
.chip-name { font-weight: 600; }
.chip-country {
  font-size: .72rem;
  color: var(--ink-3);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(2rem, 4vw, 3rem) var(--pad-x) clamp(2rem, 4vw, 3rem);
  border-top: 1px solid rgba(var(--ink-i), .08);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.18));
}
body.time-day .site-footer { background: linear-gradient(180deg, transparent, rgba(255,255,255,.18)); }
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}
.footer-nav {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  font-size: .88rem;
}
.footer-nav a {
  color: var(--ink-2);
  transition: color .2s ease;
}
.footer-nav a:hover { color: var(--ink); }

.footer-meta {
  display: flex; flex-wrap: wrap; gap: .55rem;
  font-size: .78rem;
  color: var(--ink-3);
}
.footer-meta a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(var(--ink-i), .25);
}
.footer-meta a:hover { color: var(--ink); }
.footer-brand { color: var(--ink-2); font-weight: 600; }

.tbs-network:empty { display: none; }
.tbs-network .tbs-network-list {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem;
}

/* ---------- Mobile / responsive tweaks ---------- */
@media (max-width: 720px) {
  .hero { min-height: auto; padding-bottom: 2.5rem; }
  .hero-temp { gap: .4rem; }
  .weather-label { padding-bottom: .8rem; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-meta { gap: .6rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .star, .drop, .flake, .cloud, .lightning, .grain { display: none; }
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 4px;
  border-radius: 4px;
}
