/* UX Phase 2 — ceremonies. Parchment palette for ceremonial surfaces (decision d): #F3EEE6 / #1F1A16, accents #C45C26, #3F4A42.
   Transform and opacity only. Every motion has a still (html.rm, data-stage still) and a Kids (html.kidsm) version. */

/* Art slots from src/ui/artmanifest.js. The "Placeholder art" tag shows on staging only (html.stg). */
.art-slot{position:relative}
.art-slot svg,.art-slot img{display:block;width:100%;height:100%}
.art-ph{display:none}
html.stg .art-ph{display:block;position:absolute;right:8px;bottom:8px;z-index:3;padding:2px 7px;border-radius:7px;background:rgba(31,26,22,.78);color:#F3EEE6;font:600 10px/1.4 var(--f-b);letter-spacing:.04em;pointer-events:none}

/* 1) Opening (designer spec 1.1): Designer Bot's architecture-only arrival behind the parchment, in the same fixed layer
   (one layer, one focus trap). Times are absolute from the first frame. */
.fr-parch-wrap[data-opening][data-arrival="1"]{background:#F3EEE6}
.fr-parch-wrap[data-opening] .op-scene{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:auto}
.fr-parch-wrap[data-opening] .op-scene .art-slot{position:absolute;inset:0}
.op-sky{position:absolute;inset:0;background:linear-gradient(#F6E7C6 0,#F3EEE6 45%,#EFE6D6 100%)}
.op-ground{position:absolute;left:0;right:0;bottom:0;height:17%;background:linear-gradient(#E6D3AE,#D8C29A);border-top:1px solid rgba(31,26,22,.08)}
.op-stage{position:absolute;left:50%;bottom:0;top:0;width:min(100%,520px);transform:translateX(-50%)}
.op-torana{position:absolute;left:4%;right:4%;top:calc(34px + env(safe-area-inset-top,0px))}
.art-slot .op-torana-svg{display:block;width:100%;height:auto;overflow:visible}
.art-slot .op-stage img{display:block;height:auto}
.op-cap{margin-top:10px;text-align:center;font:600 12px/1.2 var(--f-b);letter-spacing:.14em;text-transform:uppercase;color:#5A4A3A}
.op-temple{position:absolute;left:0;right:0;bottom:17%;height:0}
.op-temple img{position:absolute;bottom:-1px;height:auto}
.art-slot .op-gopuram{left:50%;width:min(44%,210px);transform:translateX(-50%);z-index:2}
.art-slot .op-shik{width:min(21%,100px);z-index:1}
.art-slot .op-shik-l{left:9%}.art-slot .op-shik-r{right:9%;width:min(19%,90px)}
.art-slot .op-diyas img{position:absolute;bottom:calc(17% - 14px);width:min(9%,44px);height:auto;z-index:3}
.op-diya-0{left:9%}.op-diya-1{left:26%}.op-diya-2{right:26%}.op-diya-3{right:9%}
.art-slot .op-kolam{position:absolute;left:50%;bottom:2.5%;width:min(19%,92px);height:auto;transform:translateX(-50%)}
@media (max-height:620px){.op-cap{display:none}}
.fr-parch-wrap[data-opening] .fr-parch{position:relative;z-index:1;border-top:10px solid #8C5A3C;border-bottom:10px solid #8C5A3C;box-shadow:0 14px 34px rgba(31,26,22,.18)}
.fr-parch-wrap[data-opening] .op-note{margin:8px 0 0;font:400 12px/1.4 var(--f-b);color:var(--ink-3,#5A4A3A);text-align:center}
/* Skip: top right on every frame, at least 64 x 36. */
.fr-parch-wrap[data-opening] .fr-skip.op-skip{position:fixed;z-index:3;top:calc(12px + env(safe-area-inset-top,0px));right:12px;width:auto;min-width:64px;min-height:36px;margin:0;padding:6px 16px;border-radius:999px;border:1px solid rgba(31,26,22,.25);background:rgba(243,238,230,.95);color:#1F1A16;font:600 14px var(--f-b);cursor:pointer}
.fr-parch-wrap[data-opening] .op-skip:focus-visible{outline:3px solid #C45C26;outline-offset:2px}
.fr-parch-wrap[data-cardless] .fr-parch{display:none}
/* Full motion. */
.fr-parch-wrap[data-opening=full] .op-sky,.fr-parch-wrap[data-opening=full] .op-torana{animation:op-in .4s ease-out both}
.fr-parch-wrap[data-opening=full] .op-temple img{animation:op-rise .9s cubic-bezier(.2,.7,.2,1) both}
.fr-parch-wrap[data-opening=full] .op-gopuram{animation-name:op-rise-c!important}
.fr-parch-wrap[data-opening=full] .op-bell{transform-box:view-box;transform-origin:0 0;animation:op-bell 1.2s ease-in-out .3s both}
.fr-parch-wrap[data-opening=full] .op-diya{animation:op-lamp .6s ease-out both}
.op-diya-1{animation-delay:.42s!important}.op-diya-2{animation-delay:.54s!important}.op-diya-3{animation-delay:.66s!important}.op-diya-0{animation-delay:.3s!important}
.fr-parch-wrap[data-opening=full]:not([data-cardless]) .op-stage{animation:op-dim .6s ease 1.4s both}
.fr-parch-wrap[data-opening=full] .fr-parch{transform-origin:50% 0;animation:op-unfurl .9s cubic-bezier(.22,.8,.24,1) .7s both}
.fr-parch-wrap[data-opening=full] .fr-compass{animation:op-compass .9s cubic-bezier(.34,1.3,.64,1) 1.3s both}
.fr-parch-wrap[data-opening=full][data-arrival="1"] .fr-parch>:not(.fr-compass){animation:op-copy .4s ease-out 1.6s both}
.fr-parch-wrap[data-opening=full][data-arrival="0"] .fr-parch{animation-delay:0s}
.fr-parch-wrap[data-opening=full][data-arrival="0"] .fr-compass{animation-delay:.4s}
.fr-parch-wrap[data-jump] *{animation-delay:0s!important;animation-duration:.01s!important}
/* Begin: the parchment folds (scaleY 1 to 0, 400 ms, ease-in) as the zoom starts. */
.fr-parch-wrap[data-opening=full].out .fr-parch{animation:op-fold .4s ease-in both!important}
.fr-parch-wrap[data-opening].out{transition:opacity .4s ease .1s!important;transform:none!important}
@keyframes op-in{from{opacity:0}to{opacity:1}}
@keyframes op-rise{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:none}}
@keyframes op-rise-c{from{opacity:0;transform:translate(-50%,30px)}to{opacity:1;transform:translateX(-50%)}}
@keyframes op-bell{0%{transform:rotate(0)}33%{transform:rotate(6deg)}66%{transform:rotate(-4deg)}100%{transform:rotate(0)}}
@keyframes op-lamp{from{opacity:.15;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes op-dim{to{opacity:.55}}
@keyframes op-unfurl{from{opacity:0;transform:scaleY(.08)}12%{opacity:1}to{opacity:1;transform:scaleY(1)}}
@keyframes op-compass{0%{transform:rotate(-40deg)}55%{transform:rotate(8deg)}80%{transform:rotate(-3deg)}100%{transform:rotate(0)}}
@keyframes op-copy{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes op-fold{from{transform:scaleY(1);opacity:1}to{transform:scaleY(0);opacity:.6}}
@keyframes op-fade{from{opacity:0}to{opacity:1}}
/* Calm motion, reduced motion and Kids: the end frame, faded in over 200 ms. */
.fr-parch-wrap[data-opening=still]{animation:op-fade .2s linear both}
.fr-parch-wrap[data-opening=still] *{animation:none!important}
.fr-parch-wrap[data-opening=still]:not([data-cardless]) .op-stage{opacity:.55}
html.rm .fr-parch-wrap[data-opening] *{animation:none!important}
html.rm .fr-parch-wrap[data-opening]:not([data-cardless]) .op-stage{opacity:.55}
@media (prefers-reduced-motion:reduce){.fr-parch-wrap[data-opening] *{animation:none!important}}

/* 2) Toast ink ripple: drawn inside the toast's own box, so the p1r6 "covers nothing" placement still holds. */
.fr-toast{overflow:hidden;isolation:isolate}
.fr-toast .ink-rip{position:absolute;left:50%;top:50%;width:150%;aspect-ratio:1;border-radius:50%;z-index:-1;pointer-events:none;border:2px solid rgba(196,92,38,.9);background:radial-gradient(circle,rgba(196,92,38,0) 55%,rgba(196,92,38,.25) 70%,rgba(196,92,38,0) 72%);box-sizing:border-box;transform:translate(-50%,-50%) scale(.07);opacity:0;animation:ink-rip .6s cubic-bezier(.1,.6,.3,1) .08s both}
@keyframes ink-rip{0%{transform:translate(-50%,-50%) scale(.07);opacity:.45}100%{transform:translate(-50%,-50%) scale(1);opacity:0}}
.fr-toast{animation-duration:.12s}
.fr-toast.out{transition:opacity .32s ease}
html.rm .fr-toast .ink-rip{display:none}

/* 3) Garland formation in Weave and Offer. */
.weave .garland{transform-box:view-box;transform-origin:143px 60px}
.weave .weave-strand{fill:none;stroke:#3F4A42;stroke-width:1.6;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:0;opacity:.75}
.weave .gbead{transform-box:view-box}
.weave .garland.still .weave-strand{stroke-dashoffset:0}
.weave .weave-node.on{stroke:#C45C26;stroke-opacity:.9;transform-box:fill-box;transform-origin:50% 50%;animation:wn-settle .26s cubic-bezier(.2,.8,.2,1) both}
@keyframes wn-settle{from{transform:scale(1.6);opacity:.4}to{transform:none;opacity:1}}
.weave [data-testid=weave-path]{transform-origin:50% 0}
.weave-tray img{display:block;width:22px;height:22px}
.petal-rain i img{display:block;width:12px;height:12px}
/* 1.8 Garland settles (SB-08): architecture only. The settle scene sits over the weave stage. */
.weave-stage{position:relative}
.weave .gsettle{position:absolute;inset:0;z-index:2;border-radius:16px;background:var(--parch-cer,#F3EEE6);display:flex;align-items:center;justify-content:center;overflow:hidden;pointer-events:none}
.weave .gsettle[hidden]{display:none}
.weave .gsettle .gs-box{position:relative;width:min(92%,300px)}
.weave .gsettle .gs-torana svg{display:block;width:100%;height:auto}
.weave .gsettle .gs-garland{position:absolute;left:0;top:0;width:100%;height:auto;aspect-ratio:320/176;overflow:visible;transform-origin:50% 30%}
.weave .gsettle .gs-glow{position:absolute;left:50%;top:40%;width:90%;aspect-ratio:2/1;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(closest-side,rgba(242,182,50,1),rgba(242,182,50,0));opacity:0;pointer-events:none}
html.rm .weave .weave-node.on{animation:none}

/* 4) Stamp ink-settling: a soft bleed past the edge that dries back; the wet print sharpens. */
.s-res .stamp .ink-settle{position:absolute;inset:-14px;border-radius:50%;pointer-events:none;background:radial-gradient(circle,rgba(31,26,22,0) 52%,rgba(122,31,43,.20) 63%,rgba(122,31,43,.08) 72%,rgba(122,31,43,0) 78%);opacity:0}
.s-res .stamp[data-ink=settle] .ink-settle{animation:ink-bleed 1.1s cubic-bezier(.2,.7,.3,1) .28s both}
.s-res .stamp[data-ink=settle] .ink-settle{animation-delay:.18s}
.s-res .stamp[data-ink=fade] .ink-settle{animation:ink-fade .5s ease-out .3s both}
.s-res .stamp[data-ink=still] .ink-settle{opacity:.45;animation:none}
@keyframes ink-bleed{0%{opacity:0;transform:scale(.82)}35%{opacity:1;transform:scale(1.06)}100%{opacity:.45;transform:scale(1)}}
@keyframes ink-dry{0%{opacity:.72;filter:blur(.7px)}100%{opacity:1;filter:none}}
@keyframes ink-fade{from{opacity:0}to{opacity:.45}}
html.rm .s-res .stamp .ink-settle{animation:none!important;opacity:.45}
html.rm .s-res .stamp>div{animation:none!important}
.s-res .stamp-kids{margin:6px 18px 0;text-align:center;font:600 15px/1.35 var(--f-b);color:var(--ink,#1F1A16)}

/* 7) Festival day and set completion: a parchment glow, once. */
.fest-banner[data-peak]{position:relative}
.fest-banner[data-peak=settle]{animation:peak-glow 1.6s ease-out both}
.fest-banner[data-peak=fade]{animation:peak-glow 1s ease-out both}
.fest-banner[data-peak=still]{box-shadow:0 0 0 2px rgba(196,92,38,.45)}
@keyframes peak-glow{0%{box-shadow:0 0 0 0 rgba(196,92,38,0)}35%{box-shadow:0 0 0 3px rgba(196,92,38,.55),0 0 18px 4px rgba(196,92,38,.35)}100%{box-shadow:0 0 0 2px rgba(196,92,38,.35),0 0 0 0 rgba(196,92,38,0)}}
.set-peak{margin:10px 18px 0;padding:8px 12px;border-radius:14px;background:#F3EEE6;border:1px solid rgba(31,26,22,.18);color:#1F1A16;text-align:center;font:600 14px/1.35 var(--f-ui);overflow-wrap:anywhere}
.set-peak .sp-orn{color:#C45C26}
.set-peak{display:flex;align-items:center;justify-content:center;gap:10px}
.set-peak .sp-kolam{width:40px;height:40px;flex:none}
.set-peak[data-peak=wait]{opacity:.0}
.set-peak[data-peak=settle] .sp-kolam{animation:sp-kolam .7s ease-out both}
@keyframes sp-kolam{from{opacity:0;transform:rotate(-30deg) scale(.6)}to{opacity:1;transform:none}}
.fest-diyas{display:flex;justify-content:center;gap:4px;margin-top:4px}
.fest-diyas img{width:18px;height:18px;opacity:1}
.fest-banner[data-peak=settle] .fest-diyas img,.fest-banner[data-peak=fade] .fest-diyas img{animation:fd-light .5s ease-out both}
@keyframes fd-light{from{opacity:.15;transform:scale(.8)}to{opacity:1;transform:none}}
html.rm .fest-diyas img,html.rm .set-peak .sp-kolam{animation:none!important}
.set-peak[data-peak=settle]{animation:peak-glow 1.8s ease-out both}
.set-peak[data-peak=fade]{animation:peak-glow 1s ease-out both}
.set-peak[data-peak=still]{box-shadow:0 0 0 2px rgba(196,92,38,.45)}
html.rm .fest-banner[data-peak],html.rm .set-peak[data-peak]{animation:none!important;box-shadow:0 0 0 2px rgba(196,92,38,.45)}
html[data-theme=aarti] .set-peak{background:#F3EEE6;color:#1F1A16}


/* Font fixes (designs/phase2-3/FONT-CHECK.md), staging. */
/* 1) Set-out sheet at <= 430 px (FONT-CHECK named 360; the same orphan shows at 390): the "100 + terrain" chip moves under the heading, so "Choose your next pin" keeps
   "pin" on its line and the chip is not clipped; the sticky Set out bar also covers the card scrolling under it. */
@media (max-width:430px){
  .sheet .sheet-head{flex-wrap:wrap;align-items:flex-start;row-gap:6px}
  .sheet .sheet-head-t{flex:1 1 100%;min-width:0}
  .sheet .sheet-head .sf{order:-1;flex:none}
}
.sheet .sheet-go{box-shadow:0 -10px 16px -12px rgba(80,40,10,.2),0 44px 0 0 var(--card,#FFFDF8)}
/* 2) Loom count line: Mukta 600 15 px, sentence case, tabular figures on the digits only. */
.s-loom .loom-count,[data-testid=loom-count].loom-count{font-family:var(--f-ui);font-weight:600;font-size:15px;line-height:1.4;letter-spacing:0;text-transform:none;font-variant-numeric:normal;font-feature-settings:normal;color:var(--ink-2,#3A2A1E);margin:8px 0 4px}
.loom-count .lc-n{font-weight:600;font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1}
.loom-count .lc-got{white-space:nowrap}
@media (max-width:360px){.loom-count .lc-sep{display:none}.loom-count .lc-got{display:block}}
/* 3) Profile tier icon: an SVG (the rosette emoji drew as a missing-glyph box in Firefox). */
.prof-tier-ic{display:inline-block;width:14px;height:14px;vertical-align:-2px;margin-right:2px}
/* 4) Yatra One only at 22 px or larger: the profile name (24 px) and the Yatra passport heading (22 px). */
.s-prof .prof-name{font:400 24px/1.2 var(--f-d);letter-spacing:.02em}
.s-prof .pp-title{font:400 22px/1.3 var(--f-d);letter-spacing:.025em}
html.lg .s-prof .pp-title{font-size:24px}
