/* Variantes locales: las ilustraciones conservan capas, tiempos y composición. */
.theme-toggle {
  position:fixed; z-index:60; top:max(68px,calc(env(safe-area-inset-top) + 62px));
  right:max(14px,calc((100vw - 780px)/2 + 14px)); width:44px; height:44px;
  display:grid; place-items:center; padding:10px; border:1px solid rgb(126 88 154 / 30%);
  border-radius:50%; color:#684276; background:rgb(250 238 245 / 76%); cursor:pointer;
  box-shadow:0 2px 10px rgb(54 30 77 / 12%); -webkit-tap-highlight-color:transparent;
}
.theme-toggle[hidden] { display:none; }
.theme-toggle svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle .theme-sun { display:none; }
.theme-toggle:focus-visible { outline:3px solid #dbb457; outline-offset:3px; }
.theme-toggle:disabled { opacity:.65; cursor:wait; }
body.intro-active .theme-toggle { visibility:hidden; pointer-events:none; }
.theme-status { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
html[data-theme="night"] { --paper:#231e43; --paper-soft:#332844; --plum:#efdeee; --violet:#f5deef; --gold:#f1c569; --ink:#f2e9f2; --shadow:0 20px 60px rgb(0 0 0 / 32%); background:#201936; color-scheme:dark; }
html[data-theme="night"] body { background:radial-gradient(circle at 20% 15%,#39305a,transparent 65%),#201936; }
html[data-theme="night"] .hero { background:#292148; }
html[data-theme="night"] .bg { filter:brightness(.62) saturate(.85); }
html[data-theme="night"] .hero-copy::before { background:radial-gradient(ellipse at center,rgb(39 29 69 / 42%) 0%,rgb(40 31 72 / 26%) 53%,transparent 78%); }
html[data-theme="night"] :is(.eyebrow,.pre-age,.intro,.hero-address) { color:#f3e7f1; text-shadow:0 1px 3px rgb(18 11 40 / 90%); }
html[data-theme="night"] .nickname { color:#f5deef; text-shadow:0 1px 4px rgb(18 11 40 / 65%); }
html[data-theme="night"] .name-brush > g > path { fill:currentColor; }
html[data-theme="night"] :is(.age,.hero-date) { color:#ffdfa1; text-shadow:0 1px 3px #241735; border-color:rgb(243 201 111 / 70%); }
html[data-theme="night"] .ribbon-line { fill:#fff1df; stroke:none; filter:none; text-shadow:0 1px 2px rgb(35 20 50 / 60%); }
html[data-theme="night"] .mist-a { background:rgb(118 94 175 / 20%); }
html[data-theme="night"] .mist-b { background:rgb(54 60 134 / 16%); }
html[data-theme="night"] .hero.is-revealing .landscape { opacity:1; }
html[data-theme="night"] .magic-button { color:#fff5ee; background:linear-gradient(135deg,#805091,#774777 65%,#8b587b); box-shadow:0 8px 24px rgb(14 8 37 / 28%),inset 0 0 0 1px rgb(246 202 239 / 32%); }
html[data-theme="night"] .theme-toggle { color:#f5d891; background:rgb(39 28 62 / 80%); border-color:rgb(245 205 139 / 35%); }
html[data-theme="night"] .theme-toggle .theme-sun { display:block; }
html[data-theme="night"] .theme-toggle .theme-moon { display:none; }
html[data-theme="night"] .music-control { color:#efce84; border-color:rgb(244 207 139 / 30%); background:rgb(39 28 62 / 70%); }
html[data-theme="night"] .rsvp-card { color:#f2e7f1; background:radial-gradient(circle at 15% 0%,rgb(192 126 87 / 12%),transparent 40%),linear-gradient(150deg,#3b2b50,#2c233e); border-color:rgb(235 192 228 / 25%); }
html[data-theme="night"] :is(.modal-kicker,.rsvp-card h2,.modal-lead,.modal-close,.field>span,.attendance-fieldset legend,.choice-card b,.counter-row b,.stepper button,.stepper input) { color:#f0e1ee; }
html[data-theme="night"] :is(.field em,.choice-card small,.counter-row small) { color:#cbb9d2; }
html[data-theme="night"] :is(.field input,.field textarea,.stepper) { background:#251d37; color:#f8edf6; border-color:#6f587e; }
html[data-theme="night"] :is(.field input,.field textarea)::placeholder { color:#bba6c5; opacity:1; }
html[data-theme="night"] .choice-card { background:#2e243f; border-color:#665073; }
html[data-theme="night"] .choice-card:has(input:checked) { background:linear-gradient(135deg,#594066,#422e56); border-color:#d7adce; }
html[data-theme="night"] .choice-card input { accent-color:#dfb4da; }
html[data-theme="night"] .counter-row { border-bottom-color:rgb(222 187 221 / 18%); }
html[data-theme="night"] .privacy-note { color:#c5b4ce!important; }
html[data-theme="night"] .rsvp-feedback { color:#ffdfed; background:#52324d; }
@media (prefers-reduced-motion:reduce) { .theme-toggle { transition:none; } }
/* El marco nocturno incluye margen transparente para el resplandor. */
html[data-theme="night"] .frame { inset:.65% .65% auto; width:115%; max-width:none; height:111%; }

/* La luna conserva su flotación suave, pero no gira sobre su eje. */
html[data-theme="night"] .hero.is-revealing .sun { animation-name:sun-enchanted; rotate:0deg; }

/* El color acompaña la disolución de las ilustraciones; los trazos blancos
   de las máscaras mantienen su luminancia en ambos estilos. */
html.theme-changing :is(.hero,.nickname,.eyebrow,.pre-age,.intro,.hero-address,.age,.hero-date,.theme-toggle,.music-control) {
  transition:color 900ms ease-in-out, background-color 900ms ease-in-out, border-color 900ms ease-in-out, text-shadow 900ms ease-in-out;
}
.name-brush > g > path { fill:currentColor; }
.name-brush mask { mask-type:alpha; }
