/* Ephor — the capsule's ambient sky (weather.js sets data-sky/data-phase).
   The layer lives INSIDE the pill, behind the content, clipped to its radius.
   Tints stay faint: the pill is a navigation instrument first, weather second,
   and navy text must pass contrast on every sky. Particles fall straight down
   — gravity has no writing direction — and the layer never repositions
   anything, so RTL needs no cases here. */

.nav-weather {
  position: absolute; z-index: -1; inset: 0; overflow: hidden;
  border-radius: inherit; pointer-events: none;
}
/* the sky itself — one gradient, driven by header state */
.nav-weather::before {
  content: ""; position: absolute; inset: 0; opacity: 0.55;
  transition: background 1.2s ease, opacity 0.6s ease;
}
[data-phase="day"] .nav-weather::before { background: linear-gradient(180deg, #cfe9fb, #eef8ff); }
[data-phase="dusk"] .nav-weather::before { background: linear-gradient(200deg, #f8d8b8, #dfd3ef 70%); }
[data-phase="night"] .nav-weather::before { background: linear-gradient(180deg, #10203e, #223760); }
[data-sky="cloud"][data-phase="day"] .nav-weather::before { background: linear-gradient(180deg, #dbe4ec, #eef2f6); }
[data-sky="rain"] .nav-weather::before { background: linear-gradient(180deg, #b9c9d8, #d5dfe8); }
[data-sky="rain"][data-phase="night"] .nav-weather::before,
[data-sky="storm"][data-phase="night"] .nav-weather::before { background: linear-gradient(180deg, #101c33, #2c3c55); }
[data-sky="storm"] .nav-weather::before { background: linear-gradient(180deg, #97a7b8, #c3ceda); }
[data-sky="snow"] .nav-weather::before { background: linear-gradient(180deg, #dfe9f2, #f6fafd); }
[data-sky="snow"][data-phase="night"] .nav-weather::before { background: linear-gradient(180deg, #1a2b47, #3a4d6d); }

/* night text: the pill's own ink stays navy on light skies; a night sky is
   dark, so the header borrows its existing inverted treatment — but only
   while the capsule shows. At the top there is no capsule, and the hero
   stays light at every hour, so the words stay navy there. */
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .brand,
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .brand-word,
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .nav-links > a,
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .nav-module-trigger,
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .menu { color: var(--white); }
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .brand small { color: var(--on-dark-3); }
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .watcher { fill: #5b9dff; }
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .nav-cta { background: #fff; color: var(--navy); }
[data-phase="night"] .site-header:is(.is-scrolled, .menu-open) .nav-pill { border-color: #ffffff2e; }

/* over dark sections the inverted plate already carries the pill — the sky
   steps well back rather than fighting it */
.site-header.on-dark .nav-weather { opacity: 0.22; }

/* ---- the moving parts ---- */
.nav-weather i { position: absolute; display: block; }

/* rain: thin streaks, each on its own column and clock */
.w-drop {
  inset-block-start: -14px; inset-inline-start: var(--x, 50%);
  inline-size: 1.5px; block-size: 11px; border-radius: 1px;
  background: linear-gradient(#4a7dd800, #4a7dd8cc);
  animation: w-fall var(--t, 1s) linear var(--d, 0s) infinite;
}
[data-phase="night"] .w-drop { background: linear-gradient(#9db8e600, #9db8e6b3); }
@keyframes w-fall { to { translate: 0 var(--fall, 96px); } }

/* snow: soft dots that sway as they settle */
.w-flake {
  inset-block-start: -8px; inset-inline-start: var(--x, 50%);
  inline-size: 4px; block-size: 4px; border-radius: 50%;
  background: #ffffffe6; box-shadow: 0 0 4px #ffffff80;
  animation: w-drift calc(var(--t, 1s) * 4) linear var(--d, 0s) infinite;
}
@keyframes w-drift {
  50% { translate: 5px calc(var(--fall, 96px) / 2); }
  to { translate: -3px var(--fall, 96px); }
}

/* stars: pinpricks that breathe (clear/cloudy nights only) */
.w-star {
  inset-block-start: calc(8% + 60% * var(--r, 0.5)); inset-inline-start: var(--x, 50%);
  inline-size: 2px; block-size: 2px; border-radius: 50%;
  background: #e8f2ff; animation: w-twinkle var(--t, 1s) ease-in-out var(--d, 0s) infinite;
}
@keyframes w-twinkle { 50% { opacity: 0.15; } }

/* clear day: one warm glow rising past the pill's end — sunlight, not amber:
   the product's money-colour stays out of the chrome */
.w-sun {
  inset-block-start: -180%; inset-inline-end: -4%;
  inline-size: 42%; block-size: 420%;
  background: radial-gradient(closest-side, #ffdf9e59, #ffdf9e00 70%);
  animation: w-glow 7s ease-in-out infinite;
}
@keyframes w-glow { 50% { opacity: 0.55; } }

/* clouds: blurred puffs on a very slow crossing */
.w-puff {
  inset-block-start: 12%; inset-inline-start: var(--x, 50%);
  inline-size: 34%; block-size: 70%; border-radius: var(--r-pill);
  background: #ffffff8c; filter: blur(10px);
  animation: w-cross var(--t, 1s) linear infinite alternate;
}
[data-phase="night"] .w-puff { background: #aebfd826; }
[data-sky="storm"] .w-puff { background: #6b7c8f66; }
@keyframes w-cross { to { translate: 26px 0; } }

@media (prefers-reduced-motion: reduce) {
  .nav-weather i { animation: none; }
}

/* ---- the hero's sky: the same weather over the star chart ----
   The page stays LIGHT at every hour (owner, 2026-10-07): the chart's paper
   warms at dusk and cools after dark, but never turns dark — the capsule
   above it carries the night. White flakes and white stars would vanish on
   paper, so the flakes take ink and the stars sit out (the chart has its own,
   which twinkle after dark). */
.hero-weather { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-weather i { position: absolute; display: block; --fall: 115vh; }
/* ink-blue at every hour: the night capsule's pale drops would vanish here */
.hero-weather .w-drop,
[data-phase="night"] .hero-weather .w-drop {
  block-size: 22px; opacity: 0.5; background: linear-gradient(#4a7dd800, #4a7dd8cc);
}
.hero-weather .w-flake { inline-size: 5px; block-size: 5px; background: #9fb3cf; box-shadow: none; }
.hero-weather .w-star { display: none; }
.hero-weather .w-puff {
  inset-block-start: 4%; inline-size: 40%; block-size: 24%;
  background: #c4d2e199; filter: blur(32px);
}
[data-sky="storm"] .hero-weather .w-puff { background: #8d9db180; }
.hero-weather .w-sun {
  inset-block-start: -35%; inset-inline-end: -12%; inline-size: 62%; block-size: 95%;
  background: radial-gradient(closest-side, #ffe2a659, #ffe2a600 70%);
}
[data-phase="dusk"] .hero-chart {
  background: radial-gradient(1100px 760px at 66% 38%, #fffaf3 0%, #f8efe8 46%, #ece2ea 100%);
}
[data-phase="night"] .hero-chart {
  background: radial-gradient(1100px 760px at 66% 38%, #f3f6fb 0%, #e3e9f3 46%, #d2dbea 100%);
}
[data-sky="rain"][data-phase="day"] .hero-chart,
[data-sky="storm"][data-phase="day"] .hero-chart {
  background: radial-gradient(1100px 760px at 66% 38%, #f6f8fa 0%, #e9eef2 46%, #dbe3ea 100%);
}
[data-phase="night"] .chart-sky .specks circle { animation: w-twinkle 3.4s ease-in-out var(--d, 0s) infinite; }

/* ---- the footer's sky: the same weather, sparser, over the photograph ----
   The frame is the site's other framed surface; the capsule and the footer
   book-end the page and everything between stays quiet. */
.footer-weather {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; border-radius: inherit;
}
.footer-weather i { position: absolute; --fall: 92vh; }
.footer-weather .w-drop { block-size: 18px; opacity: 0.6; }
.footer-weather .w-flake { opacity: 0.85; }
.footer-weather .w-star {
  inset-block-start: calc(3% + 38% * var(--r, 0.5)); /* upper sky only —
    stars behind the headline, never behind the legal bar */
}

/* ---- the clock's weather segment: glyph, condition, temperature ---- */
.clock-sky {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-small); font-weight: 500; color: var(--white);
}
.clock-sky b { font-weight: 500; color: var(--on-dark-4); }
.clock-sky svg { color: var(--sky); }

/* ---- the footer's grade ----
   The footer stays the page's night scene — the dark close is structural,
   every contrast contract on it depends on a dark ground. But the GRADE
   follows the hour, like film: lifted and bluer while the sun is up, a warm
   horizon at dusk, deepest navy after dark (the closing.css default). */
.footer-media::after { transition: background 1.2s ease; }
[data-phase="day"] .footer-media::after {
  background: linear-gradient(180deg, #1d3357cc, #21395f5c 48%, #0f1f3ac9);
}
[data-phase="dusk"] .footer-media::after {
  background: linear-gradient(180deg, #221f3dd9, #6d3a4d66 58%, #0d1a30d9);
}
