/* Four complete stationery palettes. Event illustrations keep their own colours. */
body[data-card-theme]{--ivory:#f8f3e9;--paper:#fffcf4;--green:#735231;--deep:#382b21;--ink:#493b2f;--gold:#94703e;--gold-light:#efdab0;--muted:#756757;--line:#d9c8a9;--field:#eee2cc;--env:#e3cfa9;--env-light:#fff1d5;--env-shadow:#d3b98c;--foil:#b58a47;--ribbon-shadow:#9c7138;--ribbon-mid:#dfbf80;--ribbon-shine:#fff4d6;--light:#ffd58c;--light-rgb:255,213,140;--petal-a:#e6a4b1;--petal-b:#b55773}
body[data-card-theme=emerald]{--ivory:#edf3ec;--paper:#f8fcf4;--green:#245547;--deep:#102f29;--ink:#29483e;--gold:#867345;--gold-light:#e2d5ad;--muted:#627467;--line:#bfd0bc;--field:#dce8da;--env:#b9d0bc;--env-light:#e5efe0;--env-shadow:#8eaf9a;--foil:#9b8a52;--ribbon-shadow:#305d4b;--ribbon-mid:#81af91;--ribbon-shine:#e0edc8;--light:#b9efcb;--light-rgb:185,239,203}
body[data-card-theme=rose]{--ivory:#f8efef;--paper:#fff9f7;--green:#813d54;--deep:#421f32;--ink:#54373f;--gold:#a07258;--gold-light:#efcfbf;--muted:#81656f;--line:#e0bec5;--field:#efdce0;--env:#e6c1ca;--env-light:#fce5e9;--env-shadow:#cea0ad;--foil:#af7c72;--ribbon-shadow:#955567;--ribbon-mid:#d899ab;--ribbon-shine:#ffe4e9;--light:#ffd0df;--light-rgb:255,208,223}
body[data-card-theme=blue]{--ivory:#edf0f6;--paper:#f8faff;--green:#30496e;--deep:#16253f;--ink:#34465e;--gold:#8e764b;--gold-light:#e8d8b7;--muted:#68778b;--line:#bcc9dd;--field:#dce3f0;--env:#aebfdc;--env-light:#e3e9f7;--env-shadow:#849cbd;--foil:#9f8a66;--ribbon-shadow:#3e557b;--ribbon-mid:#93acd6;--ribbon-shine:#e5eeff;--light:#c9dcff;--light-rgb:201,220,255}
body[data-card-theme] .topbar{background:color-mix(in srgb,var(--paper) 94%,transparent);border-color:var(--line)}
body[data-card-theme] :is(.monogram-logo>span,.header-tools button>span,.cover h1,.guest-dedication>strong,.couple-names,.dua-section h2,.hero-paper .bismillah,.insert-names,.footer-signature){color:var(--green)}
body[data-card-theme] :is(.monogram-logo small,.cover-urdu,.cover-date,.cover-heading .eyebrow,.guest-dedication>span,.opening-instruction p,.open-prompt,.music-hint,.sample-marker,.formal-invite,.parentage,.hero-city,.bismillah-translation){color:var(--muted)}
body[data-card-theme] .cover{background:var(--field);color:var(--ink)}
body[data-card-theme] .cover-shade{background:radial-gradient(ellipse at 50% 30%,var(--paper),transparent 72%)}
body[data-card-theme] :is(.cover:before,.cover:after,.invitation-hero:before){border-color:var(--line)}
body[data-card-theme] :is(.programme-section,.share-section,.venue-copy,.celebration-ribbon){background:var(--field);color:var(--ink)}
body[data-card-theme] :is(.families-section,.invitation-hero){background:radial-gradient(ellipse at top,var(--paper),var(--field))}
body[data-card-theme] :is(.countdown-section,.rsvp-section){background:radial-gradient(ellipse at top,var(--green),var(--deep))}
body[data-card-theme] :is(footer,dialog,.event-content){background:var(--paper)}
body[data-card-theme] :is(.event-tabs button[aria-selected=true],.volume-panel){background:var(--paper)}
body[data-card-theme] :is(.section-heading h2 em,.share-section h2 em,.venue-copy>h2 em,.cover h1 em){color:var(--gold)}
body[data-card-theme] .event-content>h3{color:var(--green)}
body[data-card-theme] :is(.hero-paper,.inside-card){background-color:var(--paper);background-blend-mode:multiply;color:var(--ink)}
body[data-card-theme] :is(.hero-paper,.inside-card):after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 85px color-mix(in srgb,var(--field) 55%,transparent);z-index:1}
body[data-card-theme] .envelope-back{background:var(--env);border-color:var(--foil)}
body[data-card-theme] .fold-left{background:linear-gradient(108deg,var(--env-light),var(--env-shadow))}
body[data-card-theme] .fold-right{background:linear-gradient(253deg,var(--env-light),var(--env-shadow))}
body[data-card-theme] .fold-bottom{background:linear-gradient(10deg,var(--env),var(--env-light))}
body[data-card-theme] .envelope-flap{background:linear-gradient(155deg,var(--env-light),var(--env))}
body[data-card-theme] .fold-emboss{color:var(--env);opacity:.95;filter:drop-shadow(1px 1px 0 var(--foil)) drop-shadow(-1px -1px 0 var(--paper))}
body[data-card-theme] .envelope-border{border-color:var(--foil);outline-color:var(--paper);opacity:.55}
body[data-card-theme] .envelope-inscription{color:var(--green);text-shadow:0 1px var(--env-light)}
body[data-card-theme] .wax-medallion{z-index:21;background:radial-gradient(ellipse at 30% 20%,var(--ribbon-mid),var(--green) 48%,var(--deep) 90%);border-color:var(--green);color:var(--gold-light);text-shadow:0 -1px var(--deep);box-shadow:inset 2px 2px 3px #fff5,inset -2px -3px 4px #0005,0 5px 9px #26171750}
body[data-card-theme] .wax-medallion:before{border-color:var(--gold-light)}
body[data-card-theme] .wax-medallion small{color:var(--gold-light)}
#satinGold stop:nth-child(1),#satinGold stop:nth-child(5){stop-color:var(--ribbon-shadow)}
#satinGold stop:nth-child(2),#satinGold stop:nth-child(4){stop-color:var(--ribbon-mid)}
#satinGold stop:nth-child(3){stop-color:var(--ribbon-shine)}
.silk-edge{stroke:var(--ribbon-shadow)}.silk-highlight{stroke:var(--ribbon-shine)}
.seal-aura{opacity:.65;background:radial-gradient(ellipse,rgba(var(--light-rgb),.9),transparent 68%);animation:sealBreath 3.5s ease-in-out infinite;filter:none;transform:scale(1.2)}
.opening .seal-aura{animation:sealGlow 1.5s ease-out both}
.seal-flash{position:fixed;width:90px;height:90px;border-radius:50%;z-index:140;pointer-events:none;transform:translate(-50%,-50%);box-shadow:0 0 30px rgba(var(--light-rgb),.7),inset 0 0 20px rgba(var(--light-rgb),.4);border:1px solid var(--light);animation:sealRipple 1.2s ease-out both}
.seal-spark{position:fixed;width:5px;height:5px;background:var(--light);border-radius:50%;box-shadow:0 0 8px var(--light);z-index:140;pointer-events:none;animation:sealSpark 1.3s ease-out both}
.seal-spark.flower-spark{width:10px;height:14px;border-radius:85% 10% 70% 30%;background:linear-gradient(135deg,var(--petal-a),var(--petal-b));box-shadow:none}
/* Readable controls remain available after opening. */
.roshni-picker{gap:5px;flex-wrap:wrap;justify-content:center;max-width:100%;direction:ltr}
.roshni-picker>span{flex-basis:100%;text-align:center;font-size:8px;letter-spacing:1.8px;color:var(--muted);margin:0 0 3px}
.light-swatch{display:flex;align-items:center;justify-content:center;gap:6px;min-width:58px;width:auto;height:40px;padding:4px 8px;background:transparent!important;border:1px solid transparent;outline:none;border-radius:5px;color:var(--ink);font-size:10px;transition:background .3s,border-color .3s}
.light-swatch:before{content:'';width:13px;height:13px;border-radius:50%;background:var(--swatch);box-shadow:inset 0 0 0 1px #0002;flex-shrink:0}
.light-swatch.selected{background:var(--paper)!important;border-color:var(--gold)}
.light-swatch:focus-visible,.flower-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.flower-toggle{border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);min-height:38px;padding:6px 14px;font-size:10px;display:inline-flex;align-items:center;justify-content:center;gap:7px}
.flower-toggle:before{content:'✿';font-size:16px;color:var(--gold)}
.cover-flower-control{position:relative;z-index:10;margin:8px 0 0}
.card-personalisation{display:flex;align-items:center;justify-content:center;gap:24px;padding:15px 20px;background:var(--paper);border-bottom:1px solid var(--line);position:relative;z-index:4}
.card-personalisation .roshni-picker{margin:0}.card-personalisation .roshni-picker>span{flex-basis:auto;margin:0 8px 0 0}
.lang-ur .light-swatch,.lang-ur .flower-toggle{font-size:14px}.lang-ur .roshni-picker>span{font-size:12px}
/* Light curtains and engraved wedding motifs sit around the stationery. */
.ambience-host{position:relative;isolation:isolate}.wedding-ornaments{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:-1;color:var(--gold)}
.cover .wedding-ornaments{z-index:0}.wedding-motif{position:absolute;width:60px;height:75px;opacity:.1;animation:motifFloat 8s ease-in-out infinite alternate;animation-play-state:paused}
.ambience-visible .wedding-motif{animation-play-state:running}
.cover-heading,.guest-dedication,.opening-instruction{position:relative;z-index:2}
.fairy-curtain{position:absolute;top:0;width:1px;height:66%;max-height:560px;background:linear-gradient(var(--gold),transparent);opacity:.65;pointer-events:none;z-index:3}
.fairy-curtain.left{left:3%}.fairy-curtain.right{right:3%;height:80%}
.fairy-curtain i{position:absolute;left:-2px;width:5px;height:7px;border-radius:50%;background:var(--light);box-shadow:0 0 7px 2px var(--light),0 0 23px 7px rgba(var(--light-rgb),.3);animation:gentleTwinkle 4s var(--delay) ease-in-out infinite alternate;animation-play-state:paused}
.ambience-visible .fairy-curtain i{animation-play-state:running}
.cover .festoon{opacity:1}.cover .festoon .bulb{filter:drop-shadow(0 0 5px var(--light)) drop-shadow(0 0 12px var(--light))}
.hanging-lantern{color:var(--gold)}.lantern-flame{filter:drop-shadow(0 0 9px var(--light)) drop-shadow(0 0 22px var(--light));fill:var(--light)}
.ambient-bokeh{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}.ambient-bokeh i{position:absolute;width:var(--size);height:var(--size);left:var(--x);top:var(--y);border-radius:50%;background:radial-gradient(circle,rgba(var(--light-rgb),.65),rgba(var(--light-rgb),.12) 55%,transparent 70%);opacity:.5;animation:bokehDrift 8s var(--delay) ease-in-out infinite alternate;animation-play-state:paused}
.ambience-visible .ambient-bokeh i{animation-play-state:running}
.event-panel .event-art-lights{opacity:1!important}.scene-light{background:radial-gradient(ellipse at 18% 28%,rgba(var(--light-rgb),.24),transparent 28%),radial-gradient(ellipse at 82% 28%,rgba(var(--light-rgb),.22),transparent 28%)}
.chandelier-halo{position:absolute;top:0;left:20%;right:20%;height:28%;z-index:1;pointer-events:none;background:radial-gradient(ellipse at top,rgba(var(--light-rgb),.4),transparent 68%);animation:gentleTwinkle 5s ease-in-out infinite alternate;animation-play-state:paused}
.event-panel.is-lit .chandelier-halo{animation-play-state:running}
/* Fixed-size particle pool: no growing timers or DOM, and no pointer interception. */
.flower-rain{position:fixed;inset:0;z-index:35;pointer-events:none;overflow:hidden;contain:strict}
.falling-petal{position:absolute;top:-30px;left:var(--x);width:var(--size);height:calc(var(--size)*1.4);border-radius:80% 14% 70% 30%;background:linear-gradient(130deg,var(--petal-a),var(--petal-b));opacity:0;animation:petalRain var(--duration) var(--delay) linear infinite;will-change:transform}
body[data-petal-event=mehndi]{--petal-a:#ffe18a;--petal-b:#ce8d2d}body[data-petal-event=walima]{--petal-a:#fffef7;--petal-b:#cdbb9c}
.flowers-off :is(.flower-rain,.scene-petals,#petals){visibility:hidden}.flowers-off :is(.falling-petal,.scene-petals i){animation-play-state:paused!important}
.lights-off :is(.ambient-bokeh,.seal-aura,.chandelier-halo,.hero-lantern-glow,.scene-light){opacity:0!important;animation:none!important}
.lights-off .fairy-curtain i{opacity:.2;box-shadow:none;animation:none}.lights-off .festoon .bulb{filter:none!important}.lights-off .lantern-flame{filter:none!important;opacity:.15}
.page-inactive :is(.falling-petal,.wedding-motif,.fairy-curtain i,.ambient-bokeh i,.seal-aura,.chandelier-halo){animation-play-state:paused!important}
@keyframes petalRain{0%{opacity:0;transform:translate3d(0,-20px,0) rotate(0)}8%{opacity:.45}88%{opacity:.45}100%{opacity:0;transform:translate3d(var(--drift),calc(100vh + 65px),0) rotate(var(--spin))}}
@keyframes gentleTwinkle{from{opacity:.45}to{opacity:1}}
@keyframes sealBreath{0%,100%{opacity:.4;transform:scale(1.05)}50%{opacity:.9;transform:scale(1.45)}}
@keyframes sealRipple{from{opacity:.9;transform:translate(-50%,-50%) scale(.65)}to{opacity:0;transform:translate(-50%,-50%) scale(3.3)}}
@keyframes sealSpark{from{opacity:1;transform:translate(-50%,-50%) scale(.4)}to{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(170deg) scale(.8)}}
@keyframes motifFloat{from{transform:translateY(-5px) rotate(-5deg)}to{transform:translateY(9px) rotate(5deg)}}
@keyframes bokehDrift{from{transform:translate3d(-8px,5px,0);opacity:.25}to{transform:translate3d(8px,-12px,0);opacity:.7}}
@media(min-width:1100px){.cover-flower-control{grid-column:1;grid-row:5;justify-self:center;align-self:start;margin-top:48px}.cover .music-hint{margin-top:15px}.cover .roshni-picker{margin-top:16px}.cover .roshni-picker>span{margin-bottom:5px}}
@media(max-width:700px){.card-personalisation{flex-direction:column;gap:6px;padding:12px 8px}.card-personalisation .roshni-picker>span{flex-basis:100%;margin:0}.roshni-picker{gap:2px}.light-swatch{padding:4px 7px;font-size:9px;min-width:54px;height:38px}.cover-flower-control{margin-top:6px}.cover .sample-marker{margin-top:6px}.fairy-curtain{max-height:430px;opacity:.55}.wedding-motif{width:38px;height:52px}.falling-petal:nth-child(n+15){display:none}.cover .music-hint{margin-top:7px}.flower-toggle{min-height:34px;padding:5px 13px}.cover{padding-bottom:25px}}
@media(prefers-reduced-motion:reduce){.flower-rain,.seal-flash,.seal-spark{display:none}.wedding-motif,.fairy-curtain i,.ambient-bokeh i,.seal-aura,.chandelier-halo{animation:none!important}.seal-aura{opacity:.55}.falling-petal{will-change:auto}}
