/* Manifestation Cascade: Tidal Rings. Colours come from --bg/--fg/--muted on body; body.is-active is the night palette. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); font-family: system-ui, sans-serif;
  transition: background-color 4s ease, color 4s ease;
}
button { font: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.skip { position: absolute; inset-inline-start: 8px; top: -80px; z-index: 10; padding: 12px 16px; background: var(--fg); color: var(--bg); text-decoration: none; }
.skip:focus { top: 8px; }
main:focus { outline: none; }

/* Stage */
.stage { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage > header, .stage > main, .stage > footer { position: relative; }
.nojs { margin: 15vh auto; max-width: 40ch; padding: 0 24px; text-align: center; line-height: 1.6; }

.hdr { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.hdr-right { display: flex; align-items: center; gap: 20px; }
.lang { position: relative; min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.lang:focus-within { outline: 2px solid currentColor; outline-offset: 3px; }
.lang select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 1rem; } /* 16px: iOS zooms smaller form fields on focus */
.lang option { color: #16202B; background: #fff; font-size: 1rem; }
.sound { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; color: inherit; cursor: pointer; }

.main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.theme { margin: 0; text-wrap: balance; }
.label, .sub { text-wrap: pretty; }
.count { font-variant-numeric: tabular-nums; margin: 0; line-height: 1; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.btn { min-width: 2.75rem; background: transparent; color: inherit; cursor: pointer; }
.note { margin: 0; }

.ftr { display: flex; flex-direction: column; }
.steps { list-style: none; margin: 0; padding: 0; }
.safe { margin: 0; text-wrap: pretty; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.about-btn { min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.about { position: relative; width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.5rem; }
.about-title { margin: 0; font: inherit; }
.about-toggle { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.about-toggle[aria-expanded="true"] { color: var(--fg); }
.about-toggle .chev { flex: none; transition: transform .25s; }
.about-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.about-panel { margin: .25rem 0 1.5rem; padding: 1.25rem 1.5rem .5rem; border-radius: .5rem; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.do-title { margin: 0; }
.story, .do-body { margin: 0 0 1rem; text-wrap: pretty; overflow-wrap: break-word; }
.cal-link { display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  body, .btn, .stage *, .chev { transition: none !important; }
}
/* In-page "pause animation" (body.still) */
.still, .still * { transition: none !important; }

/* No palette fade on first paint (removed by app.js after the scene mounts) */
.boot, .boot * { transition: none !important; }

/* Fonts and design */
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-display: swap; src: url("../fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-display: swap; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 300; font-display: swap; src: url("../fonts/source-sans-3-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 500; font-display: swap; src: url("../fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); }

body { --bg: #F3EFE8; --fg: #16202B; --muted: #36404B; --gold: #E2B95B; }
body.is-active { --bg: #0B1426; --fg: #F3EFE8; --muted: #B7BFCB; }
.stage { font-family: "Source Sans 3", system-ui, sans-serif; }
.hdr { padding: 22px 28px; }
.lang { font-size: 0.9375rem; padding: 10px 4px; }
.sound { border: 0; border-radius: 999px; }
@media (hover: hover) { .sound:hover { background: rgba(127, 127, 127, .14); } }
.theme { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 300; font-size: clamp(3.5rem, 10vw, 9rem); line-height: 1; letter-spacing: .02em; max-width: 14ch; }
.label { margin: 56px 0 10px; font-size: 0.875rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.count { font-size: clamp(2.75rem, 6vw, 4.25rem); font-weight: 300; letter-spacing: .04em; }
.sub { margin: 14px 0 0; font-size: 1rem; line-height: 1.5; color: var(--muted); max-width: 40ch; min-height: 24px; }
.actions { gap: 12px; margin-top: 44px; min-height: 52px; }
.btn { padding: 14px 28px; border: 1px solid currentColor; border-radius: 999px; font-size: 1rem; transition: background .3s; }
@media (hover: hover) { .btn:hover { background: rgba(127, 127, 127, .14); } }
.btn-med { border-color: var(--gold); color: var(--gold); }
@media (hover: hover) { .btn-med:hover { background: rgba(226, 185, 91, .12); } }
.note { font-size: 1rem; color: var(--muted); }
.note-med { color: var(--gold); }
.ftr { align-items: center; gap: 18px; padding: 0 28px 28px; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 32px; max-width: 1040px; width: 100%; font-size: 0.9375rem; line-height: 1.5; color: var(--muted); text-align: start; }
.steps li { display: flex; gap: 10px; }
.steps .n { font-family: "Cormorant Garamond", serif; font-size: 1.25rem; line-height: 1.1; color: var(--fg); }
.steps .t { text-wrap: pretty; }
.safe { font-size: 0.875rem; color: var(--muted); max-width: 60ch; }
.row { justify-content: center; gap: 8px 20px; font-size: 0.875rem; color: var(--muted); }
.about-btn { padding: 10px 0; font-size: 0.875rem; }
.about-toggle { font-size: .9375rem; letter-spacing: .06em; }
@media (hover: hover) { .about-toggle:hover { color: var(--fg); } }
.story { font-size: 1.0625rem; line-height: 1.75; }
.do-title { margin-top: 1.5rem; font-size: .875rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.do-body { font-size: 1.0625rem; line-height: 1.75; }
