/* theme-scene.2.css replaces theme-scene.1.css (which stays byte-identical: versioned assets are immutable for a year).
   One change: --ground-dark is the redesign 1121 dark ground #111215 (partner D1 + D13, 2026-11-21T15:01Z: the website dark theme
   follows the new ladder); it was #0A0A0C. The rest of the file is theme-scene.1.css unchanged.

   theme-scene.1.css - the footer's scene card and the eased theme change (assets/theme-control.1.js drives it; assets/theme.2.js is the pick).
   Linked after /styles.css. Colour tokens come from styles.css; the four ground values below are the page background of BOTH themes
   (always present, because the page swaps in the middle of the change) and the two greys either side of the band where no text colour
   is readable. Numbers: design note 2026-11-12 (P:\live-it-up-data\deploy\theme-scene-1112\design.md, sections 4 and 6).
   Only transform, opacity and ONE flat background-color (the body) animate. Never transition: all. */
:root {
  --ground-dark: #111215; /* = --background-primary, dark (a test pins it) */
  --ground-light: #E8ECF0; /* = --background-primary, light (a test pins it) */
  --ground-lo: #707173; /* the dark edge of the band: white text still has 4.5:1 */
  --ground-hi: #838588; /* the light edge of the band: the dark text has 4.5:1 */
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The slot is in every page's footer. With scripts off it is not shown at all; with them on it keeps the card's room from the first paint
   (the drawing is 360 x 104, then the segment row and the caption), so mounting the card moves nothing. */
.theme-slot { display: none; --seg-h: 44px; --gap: 8px; --pad: 4px; flex: 0 0 auto; width: 100%; }
:root[data-theme-js] .theme-slot { display: block; }
:root[data-theme-js] .theme-slot:not(.is-mounted) { padding-bottom: calc(51px + var(--seg-h)); }
:root[data-theme-js] .theme-slot:not(.is-mounted)::before { content: ""; display: block; width: calc(min(100%, 420px) - 2px); margin: 0 auto; aspect-ratio: 360 / 104; }
/* Touch: 48 px high segments and 8 px between them (Android 48 dp, iOS 44 pt; the gap is measured between the label boxes). */
@media (max-width: 767px), (pointer: coarse) { .theme-slot { --seg-h: 48px; } }
/* Under 360 px the "reports no setting" caption can take two lines: both the card and its reservation keep room for them. */
@media (max-width: 359px) { .theme-note { min-height: 58px; } :root[data-theme-js] .theme-slot:not(.is-mounted) { padding-bottom: calc(69px + var(--seg-h)); } }

.theme-pick { width: 100%; max-width: 420px; margin: 0 auto; text-align: left; border: 1px solid var(--border-control); border-radius: 14px; background: var(--background-card); overflow: hidden; }
.theme-scene { position: relative; display: block; width: 100%; aspect-ratio: 360 / 104; }
.theme-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.theme-scene { background: var(--ground-light); } /* the base under the day drawing; the drawings cover it */

/* The scene: the day drawing is the base, the night drawing fades over it (opacity only), the lights are a third layer. */
.scene-dark { opacity: 1; }
:root[data-scene="light"] .scene-dark { opacity: 0; }
.scene-lights { opacity: 1; }
:root[data-scene="light"] .scene-lights { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  /* t=0: the night drawing fades (360 ms, in-out). The lights come on only after the colours have landed (360 ms delay) and go off at once. */
  .theme-scene .scene-dark { transition: opacity 360ms var(--ease-inout); }
  .scene-lights { transition: opacity 140ms var(--ease-out) 360ms; }
  :root[data-scene="light"] .scene-lights { transition: opacity 60ms linear; }

  /* The page ground. One strong curve cubic-bezier(0.77, 0, 0.175, 1) over 360 ms, cut at its half (de Casteljau) into two pieces that
     join without a seam: 172 ms as a transition, 188 ms as an animation. Phase 1 stops at the edge of the unreadable band; phase 2 starts
     at the other edge. The page swaps theme on the transitionend of phase 1 (the step is 18 of 255 levels, once, inside the fastest part). */
  html.theme-turn[data-ground^="pre-"] body { transition: background-color 172ms cubic-bezier(0.803, 0, 0.894, 0.5); }
  html.theme-turn[data-ground="light"] body { animation: ground-from-hi 188ms cubic-bezier(0.097, 0.5, 0.208, 1) both; }
  html.theme-turn[data-ground="dark"] body { animation: ground-from-lo 188ms cubic-bezier(0.097, 0.5, 0.208, 1) both; }
  .theme-seg::before { transition: transform 220ms var(--ease-out); }
}
@keyframes ground-from-hi { from { background-color: var(--ground-hi); } }
@keyframes ground-from-lo { from { background-color: var(--ground-lo); } }
html.theme-turn[data-ground="pre-light"] body { background-color: var(--ground-lo); }
html.theme-turn[data-ground="pre-dark"] body { background-color: var(--ground-hi); }
html.theme-turn[data-ground="dark"] body { background-color: var(--ground-dark); }
html.theme-turn[data-ground="light"] body { background-color: var(--ground-light); }

/* In the swap no element eases its own colour: the site's 200 ms colour rules (links, buttons, cards) would otherwise carry the OLD colour
   across the new ground (measured 1.0:1 on a footer link at the swap frame). The class is added in the SAME task as data-theme and
   removed 80 ms later. Not the body (the ground), the night drawing, the lights or the indicator. */
html.theme-swap *:not(body):not(.scene-dark):not(.scene-lights):not(.theme-seg),
html.theme-swap *:not(.theme-seg):not(.scene-dark)::before,
html.theme-swap *::after { transition: none !important; }

/* The home wash (see theme-control.1.js): the body's image is off for the length of the change; a layer draws it and fades. The layer sits
   under the page's own surfaces (z-index -1) and over the ground, at the body's origin, with the body's own size and repeat. */
html.theme-turn body { background-image: none !important; }
.theme-wash { position: absolute; top: 0; left: 0; width: 100%; z-index: -1; pointer-events: none; }
.theme-wash.wash-in { background-image: var(--hero-wash); }
@media (prefers-reduced-motion: no-preference) {
  .theme-wash.wash-out { animation: wash-out 360ms var(--ease-inout) both; }
  .theme-wash.wash-in { animation: wash-in 188ms cubic-bezier(0.097, 0.5, 0.208, 1) both; }
}
@keyframes wash-out { to { opacity: 0; } }
@keyframes wash-in { from { opacity: 0; } }

/* The control: three native radios stretched over their segments, a sliding indicator moved by --i (0, 1, 2). */
.theme-seg { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); padding: var(--pad); border-top: 1px solid var(--border-subtle); }
.theme-seg::before { content: ""; position: absolute; left: var(--pad); top: var(--pad); bottom: var(--pad); width: calc((100% - 2 * var(--pad) - 2 * var(--gap)) / 3); box-sizing: border-box; border: 2px solid var(--accent-line); border-radius: 10px; background: var(--background-cardElevated); transform: translateX(calc(var(--i, 0) * (100% + var(--gap)))); }
.theme-seg label { position: relative; display: block; }
.theme-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-seg span { position: relative; display: flex; align-items: center; justify-content: center; min-height: var(--seg-h); font-size: 15px; font-weight: 500; color: var(--text-secondary); border-radius: 10px; pointer-events: none; user-select: none; }
.theme-seg input:checked + span { color: var(--text-primary); font-weight: 700; }
.theme-seg input:focus-visible + span { outline: 2px solid var(--border-focused); outline-offset: 1px; }
.theme-seg input:active + span { transform: scale(0.97); }
@media (hover: hover) { .theme-seg input:not(:checked):hover + span { color: var(--text-primary); } }
.theme-note { min-height: 40px; margin: 0; padding: 8px 14px 12px; font-size: 13px; line-height: 1.4; color: var(--text-secondary); }
