/* sky.css — behind every sign-in style card the backdrop is the hour of the
   day (2026-11-17; design review proposal 5 — the owner picked option B
   from four drawn options and "radiating light" from a moving sketch, saw
   the real screens both ways and kept it; the floating dust stays).

   The idea of the product is that a day has four phases. The page says it
   with colour alone: the morning's amber with the sun rising, the noon's
   blue with the sun high, the evening's purple with the sun setting, the
   night's navy with the moon and a few stars. The card does not change.

   WHAT MOVES (and only for a person who did not ask their device for less
   motion — everyone else gets the same picture, still):
     1. once, when the page opens: the sun or moon glides 76px into its place
        and fades in, over 1.8 seconds;
     2. then, for as long as the page is open: a soft ring leaves the disc's
        edge every 3.3 seconds, grows to one and a half times the disc and
        fades to nothing over 10 seconds;
     3. at night the stars brighten and dim, in three groups, each at its
        own pace.
   Only size and transparency are animated, so the browser draws it without
   laying the page out again.

   THE SWITCH: every rule below waits for <html data-sky="…">, which only
   templates/_sky.html sets, and that file and this one are both behind SKY
   in app/__init__.py. With SKY off the pages show the photo as before. */

/* ---- the four skies: light ---- */
html[data-sky="morning"] {
  --sky: linear-gradient(180deg, #FFF3D4 0%, #FBDA94 55%, #F2B552 100%);
  --sky-disc: linear-gradient(180deg, #FFFDF2 0%, #FFF0BF 50%);
  --sky-ring: 255, 255, 255; --sky-glow: .34;
}
html[data-sky="noon"] {
  --sky: linear-gradient(180deg, #5FB0E6 0%, #A9D6F3 55%, #DCEEFA 100%);
  --sky-disc: linear-gradient(0deg, #FFFFFF 0%, #FFFBE6 50%);
  --sky-ring: 255, 255, 255; --sky-glow: .34;
}
html[data-sky="evening"] {
  --sky: linear-gradient(180deg, #4B2F96 0%, #8A4CB4 40%, #D4739F 74%, #F5A77E 100%);
  --sky-disc: linear-gradient(180deg, #FFE7C2 0%, #FFB98A 50%);
  --sky-ring: 255, 206, 170; --sky-glow: .30;
}
html[data-sky="night"] {
  --sky: linear-gradient(180deg, #111837 0%, #1C2857 55%, #2E3F7E 100%);
  --sky-disc: linear-gradient(0deg, #F4F6FF 0%, #DCE3FA 50%);
  --sky-ring: 200, 212, 255; --sky-glow: .16;
}
/* ---- the four skies: dark (the sun and the moon are dimmed: nothing glares) ---- */
html[data-theme="dark"][data-sky="morning"] {
  --sky: linear-gradient(180deg, #1C1307 0%, #45290A 55%, #7E5212 100%);
  --sky-disc: linear-gradient(180deg, #E3AE55 0%, #B97C24 50%);
  --sky-ring: 255, 196, 110; --sky-glow: .24;
}
html[data-theme="dark"][data-sky="noon"] {
  --sky: linear-gradient(180deg, #1B5380 0%, #123656 50%, #0A2036 100%);
  --sky-disc: linear-gradient(0deg, #8DC0E6 0%, #5B9ACB 50%);
  --sky-ring: 170, 214, 245; --sky-glow: .22;
}
html[data-theme="dark"][data-sky="evening"] {
  --sky: linear-gradient(180deg, #130B2E 0%, #361A50 45%, #693154 78%, #915040 100%);
  --sky-disc: linear-gradient(180deg, #DB8E62 0%, #B26440 50%);
  --sky-ring: 255, 170, 130; --sky-glow: .22;
}
html[data-theme="dark"][data-sky="night"] {
  --sky: linear-gradient(180deg, #060918 0%, #0C122B 55%, #162045 100%);
  --sky-disc: linear-gradient(0deg, #A3AEDB 0%, #7B88C2 50%);
  --sky-ring: 180, 195, 255; --sky-glow: .13;
}

/* ---- the backdrop: the sky takes the photo's place ---- */
html[data-sky] .login-wrap { background: var(--sky); }
.sky { display: none; }
html[data-sky] .sky { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

/* ---- the sun and the moon: one disc, centred, half of it past the edge ---- */
.sky-sun {
  --sky-size: min(760px, 170vw);
  position: absolute; left: calc(50% - var(--sky-size) / 2);
  width: var(--sky-size); height: var(--sky-size);
}
html[data-sky="morning"] .sky-sun { bottom: calc(var(--sky-size) * -.5); --sky-from: 76px; }    /* rising */
html[data-sky="noon"] .sky-sun    { top: calc(var(--sky-size) * -.5); --sky-from: -76px; }      /* high */
html[data-sky="evening"] .sky-sun { bottom: calc(var(--sky-size) * -.68); --sky-from: -76px; }  /* setting */
html[data-sky="night"] .sky-sun   { --sky-size: min(520px, 120vw); top: calc(var(--sky-size) * -.5); --sky-from: -76px; }
.sky-disc, .sky-ring { position: absolute; inset: 0; border-radius: 50%; }
.sky-disc { background: var(--sky-disc); }
/* Still, the three rings stand at three distances from the disc — this is
   the whole picture for a person who asked for less motion. */
.sky-ring { background: rgb(var(--sky-ring)); }
.sky-ring:nth-child(1) { transform: scale(1.46); opacity: calc(var(--sky-glow) * .2); }
.sky-ring:nth-child(2) { transform: scale(1.27); opacity: calc(var(--sky-glow) * .4); }
.sky-ring:nth-child(3) { transform: scale(1.12); opacity: calc(var(--sky-glow) * .65); }

/* ---- the stars: the night's only ---- */
.sky-stars, .sky-stars::before, .sky-stars::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%;
}
.sky-stars { display: none; }
html[data-sky="night"] .sky-stars { display: block; }
.sky-stars { box-shadow:
    49.0vw 56.1vh 0 0 rgba(255, 255, 255, 0.57),
    44.3vw 50.6vh 0 0 rgba(255, 255, 255, 0.89),
    58.9vw 41.1vh 0 0 rgba(255, 255, 255, 0.84),
    65.7vw 7.7vh 0 0 rgba(255, 255, 255, 0.57),
    67.2vw 15.8vh 0 0 rgba(255, 255, 255, 0.69),
    17.6vw 5.0vh 0 .5px rgba(255, 255, 255, 0.93),
    12.1vw 44.4vh 0 .5px rgba(255, 255, 255, 0.54),
    41.9vw 55.0vh 0 .5px rgba(255, 255, 255, 0.59),
    17.0vw 98.6vh 0 0 rgba(255, 255, 255, 0.57),
    54.7vw 33.0vh 0 0 rgba(255, 255, 255, 0.84),
    35.2vw 35.0vh 0 0 rgba(255, 255, 255, 0.91),
    23.9vw 88.4vh 0 0 rgba(255, 255, 255, 0.57); }
.sky-stars::before { box-shadow:
    84.0vw 77.7vh 0 .5px rgba(255, 255, 255, 0.60),
    92.8vw 82.2vh 0 0 rgba(255, 255, 255, 0.60),
    6.2vw 89.9vh 0 0 rgba(255, 255, 255, 0.49),
    85.8vw 36.7vh 0 0 rgba(255, 255, 255, 0.86),
    89.8vw 10.3vh 0 0 rgba(255, 255, 255, 0.61),
    94.5vw 39.0vh 0 0 rgba(255, 255, 255, 0.56),
    84.0vw 47.5vh 0 0 rgba(255, 255, 255, 0.93),
    5.2vw 79.1vh 0 0 rgba(255, 255, 255, 0.54),
    90.2vw 84.4vh 0 0 rgba(255, 255, 255, 0.51),
    45.2vw 76.9vh 0 .5px rgba(255, 255, 255, 0.65),
    5.9vw 55.4vh 0 0 rgba(255, 255, 255, 0.73),
    60.0vw 92.8vh 0 .5px rgba(255, 255, 255, 0.66); }
.sky-stars::after { box-shadow:
    48.8vw 6.7vh 0 0 rgba(255, 255, 255, 0.62),
    92.0vw 13.4vh 0 0 rgba(255, 255, 255, 0.92),
    44.7vw 54.3vh 0 0 rgba(255, 255, 255, 0.86),
    72.3vw 13.3vh 0 .5px rgba(255, 255, 255, 0.71),
    14.3vw 37.2vh 0 0 rgba(255, 255, 255, 0.94),
    39.8vw 58.3vh 0 0 rgba(255, 255, 255, 0.52),
    69.9vw 82.7vh 0 0 rgba(255, 255, 255, 0.49),
    66.2vw 46.2vh 0 0 rgba(255, 255, 255, 0.95),
    86.8vw 36.5vh 0 0 rgba(255, 255, 255, 0.78),
    8.2vw 81.8vh 0 0 rgba(255, 255, 255, 0.82),
    14.4vw 7.1vh 0 .5px rgba(255, 255, 255, 0.77),
    52.2vw 55.3vh 0 .5px rgba(255, 255, 255, 0.46); }

/* ---- the motion ---- */
@media (prefers-reduced-motion: no-preference) {
  html[data-sky] .sky-sun { animation: sky-arrive 1.8s cubic-bezier(.2, .7, .2, 1) both; }
  html[data-sky] .sky-ring { animation: sky-radiate 10s linear infinite; will-change: transform, opacity; }
  html[data-sky] .sky-ring:nth-child(1) { animation-delay: 0s; }
  html[data-sky] .sky-ring:nth-child(2) { animation-delay: -3.33s; }
  html[data-sky] .sky-ring:nth-child(3) { animation-delay: -6.66s; }
  html[data-sky="night"] .sky-stars { animation: sky-twinkle 5.1s ease-in-out infinite alternate; }
  html[data-sky="night"] .sky-stars::before { animation: sky-twinkle 3.7s ease-in-out -1.2s infinite alternate; }
  html[data-sky="night"] .sky-stars::after { animation: sky-twinkle 6.3s ease-in-out -2.6s infinite alternate; }
}
@keyframes sky-arrive { from { transform: translateY(var(--sky-from)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sky-radiate { from { transform: scale(1); opacity: var(--sky-glow); } to { transform: scale(1.5); opacity: 0; } }
@keyframes sky-twinkle { from { opacity: .3; } to { opacity: 1; } }
