/* The invitation: the stage it sits on, the envelope and seal, the card, the details and the reply.
   One set of parts, built a different way for each theme. Each theme sets its own paper, ink, envelope, seal place and motion. */

/* ── The invitation's own tokens and ground rules ───────────────────────────────────────────────────────────
   Nothing in this file follows the page's type, colour or timing (css/site.css). The page can change its faces,
   its sizes and its focus ring, and an invitation already sent looks exactly as it did.
   --inv-plain is the face the names fall back to when a theme's own name face cannot set a letter (see app.js). */
:root {
  --inv-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --inv-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --inv-plain: 'Petrona', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --inv-tap: 160ms; --inv-move: 320ms; --inv-ease: cubic-bezier(.2, .8, .2, 1); --inv-spring: cubic-bezier(.34, 1.56, .64, 1);
}
/* What the invitation once inherited from the page, held here at no extra weight (:where), so every rule below still wins as it did. */
:where(.stage, .mini) { font: 400 16px/1.5 var(--inv-sans); }
:where(.mini) { color: #FFF6E6; }
:where(.stage) :focus-visible { outline: 3px solid #FFC53D; outline-offset: 3px; border-radius: 6px; }
:where(.stage) .fld { display: grid; gap: 6px; min-width: 0; }
:where(.stage) .fld > span { font: 600 12.5px/1.2 var(--inv-sans); color: #BBAE9B; }
:where(.stage) .fld em { font-style: normal; font-weight: 400; opacity: .8; }
:where(.stage) .stepper { display: inline-flex; align-items: center; }
:where(.stage) .stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; background: transparent; font: 500 20px/1 var(--inv-sans); }
:where(.stage) .stepper output { min-width: 34px; text-align: center; font: 600 18px/1 var(--inv-display); font-variant-numeric: tabular-nums; }
:where(.stage) .fine { margin-top: 10px; font-size: 13px; line-height: 1.45; color: #BBAE9B; }
:where(.stage) .err { margin-top: 10px; font: 600 14px/1.4 var(--inv-sans); color: #FF8A95; }
:where(.stage) .err:empty { display: none; }
@keyframes turn { to { transform: rotate(360deg); } }

.stage { position: relative; isolation: isolate; overflow: hidden; min-height: 452px; border-radius: 28px; background: var(--t-bg); color: var(--t-ink);
  box-shadow: 0 0 0 1px #fff6e61f, 0 40px 80px -40px #000; transition: background-color var(--inv-move);
  --t-display: var(--inv-display); --t-names: var(--inv-display); --t-rule: color-mix(in srgb, var(--t-ink) 16%, transparent); --t-focus: var(--t-ink); }
.stage :focus-visible { outline-color: var(--t-focus); }
/* A theme in small, for the chooser: the same card rules at the size of a thumbnail. */
.mini { position: absolute; inset: 0; display: block; container-type: inline-size; background-color: var(--t-bg); --t-display: var(--inv-display); --t-names: var(--inv-display); }
html[data-mode="guest"] .stage { min-height: calc(100vh - 150px); min-height: calc(100svh - 150px); border-radius: 0; box-shadow: none; }
@media (min-width: 520px) { html[data-mode="guest"] .stage { border-radius: 28px; } }

/* ── The first five themes, drawn: colour and type ───────────────────────────────────────────────────── */
:is(.stage, .mini)[data-theme="golden"] { --t-bg: #F3E8D2; --t-ink: #1D1711; --t-sub: #5C5143; --t-accent: #8F4A00; --panel: #E9DCC0; --lift: #FFFBF1;
  --f-bg: #FFFDF8; --f-bd: #B9A47E; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFFBF1; --c-ink: #1D1711; --c-sub: #5C5143; --c-accent: #8F4A00;
  --e0: #E6D3A6; --e1: #F7EACB; --e2: #EEDDB6; --e-in: url("../brand/bloom-line.svg") 50% 8% / 34% no-repeat, linear-gradient(180deg, #F2A52E, #DB8208);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFF8E8 0%, transparent 62%); }
:is(.stage, .mini)[data-theme="afterdark"] { --t-bg: #0B0C22; --t-ink: #F5EFE0; --t-sub: #BDBADC; --t-accent: #FFC53D; --panel: #16173A; --lift: #262866; --t-focus: #FFC53D;
  --f-bg: #121333; --f-bd: #5A5DA6; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #14153A; --c-ink: #F5EFE0; --c-sub: #C9C6E4; --c-accent: #FFC53D; --t-names: 'Marcellus', 'Fraunces', Georgia, serif;
  --e0: #2A2D78; --e1: #20225C; --e2: #181A49; --e-in: linear-gradient(180deg, #FFD466, #E79A14);
  background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 82% 12%, #FFE49A 50%, transparent 52%), radial-gradient(1px 1px at 64% 30%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 30% 42%, #A9ADFF 50%, transparent 52%), radial-gradient(1px 1px at 90% 52%, #fff 50%, transparent 52%), radial-gradient(1.3px 1.3px at 8% 66%, #FFE49A 50%, transparent 52%), radial-gradient(1px 1px at 46% 8%, #fff 50%, transparent 52%), radial-gradient(90% 46% at 50% 0%, #2B2D6E 0%, transparent 70%); }
:is(.stage, .mini)[data-theme="headline"] { --t-bg: #E6E0D4; --t-ink: #141210; --t-sub: #4F4942; --t-accent: #A93407; --panel: #D8D0C1; --lift: #FBF8F1;
  --f-bg: #FBF8F1; --f-bd: #8E8576; --btn-bg: #141210; --btn-ink: #FBF8F1;
  --c-bg: #FBF8F1; --c-ink: #141210; --c-sub: #4F4942; --c-accent: #C23D09;
  --t-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; --t-names: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --e0: #B99B6C; --e1: #CFB58B; --e2: #C4A87B; --e-in: repeating-linear-gradient(135deg, #F2551A 0 9px, #E0470F 9px 18px);
  background-image: radial-gradient(#1412101c 1px, transparent 1.4px); background-size: 14px 14px; }
:is(.stage, .mini)[data-theme="marigold"] { --t-bg: #5A0A2E; --t-ink: #FFF1D6; --t-sub: #F4CDD6; --t-accent: #FFC53D; --panel: #76103D; --lift: #A3174F; --t-focus: #FFC53D;
  --f-bg: #4A0725; --f-bd: #C96A8C; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFEFC4; --c-ink: #5C0B2B; --c-sub: #7A2B49; --c-accent: #A93407;
  --t-display: 'Rozha One', 'Fraunces', Georgia, serif; --t-names: 'Rozha One', 'Fraunces', Georgia, serif;
  --e0: #BE2162; --e1: #A8184F; --e2: #8E1245; --e-in: radial-gradient(#A3174F 1.6px, transparent 2px) 0 0 / 14px 14px, linear-gradient(180deg, #FFCB4A, #F2A215);
  background-image: radial-gradient(100% 50% at 50% 0%, #A3174F 0%, transparent 72%); }
:is(.stage, .mini)[data-theme="vellum"] { --t-bg: #EEF2EE; --t-ink: #22312C; --t-sub: #4C5C57; --t-accent: #2C5750; --panel: #DFE7E1; --lift: #FFFFFF;
  --f-bg: #FFFFFF; --f-bd: #8FA39B; --btn-bg: #2C5750; --btn-ink: #FFFFFF;
  --c-bg: #FFFFFF; --c-ink: #22312C; --c-sub: #4C5C57; --c-accent: #2C5750; --t-names: 'Pinyon Script', 'Fraunces', Georgia, serif;
  background-image: radial-gradient(60% 34% at 8% 4%, #CFE0D6 0%, transparent 70%), radial-gradient(50% 30% at 96% 16%, #F3DDD6 0%, transparent 70%), radial-gradient(60% 30% at 80% 100%, #CBE0E6 0%, transparent 70%); }

/* ── Bar across the top of the stage ────────────────────────────────────────────────────── */
.stage-bar { position: relative; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 8px 0 16px; min-height: 52px; }
.stage-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 700 11px/1.2 var(--inv-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--t-sub); text-decoration: none; }
.stage-tag { margin-right: auto; }
.stage-tools { display: contents; }   /* the tools wrap one by one, so a row of languages never pushes the music button off the edge */
/* Language: one small button for each language the couple added */
.langs { display: inline-flex; padding: 0 3px; border-radius: 999px; background: color-mix(in srgb, var(--t-ink) 8%, transparent); }
.langs button { min-width: 40px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--t-sub); font: 700 12px/1 var(--inv-sans); letter-spacing: .06em; }
@media (max-width: 480px) { .stage-bar:has(.langs:not([hidden])) .stage-tag.guest-only span { display: none; } }
.langs:has(button:nth-child(4)) button { min-width: 35px; padding: 0 3px; }
.langs button[aria-pressed="true"] { color: var(--t-ink); background: radial-gradient(closest-side, var(--lift) 0 86%, transparent 88%) center / 38px 38px no-repeat; }
.tool { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--t-ink); font: 600 13.5px/1 var(--inv-sans); transition: background var(--inv-tap); }
.tool:hover { background: color-mix(in srgb, var(--t-ink) 9%, transparent); }
.tool[aria-pressed="true"] { background: color-mix(in srgb, var(--t-ink) 12%, transparent); }
.tool[aria-pressed="true"] svg { animation: note 1.2s ease-in-out infinite; }
@keyframes note { 50% { transform: translateY(-2px) rotate(-6deg); } }
.fx { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }
.flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--fx-x, 50%) var(--fx-y, 40%), #FFF6DC 0%, #FFD466 34%, #FF9F1C 70%, transparent 100%); }

/* ── Sealed: the envelope ───────────────────────────────────────────────────────────────── */
.seal-view { position: relative; z-index: 2; padding: 6px 16px 30px; text-align: center; }
.stage[data-state="open"] .seal-view, .stage:not([data-state="open"]) .invite { display: none; }
html:not([data-mode="guest"]) .sv-from, html:not([data-mode="guest"]) .sv-names { display: none; }
html:not([data-mode="guest"]) .env { margin-top: 14px; }
html[data-mode="guest"] .seal-view { padding-top: min(9vh, 70px); }
.sv-from { font: 700 11px/1.3 var(--inv-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--t-sub); }
.sv-names { margin-top: 6px; font: 500 24px/1.15 var(--t-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.sv-amp { color: var(--t-accent); font-style: italic; }
.hint { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; padding: 9px 16px 9px 13px; border-radius: 999px; background: color-mix(in srgb, var(--t-ink) 8%, transparent); font: 600 14px/1.2 var(--inv-sans); }
.hint-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--t-accent); animation: dot 1.6s ease-in-out infinite; }
@keyframes dot { 50% { transform: scale(1.7); opacity: .45; } }

.env { position: relative; width: min(88%, 340px); aspect-ratio: 7 / 5; margin: 34px auto 0; perspective: 900px; filter: drop-shadow(0 20px 18px #0000003d);
  --sx: 50%; --sy: 55%; --sw: 28%; }
.env > * { position: absolute; }
.env-back { inset: 0; border-radius: 7px; background: var(--e-in); }
.env-card { z-index: 1; left: 5%; right: 5%; top: 5%; bottom: 6%; display: grid; align-content: start; justify-items: center; padding: 9% 6% 0; border-radius: 3px; background: var(--c-bg); color: var(--c-ink); box-shadow: 0 0 0 1px #0000000f; }
.ec-names { display: grid; font: italic 400 17px/1.1 var(--t-names); overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.ec-amp { font-size: .7em; color: var(--c-accent); }
.env-front { z-index: 2; inset: 0; border-radius: 7px; clip-path: polygon(0 0, 50% 57%, 100% 0, 100% 100%, 0 100%);
  background: conic-gradient(from 0deg at 50% 57%, var(--e2) 0deg 51deg, var(--e2) 52deg 121deg, var(--e1) 123deg 237deg, var(--e2) 239deg 308deg, var(--e2) 309deg); }
.env-to { z-index: 3; left: 8%; right: 8%; bottom: 5.5%; display: grid; gap: 3px; justify-items: center; color: var(--t-ink); pointer-events: none; }
.et-names { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: italic 400 16px/1.2 var(--t-names); }
.env-to small { font: 600 9.5px/1 var(--inv-sans); letter-spacing: .2em; text-transform: uppercase; opacity: .72; }
.env-flap { z-index: 4; inset: 0; transform-origin: 50% 0; filter: drop-shadow(0 3px 2px #00000030); }
.env-flap i { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 61%); background: linear-gradient(180deg, var(--e1) 0%, var(--e0) 100%); }
.env-extra { z-index: 5; inset: 0; pointer-events: none; }

/* The seal: the twelve-petal Bloom, with the couple's initials in the lens. */
.seal { z-index: 6; left: var(--sx); top: var(--sy); width: var(--sw); aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 5px #00000059); -webkit-tap-highlight-color: transparent; transition: transform var(--inv-move) var(--inv-spring); }
.seal::before { content: ''; position: absolute; inset: -8%; border-radius: 50%; border: 2px solid var(--t-accent); opacity: 0; animation: ring 2.4s var(--inv-ease) infinite; }
@keyframes ring { 0% { transform: scale(.8); opacity: .7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.seal::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal:hover { transform: translate(-50%, -50%) scale(1.06); }
.seal:active { transform: translate(-50%, -50%) scale(.96); }
.seal:focus-visible { outline: 3px solid var(--t-focus); outline-offset: 6px; border-radius: 50%; }
.pt { transform: rotate(calc(var(--k) * 30deg)); transition: transform var(--inv-move) var(--inv-ease); }
.seal:hover .pt { transform: rotate(calc(var(--k) * 30deg + 7deg)); }
.s-mono { font: 600 62px/1 var(--inv-display); letter-spacing: .02em; }
.s-emboss { filter: drop-shadow(2px 3px 0 #00000038) drop-shadow(-2px -2px 0 #ffffff59); }

/* ── Five envelopes ─────────────────────────────────────────────────────────────────────── */
/* After Dark: a deep pointed flap, foil stamp at its tip */
[data-theme="afterdark"] .env { --sy: 66%; --sw: 27%; filter: drop-shadow(0 20px 22px #000000a6); }
[data-theme="afterdark"] .env-front { clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 100%, 0 100%); background: conic-gradient(from 0deg at 50% 60%, var(--e2) 0deg 54deg, var(--e2) 55deg 116deg, var(--e1) 118deg 242deg, var(--e2) 244deg 305deg, var(--e2) 306deg); }
[data-theme="afterdark"] .env-flap i { clip-path: polygon(0 0, 100% 0, 50% 69%); background: radial-gradient(1.2px 1.2px at 22% 14%, #FFE49A 50%, transparent 52%), radial-gradient(1px 1px at 70% 22%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 48% 34%, #FFE49A 50%, transparent 52%), radial-gradient(1px 1px at 84% 8%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 36% 8%, #fff 50%, transparent 52%), linear-gradient(180deg, var(--e1), var(--e0)); }
[data-theme="afterdark"] .env-to { color: #FFE49A; bottom: 5%; }
[data-theme="afterdark"] .et-names { font: 400 12.5px/1.2 var(--t-names); letter-spacing: .2em; text-transform: uppercase; }
[data-theme="afterdark"] .env-to small { display: none; }
[data-theme="afterdark"] .ec-names { font: 400 13px/1.3 var(--t-names); letter-spacing: .16em; text-transform: uppercase; }

/* Headline: a kraft sleeve that opens at the side, closed with a sticker */
[data-theme="headline"] .env { aspect-ratio: 7 / 4.3; --sx: 76%; --sy: 50%; --sw: 25%; }
[data-theme="headline"] .env-front { clip-path: inset(0 24% 0 0); background: repeating-linear-gradient(96deg, #00000008 0 2px, transparent 2px 7px), linear-gradient(180deg, var(--e1), var(--e2)); }
[data-theme="headline"] .env-flap { transform-origin: 100% 50%; }
[data-theme="headline"] .env-flap i { clip-path: inset(0 0 0 76%); background: repeating-linear-gradient(96deg, #00000008 0 2px, transparent 2px 7px), linear-gradient(90deg, var(--e0), var(--e2)); box-shadow: inset 1px 0 0 #0003; }
[data-theme="headline"] .env-card { padding: 9% 6% 0 46%; justify-items: start; text-align: left; }
[data-theme="headline"] .ec-names { font: 800 20px/.92 var(--t-names); letter-spacing: -.03em; white-space: normal; }
[data-theme="headline"] .env-to { left: 7%; right: 30%; top: 12%; bottom: 12%; justify-items: start; align-content: space-between; text-align: left; }
[data-theme="headline"] .et-names { font: 800 clamp(17px, 6.4vw, 25px)/.95 var(--t-names); letter-spacing: -.03em; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
[data-theme="headline"] .et-amp { color: #A93407; }
[data-theme="headline"] .env-to small { padding: 5px 7px; border: 1.5px solid currentColor; border-radius: 3px; font-size: 9.5px; letter-spacing: .14em; opacity: .85; transform: rotate(-3deg); }

/* Marigold: a straight scalloped flap with a garland under it */
[data-theme="marigold"] .env { --sy: 47%; --sw: 28%; filter: drop-shadow(0 20px 22px #00000080); }
[data-theme="marigold"] .env-front { clip-path: inset(28% 0 0 0); background: radial-gradient(#FFC53D59 1.2px, transparent 1.6px) 0 0 / 16px 16px, linear-gradient(180deg, var(--e1), var(--e2)); }
[data-theme="marigold"] .env-flap i { clip-path: none; bottom: 53%; background: linear-gradient(180deg, var(--e1), var(--e0));
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 13px) no-repeat, radial-gradient(ellipse 50% 100% at 50% 0, #000 97%, transparent 100%) 0 100% / 10% 14px repeat-x;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - 13px) no-repeat, radial-gradient(ellipse 50% 100% at 50% 0, #000 97%, transparent 100%) 0 100% / 10% 14px repeat-x; }
[data-theme="marigold"] .env-extra .swag { position: absolute; left: 0; top: 45%; width: 100%; transform-origin: 50% 0; }
[data-theme="marigold"] .env-to { color: #FFF1D6; bottom: 8%; }
[data-theme="marigold"] .et-names { font: 400 18px/1.2 var(--t-names); }
[data-theme="marigold"] .ec-names { font: 400 17px/1.15 var(--t-names); }

/* Vellum: no envelope at all. The card, wrapped in a translucent sheet and tied with twine */
[data-theme="vellum"] .env { width: min(60%, 232px); aspect-ratio: 5 / 6.7; --sy: 50%; --sw: 34%; filter: drop-shadow(0 22px 20px #22312c38); }
[data-theme="vellum"] .env-back, [data-theme="vellum"] .env-flap, [data-theme="vellum"] .env-to { display: none; }
[data-theme="vellum"] .env-card { inset: 0; align-content: center; padding: 0 8% 0; border-radius: 2px;
  background: radial-gradient(70% 40% at 0% 0%, #CFE0D6 0%, transparent 70%), radial-gradient(60% 36% at 100% 100%, #F3DDD6 0%, transparent 70%), radial-gradient(50% 30% at 100% 10%, #CBE0E6 0%, transparent 70%), #fff; }
[data-theme="vellum"] .env-card { align-content: start; padding-top: 16%; }
[data-theme="vellum"] .ec-names { font: 400 32px/1 var(--t-names); white-space: normal; overflow-wrap: anywhere; text-align: center; padding: .1em .05em; }
[data-theme="vellum"] .env-front { inset: -1.5% -2.5%; clip-path: none; border-radius: 2px; background: linear-gradient(105deg, #ffffff80, #ffffff4d 45%, #f4f7f48c); border: 1px solid #ffffffd9; box-shadow: inset 0 0 0 1px #22312c14;
  -webkit-backdrop-filter: blur(1.6px); backdrop-filter: blur(1.6px); }
[data-theme="vellum"] .env-extra::before, [data-theme="vellum"] .env-extra::after { content: ''; position: absolute; background: repeating-linear-gradient(45deg, #B89F7A 0 3px, #9E845E 3px 6px); border-radius: 2px; box-shadow: 0 1px 1px #0003; }
[data-theme="vellum"] .env-extra::before { left: -2.5%; right: -2.5%; top: calc(50% - 1.5px); height: 3px; }
[data-theme="vellum"] .env-extra::after { top: -1.5%; bottom: -1.5%; left: calc(50% - 1.5px); width: 3px; }

/* ── Opening: each theme moves its own way ──────────────────────────────────────────────── */
[data-state="opening"] .seal { pointer-events: none; }
[data-state="opening"] .seal::before { animation: none; }
[data-state="opening"] .pt { animation: petal .72s var(--inv-ease) both; animation-delay: calc(var(--k) * 16ms); }
@keyframes petal { to { transform: rotate(calc(var(--k) * 30deg + 76deg)) translateY(-150px) scale(.7); opacity: 0; } }
[data-state="opening"] .s-back, [data-state="opening"] .s-base { animation: gone .5s ease-out both; transform-origin: 0 0; }
[data-state="opening"] .s-core { animation: lens .7s var(--inv-ease) .12s both; transform-origin: 0 0; }
@keyframes gone { to { opacity: 0; transform: scale(.82); } }
@keyframes lens { 60% { opacity: 1; } to { opacity: 0; transform: scale(2.6); } }
[data-state="opening"] .sv-from, [data-state="opening"] .sv-names, [data-state="opening"] .hint { animation: fadeout .35s ease-out both; }
[data-state="opening"] .env-to { animation: fadeout .3s ease-out .3s both; }
@keyframes fadeout { to { opacity: 0; } }

/* Golden Hour: the shutter turns, the flap lifts, the card rises */
[data-state="opening"]:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .env, [data-state="opening"][data-theme="golden"] .env { animation: envDown 1.65s var(--inv-ease) both; }
[data-state="opening"]:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .env-flap, [data-state="opening"][data-theme="golden"] .env-flap { animation: flapUp .7s cubic-bezier(.5, 0, .3, 1) .5s both, flapBack .7s steps(1) .5s both; }
[data-state="opening"]:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .env-flap i, [data-state="opening"][data-theme="golden"] .env-flap i { animation: flapIn .7s steps(1) .5s both; }
[data-state="opening"]:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .env-card, [data-state="opening"][data-theme="golden"] .env-card { animation: cardUp .62s var(--inv-ease) 1.02s both; }
@keyframes envDown { 0% { transform: none; opacity: 1; } 45% { transform: translateY(74px); opacity: 1; } 88% { transform: translateY(74px); opacity: 1; } 100% { transform: translateY(74px) scale(.97); opacity: 0; } }
@keyframes flapUp { to { transform: rotateX(180deg); } }
@keyframes flapBack { 0% { z-index: 4; } 50%, 100% { z-index: 0; } }
@keyframes flapIn { 50%, 100% { background: var(--e-in); } }
@keyframes cardUp { to { transform: translateY(-64%); } }

/* After Dark: the seal opens like an aperture and light floods the stage */
[data-state="opening"][data-theme="afterdark"] .env { animation: envNear 1.5s var(--inv-ease) both; }
[data-state="opening"][data-theme="afterdark"] .flash { animation: flood 1.05s cubic-bezier(.6, 0, .3, 1) .42s both; }
@keyframes envNear { 0% { transform: none; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes flood { 0% { opacity: 1; clip-path: circle(0% at var(--fx-x, 50%) var(--fx-y, 40%)); } 75% { opacity: 1; clip-path: circle(140% at var(--fx-x, 50%) var(--fx-y, 40%)); } 100% { opacity: 0; clip-path: circle(140% at var(--fx-x, 50%) var(--fx-y, 40%)); } }

/* Headline: the sticker peels, the end flap swings out, the card slides sideways */
[data-state="opening"][data-theme="headline"] .seal { animation: peel .55s cubic-bezier(.5, 0, .7, .4) both; }
[data-state="opening"][data-theme="headline"] .pt { animation: none; }
[data-state="opening"][data-theme="headline"] .s-core, [data-state="opening"][data-theme="headline"] .s-base { animation: none; }
[data-state="opening"][data-theme="headline"] .env { animation: envLeft 1.45s var(--inv-ease) both; }
[data-state="opening"][data-theme="headline"] .env-flap { animation: flapSide .5s cubic-bezier(.5, 0, .3, 1) .38s both, flapBack .5s steps(1) .38s both; }
[data-state="opening"][data-theme="headline"] .env-flap i { animation: flapIn .5s steps(1) .38s both; }
[data-state="opening"][data-theme="headline"] .env-card { animation: cardOut .6s var(--inv-ease) .78s both; }
@keyframes peel { 40% { transform: translate(-50%, -50%) rotate(-14deg) scale(1.08); opacity: 1; } 100% { transform: translate(40%, -190%) rotate(34deg) scale(.9); opacity: 0; } }
@keyframes envLeft { 0% { transform: none; opacity: 1; } 40% { transform: translateX(-13%); opacity: 1; } 88% { transform: translateX(-13%); opacity: 1; } 100% { transform: translateX(-13%); opacity: 0; } }
@keyframes flapSide { to { transform: rotateY(-180deg); } }
@keyframes cardOut { to { transform: translateX(46%); } }

/* Marigold: the garland drops away, the scalloped flap lifts, the card rises through falling petals */
[data-state="opening"][data-theme="marigold"] .env { animation: envDown 1.7s var(--inv-ease) both; }
[data-state="opening"][data-theme="marigold"] .swag { animation: swagDrop .7s cubic-bezier(.5, 0, .8, .5) .1s both; }
[data-state="opening"][data-theme="marigold"] .env-flap { animation: flapUp .7s cubic-bezier(.5, 0, .3, 1) .55s both, flapBack .7s steps(1) .55s both; }
[data-state="opening"][data-theme="marigold"] .env-flap i { animation: flapIn .7s steps(1) .55s both; }
[data-state="opening"][data-theme="marigold"] .env-card { animation: cardUp .62s var(--inv-ease) 1.06s both; }
@keyframes swagDrop { 30% { transform: rotate(-3deg); opacity: 1; } 100% { transform: translateY(150px) rotate(9deg); opacity: 0; } }

/* Vellum: the twine slips off, the wrap falls away */
[data-state="opening"][data-theme="vellum"] .seal { animation: sealLift .6s var(--inv-ease) both; }
[data-state="opening"][data-theme="vellum"] .pt, [data-state="opening"][data-theme="vellum"] .s-core, [data-state="opening"][data-theme="vellum"] .s-base, [data-state="opening"][data-theme="vellum"] .s-back { animation: none; }
[data-state="opening"][data-theme="vellum"] .env-extra::before { animation: twineH .6s cubic-bezier(.6, 0, .3, 1) .22s both; }
[data-state="opening"][data-theme="vellum"] .env-extra::after { animation: twineV .6s cubic-bezier(.6, 0, .3, 1) .3s both; }
[data-state="opening"][data-theme="vellum"] .env-front { animation: wrapFall .85s cubic-bezier(.5, 0, .7, .5) .62s both; }
[data-state="opening"][data-theme="vellum"] .env { animation: envStay 1.6s linear both; }
@keyframes sealLift { to { transform: translate(-50%, -120%) scale(.7) rotate(-20deg); opacity: 0; } }
@keyframes twineH { to { transform: translateX(120%); opacity: 0; } }
@keyframes twineV { to { transform: translateY(120%); opacity: 0; } }
@keyframes wrapFall { 30% { transform: translateY(4%) rotate(1.5deg); opacity: 1; } 100% { transform: translateY(70%) rotate(7deg); opacity: 0; } }
@keyframes envStay { 0%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(1.04); } }

/* ── Open: the card ─────────────────────────────────────────────────────────────────────── */
.invite { position: relative; z-index: 2; padding: 4px 16px 22px; }
.card { position: relative; width: 100%; max-width: 400px; margin: 0 auto; container-type: inline-size; outline-offset: 6px; }
.card-bg { position: absolute; inset: 0; overflow: hidden; border-radius: 3px; background: var(--c-bg); box-shadow: 0 1px 0 #ffffff80 inset, 0 24px 40px -24px #0000006b, 0 2px 6px #0000001f; }
.card-in { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqw; min-height: 138cqw; padding: 13cqw 10cqw; text-align: center; color: var(--c-ink); }
.orn { display: block; }
.c-eyebrow { font: 700 max(10.5px, 2.8cqw)/1.3 var(--inv-sans); letter-spacing: .17em; text-transform: uppercase; color: var(--c-sub); }
.c-names { display: grid; justify-items: center; max-width: 100%; margin: 1.5cqw 0; font: italic 400 calc(14cqw * var(--fit, 1))/1 var(--t-names); font-variation-settings: 'opsz' 144; letter-spacing: -.015em; overflow-wrap: anywhere; }
.c-n { display: block; max-width: 100%; }
.c-amp { display: block; margin: .08em 0 .02em; font-size: .52em; color: var(--c-accent); }
.c-line { font: italic 400 max(14px, 4.1cqw)/1.35 var(--inv-display); color: var(--c-sub); }
.c-rule { width: 14cqw; height: 1px; margin: 1.5cqw 0; background: var(--c-accent); opacity: .7; }
.c-when { display: grid; gap: 1.2cqw; justify-items: center; }
.c-num { display: none; }
.c-day { font: 700 max(10.5px, 2.8cqw)/1.2 var(--inv-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--c-accent); }
.c-date { font: 500 max(19px, 6cqw)/1.15 var(--inv-display); letter-spacing: -.01em; }
.c-time { font: 500 max(13px, 3.6cqw)/1.3 var(--inv-sans); color: var(--c-sub); }
.c-where { display: grid; gap: .6cqw; max-width: 100%; margin-top: 1.5cqw; overflow-wrap: anywhere; }
.c-venue { font: 600 max(15px, 4.4cqw)/1.25 var(--inv-display); }
.c-city { font: 500 max(12.5px, 3.4cqw)/1.3 var(--inv-sans); color: var(--c-sub); }

/* Golden Hour card: cream stock, a foil Bloom, the sun coming up under the names */
[data-theme="golden"] .card-bg { background: radial-gradient(110% 46% at 50% 112%, #FFD98A 0%, #FFE9B8 34%, transparent 72%), var(--c-bg); }
[data-theme="golden"] .card-bg::before { content: ''; position: absolute; inset: 3.4cqw; border: 1px solid #C99A45; border-radius: 1px; }
[data-theme="golden"] .card-bg::after { content: ''; position: absolute; inset: 4.6cqw; border: 1px solid #C99A4566; }
[data-theme="golden"] .orn-rise { position: absolute; left: 50%; bottom: -50cqw; width: 104cqw; margin-left: -52cqw; color: #D08A16; opacity: .5; animation: turn 180s linear infinite; }
[data-theme="golden"] .orn-mark { width: 12cqw; margin-bottom: 2cqw; }
[data-theme="golden"] .c-names { font-weight: 380; }
[data-theme="golden"] .c-amp { background: linear-gradient(135deg, #C4700A, #8F4A00 60%, #B8650A); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
[data-theme="golden"] .card-in { padding-bottom: 20cqw; }

/* After Dark card: an arch of night sky, gold foil lettering in capitals */
[data-theme="afterdark"] .card-bg { border-radius: 50cqw 50cqw 2cqw 2cqw / 46cqw 46cqw 2cqw 2cqw; box-shadow: 0 0 0 1px #FFC53D, 0 30px 50px -24px #000;
  background: radial-gradient(1.4px 1.4px at 20% 30%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 78% 24%, #FFE49A 50%, transparent 52%), radial-gradient(1.2px 1.2px at 88% 58%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 12% 64%, #A9ADFF 50%, transparent 52%), radial-gradient(1.2px 1.2px at 30% 88%, #FFE49A 50%, transparent 52%), radial-gradient(1px 1px at 70% 92%, #fff 50%, transparent 52%), radial-gradient(80% 50% at 50% 0%, #2B2D6E 0%, transparent 75%), linear-gradient(180deg, #16173A, #0C0D27); }
[data-theme="afterdark"] .card-bg::before { content: ''; position: absolute; inset: 2.6cqw; border: 1px solid #FFC53D8c; border-radius: 47cqw 47cqw 1cqw 1cqw / 43.5cqw 43.5cqw 1cqw 1cqw; }
[data-theme="afterdark"] .card-in { padding: 20cqw 12cqw 13cqw; min-height: 150cqw; }
[data-theme="afterdark"] .orn-sky { width: 58cqw; color: #FFC53D; margin-bottom: 1cqw; }
[data-theme="afterdark"] .c-names { font: 400 calc(9.6cqw * var(--fit, 1))/1.12 var(--t-names); letter-spacing: .14em; text-transform: uppercase; margin-right: -.14em; background: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 45%, #FFB02E 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
[data-theme="afterdark"] .c-amp { font: italic 400 .5em/1.6 var(--inv-display); letter-spacing: 0; text-transform: none; -webkit-text-fill-color: #F5EFE0; color: #F5EFE0; }
[data-theme="afterdark"] .c-date { font-family: var(--t-names); letter-spacing: .06em; }
[data-theme="afterdark"] .c-venue { font-family: var(--t-names); font-weight: 400; letter-spacing: .05em; }

/* Headline card: flush left, loud, with a tear-off stub */
[data-theme="headline"] .card-bg { border-radius: 2px; --stub: 25cqw;
  -webkit-mask: radial-gradient(circle 2.6cqw at 0 calc(100% - var(--stub)), transparent 97%, #000 100%) left / 51% 100% no-repeat, radial-gradient(circle 2.6cqw at 100% calc(100% - var(--stub)), transparent 97%, #000 100%) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 2.6cqw at 0 calc(100% - var(--stub)), transparent 97%, #000 100%) left / 51% 100% no-repeat, radial-gradient(circle 2.6cqw at 100% calc(100% - var(--stub)), transparent 97%, #000 100%) right / 51% 100% no-repeat; }
[data-theme="headline"] .card { filter: drop-shadow(0 18px 18px #00000038); }
[data-theme="headline"] .card-bg { box-shadow: none; }
[data-theme="headline"] .orn-wheel { position: absolute; right: -30cqw; top: -30cqw; width: 78cqw; color: #F2551A; animation: turn 120s linear infinite; }
[data-theme="headline"] .orn-wheel path, [data-theme="headline"] .orn-wheel circle { stroke-width: 3.4; }
[data-theme="headline"] .card-in { align-items: flex-start; justify-content: flex-start; gap: 0; padding: 8cqw 8cqw 0; text-align: left; min-height: 140cqw; }
[data-theme="headline"] .c-eyebrow { display: flex; align-items: center; gap: 2cqw; max-width: 52%; letter-spacing: .12em; color: var(--c-ink); }
[data-theme="headline"] .c-eyebrow::before { content: ''; flex: none; width: 2.6cqw; height: 2.6cqw; background: #F2551A; }
[data-theme="headline"] .c-n:first-child { grid-column: 1 / -1; }
[data-theme="headline"] .c-n { min-width: 0; }
[data-theme="headline"] .c-names { display: grid; grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: start; width: 100%; margin: auto 0 0; padding-top: 30cqw; font: 800 calc(17cqw * var(--fit, 1))/.88 var(--t-names); font-variation-settings: 'opsz' 96; letter-spacing: -.045em; }
[data-theme="headline"] .c-amp { margin: 0 .5cqw 0 0; font-size: 0; }
[data-theme="headline"] .c-amp::before { content: '+'; font-size: calc(17cqw * var(--fit, 1)); line-height: .88; color: #F2551A; }
[data-theme="headline"] .c-line { margin-top: 4cqw; font: 500 max(13.5px, 3.8cqw)/1.3 var(--inv-sans); color: var(--c-ink); }
[data-theme="headline"] .c-rule { width: 100%; height: 3px; margin: 4cqw 0 3.4cqw; background: var(--c-ink); opacity: 1; }
[data-theme="headline"] .c-when { grid-template-columns: auto minmax(0, 1fr); gap: 0 4cqw; justify-items: start; align-items: center; width: 100%; margin-bottom: 5cqw; }
[data-theme="headline"] .c-num { display: block; grid-row: 1 / span 3; font: 800 12.4cqw/.9 var(--t-names); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
[data-theme="headline"] .c-day { letter-spacing: .12em; color: var(--c-accent); }
[data-theme="headline"] .c-date { font: 600 max(13.5px, 3.8cqw)/1.25 var(--inv-sans); letter-spacing: 0; }
[data-theme="headline"] .c-time { color: var(--c-ink); }
[data-theme="headline"] .c-where { grid-template-columns: minmax(0, 1fr); align-content: center; width: 100%; height: 25cqw; margin-top: 0; padding: 0 1cqw; border-top: 2px dashed #14121066; }
[data-theme="headline"] .c-venue { font: 800 max(15px, 5cqw)/1.1 var(--t-names); letter-spacing: -.02em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
[data-theme="headline"] .c-city { font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: max(10.5px, 2.8cqw); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Marigold card: a cusped arch on turmeric paper, a toran hung across the top */
[data-theme="marigold"] .card-bg { border-radius: 4px; background: radial-gradient(#E9A01933 1.3px, transparent 1.7px) 0 0 / 4.4cqw 4.4cqw, #FFC53D; box-shadow: 0 0 0 1px #FFE49A, 0 30px 50px -24px #000; }
[data-theme="marigold"] .orn-arch { position: absolute; inset: 3cqw; width: calc(100% - 6cqw); height: calc(100% - 6cqw); }
[data-theme="marigold"] .c-top { position: absolute; left: 0; right: 0; top: 0; }
[data-theme="marigold"] .orn-toran { width: 100%; transform-origin: 50% 0; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.7deg); } }
[data-theme="marigold"] .card-in { padding: 43cqw 15cqw 13cqw; min-height: 152cqw; gap: 2.2cqw; }
[data-theme="marigold"] .c-names { font: 400 calc(12.5cqw * var(--fit, 1))/1.02 var(--t-names); letter-spacing: 0; color: #8E1245; }
[data-theme="marigold"] .c-amp { display: grid; place-items: center; width: 2.2em; height: 2.2em; margin: .35em 0 .3em; border-radius: 50%; background: #8E1245; color: #FFE49A; font: 400 .42em/1 var(--t-names); }
[data-theme="marigold"] .c-line { font-style: normal; font-family: var(--inv-sans); font-size: max(13px, 3.5cqw); }
[data-theme="marigold"] .c-eyebrow { letter-spacing: .12em; max-width: 52cqw; }
[data-theme="marigold"] .c-rule { display: none; }
[data-theme="marigold"] .c-date { font: 400 max(19px, 6cqw)/1.15 var(--t-names); color: #8E1245; }
[data-theme="marigold"] .c-venue { font: 400 max(15px, 4.6cqw)/1.2 var(--t-names); }
[data-theme="marigold"] .orn-row { display: flex; align-items: center; gap: 2.4cqw; margin-top: 2.5cqw; }
[data-theme="marigold"] .orn-bud { width: 6cqw; }
[data-theme="marigold"] .orn-bud:nth-child(2) { width: 9cqw; }

/* Vellum card: white stock, watercolour in the corners, script names */
[data-theme="vellum"] .card-bg { border-radius: 2px; background: #fff; box-shadow: 0 24px 40px -26px #22312c80, 0 1px 4px #22312c26; }
[data-theme="vellum"] .card-bg::before, [data-theme="vellum"] .card-bg::after { content: ''; position: absolute; filter: blur(5cqw); }
[data-theme="vellum"] .card-bg::before { left: -22cqw; top: -18cqw; width: 78cqw; height: 62cqw; border-radius: 46% 54% 60% 40%; background: radial-gradient(circle at 60% 60%, #BFD8CB, #CFE3DA 50%, #CBE0E6 80%); opacity: .95; }
[data-theme="vellum"] .card-bg::after { right: -24cqw; bottom: -20cqw; width: 80cqw; height: 60cqw; border-radius: 60% 40% 44% 56%; background: radial-gradient(circle at 40% 40%, #F3DDD6, #F6E6DC 50%, #D5E6DE 85%); opacity: .95; }
[data-theme="vellum"] .orn-sprig { width: 48cqw; margin-bottom: 2cqw; }
[data-theme="vellum"] .c-names { font: 400 calc(18.5cqw * var(--fit, 1))/.98 var(--t-names); letter-spacing: 0; padding: 0 .1em; }
[data-theme="vellum"] .c-amp { font-size: .5em; margin: .12em 0 0; }
[data-theme="vellum"] .c-eyebrow, [data-theme="vellum"] .c-day { letter-spacing: .2em; }
[data-theme="vellum"] .c-line, [data-theme="vellum"] .c-date { font-weight: 350; }
[data-theme="vellum"] .c-rule { width: 6cqw; height: 6cqw; background: none; border: 1px solid var(--c-accent); border-radius: 50%; transform: scale(.4); margin: 0; }

/* How each card arrives. Only the starting state is animated, so with motion off everything is simply there. */
[data-state="open"] .card { animation: rise .7s var(--inv-ease) both; }
[data-state="open"][data-theme="afterdark"] .card { animation: aperture .95s cubic-bezier(.3, .7, .2, 1) both; }
[data-state="open"][data-theme="headline"] .card { animation: slide .6s var(--inv-ease) both; }
[data-state="open"][data-theme="marigold"] .card { animation: drop .7s var(--inv-spring) both; }
[data-state="open"][data-theme="vellum"] .card { animation: settle .8s ease-out both; }
[data-state="open"] .iv { animation: up .5s var(--inv-ease) both; }
[data-state="open"] .iv:nth-of-type(2) { animation-delay: .06s; }
[data-state="open"] .iv:nth-of-type(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(60px) scale(.9); } }
@keyframes aperture { from { clip-path: circle(0% at 50% 30%); } to { clip-path: circle(120% at 50% 30%); } }
@keyframes slide { from { opacity: 0; transform: translateX(-46%) rotate(-4deg); } }
@keyframes drop { from { opacity: 0; transform: translateY(-34px) scale(.92); } }
@keyframes settle { from { opacity: .3; transform: scale(1.03); filter: blur(7px); } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
/* A theme changed in place by the chooser (app.js marks the stage) is simply there: its entrance is kept for the opening. */
.stage[data-swapped] :is(.card, .iv) { animation: none !important; }

/* ── Open: countdown, the day, the place, good to know ──────────────────────────────────── */
.iv { max-width: 400px; margin: 18px auto 0; }
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cd { display: grid; gap: 4px; padding: 12px 2px 10px; border-radius: 14px; background: var(--panel); text-align: center; }
.cd b { font: 500 26px/1 var(--t-display); font-variant-numeric: tabular-nums; }
.cd span { font: 600 10.5px/1 var(--inv-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--t-sub); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--panel); }
.tabs button { min-height: 44px; padding: 0 4px; border: 0; border-radius: 12px; background: transparent; color: var(--t-sub); font: 600 13.5px/1.1 var(--inv-sans); transition: background var(--inv-tap), color var(--inv-tap); }
.tabs button[aria-selected="true"] { background: var(--lift); color: var(--t-ink); box-shadow: 0 1px 3px #00000026; }
.pan { padding: 6px 4px 0; border-radius: 12px; }
.sched li { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--t-rule); }
.sched li:last-child { border-bottom: 0; }
.sched time { font: 500 17px/1.2 var(--t-display); font-variant-numeric: tabular-nums; color: var(--t-accent); }
.sched span { font-size: 15.5px; line-height: 1.35; }
.sched small { display: block; font-size: 13px; color: var(--t-sub); }
.map-wrap { margin-top: 8px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--t-rule); }
.map { width: 100%; height: 150px; }
.m-land { fill: var(--lift); } .m-park { fill: color-mix(in srgb, #4FA476 34%, var(--lift)); } .m-water { fill: color-mix(in srgb, #5AA7D6 40%, var(--lift)); }
.m-road { fill: none; stroke: color-mix(in srgb, var(--t-ink) 26%, var(--lift)); stroke-width: 6; stroke-linecap: round; }
.m-lane { fill: none; stroke: color-mix(in srgb, var(--t-ink) 16%, var(--lift)); stroke-width: 2.6; }
.m-block { fill: color-mix(in srgb, var(--t-ink) 12%, var(--lift)); }
.m-halo { fill: #FFC53D; opacity: .35; } .m-pin path { fill: #FF9F1C; stroke: #1D1711; stroke-width: 12; stroke-linejoin: round; } .m-core { fill: #16173A; stroke: #FFE49A; stroke-width: 1.4; }
.pl-v { margin-top: 12px; font: 500 20px/1.2 var(--t-display); overflow-wrap: anywhere; }
.pl-c { margin-top: 2px; color: var(--t-sub); overflow-wrap: anywhere; }
.dir { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin: 14px 0 4px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--t-ink); color: var(--t-bg); font: 600 15px/1 var(--inv-sans); text-decoration: none; }
.dir:hover { filter: brightness(1.12); }
.stage .fine { color: var(--t-sub); }
.know { padding: 8px 2px 0; }
.know dt { font: 600 15.5px/1.3 var(--inv-sans); }
.know dd { margin: 2px 0 14px; color: var(--t-sub); font-size: 15px; }

/* ── Open: the reply ────────────────────────────────────────────────────────────────────── */
.rsvp-sec { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--t-rule); }
.rsvp-sec h3 { font: 500 28px/1.1 var(--t-display); letter-spacing: -.015em; text-align: center; }
[data-theme="golden"] .rsvp-sec h3, [data-theme="vellum"] .rsvp-sec h3 { font-style: italic; }
.rsvp { display: grid; gap: 16px; margin-top: 18px; }
.stage .fld > span, .seg legend, .chips legend, .party > span:first-child { font: 600 13.5px/1.25 var(--inv-sans); color: var(--t-ink); }
.rsvp input[type="text"], .rsvp textarea { width: 100%; min-width: 0; padding: 0 14px; border: 1px solid var(--f-bd); border-radius: 12px; background: var(--f-bg); color: var(--t-ink); font-size: 17px; }
.rsvp input[type="text"] { height: 52px; }
.rsvp textarea { display: block; min-height: 76px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.rsvp input:focus-visible, .rsvp textarea:focus-visible { outline-offset: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg legend, .chips legend { margin-bottom: 8px; }
.seg label, .chips label { position: relative; display: block; cursor: pointer; }
.seg input, .chips input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 54px; padding: 4px 8px; border: 1px solid var(--f-bd); border-radius: 12px; background: var(--f-bg); font: 600 15.5px/1.2 var(--inv-sans); text-align: center; transition: background var(--inv-tap), color var(--inv-tap), border-color var(--inv-tap); }
.seg input:checked + span { background: var(--t-ink); border-color: var(--t-ink); color: var(--t-bg); }
.seg input:focus-visible + span, .chips input:focus-visible + span { outline: 3px solid var(--t-focus); outline-offset: 2px; }
.yes-only { display: grid; gap: 16px; }
.party { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage .stepper button { border-color: var(--f-bd); background: var(--f-bg); color: var(--t-ink); }
.stage .stepper output { font-family: var(--t-display); font-size: 22px; min-width: 42px; }
.chips { display: block; }
.chips label { display: inline-block; margin: 0 6px 8px 0; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px; border: 1px solid var(--f-bd); border-radius: 999px; background: var(--f-bg); font: 500 14.5px/1 var(--inv-sans); transition: background var(--inv-tap), color var(--inv-tap), border-color var(--inv-tap); }
.chips input:checked + span { background: var(--t-ink); border-color: var(--t-ink); color: var(--t-bg); }
.rsvp .err { margin: 0; font: 600 14.5px/1.3 var(--inv-sans); color: var(--t-accent); }
.send { min-height: 58px; border: 0; border-radius: 14px; background: var(--btn-bg); color: var(--btn-ink); font: 700 17px/1 var(--inv-sans); box-shadow: inset 0 1px 0 #ffffff59, 0 14px 26px -16px #000000a6; transition: transform var(--inv-tap) var(--inv-ease), filter var(--inv-tap); }
.send:hover { filter: brightness(1.07); }
.send:active { transform: scale(.98); }
.rsvp .fine { margin-top: -6px; text-align: center; }
.send:disabled { opacity: .7; cursor: progress; }
#done { display: grid; justify-items: center; gap: 8px; margin-top: 16px; padding: 26px 16px 18px; border-radius: 18px; background: var(--panel); text-align: center; outline-offset: 4px; }
.done-spin { width: 54px; height: 54px; background: url("../brand/mark.svg") center / contain no-repeat; animation: bloomIn .9s var(--inv-spring) both; }
@keyframes bloomIn { from { transform: scale(.2) rotate(-150deg); opacity: 0; } }
.done-h { font: 500 24px/1.15 var(--t-display); overflow-wrap: anywhere; }
.done-p { color: var(--t-sub); font-size: 15px; max-width: 30em; overflow-wrap: anywhere; }
.done-a { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-top: 4px; }
.done-link, .done-again { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--t-ink); font: 600 14.5px/1 var(--inv-sans); text-decoration: underline; text-underline-offset: 3px; }
.done-link { background: var(--t-ink); color: var(--t-bg); text-decoration: none; }

/* ── The couple's own colours ───────────────────────────────────────────────────────────── */
/* app.js sets --c-bg (paper), --c-ink, --c-accent and --c-sub on the stage and marks it data-custom.
   Each theme keeps its shape and ornament; the colours it had fixed in place now follow those three. */
.stage[data-custom] .env-card { background: var(--c-bg); }
[data-custom][data-theme="golden"] .card-bg { background: radial-gradient(110% 46% at 50% 112%, color-mix(in srgb, var(--c-accent) 32%, var(--c-bg)) 0%, color-mix(in srgb, var(--c-accent) 13%, var(--c-bg)) 34%, transparent 72%), var(--c-bg); }
[data-custom][data-theme="golden"] .card-bg::before { border-color: color-mix(in srgb, var(--c-accent) 70%, var(--c-bg)); }
[data-custom][data-theme="golden"] .card-bg::after { border-color: color-mix(in srgb, var(--c-accent) 30%, var(--c-bg)); }
[data-custom][data-theme="golden"] .orn-rise { color: var(--c-accent); }
[data-custom][data-theme="golden"] .c-amp { background: none; color: var(--c-accent); -webkit-text-fill-color: var(--c-accent); }

[data-custom][data-theme="afterdark"] .card-bg { box-shadow: 0 0 0 1px var(--c-accent), 0 30px 50px -24px #000;
  background: radial-gradient(1.4px 1.4px at 20% 30%, var(--c-ink) 50%, transparent 52%), radial-gradient(1px 1px at 78% 24%, var(--c-accent) 50%, transparent 52%), radial-gradient(1.2px 1.2px at 88% 58%, var(--c-ink) 50%, transparent 52%), radial-gradient(1px 1px at 12% 64%, var(--c-accent) 50%, transparent 52%), radial-gradient(1.2px 1.2px at 30% 88%, var(--c-accent) 50%, transparent 52%), radial-gradient(1px 1px at 70% 92%, var(--c-ink) 50%, transparent 52%), radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--c-ink) 14%, var(--c-bg)) 0%, transparent 75%), var(--c-bg); }
[data-custom][data-theme="afterdark"] .card-bg::before { border-color: color-mix(in srgb, var(--c-accent) 55%, transparent); }
[data-custom][data-theme="afterdark"] .orn-sky { color: var(--c-accent); }
[data-custom][data-theme="afterdark"] .c-names { background: none; color: var(--c-accent); -webkit-text-fill-color: var(--c-accent); }
[data-custom][data-theme="afterdark"] .c-amp { color: var(--c-ink); -webkit-text-fill-color: var(--c-ink); }

[data-custom][data-theme="headline"] .orn-wheel { color: var(--c-accent); }
[data-custom][data-theme="headline"] .c-eyebrow::before { background: var(--c-accent); }
[data-custom][data-theme="headline"] .c-amp::before { color: var(--c-accent); }
[data-custom][data-theme="headline"] .c-where { border-top-color: color-mix(in srgb, var(--c-ink) 40%, transparent); }

[data-custom][data-theme="marigold"] .card-bg { background: radial-gradient(color-mix(in srgb, var(--c-ink) 22%, transparent) 1.3px, transparent 1.7px) 0 0 / 4.4cqw 4.4cqw, color-mix(in srgb, var(--c-accent) 52%, var(--c-bg)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-accent) 30%, var(--c-bg)), 0 30px 50px -24px #000; }
[data-custom][data-theme="marigold"] .orn-arch path:first-child { fill: var(--c-bg); stroke: var(--c-ink); }
[data-custom][data-theme="marigold"] .orn-arch path:last-child { stroke: var(--c-accent); }
[data-custom][data-theme="marigold"] .c-names, [data-custom][data-theme="marigold"] .c-date { color: var(--c-ink); }
[data-custom][data-theme="marigold"] .c-amp { background: var(--c-ink); color: var(--c-bg); }

[data-custom][data-theme="vellum"] .card-bg { background: var(--c-bg); }
[data-custom][data-theme="vellum"] .card-bg::before { background: color-mix(in srgb, var(--c-accent) 26%, var(--c-bg)); }
[data-custom][data-theme="vellum"] .card-bg::after { background: color-mix(in srgb, var(--c-accent) 14%, var(--c-bg)); }
[data-custom][data-theme="vellum"] .env-card { background: radial-gradient(70% 40% at 0% 0%, color-mix(in srgb, var(--c-accent) 26%, var(--c-bg)) 0%, transparent 70%), radial-gradient(60% 36% at 100% 100%, color-mix(in srgb, var(--c-accent) 14%, var(--c-bg)) 0%, transparent 70%), var(--c-bg); }

/* ── Sunfield: a picture theme. A painted meadow fills the card and moves; the names sit in the sky, the place on a paper tag. ── */
:is(.stage, .mini)[data-theme="sunfield"] { --t-bg: #F8DDB8; --t-ink: #2E1C10; --t-sub: #6A4A30; --t-accent: #7F4000; --panel: #F1CE9F; --lift: #FFF3DC;
  --f-bg: #FFF8EA; --f-bd: #C79A62; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FBE6C6; --c-ink: #3B2414; --c-sub: #654222; --c-accent: #7A3C00; --t-names: 'Pinyon Script', 'Fraunces', Georgia, serif;
  --e0: #EBC892; --e1: #FBE3BC; --e2: #F3D5A6; --e-in: linear-gradient(180deg, #F6B24A, #E08A12);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFEFD2 0%, transparent 62%), linear-gradient(180deg, transparent 45%, #F3C78C 100%); }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .ec-names { font: 400 26px/1 var(--t-names); }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .et-names { font: 400 22px/1.2 var(--t-names); }
.scene-still, .scene-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.scene-loop { opacity: 0; transition: opacity .8s ease; }
.scene-loop.on { opacity: 1; }
html[data-motion="reduce"] .scene-loop { display: none; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .card-bg { border-radius: 3px; background: #F9DDB2; box-shadow: 0 30px 50px -26px #5a2e0099, 0 2px 6px #0000001f; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .card-bg::after { content: ''; position: absolute; inset: 3cqw; border: 1px solid #fffffface; border-radius: 1px; pointer-events: none; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .card-in { justify-content: flex-start; min-height: 177.7cqw; padding: 15cqw 10cqw 9cqw; gap: 2cqw; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-eyebrow { color: var(--c-sub); letter-spacing: .2em; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-names { margin: 2.5cqw 0 1.5cqw; font: 400 calc(17.5cqw * var(--fit, 1))/.95 var(--t-names); letter-spacing: 0; padding: 0 .12em; text-shadow: var(--name-sh, 0 1px 0 #fff6e680); }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-amp { font-size: .46em; margin: .1em 0 0; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-line { font-size: max(13.5px, 3.9cqw); }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-rule { width: 9cqw; margin: 1.2cqw 0; }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-date { font: 500 max(18px, 5.6cqw)/1.15 var(--inv-display); }
/* where a sky is too bright for its lettering, a wash of the sky's own dark sits behind the words: no edge, no box */
:is([data-theme="bluehour"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="coralcourt"], [data-theme="arewa"], [data-theme="mandap"], [data-theme="kente"], [data-theme="diyalake"]) .card-in { isolation: isolate; }
:is([data-theme="bluehour"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="coralcourt"], [data-theme="arewa"], [data-theme="mandap"], [data-theme="kente"], [data-theme="diyalake"]) .card-in::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--sky-veil); }
:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .c-where { margin-top: auto; padding: 3.4cqw 6cqw 3.2cqw; border-radius: 2px; background: color-mix(in srgb, var(--c-bg) 90%, transparent); box-shadow: 0 1px 0 #ffffff99 inset, 0 10px 18px -10px #3b241499; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); transform: rotate(-1.2deg); }
[data-state="open"]:is([data-theme="sunfield"], [data-theme="moonlit"], [data-theme="citrus"], [data-theme="tide"], [data-theme="lastfling"], [data-theme="campfire"], [data-theme="glasshouse"], [data-theme="bluehour"], [data-theme="coralcourt"], [data-theme="asooke"], [data-theme="indigoroyal"], [data-theme="palmwine"], [data-theme="kente"], [data-theme="arewa"], [data-theme="mehndi"], [data-theme="mandap"], [data-theme="diyalake"]) .card { animation: rise .8s var(--inv-ease) both; }

:is(.stage, .mini)[data-theme="moonlit"] { --t-bg: #14173F; --t-ink: #F6EBD6; --t-sub: #C9C3E6; --t-accent: #FFC76A; --panel: #1E2258; --lift: #2B2F74; --t-focus: #FFC76A;
  --f-bg: #101236; --f-bd: #5A5DA6; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #191C4E; --c-ink: #F6EBD6; --c-sub: #C9C3E6; --c-accent: #FFC76A; --name-sh: 0 2px 14px #00000066;
  --e0: #2A2D78; --e1: #20225C; --e2: #181A49; --e-in: linear-gradient(180deg, #FFD466, #E79A14);
  background-image: radial-gradient(120% 60% at 50% 0%, #2B2F7466 0%, transparent 62%); }
[data-theme="moonlit"] .env-to { color: #F6EBD6; }
[data-theme="moonlit"] .card-bg::after { border-color: #ffffff59; }
[data-theme="moonlit"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

:is(.stage, .mini)[data-theme="citrus"] { --t-bg: #FFF4CC; --t-ink: #2B3A1E; --t-sub: #556540; --t-accent: #7A5200; --panel: #F6E7AE; --lift: #FFFDF0; 
  --f-bg: #FFFDF2; --f-bd: #BFA85A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFFBE6; --c-ink: #2B3A1E; --c-sub: #55653F; --c-accent: #7D5300; --name-sh: 0 1px 0 #ffffff80;
  --e0: #F0DC8E; --e1: #FFF3C4; --e2: #F8E7A6; --e-in: linear-gradient(180deg, #8DB255, #5E8A2E);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFFDF066 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="tide"] { --t-bg: #FBDDD6; --t-ink: #4A2A3A; --t-sub: #6B4655; --t-accent: #14585E; --panel: #F4C8C2; --lift: #FFF3EE; 
  --f-bg: #FFF8F4; --f-bd: #C99A98; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFF4EC; --c-ink: #4A2A3A; --c-sub: #5E3A4A; --c-accent: #0E5258; --name-sh: 0 1px 0 #ffffff80;
  --e0: #F2BDB8; --e1: #FDE0DA; --e2: #F7CFC9; --e-in: linear-gradient(180deg, #7FCFCB, #3E9FA3);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFF3EE66 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="lastfling"] { --t-bg: #B3124F; --t-ink: #FFF3E6; --t-sub: #FFDCE3; --t-accent: #FFE08A; --panel: #9C0D43; --lift: #C4215C; --t-focus: #FFE08A;
  --f-bg: #9C0E44; --f-bd: #F28BAE; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #8E0C3E; --c-ink: #FFF3E6; --c-sub: #FFE6EB; --c-accent: #FFE49A; --name-sh: 0 2px 14px #00000066;
  --sky-veil: linear-gradient(180deg, #5A062666 0%, #5A062673 48%, #5A062666 56%, #5A062600 72%);
  --e0: #D93670; --e1: #C21F5A; --e2: #A81149; --e-in: linear-gradient(180deg, #FFE08A, #E8A72A);
  background-image: radial-gradient(120% 60% at 50% 0%, #E2356F66 0%, transparent 62%); }
[data-theme="lastfling"] .env-to { color: #FFF3E6; }
[data-theme="lastfling"] .card-bg::after { border-color: #ffffff59; }
[data-theme="lastfling"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

:is(.stage, .mini)[data-theme="campfire"] { --t-bg: #0F3A40; --t-ink: #F4EAD8; --t-sub: #B9D1CC; --t-accent: #FFB25A; --panel: #154A50; --lift: #1F5E64; --t-focus: #FFB25A;
  --f-bg: #0B2E33; --f-bd: #4E8C8C; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #0C2F35; --c-ink: #F4EAD8; --c-sub: #DCEAE6; --c-accent: #FFBE73; --name-sh: 0 2px 14px #00000066;
  --sky-veil: linear-gradient(180deg, #08262C00 8%, #08262C66 24%, #08262C80 38%, #08262C99 56%, #08262C00 72%);
  --e0: #1F6168; --e1: #17505A; --e2: #11424A; --e-in: linear-gradient(180deg, #FFB25A, #E0701A);
  background-image: radial-gradient(120% 60% at 50% 0%, #1F5E6466 0%, transparent 62%); }
[data-theme="campfire"] .env-to { color: #F4EAD8; }
[data-theme="campfire"] .card-bg::after { border-color: #ffffff59; }
[data-theme="campfire"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

:is(.stage, .mini)[data-theme="glasshouse"] { --t-bg: #EAF2E8; --t-ink: #24382C; --t-sub: #4A6353; --t-accent: #8C434D; --panel: #D9E7D8; --lift: #FFFFFF; 
  --f-bg: #FFFFFF; --f-bd: #9DB5A2; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FBFDF8; --c-ink: #24382C; --c-sub: #304538; --c-accent: #873F49; --name-sh: 0 1px 0 #ffffff80;
  --e0: #CFE0CF; --e1: #EEF5EC; --e2: #DFEBDD; --e-in: linear-gradient(180deg, #F3C7CC, #D99AA2);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFFFFF66 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="bluehour"] { --t-bg: #1B2A8C; --t-ink: #FFF4E4; --t-sub: #CFD3FF; --t-accent: #FFC978; --panel: #2536A6; --lift: #3447C2; --t-focus: #FFC978;
  --f-bg: #152070; --f-bd: #7C8AE8; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #161B5C; --c-ink: #FFF4E4; --c-sub: #E6E8FF; --c-accent: #FFD08A; --name-sh: 0 2px 14px #00000066;
  --sky-veil: linear-gradient(180deg, #141A5E00 8%, #141A5E66 24%, #141A5E8C 40%, #141A5E99 56%, #141A5E00 72%);
  --e0: #3447C2; --e1: #2536A6; --e2: #1C2A8A; --e-in: linear-gradient(180deg, #FFC978, #E8873A);
  background-image: radial-gradient(120% 60% at 50% 0%, #3447C266 0%, transparent 62%); }
[data-theme="bluehour"] .env-to { color: #FFF4E4; }
[data-theme="bluehour"] .card-bg::after { border-color: #ffffff59; }
[data-theme="bluehour"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

/* The three royal scenes, made for an Owambe: a coral-hung palace door at dusk, aso-oke drapes under a champagne sky, adire and a peacock by night. */
:is(.stage, .mini)[data-theme="coralcourt"] { --t-bg: #6B1220; --t-ink: #FFF1DC; --t-sub: #F6CFC0; --t-accent: #FFD27A; --panel: #7E1A2A; --lift: #96253A; --t-focus: #FFD27A;
  --f-bg: #5A0E1A; --f-bd: #D98A7A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #5E0F1C; --c-ink: #FFF1DC; --c-sub: #FFE2D2; --c-accent: #FFD98A; --name-sh: 0 2px 14px #00000073;
  --sky-veil: linear-gradient(180deg, #4A0A1400 6%, #4A0A1459 24%, #4A0A148C 40%, #4A0A1480 52%, #4A0A1400 68%);
  --e0: #A32438; --e1: #8A1A2C; --e2: #741424; --e-in: linear-gradient(180deg, #FFD98A, #E0A02A);
  background-image: radial-gradient(120% 60% at 50% 0%, #96253A66 0%, transparent 62%); }
[data-theme="coralcourt"] .env-to { color: #FFF1DC; }
[data-theme="coralcourt"] .card-bg::after { border-color: #ffffff59; }
[data-theme="coralcourt"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

:is(.stage, .mini)[data-theme="asooke"] { --t-bg: #F6E3B8; --t-ink: #4A1220; --t-sub: #6B3A2E; --t-accent: #7A4E00; --panel: #EED59E; --lift: #FFF8E6;
  --f-bg: #FFFBEF; --f-bd: #C9A75A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFF4D6; --c-ink: #4A1220; --c-sub: #5E2A2A; --c-accent: #7A4E00; --name-sh: 0 1px 0 #ffffff80;
  --e0: #E9CF8E; --e1: #F8E8BC; --e2: #F0DAA2; --e-in: linear-gradient(180deg, #A8263C, #6E1224);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFF8E666 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="indigoroyal"] { --t-bg: #121A5A; --t-ink: #F8EEDC; --t-sub: #CDD2F5; --t-accent: #F2CF7A; --panel: #1B2470; --lift: #2A3590; --t-focus: #F2CF7A;
  --f-bg: #0E1448; --f-bd: #6F7AD0; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #141A56; --c-ink: #F8EEDC; --c-sub: #E3E6FF; --c-accent: #F6D68A; --name-sh: 0 2px 14px #00000066;
  --e0: #2A3590; --e1: #1F2978; --e2: #171F62; --e-in: linear-gradient(180deg, #F6D68A, #D49A2A);
  background-image: radial-gradient(120% 60% at 50% 0%, #2A359066 0%, transparent 62%); }
[data-theme="indigoroyal"] .env-to { color: #F8EEDC; }
[data-theme="indigoroyal"] .card-bg::after { border-color: #ffffff59; }
[data-theme="indigoroyal"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

/* Three heritage scenes from West Africa: an Igbo palm-wine courtyard at sunset, kente under a baobab at sunrise, a Hausa palace at dusk. */
:is(.stage, .mini)[data-theme="palmwine"] { --t-bg: #F6D2A8; --t-ink: #3A1608; --t-sub: #6A3A1E; --t-accent: #8A2E0A; --panel: #EFC08C; --lift: #FFF1DC;
  --f-bg: #FFF8EC; --f-bd: #C98A5A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFF0DC; --c-ink: #3A1608; --c-sub: #4E220E; --c-accent: #8A2E0A; --name-sh: 0 1px 0 #ffe7c866;
  --e0: #E9A872; --e1: #F8D2A6; --e2: #F0BE8A; --e-in: linear-gradient(180deg, #E0602A, #A8401A);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFE2C266 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="kente"] { --t-bg: #F9D0C4; --t-ink: #3B1410; --t-sub: #6A3428; --t-accent: #1F5E2A; --panel: #F3BBAA; --lift: #FFF2EC;
  --f-bg: #FFF9F5; --f-bd: #D08E7E; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFF2E8; --c-ink: #3B1410; --c-sub: #4E1E16; --c-accent: #1F5E2A; --name-sh: 0 1px 0 #ffe6de80;
  --sky-veil: linear-gradient(180deg, #FBC6B800 22%, #FBC6B89E 36%, #FBC6B8B8 46%, #FBC6B89E 54%, #FBC6B800 66%);
  --e0: #F0A898; --e1: #FCD8CC; --e2: #F6C2B4; --e-in: linear-gradient(180deg, #F2C24B, #C28F12);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFF2EC66 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="arewa"] { --t-bg: #0B3A40; --t-ink: #FFF1DC; --t-sub: #CDE6E2; --t-accent: #FFC46A; --panel: #0F4A50; --lift: #1A5E64; --t-focus: #FFC46A;
  --f-bg: #082E33; --f-bd: #4E9A98; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #0B3A40; --c-ink: #FFF1DC; --c-sub: #E3F2EF; --c-accent: #FFC97A; --name-sh: 0 2px 14px #00000066;
  --sky-veil: linear-gradient(180deg, #06262A00 8%, #06262A4D 24%, #06262A80 40%, #06262A80 54%, #06262A00 70%);
  --e0: #1A6A70; --e1: #12565C; --e2: #0E474C; --e-in: linear-gradient(180deg, #FFC97A, #E0861A);
  background-image: radial-gradient(120% 60% at 50% 0%, #1A5E6466 0%, transparent 62%); }
[data-theme="arewa"] .env-to { color: #FFF1DC; }
[data-theme="arewa"] .card-bg::after { border-color: #ffffff59; }
[data-theme="arewa"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

/* Three Indian scenes: a mehndi swing in a garden, a wedding mandap of roses and marigolds, a palace lake of floating diyas. */
:is(.stage, .mini)[data-theme="mehndi"] { --t-bg: #E4F2E2; --t-ink: #123B2A; --t-sub: #3A5A48; --t-accent: #A3165A; --panel: #D2E8D0; --lift: #FFFFFF;
  --f-bg: #FFFFFF; --f-bd: #8FB59A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #F4FBF2; --c-ink: #123B2A; --c-sub: #1E4434; --c-accent: #A3165A; --name-sh: 0 1px 0 #ffffff80;
  --e0: #C4E0C4; --e1: #EEF7EC; --e2: #DCEDDA; --e-in: linear-gradient(180deg, #FFB020, #E07A00);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFFFFF66 0%, transparent 62%); }

:is(.stage, .mini)[data-theme="mandap"] { --t-bg: #7A0A12; --t-ink: #FFF0D6; --t-sub: #FFD6C4; --t-accent: #FFD27A; --panel: #8E1420; --lift: #A8202C; --t-focus: #FFD27A;
  --f-bg: #6A0810; --f-bd: #E0907A; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #6E0A12; --c-ink: #FFF0D6; --c-sub: #FFE4D2; --c-accent: #FFD98A; --name-sh: 0 2px 14px #00000073;
  --sky-veil: linear-gradient(180deg, #5A060A00 6%, #5A060A40 22%, #5A060A80 40%, #5A060A8C 54%, #5A060A00 70%);
  --e0: #B0202C; --e1: #961824; --e2: #7E121C; --e-in: linear-gradient(180deg, #FFD98A, #E0A02A);
  background-image: radial-gradient(120% 60% at 50% 0%, #A8202C66 0%, transparent 62%); }
[data-theme="mandap"] .env-to { color: #FFF0D6; }
[data-theme="mandap"] .card-bg::after { border-color: #ffffff59; }
[data-theme="mandap"] .c-where { box-shadow: 0 1px 0 #ffffff26 inset, 0 10px 18px -10px #000000b3; }

:is(.stage, .mini)[data-theme="diyalake"] { --t-bg: #E6D6F0; --t-ink: #241036; --t-sub: #4A3260; --t-accent: #7A1650; --panel: #D8C2E8; --lift: #FFF8FF;
  --f-bg: #FFFBFF; --f-bd: #B49AC8; --btn-bg: linear-gradient(135deg, #FFE9A6 0%, #FFC53D 42%, #FF9F1C 100%); --btn-ink: #1E1400;
  --c-bg: #FFF4F8; --c-ink: #241036; --c-sub: #34184A; --c-accent: #7A1650; --name-sh: 0 1px 0 #f4e8ff59;
  --sky-veil: linear-gradient(180deg, #CFA8D800 24%, #CFA8D880 38%, #CFA8D899 48%, #CFA8D873 56%, #CFA8D800 66%);
  --e0: #C8AEDC; --e1: #F0E4F8; --e2: #E0CCEE; --e-in: linear-gradient(180deg, #FFE39A, #E0A82A);
  background-image: radial-gradient(120% 60% at 50% 0%, #FFF8FF66 0%, transparent 62%); }

/* Each picture theme sets its names in its own voice. */
/* The royal scenes use faces that set Yoruba names whole: Petrona for the court and the cloth, Pinyon Script for the night. */
:is([data-theme="coralcourt"], [data-theme="asooke"]) { --t-names: var(--inv-plain); }
[data-theme="coralcourt"] .c-names { font: 600 calc(12.6cqw * var(--fit, 1))/1.04 var(--t-names); letter-spacing: .01em; }
[data-theme="coralcourt"] :is(.ec-names, .et-names) { font: 600 18px/1.15 var(--t-names); }
[data-theme="asooke"] .c-names { font: italic 500 calc(13.6cqw * var(--fit, 1))/1.02 var(--t-names); letter-spacing: 0; }
[data-theme="asooke"] :is(.ec-names, .et-names) { font: italic 500 19px/1.1 var(--t-names); }
[data-theme="indigoroyal"] { --t-names: 'Pinyon Script', 'Fraunces', Georgia, serif; }
[data-theme="indigoroyal"] .c-names { color: var(--c-accent); font-size: calc(15.5cqw * var(--fit, 1)); }   /* a little smaller, so two names stay clear of the peacock */
/* The heritage scenes: Petrona italic sets Igbo names whole; Fraunces made heavy for kente; Arewa takes the Marcellus capitals (below);
   Pinyon Script for the mehndi garden, Rozha One for the mandap, Fraunces italic for the lake. */
[data-theme="palmwine"] { --t-names: var(--inv-plain); }
[data-theme="palmwine"] .c-names { font: italic 600 calc(13.2cqw * var(--fit, 1))/1.04 var(--t-names); letter-spacing: 0; }
[data-theme="palmwine"] :is(.ec-names, .et-names) { font: italic 600 19px/1.12 var(--t-names); }
[data-theme="kente"] .c-names { font: 650 calc(14.2cqw * var(--fit, 1))/1 var(--t-names); letter-spacing: -.01em; }
[data-theme="kente"] :is(.ec-names, .et-names) { font: 650 19px/1.12 var(--t-names); }
[data-theme="mehndi"] { --t-names: 'Pinyon Script', 'Fraunces', Georgia, serif; }
[data-theme="mehndi"] .c-names { color: var(--c-accent); }
[data-theme="mandap"] { --t-names: 'Rozha One', 'Fraunces', Georgia, serif; }
[data-theme="mandap"] .c-names { color: var(--c-accent); font-size: calc(14cqw * var(--fit, 1)); line-height: 1.02; }
[data-theme="mandap"] :is(.ec-names, .et-names) { font: 400 19px/1.12 var(--t-names); }
[data-theme="diyalake"] .c-names { font: italic 400 calc(15cqw * var(--fit, 1))/1 var(--t-names); }
[data-theme="diyalake"] :is(.ec-names, .et-names) { font: italic 400 20px/1.1 var(--t-names); }
:is([data-theme="moonlit"], [data-theme="bluehour"], [data-theme="arewa"]) { --t-names: 'Marcellus', 'Fraunces', Georgia, serif; }
:is([data-theme="moonlit"], [data-theme="bluehour"], [data-theme="arewa"]) .c-names { font: 400 calc(10.4cqw * var(--fit, 1))/1.12 var(--t-names); letter-spacing: .13em; text-transform: uppercase; margin-right: -.13em; padding: 0; }
:is([data-theme="moonlit"], [data-theme="bluehour"], [data-theme="arewa"]) .c-amp { font: italic 400 .5em/1.7 var(--inv-display); letter-spacing: 0; text-transform: none; }
:is([data-theme="moonlit"], [data-theme="bluehour"], [data-theme="arewa"]) :is(.ec-names, .et-names) { font: 400 13px/1.3 var(--t-names); letter-spacing: .16em; text-transform: uppercase; }
[data-theme="citrus"] { --t-names: 'Fraunces', Georgia, serif; }
[data-theme="citrus"] .c-names { font: italic 500 calc(13.5cqw * var(--fit, 1))/1 var(--t-names); font-variation-settings: 'opsz' 144; letter-spacing: -.02em; }
[data-theme="citrus"] :is(.ec-names, .et-names) { font: italic 500 17px/1.1 var(--t-names); }
[data-theme="lastfling"] { --t-names: 'Rozha One', 'Fraunces', Georgia, serif; }
[data-theme="lastfling"] .c-names { font: 400 calc(13.5cqw * var(--fit, 1))/1 var(--t-names); letter-spacing: 0; }
[data-theme="lastfling"] :is(.ec-names, .et-names) { font: 400 18px/1.15 var(--t-names); }
[data-theme="campfire"] { --t-names: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; --t-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; }
[data-theme="campfire"] .c-names { font: 800 calc(13cqw * var(--fit, 1))/.95 var(--t-names); font-variation-settings: 'opsz' 96; letter-spacing: -.035em; }
[data-theme="campfire"] .c-amp { font-weight: 500; }
[data-theme="campfire"] :is(.ec-names, .et-names) { font: 800 18px/1 var(--t-names); letter-spacing: -.02em; }

/* ── The chooser's small cards ──────────────────────────────────────────────────────────── */
.mini .card-bg { border-radius: 0; box-shadow: none; }
.mini .card-in { position: absolute; inset: 0; min-height: 0; }
.mini .orn { animation: none !important; }
.mini .c-names { display: grid; }
.mini .th-img, .mini .th-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.mini .th-vid { opacity: 0; transition: opacity .5s ease; }
.mini .th-vid.on { opacity: 1; }
.mini[data-theme="afterdark"] .card-bg { inset: 5cqw 5cqw 0; border-radius: 45cqw 45cqw 0 0 / 42cqw 42cqw 0 0; }
.mini[data-theme="afterdark"] .card-bg::before { border-radius: 43cqw 43cqw 0 0 / 40cqw 40cqw 0 0; border-bottom: 0; bottom: 0; }
.mini[data-theme="afterdark"] .card-in { padding-top: 26cqw; justify-content: flex-start; }
.mini[data-theme="golden"] .card-in { justify-content: flex-start; padding-top: 20cqw; }
.mini[data-theme="vellum"] .card-in { justify-content: flex-start; padding-top: 22cqw; }
.mini[data-theme="headline"] .card-bg { -webkit-mask: none; mask: none; }
.mini[data-theme="headline"] .c-names { margin: 0; padding-top: 52cqw; }
.mini[data-theme="marigold"] .card-in { padding-top: 50cqw; justify-content: flex-start; }
.c-time:empty { display: none; }

/* Each painting keeps its own subject clear: words step round the lemon branch and the mirror ball, the tag sits below the fire and the tower. */
[data-theme="citrus"] .card-in { padding-top: 21cqw; }
[data-theme="lastfling"] .c-eyebrow { max-width: 58cqw; }
:is([data-theme="lastfling"], [data-theme="campfire"]) .card-in { padding-bottom: 3.6cqw; }

/* ── Names a theme's own face cannot set ────────────────────────────────────────────────── */
/* When a name has a letter the theme's name face lacks (app.js marks the stage and the chooser's small card), the names are
   set whole in Petrona rather than letter by letter in whatever the browser finds. Everything else about the theme stays. */
:is(.stage, .mini)[data-namefall] { --t-names: var(--inv-plain); }
.stage[data-namefall] .sv-names, .stage[data-svfall] .sv-names { font-family: var(--inv-plain); }
