/* Theme controls use the same header placement on desktop and mobile. */
.header-actions{display:flex;align-items:center;gap:12px}
/* The theme switch: the moon (dark) on the left, the sun (light) on the right, and the thumb under the current one. The
   icon on the thumb is drawn in the header's ground so it reads on it. The button itself keeps a 44px target. */
.theme-toggle{display:inline-grid;place-items:center;min-width:44px;min-height:44px;color:inherit;pointer-events:auto;touch-action:manipulation;cursor:pointer}
.theme-track{position:relative;display:flex;align-items:center;justify-content:space-between;width:60px;height:32px;padding:0 6px;border:1px solid currentColor;border-radius:999px}
.theme-track .icon{position:relative;z-index:1;width:18px;height:18px;opacity:.6;transition:color 220ms var(--ease-out),opacity 220ms var(--ease-out)}
.theme-thumb{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:currentColor;transition:transform 220ms var(--ease-out)}
html[data-theme="light"] .theme-thumb{transform:translateX(28px)}
html:not([data-theme="light"]) .theme-moon,html[data-theme="light"] .theme-sun{color:var(--cap);opacity:1}
@media (prefers-reduced-motion:reduce){.theme-thumb,.theme-track .icon{transition:none}}
@media(max-width:700px){
  .masthead{gap:12px}
  .header-actions{gap:8px}
}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light;background:#F4F2EC}
html[data-theme="light"] body{background:#F4F2EC;color:#1B2B41}
/* Existing day sections keep their palette; night sections receive paper surfaces and ink type. */
html[data-theme="light"] :is(section,footer)[data-ground="ink"]{
  --ink:#F4F2EC;--paper:#1B2B41;--ink-soft:#D8DFDE;--paper-soft:#2E405A;--paper-72:#4A5A6E;
  --bg:#F4F2EC;--fg:#1B2B41;--fg-2:#4A5A6E;
}
html[data-theme="light"] .site-header{--fg:#1B2B41;--cap:#F4F2EC;--cap-edge:url('../art/edge-paper.webp');color:#1B2B41}
html[data-theme="light"] .mobile-menu{background:#F4F2EC;color:#1B2B41}
html[data-theme="light"] #hero .hero-phone-body{background:#D8DFDE;box-shadow:inset 0 0 0 1px #C0CBCF,0 18px 55px rgb(27 43 65 / .16)}
html[data-theme="light"] #hero :is(.hero-lede,.hero-caption-title,.hero-screens button),html[data-theme="light"] #keys :is(.keys-copy>h2,.keys-copy>p,.keys-points){text-shadow:0 0 .2em #F4F2EC,0 0 .45em #F4F2EC}
html[data-theme="light"] #hero .hero-screens button{color:#4A5A6E}
html[data-theme="light"] #hero .hero-screens button[aria-pressed="true"]{color:#1B2B41}
html[data-theme="light"] #finale .finale-lead{text-shadow:0 0 .2em #F4F2EC,0 0 .45em #F4F2EC}
html[data-theme="light"]{--bg:#F4F2EC;--fg:#1B2B41;--fg-2:#4A5A6E}
html[data-theme="light"] .cta-row .cta-button{box-shadow:inset 0 0 0 1px rgb(27 43 65 / .35)}
/* The dusk over #send is a night thing: by day both sides are Paper, and its grain would only speckle the form above. */
html[data-theme="light"] #keys>.edge-ink{display:none}
/* #send keeps room under its form for the dusk that #keys hangs over it. By day there is no dusk, so the room goes. */
html[data-theme="light"] #send{padding-bottom:clamp(56px,5vw,88px)}
html[data-theme="light"] #questions .questions-list{position:relative;z-index:1}
/* Day plates. Each night plate has a day twin of the same drawing (theme.js swaps the file), so the layout, the scrubbed
   scenes and the vault's wheel are the same in both themes. No colours are inverted and nothing is filtered. */
html[data-theme="light"] #hero .hero-moon{display:none}   /* a day sky has no moon */
html[data-theme="light"] #hero .hero-ground::before,html[data-theme="light"] .edge-ink{background-image:url('../art/edge-paper.webp')}
html[data-theme="light"] .edge-cap::after,html[data-theme="light"] #keys .keys-stage::before,html[data-theme="light"] #keys .keys-stage::after,html[data-theme="light"] #keys .keys-art::before{background-image:url('../art/edge-paper.webp')}
html[data-theme="light"] #hero .hero-phone-poster{filter:none}
/* The wallet demo is Ink in both themes, so the phone's screen, its status bar and its home bar keep the night palette by day. */
html[data-theme="light"] #hero .hero-phone-screen{--ink:#1B2B41;--paper:#F4F2EC;--ink-soft:#2E405A}

/* The crossing in the light theme runs day to night (bridge.js swaps the plates). So the inks swap too: the real copy and
   form are Ink on the Paper sky, and their clones, shown where dusk has passed, are Paper on the night. The section's
   ground is paper at the start and "night" at the end, which is real Ink whatever the theme. */
html[data-theme="light"].js:not(.rm) #bridge{background:#F4F2EC;color:#1B2B41}
html[data-theme="light"].js:not(.rm) #bridge .bridge-copy{--halo:#F4F2EC;color:#1B2B41}
html[data-theme="light"].js:not(.rm) #bridge .bridge-copy-day{--halo:#1B2B41;color:#F4F2EC}
html[data-theme="light"].js:not(.rm) #bridge .bridge-sub{color:#4A5A6E}
html[data-theme="light"].js:not(.rm) #bridge .bridge-copy-day .bridge-sub{color:rgb(244 242 236 / .72)}
html[data-theme="light"].js:not(.rm) #bridge .hf{--f:#1B2B41;--f2:#4A5A6E;--f3:#F4F2EC;--mark:#1B2B41;--go-hover:#2E405A;--halo:#F4F2EC}
html[data-theme="light"].js:not(.rm) #bridge :is(.hf.is-day,.bridge-dock-day .hf){--f:#F4F2EC;--f2:rgb(244 242 236 / .72);--f3:#1B2B41;--mark:#8DB1C1;--go-hover:#E6E4DC;--halo:#1B2B41}
html[data-theme="light"] .site-header .bridge-masthead-day{--fg:#F4F2EC;--paper:#1B2B41;color:#F4F2EC}
html[data-theme="light"][data-ground="night"] .site-header{--fg:#F4F2EC;--cap:#1B2B41;--cap-edge:url('../art/edge-ink.webp');color:#F4F2EC}
html[data-theme="light"] .site-header:has(.bridge-masthead-day:not([hidden])) .masthead :focus-visible{outline-color:#1B2B41;box-shadow:0 0 0 2px #F4F2EC}
/* Where the vault stacks above the words, its bottom dissolves into the page: Paper here, not Ink. */
html[data-theme="light"] #keys{--keys-edge:url('../art/edge-paper.webp')}
/* The cookie notice sits outside every section, so the root tokens keep their values here: Paper is its surface, Ink its type. */
html[data-theme="light"] .consent{
  --c-bg:var(--paper);--c-fg:var(--ink);--c-edge:var(--line);
  --c-shadow:0 12px 32px rgb(27 43 65 / .16),0 2px 6px rgb(27 43 65 / .08);
  --c-go-bg:var(--ink);--c-go-fg:var(--paper);--c-go-hover:var(--ink-soft);
  --c-no-edge:rgb(27 43 65 / .35);--c-no-hover:rgb(27 43 65 / .06);
}
