/* The night sky (spec 7.1.1), drawn by tools/night_sky_art.py: its colours from the theme's tokens,
   and its twinkle. Every colour is opaque: a faint star or line is Primary mixed with the page's
   ground, never Primary seen through. With "reduce motion", the sky stands still. */
.sky {
  display: block;
  --sky-star: var(--bluewell-primary);
  --sky-ground: var(--bluewell-paper);
  /* the twinkle's tone: Primary drawn toward the text colour (deeper on paper, lighter on a dark ground) */
  --sky-bright: color-mix(in srgb, var(--bluewell-primary) 60%, var(--bluewell-ink));
}
/* stars, by brightness: .s0 full Primary to .s5 the faintest */
.sky .s0 { --base: var(--sky-star); }
.sky .s1 { --base: color-mix(in srgb, var(--sky-star) 90%, var(--sky-ground)); }
.sky .s2 { --base: color-mix(in srgb, var(--sky-star) 80%, var(--sky-ground)); }
.sky .s3 { --base: color-mix(in srgb, var(--sky-star) 70%, var(--sky-ground)); }
.sky .s4 { --base: color-mix(in srgb, var(--sky-star) 60%, var(--sky-ground)); }
.sky .s5 { --base: color-mix(in srgb, var(--sky-star) 40%, var(--sky-ground)); }
/* the band under a masthead and the clearing round text: the faintest, so letters stay clear */
.sky .sq { --base: color-mix(in srgb, var(--sky-star) 24%, var(--sky-ground)); }
.sky :is(.s0, .s1, .s2, .s3, .s4, .s5, .sq) { fill: var(--base); }
/* the figures: thin lines, the second stroke paler */
.sky .f1, .sky .f2 { fill: none; stroke-linecap: round; }
.sky .f1 { stroke: color-mix(in srgb, var(--sky-star) 38%, var(--sky-ground)); }
.sky .f2 { stroke: color-mix(in srgb, var(--sky-star) 22%, var(--sky-ground)); }
/* the twinkle, slow and quiet: once in its rhythm (14 s) the star brightens and settles again
   over about two seconds, while an open square fades in round it, grows and fades out; the
   brightest stars glint, a diamond behind them, in the same way (spec 2.1: the open square and the
   diamond). Every colour is opaque: fading is a mix toward the ground, and outside its moment a
   ring is hidden. 48 stars, each at its own moment, so seven or eight twinkle at a time, overlapping,
   never in step. */
.sky { --sky-dim: color-mix(in srgb, var(--sky-bright) 18%, var(--sky-ground)); }
.sky .ring { fill: none; stroke: var(--sky-dim); stroke-width: 0.8; visibility: hidden;
  transform-box: fill-box; transform-origin: center; }
.sky .glint { fill: var(--sky-dim); visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .sky .tw { animation: sky-star var(--t) ease-in-out var(--o) infinite; }
  .sky .ring { animation: sky-ring var(--t) ease-in-out var(--o) infinite; }
  .sky .glint { animation: sky-glint var(--t) ease-in-out var(--o) infinite; }
}
@keyframes sky-star { 0%, 80%, 97%, 100% { fill: var(--base); } 87% { fill: var(--sky-bright); } }
@keyframes sky-ring {
  0%, 79.9% { visibility: hidden; transform: scale(1); stroke: var(--sky-dim); }
  80% { visibility: visible; transform: scale(1); stroke: var(--sky-dim); }
  87% { stroke: var(--sky-bright); }
  96% { visibility: visible; transform: scale(1.8); stroke: var(--sky-dim); }
  96.1%, 100% { visibility: hidden; transform: scale(1.8); stroke: var(--sky-dim); }
}
@keyframes sky-glint {
  0%, 81.9% { visibility: hidden; fill: var(--sky-dim); }
  82% { visibility: visible; fill: var(--sky-dim); }
  87% { fill: var(--sky-bright); }
  93% { visibility: visible; fill: var(--sky-dim); }
  93.1%, 100% { visibility: hidden; fill: var(--sky-dim); }
}
/* the 48 moments (tools/night_sky_art.py TIMINGS): one rhythm of 14 s for every star, each starting
   14/48 s after the last, so a twinkle begins every 0.29 s somewhere in the sky and seven or eight
   are always under way, overlapping. Rhythms of different lengths drift into step and bunch up. */
.sky { --t: 14s; }
.sky .t0 { --o: -0.00s; }         .sky .t1 { --o: -0.29s; }         .sky .t2 { --o: -0.58s; }         .sky .t3 { --o: -0.88s; }
.sky .t4 { --o: -1.17s; }         .sky .t5 { --o: -1.46s; }         .sky .t6 { --o: -1.75s; }         .sky .t7 { --o: -2.04s; }
.sky .t8 { --o: -2.33s; }         .sky .t9 { --o: -2.62s; }         .sky .t10 { --o: -2.92s; }        .sky .t11 { --o: -3.21s; }
.sky .t12 { --o: -3.50s; }        .sky .t13 { --o: -3.79s; }        .sky .t14 { --o: -4.08s; }        .sky .t15 { --o: -4.38s; }
.sky .t16 { --o: -4.67s; }        .sky .t17 { --o: -4.96s; }        .sky .t18 { --o: -5.25s; }        .sky .t19 { --o: -5.54s; }
.sky .t20 { --o: -5.83s; }        .sky .t21 { --o: -6.12s; }        .sky .t22 { --o: -6.42s; }        .sky .t23 { --o: -6.71s; }
.sky .t24 { --o: -7.00s; }        .sky .t25 { --o: -7.29s; }        .sky .t26 { --o: -7.58s; }        .sky .t27 { --o: -7.88s; }
.sky .t28 { --o: -8.17s; }        .sky .t29 { --o: -8.46s; }        .sky .t30 { --o: -8.75s; }        .sky .t31 { --o: -9.04s; }
.sky .t32 { --o: -9.33s; }        .sky .t33 { --o: -9.62s; }        .sky .t34 { --o: -9.92s; }        .sky .t35 { --o: -10.21s; }
.sky .t36 { --o: -10.50s; }       .sky .t37 { --o: -10.79s; }       .sky .t38 { --o: -11.08s; }       .sky .t39 { --o: -11.38s; }
.sky .t40 { --o: -11.67s; }       .sky .t41 { --o: -11.96s; }       .sky .t42 { --o: -12.25s; }       .sky .t43 { --o: -12.54s; }
.sky .t44 { --o: -12.83s; }       .sky .t45 { --o: -13.12s; }       .sky .t46 { --o: -13.42s; }       .sky .t47 { --o: -13.71s; }
