/* ============================================================
   SKY: live Limbe weather and the Christmas theme
   Shared by the site and the admin, loaded only when Admin, Look and
   seasons has something switched on. sky.js builds every element.

   The weather plays over the whole page, in front of the content, with
   every click and tap passing straight through it. The header and the
   phone tab bar stay on top so the menu is always clean. Colours are
   kept translucent so text under the rain or the sun stays readable.
   ============================================================ */
.sky { position: fixed; inset: 0; z-index: 140; pointer-events: none; overflow: hidden; contain: strict; }
html[data-blur] .sky { z-index: 3; }
.sky > * { position: absolute; inset: 0; }
.sky__canvas { width: 100%; height: 100%; }
/* The site's phone tab bar stays above the weather, like the header. */
html[data-sky]:not([data-blur]) .bottom-nav { z-index: 145; }

/* Overall tone of the sky: cooler and a touch darker for rain. */
.sky__tint { opacity: 0; transition: opacity 2.5s ease, background 2.5s ease; }
.sky--rain .sky__tint { opacity: 1; background: linear-gradient(to bottom, rgba(52, 72, 88, .2), rgba(52, 72, 88, .1) 60%, rgba(52, 72, 88, .14)); }
.sky--storm .sky__tint { opacity: 1; background: linear-gradient(to bottom, rgba(28, 36, 48, .32), rgba(28, 36, 48, .16) 60%, rgba(28, 36, 48, .22)); }
.sky--fog .sky__tint { opacity: 1; background: linear-gradient(to top, rgba(222, 226, 218, .55), rgba(222, 226, 218, .22) 55%, rgba(222, 226, 218, .08)); animation: sky-haze 14s ease-in-out infinite alternate; }
[data-theme="dark"] .sky--fog .sky__tint { background: linear-gradient(to top, rgba(170, 180, 165, .2), rgba(170, 180, 165, .06) 60%, rgba(170, 180, 165, 0)); }
.sky--clear.sky--day .sky__tint { opacity: 1; background: linear-gradient(200deg, rgba(255, 206, 120, .1), rgba(255, 220, 160, .03) 55%, rgba(255, 220, 160, 0)); }

/* Sun: a bright source in the top corner, rays fanning across the
   whole page and a band of light sweeping over it now and then. */
.sky__sun { opacity: 0; transition: opacity 3s ease; }
.sky--clear.sky--day .sky__sun { opacity: 1; }
[data-theme="dark"] .sky--clear.sky--day .sky__sun { opacity: .6; }
.sky__sun::before {
  content: ''; position: absolute; top: -30vmax; right: -26vmax; width: 80vmax; height: 80vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 190, .5) 0%, rgba(255, 210, 130, .24) 14%, rgba(255, 196, 110, .08) 34%, rgba(255, 196, 110, 0) 60%);
  animation: sky-breathe 7s ease-in-out infinite alternate;
}
.sky__sun::after {
  content: ''; position: absolute; top: -110vmax; right: -110vmax; width: 220vmax; height: 220vmax; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 150, .11) 0deg 3deg, rgba(255, 214, 150, 0) 3deg 11deg);
  -webkit-mask: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .4) 20%, transparent 42%); mask: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .4) 20%, transparent 42%);
  animation: sky-turn 90s linear infinite;
}
.sky__sweep { opacity: 0; }
.sky--clear.sky--day .sky__sweep { opacity: 1; }
.sky__sweep::before {
  content: ''; position: absolute; top: -50%; left: 0; width: 40vw; height: 200%;
  background: linear-gradient(90deg, rgba(255, 230, 180, 0), rgba(255, 230, 180, .09), rgba(255, 230, 180, 0));
  transform: translateX(-60vw) rotate(18deg); animation: sky-sweep 11s ease-in-out infinite;
}
/* Clear night: a cool moon glow instead. */
.sky__moon { opacity: 0; transition: opacity 3s ease; }
.sky--clear.sky--night .sky__moon, .sky--cloudy.sky--night .sky__moon { opacity: 1; }
.sky__moon::before {
  content: ''; position: absolute; top: -12vmax; right: -10vmax; width: 38vmax; height: 38vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 226, 240, .22) 0%, rgba(214, 226, 240, .06) 35%, rgba(214, 226, 240, 0) 65%);
}

/* Clouds: large soft shapes drifting across the whole page. */
.sky__clouds { opacity: 0; transition: opacity 3s ease; }
.sky--cloudy .sky__clouds, .sky--rain .sky__clouds, .sky--storm .sky__clouds, .sky--fog .sky__clouds { opacity: 1; }
.sky__cloud {
  position: absolute; border-radius: 50%; filter: blur(28px);
  background: radial-gradient(ellipse at center, var(--sky-cloud) 0%, transparent 70%);
  animation: sky-drift linear infinite;
}
.sky { --sky-cloud: rgba(120, 134, 124, .3); }
.sky--rain, .sky--storm { --sky-cloud: rgba(70, 84, 96, .36); }
.sky--cloudy.sky--day { --sky-cloud: rgba(132, 144, 136, .34); }
[data-theme="dark"] .sky { --sky-cloud: rgba(196, 208, 192, .12); }
.sky__cloud:nth-child(1) { width: 70vw; height: 30vh; top: -8vh; animation-duration: 70s; animation-delay: -20s; }
.sky__cloud:nth-child(2) { width: 55vw; height: 26vh; top: 26vh; animation-duration: 95s; animation-delay: -60s; opacity: .85; }
.sky__cloud:nth-child(3) { width: 80vw; height: 32vh; top: 58vh; animation-duration: 120s; animation-delay: -35s; opacity: .7; }
.sky__cloud:nth-child(4) { width: 45vw; height: 22vh; top: 12vh; animation-duration: 85s; animation-delay: -75s; opacity: .6; }

/* Lightning, only in a storm: sky.js lights it now and then. */
.sky__flash { background: radial-gradient(ellipse at 60% 0%, rgba(240, 244, 255, .95), rgba(225, 232, 255, .45) 45%, rgba(225, 232, 255, .2)); opacity: 0; }
.sky__flash.is-on { animation: sky-flash 1.1s ease-out; }

@keyframes sky-turn { to { transform: rotate(360deg); } }
@keyframes sky-breathe { from { transform: scale(1); opacity: .85; } to { transform: scale(1.06); opacity: 1; } }
@keyframes sky-drift { from { transform: translateX(-85vw); } to { transform: translateX(110vw); } }
@keyframes sky-sweep { 0%, 35% { transform: translateX(-60vw) rotate(18deg); } 75%, 100% { transform: translateX(130vw) rotate(18deg); } }
@keyframes sky-haze { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
@keyframes sky-flash { 0% { opacity: 0; } 8% { opacity: .9; } 16% { opacity: .15; } 24% { opacity: .7; } 100% { opacity: 0; } }

/* ---------- Weather chip in the header ---------- */
.lj-header__sky, .gx-top__sky { display: inline-flex; }
.lj-header__sky[hidden], .gx-top__sky[hidden] { display: none; }
.sky-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px;
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, .08)); background: color-mix(in srgb, var(--bg-card, #fff) 70%, transparent);
  color: var(--text-secondary); font-size: .8125rem; line-height: 1; white-space: nowrap;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: sky-chip-in .6s cubic-bezier(.22, 1, .36, 1) both;
}
.sky-chip b { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.sky-chip__icon { width: 22px; height: 22px; flex-shrink: 0; overflow: visible; }
.sky-chip__place { color: var(--text-tertiary); }
@keyframes sky-chip-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Icon motion: the sun turns, drops fall, clouds sway, the bolt blinks. */
.sky-chip__sun { transform-origin: 12px 12px; animation: sky-turn 18s linear infinite; }
.sky-chip__drop { animation: sky-chip-drop 1.1s linear infinite; }
.sky-chip__drop:nth-of-type(2) { animation-delay: .35s; }
.sky-chip__drop:nth-of-type(3) { animation-delay: .7s; }
.sky-chip__cloud { animation: sky-chip-sway 5s ease-in-out infinite alternate; }
.sky-chip__bolt { animation: sky-chip-blink 3.2s steps(1) infinite; }
@keyframes sky-chip-drop { from { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(5px); opacity: 0; } }
@keyframes sky-chip-sway { from { transform: translateX(-1px); } to { transform: translateX(1.5px); } }
@keyframes sky-chip-blink { 0%, 86%, 92%, 100% { opacity: 0; } 88%, 95% { opacity: 1; } }
/* Over the home video the header is see-through: light chip. */
.lj-header--over:not(.is-stuck) .sky-chip { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: rgba(255, 255, 255, .85); }
.lj-header--over:not(.is-stuck) .sky-chip b { color: #fff; }
.lj-header--over:not(.is-stuck) .sky-chip__place { color: rgba(255, 255, 255, .7); }
/* Phones and tablets: icon and temperature only. Small desktops
   (1024 to 1279 px) have the full menu and no room left: no chip in the
   site header there. The admin bar always has room. */
@media (max-width: 1279px) {
  .lj-header .sky-chip { padding: 0 9px 0 6px; }
  .lj-header .sky-chip__label, .lj-header .sky-chip__place { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .lj-header__sky { display: none !important; } }
@media (max-width: 767px) { .gx-top .sky-chip__label, .gx-top .sky-chip__place { display: none; } .gx-top .sky-chip { padding: 0 9px 0 6px; } }
@media (max-width: 359px) { .lj-header__sky { display: none !important; } }

/* ---------- Christmas: garland of lights along the header ---------- */
.sky-garland { position: absolute; left: 0; right: 0; bottom: -7px; height: 14px; pointer-events: none; z-index: 2; overflow: hidden; }
.sky-garland::before {
  content: ''; position: absolute; left: 0; right: 0; top: 2px; height: 8px;
  background: radial-gradient(ellipse 18px 7px at 17px 0, transparent 82%, rgba(60, 74, 52, .55) 84%, rgba(60, 74, 52, .55) 98%, transparent 100%) 0 0 / 34px 8px repeat-x;
}
[data-theme="dark"] .sky-garland::before { background-image: radial-gradient(ellipse 18px 7px at 17px 0, transparent 82%, rgba(200, 210, 190, .4) 84%, rgba(200, 210, 190, .4) 98%, transparent 100%); }
.sky-garland__bulb {
  position: absolute; top: 5px; width: 6px; height: 9px; margin-left: -3px; border-radius: 45% 45% 50% 50%;
  background: var(--bulb); box-shadow: 0 0 6px 1px var(--bulb);
  animation: sky-twinkle 2.6s ease-in-out infinite alternate;
}
.sky-garland__bulb::before { content: ''; position: absolute; top: -2px; left: 1.5px; width: 3px; height: 3px; border-radius: 1px; background: rgba(60, 74, 52, .8); }
.sky-garland__bulb--a { --bulb: #C8402E; }
.sky-garland__bulb--b { --bulb: #E2B23E; }
.sky-garland__bulb--c { --bulb: #8FB07A; }
.sky-garland__bulb--d { --bulb: #F4EFD8; }
@keyframes sky-twinkle { 0%, 40% { opacity: 1; filter: brightness(1.15); } 100% { opacity: .35; filter: brightness(.8); box-shadow: 0 0 2px 0 var(--bulb); } }
.gx-top { position: relative; }

/* ---------- Christmas: greeting ribbon ---------- */
.sky-banner {
  position: fixed; z-index: 160; left: 50%; bottom: calc(var(--tabbar-h, 54px) + env(safe-area-inset-bottom, 0px) + 14px);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(560px, calc(100vw - 24px));
  padding: 10px 10px 10px 16px; border-radius: 16px;
  background: #2C3A25; color: #F7F5EF; box-shadow: 0 18px 40px -16px rgba(20, 28, 16, .55);
  font-size: .875rem; line-height: 1.45;
  transform: translate(-50%, 140%); opacity: 0; transition: transform .7s cubic-bezier(.22, 1, .36, 1), opacity .5s ease;
}
.sky-banner.is-in { transform: translate(-50%, 0); opacity: 1; }
.sky-banner__star { width: 18px; height: 18px; flex-shrink: 0; color: #E2B23E; animation: sky-turn 12s linear infinite; }
.sky-banner__close {
  display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 10px;
  background: rgba(247, 245, 239, .1); color: #F7F5EF; cursor: pointer; font: inherit; font-size: 1.1rem; line-height: 1;
}
.sky-banner__close:hover, .sky-banner__close:focus-visible { background: rgba(247, 245, 239, .22); }
@media (min-width: 1024px) { .sky-banner { bottom: 24px; } }

/* ---------- Quieter season (Strata) ----------
   The weather and Christmas layers sit under the brand, not over it:
   a cooler, fainter sun so the white page stays white; a fine garland
   of small warm lights; a small greeting that leaves by itself. */
.sky--clear.sky--day .sky__tint { background: linear-gradient(200deg, rgba(255, 226, 170, .035), rgba(255, 226, 170, 0) 50%); }
.sky--clear.sky--day .sky__sun { opacity: .45; }
[data-theme="dark"] .sky--clear.sky--day .sky__sun { opacity: .3; }
.sky__sun::after { opacity: .4; }
.sky--clear.sky--day .sky__sweep { opacity: .35; }

.sky-garland { bottom: -5px; height: 10px; opacity: .8; }
.sky-garland::before {
  top: 1px; height: 6px;
  background: radial-gradient(ellipse 28px 6px at 28px 0, transparent 86%, rgba(255, 255, 255, .22) 88%, rgba(255, 255, 255, .22) 97%, transparent 100%) 0 0 / 56px 6px repeat-x;
}
[data-theme="dark"] .sky-garland::before { background-image: radial-gradient(ellipse 28px 6px at 28px 0, transparent 86%, rgba(255, 255, 255, .18) 88%, rgba(255, 255, 255, .18) 97%, transparent 100%); }
.sky-garland__bulb { top: 4px; width: 4px; height: 6px; margin-left: -2px; box-shadow: 0 0 4px 0 var(--bulb); }
.sky-garland__bulb::before { display: none; }
.sky-garland__bulb--a { --bulb: #F3D9A8; }
.sky-garland__bulb--b { --bulb: #E3974A; }
.sky-garland__bulb--c { --bulb: #7FCB92; }
.sky-garland__bulb--d { --bulb: #FFF6E2; }
@keyframes sky-twinkle { 0%, 50% { opacity: .95; } 100% { opacity: .45; box-shadow: 0 0 1px 0 var(--bulb); } }

.sky-banner {
  gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; font-size: .8125rem;
  background: rgba(10, 34, 20, .92); color: rgba(242, 245, 241, .9);
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  max-width: min(420px, calc(100vw - 24px));
}
.sky-banner__star { width: 14px; height: 14px; color: #E3974A; animation-duration: 24s; }
.sky-banner__close { position: relative; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: rgba(242, 245, 241, .8); }
.sky-banner__close::after { content: ''; position: absolute; inset: -7px; }
.sky-banner { bottom: calc(var(--tabbar-h, 54px) + 30px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .sky-banner { bottom: 24px; } }

/* ---------- Motion off: the scene stays, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .sky__sun::before, .sky__sun::after, .sky__sweep::before, .sky--fog .sky__tint, .sky__cloud, .sky-chip, .sky-chip__sun, .sky-chip__drop, .sky-chip__cloud, .sky-chip__bolt, .sky-garland__bulb, .sky-banner__star { animation: none; }
  .sky-chip__drop, .sky-chip__bolt { opacity: 1; }
  .sky__cloud:nth-child(1) { transform: translateX(10vw); }
  .sky__cloud:nth-child(2) { transform: translateX(55vw); }
  .sky__cloud:nth-child(3) { transform: translateX(30vw); }
  .sky-banner { transition: opacity .3s ease; transform: translate(-50%, 0); }
}
