/* The sky (assets/js/sky.js). */
@property --pale-a { syntax: '<color>'; inherits: true; initial-value: #fde9cf; }
@property --pale-b { syntax: '<color>'; inherits: true; initial-value: #e3ebff; }
:root[data-sky] .corona { transition: opacity 1.4s var(--ease); }
:root[data-sky]:not([data-sky="fixed"]) .corona { opacity: var(--sky-glow, 1); }

/* The sun sits on the rim of the disc, half behind it, under the words. It rides with the ring (site.js). */
.sun { position: absolute; z-index: 3; inset: -9%; border-radius: 50%; pointer-events: none; will-change: transform;
  --sc: var(--sun-c, #ffc65c);
  background:
    radial-gradient(circle 2.6vw at var(--sun-x, 50%) var(--sun-y, 8%), color-mix(in srgb, var(--sc) 70%, white) 0, var(--sc) 80%, transparent 100%),
    radial-gradient(circle 16vw at var(--sun-x, 50%) var(--sun-y, 8%), color-mix(in srgb, var(--sc) 75%, transparent) 0, color-mix(in srgb, var(--sc) 40%, transparent) 14%,
      color-mix(in srgb, var(--sc) 16%, transparent) 40%, color-mix(in srgb, var(--sc) 5%, transparent) 70%, transparent 100%);
  opacity: var(--sun-a, 0); transition: opacity 1.4s var(--ease); }
/* The light above the horizon. The disc covers everything below it. */
.sky-wash { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, var(--wash, transparent) 30%, color-mix(in srgb, var(--wash, transparent) 45%, transparent) 46%, transparent 72%);
  opacity: var(--wash-a, 0); }
:root[data-sky="fixed"] :is(.sun, .sky-wash) { opacity: 0; }
/* The sun only comes out with the time bar. */
/* Off the page entirely when it's not out, so the huge layer costs nothing. */
:root:not(.sun-on) .sun { display: none; }

/* ───────── The toggle in Sky mode ─────────
   Same icon and slide, but the ring takes the sky's colours and the moon covers as much of the disc as the
   sky is dark, so dusk and dawn show a crescent. */
:root[data-mode="sky"] .tt-ring { background: conic-gradient(from 0deg, var(--p1), var(--p2), var(--p3), var(--p4), var(--p5), var(--p6), var(--p1)); }
:root[data-mode="sky"] .tt-moon { transform: translateX(var(--moon-x, -115%)); }
/* The moon keeps sliding while the theme's umbra spreads (everything else holds still for it). */
.theme-switching .tt-moon { transition: transform .8s var(--ease-io) !important; }
/* Back to the sky: the day runs through in under two seconds (sky.js). Nothing eases behind it,
   the ring spins once and a glow in the sky's colours blooms out of the icon. */
/* Everything eases briefly behind the sweep, so the text and page never snap when light and dark cross. */
.sky-sweep *, .sky-sweep *::before, .sky-sweep *::after { transition-duration: .35s !important; transition-delay: 0s !important; }
.sky-sweep .tt-ring { animation: tt-spin 3.4s var(--ease-io); }
.tt::after { content: ""; position: absolute; z-index: -1; inset: -4px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: conic-gradient(from 0deg, var(--p1), var(--p2), var(--p3), var(--p4), var(--p5), var(--p6), var(--p1)); filter: blur(7px); }
.sky-sweep .tt::after { animation: tt-bloom 3.4s var(--ease-io); }
@keyframes tt-spin { to { rotate: 1turn; } }
@keyframes tt-bloom { 0% { opacity: 0; scale: .5; } 45% { opacity: .75; scale: 1.5; } 100% { opacity: 0; scale: 2.2; } }

/* ───────── The full stop ───────── */
.sky-dot { cursor: pointer; border-radius: 50%; outline: none; transition: color .5s var(--ease), text-shadow .6s var(--ease); }
.sky-dot:hover, .sky-dot:focus-visible { color: var(--p2, #ff6a1a); text-shadow: 0 0 .3em color-mix(in srgb, var(--p2, #ff6a1a) 70%, transparent); }
:root.sun-on .sky-dot { color: var(--sun-c, #ffc65c); }

/* ───────── The toggle's hint ───────── */
.tt-hint { position: absolute; top: calc(100% + 10px); right: -4px; display: grid; gap: 3px; justify-items: end; padding: 8px 12px; border-radius: 12px;
  font-size: 12px; line-height: 1.2; white-space: nowrap; color: var(--ink); pointer-events: none;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  opacity: 0; translate: 0 -4px; transition: opacity .3s var(--ease), translate .4s var(--ease); }
.tt-hint b { font-weight: 500; }
.tt-hint small { font-size: 11px; color: var(--whisper); }
@media (hover: hover) { .theme-toggle:hover .tt-hint { opacity: 1; translate: 0 0; transition-delay: .35s; } }
.theme-toggle:focus-visible .tt-hint { opacity: 1; translate: 0 0; }

/* ───────── The time bar ─────────
   One frosted tile with no stroke, the same glass as the nav and the Shipped street's buttons. */
.sky-bar { position: fixed; z-index: 120; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: min(540px, calc(100vw - 24px)); translate: -50% 24px;
  display: grid; gap: 8px; padding: 10px 10px 8px; border-radius: 30px; corner-shape: squircle; font: 400 14px/1 var(--sans); letter-spacing: -.005em; color: var(--ink);
  background: rgb(243 247 252 / .55); box-shadow: 0 16px 50px rgb(20 40 80 / .16);
  -webkit-backdrop-filter: blur(20px) saturate(1.8) brightness(1.1); backdrop-filter: blur(20px) saturate(1.8) brightness(1.1);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), translate .55s var(--ease), visibility 0s .55s; }
[data-theme="dark"] .sky-bar { background: rgb(34 54 100 / .5); }
@supports not (corner-shape: squircle) { .sky-bar { border-radius: 24px; } }
.sky-bar.is-open { opacity: 1; visibility: visible; translate: -50% 0; transition: opacity .35s var(--ease), translate .55s cubic-bezier(.2, .9, .25, 1); }
.sky-bar button, .sb-board { flex: none; display: inline-grid; place-items: center; height: 34px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; transition: background-color .2s var(--ease), color .2s var(--ease), scale .2s var(--ease); }
.sky-bar button:hover, .sb-board:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.sky-bar button:active { scale: .96; }
.sky-bar button[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.sky-bar svg { width: 12px; height: 12px; }
.sb-top { display: flex; align-items: center; gap: 4px; }
.sky-bar .sb-play, .sky-bar .sb-close { width: 34px; padding: 0; }
.sky-bar .sb-play { color: var(--bg); background: var(--ink); }
.sky-bar .sb-play:hover { color: var(--bg); background: var(--ink); }
.sb-read { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding-left: 8px; overflow: hidden; line-height: 1.5; color: var(--ink-2); white-space: nowrap; }
/* Every digit is the same width and the clock's box never changes size, so nothing beside it moves. */
.sb-clock { flex: none; width: 4.4em; font-size: 16px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sb-name { overflow: hidden; text-overflow: ellipsis; }
.sb-name.is-new { animation: sb-name .45s var(--ease); }
@keyframes sb-name { from { opacity: 0; translate: 0 3px; } }
.sb-now[hidden] { display: none !important; }
.sb-stages { display: flex; justify-content: space-between; gap: 2px; overflow-x: auto; scrollbar-width: none; font-size: 13px; }
.sb-stages::-webkit-scrollbar { display: none; }
.sky-bar .sb-stages button { height: 30px; padding: 0 9px; }
/* The scrubber is the day drawn out: the sun's path over a horizon line, the sun (or the moon, under the line) on
   it where the time is. The real slider lies over it, invisible, so it drags and works from the keyboard. */
.sb-path { position: relative; height: 64px; margin: 0 10px; }
.sb-path svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; }
.sb-curve { stroke: color-mix(in srgb, var(--ink) 34%, transparent); stroke-width: 1.5; stroke-dasharray: 1 5; vector-effect: non-scaling-stroke; }
.sb-hz { stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sb-orb { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none;
  background: #ffb347; box-shadow: 0 0 0 4px rgb(255 179 71 / .22), 0 0 18px rgb(255 160 60 / .7); transition: background-color .4s var(--ease), box-shadow .4s var(--ease), scale .2s var(--ease); }
.sb-orb.is-moon { background: #eef1fb; box-shadow: 0 0 0 4px rgb(220 228 255 / .16), 0 0 14px rgb(200 214 255 / .5); }
.sb-path:active .sb-orb { scale: 1.2; }
.sky-bar input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: grab; }
.sky-bar input[type="range"]:active { cursor: grabbing; }
.sb-path:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--ink) 40%, transparent); outline-offset: 2px; border-radius: 12px; }
@media (max-width: 520px) { .sb-stages { justify-content: flex-start; } .sb-board { display: none; } }

@media (pointer: coarse) {
  .sky-bar { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .sky-bar button, .sky-bar .sb-stages button { min-height: 44px; }
  .sky-bar .sb-play, .sky-bar .sb-close { width: 44px; }
  .sb-stages { flex-wrap: wrap; }
}
