/* DAYBREAK styles: registered properties for smooth colour transitions, the sky scene, the time widget and the ambient wash. */
@property --sky-top { syntax: '<color>'; inherits: true; initial-value: #03050c; }
@property --sky-mid { syntax: '<color>'; inherits: true; initial-value: #070b1a; }
@property --sky-bot { syntax: '<color>'; inherits: true; initial-value: #0f1630; }
@property --sun-c { syntax: '<color>'; inherits: true; initial-value: #ff9c4a; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #05070f; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: #0a0f1d; }
@property --ink-3 { syntax: '<color>'; inherits: true; initial-value: #111a2f; }
@property --gold { syntax: '<color>'; inherits: true; initial-value: #e8b04b; }
@property --sun-x { syntax: '<number>'; inherits: true; initial-value: 50; }
@property --sun-y { syntax: '<number>'; inherits: true; initial-value: 90; }
@property --moon-x { syntax: '<number>'; inherits: true; initial-value: 50; }
@property --moon-y { syntax: '<number>'; inherits: true; initial-value: 90; }
@property --stars { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --dl { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --px { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --py { syntax: '<number>'; inherits: true; initial-value: 0; }

/* smooth drift when the minute ticks over or the visitor scrubs the sky */
:root { transition: --sky-top 1.2s linear, --sky-mid 1.2s linear, --sky-bot 1.2s linear, --ink 1.2s linear, --ink-2 1.2s linear, --ink-3 1.2s linear, --gold 1.2s linear, --sun-x 1.2s linear, --sun-y 1.2s linear, --moon-x 1.2s linear, --moon-y 1.2s linear, --stars 1.2s linear, --dl 1.2s linear, --sun-c 1.2s linear; }
body { background: var(--ink); }

/* ambient light: a soft wash from where the sun actually is */
body::before { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(80% 60% at calc(var(--sun-x) * 1%) -10%, var(--wash-strong, transparent), transparent 70%), linear-gradient(180deg, var(--wash, transparent), transparent 40%); mix-blend-mode: screen; }
:root[data-theme="light"] body::before { mix-blend-mode: multiply; opacity: .5; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at calc(var(--sun-x) * 1%) 0%, var(--wash-strong, transparent), transparent 72%); pointer-events: none; }
:root:not([data-theme="light"]) .site-header.is-stuck { background: color-mix(in srgb, var(--ink) 78%, transparent); }
svg.art, .illus svg { filter: hue-rotate(var(--tod-hue, 0deg)) saturate(var(--tod-sat, 1)) brightness(var(--tod-bri, 1)); transition: filter 1.2s linear; }
.preloader__panel--top { background: linear-gradient(180deg, color-mix(in srgb, var(--sky-top) 45%, var(--ink)), var(--ink)); }
.preloader__panel--bot { background: linear-gradient(0deg, color-mix(in srgb, var(--sky-bot) 30%, var(--ink)), var(--ink)); }

/* ---------- the scene ---------- */
.sky-scene { width: 100%; height: 100%; display: block; }
.sky-scene .sk-sun-pos { transform: translate(calc(var(--sun-x) * 16px), calc(var(--sun-y) * 9px)); opacity: var(--sun-op, 1); }
.sky-scene .sk-sun-pos .sun-halo { transform: scale(var(--sun-scale, 1)); transition: transform 1.2s linear; }
.sky-scene .sk-moon-pos { transform: translate(calc(var(--moon-x) * 16px), calc(var(--moon-y) * 9px)); opacity: var(--moon-op, 0); }
.sky-scene .sk-stars { opacity: var(--stars); }
.sky-scene .sk-st circle { fill: #fff; animation: tw 4s ease-in-out infinite; }
.sky-scene .sk-mw circle { fill: #cdd8ff; opacity: .5; }
@keyframes tw { 0%, 100% { opacity: .95; } 50% { opacity: .25; } }
.sky-scene .sun-rays { transform-origin: 0 0; opacity: .12; animation: spin 140s linear infinite; }
.sky-scene .sun-disc { filter: drop-shadow(0 0 30px var(--sun-c)); }
.sky-scene.sun-flare .sun-halo { transform: scale(calc(var(--sun-scale, 1) * 1.25)); }
.sky-scene.sun-flare .sun-rays { opacity: .35; }
.sky-scene .sk-clouds { opacity: var(--cloud-op, .6); }
.sky-scene .cloud { animation: drift 120s linear infinite; }
.sky-scene .cloud.c2 { animation-duration: 180s; animation-delay: -60s; } .sky-scene .cloud.c3 { animation-duration: 150s; animation-delay: -90s; } .sky-scene .cloud.c4 { animation-duration: 210s; animation-delay: -30s; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(1900px); } }
.sky-scene .sk-birds { opacity: var(--bird-op, 0); }
.sky-scene .bird { animation: fly 42s linear infinite; }
@keyframes fly { from { transform: translate(-100px, var(--by, 200px)); } to { transform: translate(1750px, calc(var(--by, 200px) - 70px)); } }
.sky-scene .wing { transform-box: fill-box; transform-origin: center; animation: flap .5s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleY(.45); } }
.sky-scene .sk-shoot { opacity: calc(var(--stars) - .3); animation: shoot 14s ease-in infinite; transform: translate(1300px, 80px); }
@keyframes shoot { 0%, 92% { transform: translate(1300px, 60px); opacity: 0; } 93% { opacity: 1; } 100% { transform: translate(700px, 300px); opacity: 0; } }
.sky-scene .sk-mist.m1 { animation: mist 40s ease-in-out infinite alternate; } .sky-scene .sk-mist.m2 { animation: mist 55s ease-in-out infinite alternate-reverse; }
@keyframes mist { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
.sky-scene .flag { transform-box: fill-box; transform-origin: left center; animation: wave 2.4s ease-in-out infinite; filter: brightness(calc(.55 + .45 * var(--dl) + .15 * var(--stars))); }
@keyframes wave { 0%, 100% { transform: skewY(-5deg) scaleX(1); } 50% { transform: skewY(6deg) scaleX(.9); } }
.sky-scene .lantern { opacity: calc(var(--stars) * .95); transform: translate(var(--lx, 800px), 940px); animation: rise 22s linear infinite; }
@keyframes rise { from { transform: translate(var(--lx), 960px); } to { transform: translate(calc(var(--lx) + 90px), -60px); } }
.sky-scene .lantern--click { opacity: 1; animation: none; }
.sky-scene .lantern--click .lan-in { animation: rise2 9s ease-in forwards; }
@keyframes rise2 { to { transform: translate(60px, -1100px) scale(.5); opacity: 0; } }
.sky-scene.is-paused * { animation-play-state: paused !important; }
/* parallax layers follow the pointer */
.sky-scene [class*="par-"] { will-change: transform; }
.sky-scene .par-1 { transform: translate(calc(var(--px) * -4px), calc(var(--py) * -3px)); }
.sky-scene .par-2 { transform: translate(calc(var(--px) * -8px), calc(var(--py) * -5px)); }
.sky-scene .par-3 { transform: translate(calc(var(--px) * -14px), calc(var(--py) * -6px)); }
.sky-scene .par-4 { transform: translate(calc(var(--px) * -20px), calc(var(--py) * -7px)); }
.sky-scene .par-5 { transform: translate(calc(var(--px) * -28px), calc(var(--py) * -8px)); }
.sky-scene .par-6 { transform: translate(calc(var(--px) * -38px), calc(var(--py) * -9px)); }
.sky-scene .par-7 { transform: translate(calc(var(--px) * -50px), calc(var(--py) * -10px)); }
.sky-scene .par-8 { transform: translate(calc(var(--px) * -64px), calc(var(--py) * -12px)); }

/* hero legibility scrim follows daylight so text stays readable at noon */
.hm-hero__bg::after { background: linear-gradient(90deg, rgba(5, 7, 15, var(--tod-scrim, .5)) 0%, rgba(5, 7, 15, calc(var(--tod-scrim, .5) * .45)) 55%, transparent 90%), linear-gradient(180deg, transparent 55%, var(--ink) 99%) !important; }

/* ---------- time widget ---------- */
.sky-widget { position: absolute; left: var(--gutter); bottom: 2.2rem; z-index: 4; display: grid; gap: .5rem; width: min(300px, calc(100vw - 2 * var(--gutter))); padding: .9rem 1.1rem 1rem; border: 1px solid var(--line-2); border-radius: 18px; background: color-mix(in srgb, var(--ink) 60%, transparent); backdrop-filter: blur(14px); font-size: .8rem; }
.sky-widget__row { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.sky-widget [data-sky-time] { font: 500 1.6rem/1 var(--font-display); color: var(--gold); font-variant-numeric: tabular-nums; }
.sky-widget [data-sky-phase] { font: 500 .66rem/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.sky-widget input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; outline-offset: 6px; background: linear-gradient(90deg, #070b1e 0%, #4b3a78 22%, #ffcf8a 28%, #78b2f2 50%, #ffc46b 72%, #c8507a 77%, #3a2a6a 82%, #050818 100%); }
.sky-widget input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); cursor: grab; }
.sky-widget input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); cursor: grab; }
.sky-widget [data-sky-live] { justify-self: start; font: 600 .62rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); padding: .35rem .7rem; border: 1px solid var(--line-2); border-radius: 999px; }
.sky-widget [data-sky-live].is-on { color: #1a1205; background: var(--gold); border-color: var(--gold); }
@media (max-width: 720px) { .sky-widget { position: static; margin: 0 var(--gutter) 1rem; width: auto; } }
@media (prefers-reduced-motion: reduce) { .sky-scene * { animation: none !important; } :root { transition: none; } }

.has-cursor .cursor, .has-cursor .cursor-dot { opacity: 0; }
.has-cursor.cursor-live .cursor, .has-cursor.cursor-live .cursor-dot { opacity: 1; }

/* ---------- Heroes are always dark scenes, in BOTH themes ----------
   (fixes dark-on-dark text when a visitor is in the light theme) */
:root[data-theme="light"] .hm-hero,
:root[data-theme="light"] .page-hero {
  --ink: #05070f; --ink-2: #0a0f1d; --ink-3: #111a2f;
  --text: #eaeefa; --text-2: #c4cde2; --mute: #9aa6c0;
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .18);
  --glass: rgba(255, 255, 255, .05); --glass-2: rgba(255, 255, 255, .09);
  --gold: #f0c068; --gold-2: #f6d58e;
  color: var(--text);
}
:root[data-theme="light"] .hm-hero .btn--ghost { color: var(--text); border-color: var(--line-2); }
:root[data-theme="light"] .hm-hero .btn--ghost::before { background: var(--text); }
:root[data-theme="light"] .hm-hero .btn--ghost:hover { color: #05070f; }
/* soften the hand-off from the dark hero to the light page */
:root[data-theme="light"] .hm-hero__bg::after { background: linear-gradient(90deg, rgba(5, 7, 15, var(--tod-scrim, .5)) 0%, rgba(5, 7, 15, calc(var(--tod-scrim, .5) * .45)) 55%, transparent 90%), linear-gradient(180deg, transparent 70%, rgba(5, 7, 15, .9) 100%) !important; }
:root[data-theme="light"] .page-hero::after { background: linear-gradient(180deg, rgba(5, 7, 15, .35), rgba(5, 7, 15, .92)); }
/* the header sits on the dark hero until the visitor scrolls */
:root[data-theme="light"] body.has-dark-hero .site-header:not(.is-stuck) { --text: #eaeefa; --text-2: #c4cde2; --line-2: rgba(255, 255, 255, .2); --glass-2: rgba(255, 255, 255, .1); color: var(--text); }
:root[data-theme="light"] body.has-dark-hero .site-header:not(.is-stuck) .brand { color: #eaeefa; }
:root[data-theme="light"] body.has-dark-hero .site-header:not(.is-stuck) .brand small { color: #9aa6c0; }
:root[data-theme="light"] .hm-chip { background: rgba(5, 7, 15, .55); }
:root[data-theme="light"] .sky-widget { background: rgba(5, 7, 15, .6); }
.greet { color: var(--gold); }

/* ---------- the great range ---------- */
.sky-scene .shade-l, .sky-scene .snow-shade-l { opacity: var(--shade-l, .5); transition: opacity 1.2s linear; }
.sky-scene .shade-r, .sky-scene .snow-shade-r { opacity: var(--shade-r, .5); transition: opacity 1.2s linear; }
.sky-scene .snow-shade-l, .sky-scene .snow-shade-r { filter: none; }
.sky-scene .plume { animation: plume 18s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: left center; opacity: calc(.55 + var(--dl) * .45); }
@keyframes plume { from { transform: scaleX(.8) skewY(-2deg); } to { transform: scaleX(1.15) skewY(2deg); } }
.sky-scene .gompa-win { opacity: calc(var(--stars) * .95); animation: tw 5s ease-in-out infinite; filter: drop-shadow(0 0 6px #ffc46b); }
