/* Every rule is gated to this separate, local-only recipient experiment. */
body[data-scenery=candlelit-envelope-test] .candlelit-scenery{position:sticky;left:0;top:0;flex:0 0 0;width:0;min-width:0;height:100%;z-index:-1;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .candlelit-clip{position:absolute;left:0;top:0;width:100vw;height:100%;overflow:clip}
body[data-scenery=candlelit-envelope-test] .continuous-master{width:100vw;z-index:auto}
body[data-scenery=candlelit-envelope-test][data-depth=on] .continuous-master{width:calc(100vw + var(--depth-travel,0px))}
body[data-scenery=candlelit-envelope-test] .continuous-master img{object-fit:cover;object-position:30% 50%;filter:none;visibility:visible}
/* A single calm room introduction, followed immediately by photograph one. */
body[data-scenery=candlelit-envelope-test] .opening{width:100vw;align-items:center;padding-top:max(76px,env(safe-area-inset-top));padding-bottom:128px}
body[data-scenery=candlelit-envelope-test] .opening-copy{width:min(100%,620px);max-height:calc(100% - 64px);padding-bottom:0}
body[data-scenery=candlelit-envelope-test] .opening h1{font-size:clamp(54px,7vw,94px)}
body[data-scenery=candlelit-envelope-test] .envelope-scene{width:clamp(320px,100vw,880px);padding:76px clamp(24px,6vw,70px) 90px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:32px;color:#fffaf0}
body[data-scenery=candlelit-envelope-test] #envelope-title{font:400 clamp(30px,5vw,44px)/1.15 Georgia,serif;letter-spacing:-.025em;margin:0;text-align:center;text-shadow:0 1px 5px #122119}
body[data-scenery=candlelit-envelope-test] .keepsake-envelope{position:relative;isolation:isolate;display:block;width:min(100%,460px);aspect-ratio:1.52;border:0;border-radius:2px;padding:0;background:none;color:#384034;cursor:pointer;touch-action:auto}
body[data-scenery=candlelit-envelope-test] .keepsake-envelope:focus-visible{outline:2px solid #fff;outline-offset:12px}
body[data-scenery=candlelit-envelope-test] :is(.keepsake-envelope,.envelope-theatre)>span:not(.envelope-action){position:absolute;inset:0;display:block;border-radius:2px;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .envelope-back{background:#e4dccb;box-shadow:0 8px 22px #08160d38,0 1px 2px #09140c33;z-index:0}
body[data-scenery=candlelit-envelope-test] .envelope-pocket{background:linear-gradient(145deg,#f6f0e2,#eae2d2);clip-path:polygon(0 0,50% 51%,100% 0,100% 100%,0 100%);box-shadow:inset 0 -1px 1px #a58e6a26;z-index:3}
body[data-scenery=candlelit-envelope-test] .envelope-fold{background:linear-gradient(155deg,#fbf6eb,#eee6d7);clip-path:polygon(0 100%,50% 45%,100% 100%);z-index:3}
body[data-scenery=candlelit-envelope-test] :is(.keepsake-envelope,.envelope-theatre)>.envelope-hinge{height:58%;bottom:auto;perspective:1000px;z-index:4}
body[data-scenery=candlelit-envelope-test] .envelope-flap{position:absolute;inset:0;transform-origin:50% 0;transform-style:preserve-3d;transform:rotateX(0deg)}
body[data-scenery=candlelit-envelope-test] .envelope-flap>span:not(.wax-seal){position:absolute;inset:0;display:block;clip-path:polygon(0 0,100% 0,50% 100%);backface-visibility:hidden;-webkit-backface-visibility:hidden}
body[data-scenery=candlelit-envelope-test] .flap-outside{background:linear-gradient(to bottom,#faf5e9,#e9dfce)}
body[data-scenery=candlelit-envelope-test] .flap-inside{background:linear-gradient(to bottom,#e1d6c2,#f2ebdd);transform:rotateY(180deg)}
body[data-scenery=candlelit-envelope-test] .envelope-action{position:absolute;left:12px;right:12px;bottom:18%;z-index:5;font:12px/1.5 'Helvetica Neue',Arial,sans-serif;letter-spacing:.02em;pointer-events:none}
/* One native modal, with the actual envelope artwork over its real button.
   The live HTML paper travels between layers. No screenshot/proxy letter swap. */
body[data-scenery=candlelit-envelope-test] .letter-dialog{--reading-top:max(76px,calc(env(safe-area-inset-top) + 64px));--reading-bottom:max(24px,env(safe-area-inset-bottom));position:fixed;inset:0;width:100%;height:100vh;height:100svh;max-width:none;max-height:none;margin:0;border:0;padding:var(--reading-top) max(16px,env(safe-area-inset-right)) var(--reading-bottom) max(16px,env(safe-area-inset-left));background:transparent;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr);place-items:center;color:#293529;touch-action:none}
body[data-scenery=candlelit-envelope-test] .letter-dialog:not([open]){display:none}
body[data-scenery=candlelit-envelope-test] .letter-dialog::backdrop{background:transparent}
body[data-scenery=candlelit-envelope-test] .envelope-theatre{position:absolute;pointer-events:none;color:#384034;text-align:center}
body[data-scenery=candlelit-envelope-test] .letter-shade{position:absolute;inset:0;background:#000000b8;opacity:0;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .letter-flight{position:relative;width:min(100%,660px);max-height:calc(100svh - var(--reading-top) - var(--reading-bottom));min-height:0;display:flex;transform-origin:0 0;z-index:5}
body[data-scenery=candlelit-envelope-test] .letter-dialog .letter-scroll{width:100%;max-height:inherit;min-height:0;overflow:auto;transform:none;transition:none;padding:clamp(24px,4vw,42px);overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y pinch-zoom}
body[data-scenery=candlelit-envelope-test] .letter-dialog[data-phase=open] .envelope-flap{transform:rotateX(180deg)}
body[data-scenery=candlelit-envelope-test] .letter-dialog[data-phase=open] .envelope-hinge{z-index:1}
body[data-scenery=candlelit-envelope-test] .letter-dialog[data-phase=open] .letter-shade{opacity:1}
body[data-scenery=candlelit-envelope-test] .envelope-scene[data-letter-opening] :is(.keepsake-envelope,#envelope-title){visibility:hidden}
body[data-scenery=candlelit-envelope-test] .letter-dialog .envelope-action{opacity:0}
body[data-scenery=candlelit-envelope-test] .letter-close{position:absolute;z-index:10;left:max(16px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));min-height:44px;max-width:calc(100% - 32px);padding:10px 14px;border:1px solid #fffaf042;background:#17281be8;color:#fffaf0;border-radius:2px;font:12px/1.4 'Helvetica Neue',Arial,sans-serif;cursor:pointer}
body[data-scenery=candlelit-envelope-test] .letter-close:focus-visible{outline:2px solid white;outline-offset:3px}
body[data-scenery=candlelit-envelope-test] .ending{width:100vw;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:16px;justify-items:start;padding-top:max(76px,calc(env(safe-area-inset-top) + 56px));padding-bottom:max(94px,calc(var(--depth-tools-height,44px) + 40px + env(safe-area-inset-bottom)))}
body[data-scenery=candlelit-envelope-test] .ending-copy{width:min(100%,720px);max-height:100%;padding-bottom:0;overflow-y:auto}
body[data-scenery=candlelit-envelope-test] .ending .wordmark{width:105px;margin-top:24px;filter:none;text-shadow:none;box-shadow:none}
body[data-scenery=candlelit-envelope-test] .referral-cta{margin-top:24px}
body[data-scenery=candlelit-envelope-test] .ending .again{position:static;max-width:100%;width:max-content;margin:0;align-self:end}
body[data-scenery=candlelit-envelope-test][data-recipient-clean] :is(.review-note,.adaptive-review,.journey-tools,.reach-diagnostics){display:none}
body[data-scenery=candlelit-envelope-test][data-recipient-clean] .ending{padding-bottom:max(32px,env(safe-area-inset-bottom))}
@media(max-width:700px){
 body[data-scenery=candlelit-envelope-test] .opening-copy{width:100%}
 body[data-scenery=candlelit-envelope-test] .opening h1{font-size:clamp(50px,14vw,68px)}
 body[data-scenery=candlelit-envelope-test] .opening .eyebrow{margin-bottom:16px}
 body[data-scenery=candlelit-envelope-test] .dedication{margin-top:18px}
 body[data-scenery=candlelit-envelope-test] .ending .wordmark{width:90px}
}
@media(max-height:520px){
 body[data-scenery=candlelit-envelope-test] .opening{padding-top:52px;padding-bottom:92px}
 body[data-scenery=candlelit-envelope-test] .opening-copy{max-height:100%}
 body[data-scenery=candlelit-envelope-test] .envelope-scene{padding:52px 32px 66px;gap:16px}
 body[data-scenery=candlelit-envelope-test] .keepsake-envelope{width:min(100%,280px)}
 body[data-scenery=candlelit-envelope-test] .ending{padding-top:58px;padding-bottom:70px;gap:8px}
 body[data-scenery=candlelit-envelope-test] .ending .wordmark{width:69px;margin-top:12px}
 body[data-scenery=candlelit-envelope-test] .referral-cta{margin-top:12px}
}
@media(prefers-reduced-motion:reduce){body[data-scenery=candlelit-envelope-test] .continuous-master{width:100vw;transform:none}}

/* The compact six-photo phone track is close to the 3:1 source ratio. When it
   costs at most 25% CSS enlargement, let the whole room unfold there instead
   of discarding most of it. Desktop/longer tracks retain bounded viewport cover. */
body[data-scenery=candlelit-envelope-test][data-candlelit-framing=track] .candlelit-scenery{position:absolute;inset:0;width:100%}
body[data-scenery=candlelit-envelope-test][data-candlelit-framing=track] .candlelit-clip{width:100%}
body[data-scenery=candlelit-envelope-test][data-candlelit-framing=track] .continuous-master{width:100%}

/* The approved track layer already travels left with the world: its positive
   10% compensation remains unchanged. A sticky viewport layer has no world
   translation to compensate, so it must travel from 0 toward -depth-travel.
   This is a coordinate-space correction for every viewport-framed size. */
@supports (animation-timeline:scroll(nearest x)) and (overflow:clip){
 @media(prefers-reduced-motion:no-preference){
  body[data-scenery=candlelit-envelope-test][data-depth=on][data-candlelit-framing=viewport] .continuous-master{animation-name:candlelit-viewport-depth}
 }
}
@keyframes candlelit-viewport-depth{from{transform:translateX(0)}to{transform:translateX(calc(-1 * var(--depth-travel,0px)))}}

/* Tactile materials, still exclusive to the candlelit envelope study. */
body[data-scenery=candlelit-envelope-test] :is(.keepsake-envelope,.letter-close,.photo-viewer button){appearance:none;-webkit-appearance:none}
body[data-scenery=candlelit-envelope-test] :is(.journey,.keepsake-envelope,.letter-scroll,.letter-close,[data-photograph],.photo-viewer button){-webkit-tap-highlight-color:transparent}
body[data-scenery=candlelit-envelope-test][data-input=pointer] :is(.journey,.keepsake-envelope,.letter-scroll,.letter-close,[data-photograph],.photo-viewer button):focus{outline:none}
body[data-scenery=candlelit-envelope-test][data-input=keyboard] :is(.keepsake-envelope,.letter-close,[data-photograph],.photo-viewer button):focus-visible{outline:2px solid #fffaf0;outline-offset:6px}
body[data-scenery=candlelit-envelope-test] .envelope-back{border-radius:2px 1.4px 2.5px 1px;clip-path:polygon(.2% 0,99.7% 0,100% 99.5%,.3% 100%);background:linear-gradient(115deg,#e6ddcb,#eee6d8 52%,#ddd1bd);box-shadow:0 1px 2px #34241430,0 10px 24px #1712083d}
body[data-scenery=candlelit-envelope-test] .envelope-pocket{background:linear-gradient(117deg,#f5eedf,#e7ddca 52%,#eee5d5);border-radius:1.7px 2px 1px 2.4px}
body[data-scenery=candlelit-envelope-test] .envelope-fold{background:linear-gradient(167deg,#faf3e6,#eee4d3 60%,#e5dac7)}
body[data-scenery=candlelit-envelope-test] .envelope-contact{clip-path:polygon(0 0,100% 0,50% 59%);background:linear-gradient(to bottom,transparent 30%,#79634430 58%,transparent 61%);z-index:3}
body[data-scenery=candlelit-envelope-test] :is(.wax-seal,.wax-body){position:absolute;left:50%;top:99%;width:clamp(34px,10vw,46px);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:47% 53% 48% 52% / 51% 46% 54% 49%;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0 2px 1.2px #3b281d33)}
body[data-scenery=candlelit-envelope-test] .seal-half{position:absolute;inset:0;border-radius:inherit;background:radial-gradient(ellipse at 33% 25%,#92505a33,transparent 62%),#672431;border:1px solid #481b244d;box-shadow:inset 1px 1px 1px #b7777766,inset -1px -2px 2px #37151e80}
/* Complementary irregular edges follow the actual triangular flap boundary. */
body[data-scenery=candlelit-envelope-test] .wax-flap .seal-piece{clip-path:polygon(0 0,100% 0,100% 13%,92% 17%,83% 28%,76% 29%,66% 43%,58% 42%,50% 51%,43% 44%,33% 29%,26% 31%,17% 19%,9% 20%,0 13%)}
body[data-scenery=candlelit-envelope-test] .wax-body .seal-piece{clip-path:polygon(0 13%,9% 20%,17% 19%,26% 31%,33% 29%,43% 44%,50% 51%,58% 42%,66% 43%,76% 29%,83% 28%,92% 17%,100% 13%,100% 100%,0 100%)}
body[data-scenery=candlelit-envelope-test] .seal-piece{position:absolute;inset:0;border-radius:inherit;overflow:hidden}
body[data-scenery=candlelit-envelope-test] .wax-body-anchor{z-index:4;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .wax-body{top:57.42%}
body[data-scenery=candlelit-envelope-test] .seal-half::after{content:'';position:absolute;inset:13%;border:1px solid #431d283b;border-radius:49% 51% 47% 53%;box-shadow:0 1px 1px #ba7b7233,inset 0 1px 1px #42162133}
body[data-scenery=candlelit-envelope-test] .wax-fracture{position:absolute;inset:0;width:100%;height:100%;clip-path:inset(0 0 100% 0);fill:none;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .crack-recess{stroke:#291019;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
body[data-scenery=candlelit-envelope-test] .crack-light{stroke:#d7a08cb3;stroke-width:.85;transform:translateY(-.7px);stroke-linecap:round;stroke-linejoin:round}
body[data-scenery=candlelit-envelope-test] [data-seal-broken=true] .wax-fracture{clip-path:inset(0)}
body[data-scenery=candlelit-envelope-test] .crack-branch{stroke:#32121cb3;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round}
body[data-scenery=candlelit-envelope-test] [data-seal-broken=true] .wax-body .seal-piece{transform:translate(.65px,.75px) rotate(.6deg)}
@property --paper-glow{syntax:'<number>';inherits:false;initial-value:0}
body[data-scenery=candlelit-envelope-test] .letter-dialog .letter-scroll{background-image:radial-gradient(ellipse at var(--paper-light-x,50%) var(--paper-light-y,45%),rgba(255,197,91,var(--paper-glow)),transparent 68%),var(--letter-stock-image,none);background-size:auto,512px 512px;background-repeat:no-repeat,repeat;transition:--paper-glow 360ms ease-out;user-select:text;-webkit-user-select:text}
body[data-scenery=candlelit-envelope-test] .photo-viewer{background:transparent;display:grid;place-items:center;grid-template-rows:minmax(0,1fr)}
body[data-scenery=candlelit-envelope-test] .photo-viewer:not([open]){display:none}
body[data-scenery=candlelit-envelope-test] .photo-viewer[open]{animation:none}
body[data-scenery=candlelit-envelope-test] .photo-viewer::backdrop{background:transparent}
body[data-scenery=candlelit-envelope-test] .photo-shade{position:absolute;inset:0;background:#000000cf;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .tactile-print{position:relative;padding:5px;background:#fffaf1;box-shadow:0 3px 9px #02080530,0 15px 45px #0208054d;transform-origin:0 0;max-width:100%;max-height:100%;display:flex}
body[data-scenery=candlelit-envelope-test] .tactile-print img{width:100%;height:100%;object-fit:contain;animation:none;max-width:none;max-height:none}
body[data-scenery=candlelit-envelope-test] .tactile-print img[hidden]{display:none}
body[data-scenery=candlelit-envelope-test] .photo-viewer :is(button,.viewer-count,.viewer-description,.viewer-state){z-index:2}
body[data-scenery=candlelit-envelope-test] .photo-viewer button{background:#0000009e;border:1px solid #fffaf033;backdrop-filter:none}
@media(prefers-reduced-motion:reduce){body[data-scenery=candlelit-envelope-test] .letter-dialog .letter-scroll{transition:none}}

/* Exact approved Illustrator paths used as an alpha mask, not typed lettering. */
body[data-scenery=candlelit-envelope-test] .seal-half::before{content:'';position:absolute;inset:14%;background:#421925b8;mask:url('/demo/christmas/assets/moment/assets/sorelia-monogram-approved.svg') center/contain no-repeat;-webkit-mask:url('/demo/christmas/assets/moment/assets/sorelia-monogram-approved.svg') center/contain no-repeat;filter:drop-shadow(0 .5px .2px #bc7c7270)}

body[data-scenery=candlelit-envelope-test] :is(.keepsake-envelope,.envelope-theatre)::before{content:'';position:absolute;inset:0;border-radius:2px 1px 2.5px 1px;box-shadow:0 1px 2px #24180d24,0 10px 26px #17120830;pointer-events:none}

/* Inward-folded stationery: blank exterior, printed inner HTML faces. */
body[data-scenery=candlelit-envelope-test] .fold-book{position:absolute;left:0;top:0;perspective:1200px;transform-style:preserve-3d;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .paper-hinge{position:absolute;left:0;width:100%;transform-origin:50% 0;transform-style:preserve-3d}
body[data-scenery=candlelit-envelope-test] .paper-panel{position:absolute;left:0;width:100%;transform-style:preserve-3d}
body[data-scenery=candlelit-envelope-test] :is(.paper-panel-front,.paper-panel-back){position:absolute;inset:0;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:#e9ddc5;border:1px solid #eee3ce;box-shadow:0 1px 0 #aa967573,0 2px 1px #62503626}
body[data-scenery=candlelit-envelope-test] .paper-panel-back{transform:rotateY(180deg);background-image:linear-gradient(115deg,#fff9ed55,transparent 46%,#bba78616),var(--letter-stock-image,none);background-size:auto,512px 512px}
body[data-scenery=candlelit-envelope-test] .paper-panel-front::after{content:'';position:absolute;inset:0;box-shadow:inset 0 1px 0 #fffdf4bd,inset 0 -1px 2px #80694738;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .fold-impression{pointer-events:none;user-select:none;-webkit-user-select:none}
body[data-scenery=candlelit-envelope-test] [data-photograph][data-lifted]{background:transparent;box-shadow:none}
body[data-scenery=candlelit-envelope-test] .photo-shade{background:#000000b8}
body[data-scenery=candlelit-envelope-test] .photo-viewer[data-photo-phase=opening] .photo-shade{opacity:0}
/* Narrow phones need the full safe width: the old 16px gutters made the
   largest gallery print and its close-up exactly the same width at 320px. */
@media(max-width:700px){body[data-scenery=candlelit-envelope-test] .photo-viewer{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}}

/* One local fibre material and crease memory stay aligned to the hinges. */
body[data-scenery=candlelit-envelope-test] .letter-dialog .letter-scroll{
 background-image:radial-gradient(ellipse at var(--paper-light-x,50%) var(--paper-light-y,45%),rgba(255,197,91,var(--paper-glow)),transparent 68%),
 linear-gradient(to bottom,transparent calc(var(--crease-one,20000px) - 1px),#6d60441a var(--crease-one,20000px),#edddbd63 calc(var(--crease-one,20000px) + .7px),transparent calc(var(--crease-one,20000px) + 1.3px)),
 linear-gradient(to bottom,transparent calc(var(--crease-two,20000px) - 1px),#6d60441a var(--crease-two,20000px),#edddbd63 calc(var(--crease-two,20000px) + .7px),transparent calc(var(--crease-two,20000px) + 1.3px)),var(--letter-stock-image,none);
 background-size:auto,auto,auto,512px 512px;background-repeat:no-repeat,no-repeat,no-repeat,repeat;
}
body[data-scenery=candlelit-envelope-test] :is(.opening,.ending)>.opening-copy>.eyebrow,
body[data-scenery=candlelit-envelope-test] .ending-copy>.eyebrow{letter-spacing:.22em}

/* Editorial navigation: a link with an ample target, not a filled CTA. */
body[data-scenery=candlelit-envelope-test] .opening .unfold{background:transparent;border:0;box-shadow:none;color:#fffaf0;text-shadow:0 1px 4px #152014;min-height:44px;padding:10px 0;font:12px/1.5 'Helvetica Neue',Arial,sans-serif;letter-spacing:.025em;bottom:max(38px,calc(var(--depth-tools-height,44px) + 24px + env(safe-area-inset-bottom)))}
body[data-scenery=candlelit-envelope-test][data-recipient-clean] .opening .unfold{bottom:max(32px,calc(env(safe-area-inset-bottom) + 20px))}
body[data-scenery=candlelit-envelope-test] .opening .unfold:hover{background:transparent;text-decoration:underline;text-underline-offset:5px}
body[data-scenery=candlelit-envelope-test] .opening .unfold:focus-visible{outline:1px solid #fffaf0;outline-offset:6px;box-shadow:none}
body[data-scenery=candlelit-envelope-test] .ending{display:flex;flex-direction:column;justify-content:center;gap:0}
body[data-scenery=candlelit-envelope-test] .ending .wordmark{display:block;margin-top:clamp(28px,6svh,64px)}
body[data-scenery=candlelit-envelope-test] .ending .referral-cta{background:transparent;border-color:#fffaf052;padding:10px 14px;font-size:11px}
body[data-scenery=candlelit-envelope-test] .ending .referral-cta:hover{background:#fffaf014}
/* More legible relief on the approved, unaltered monogram, inside the same wax. */
body[data-scenery=candlelit-envelope-test] .seal-half::before{inset:8%;background:#ddb0a2;filter:drop-shadow(.45px .7px 0 #30121e)}
body[data-scenery=candlelit-envelope-test] .seal-half::after{inset:7%;border-color:#3f152a55;pointer-events:none}
body[data-scenery=candlelit-envelope-test] .letter-dialog .letter-scroll{border:1px solid #f8edda;border-right:2px solid #c5b18d;border-bottom:2px solid #bba27c;border-radius:1.2px 2.1px 1.6px 1px;box-shadow:0 1px 0 #9d8867,0 3px 4px #251e1226,1px 13px 28px #13201833;background-color:#e9ddc5}
body[data-scenery=candlelit-envelope-test] .letter-flight{filter:none;transform:translate3d(0px,0px,0px)}
@media(max-height:520px){body[data-scenery=candlelit-envelope-test] .ending .wordmark{margin-top:16px}}

/* The physical envelope stays present, including after extraction. */

/* Occlusion remains at shared dialog depth: no parent-opacity stacking context. */
body[data-scenery=candlelit-envelope-test] .paper-panel-front{border:0;background:var(--paper-stock);box-shadow:none}
/* Exactly the same local material on every face, at a stable pixel mapping. */
body[data-scenery=candlelit-envelope-test] :is(.letter-scroll,.fold-impression){position:relative;isolation:isolate}
body[data-scenery=candlelit-envelope-test] :is(.letter-scroll,.fold-impression) > *{position:relative;z-index:1}
body[data-scenery=candlelit-envelope-test] :is(.letter-scroll,.fold-impression,.paper-panel-back)::before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(116deg,#f1e2c619,transparent 44%,#d5be8a0b);filter:none;opacity:1;border-radius:inherit}
body[data-scenery=candlelit-envelope-test] .paper-panel-back{background-image:var(--letter-stock-image,none);background-color:#e9ddc5;border-top:1px solid var(--paper-highlight);border-bottom:2px solid #cbb99a;box-shadow:0 1px 0 #9d8867,0 2px 1px #4a382c24}
body[data-scenery=candlelit-envelope-test] .paper-panel-front::after{box-shadow:inset 0 1px 0 #efdfbf7d,inset 0 -1px 1px #80694724}
/* No full-slide outro scrim. The 32% room band stays unchanged. */
body[data-scenery=candlelit-envelope-test] .ending::before{content:none;background:none}

/* Physical stock: thin edge faces, no thickness applied to text or layout. */
body[data-scenery=candlelit-envelope-test] .letter-dialog{--paper-thickness:1.6px;--paper-stock:#e9ddc5;--paper-highlight:#efdfbf}
body[data-scenery=candlelit-envelope-test] .letter-dialog[data-stock-cut] :is(.letter-scroll,.fold-impression,.paper-panel-back){mask-image:url('/demo/christmas/assets/moment/assets/letter-cut.svg');-webkit-mask-image:url('/demo/christmas/assets/moment/assets/letter-cut.svg');mask-size:100% 100%;-webkit-mask-size:100% 100%;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat}
body[data-scenery=candlelit-envelope-test] .paper-panel-front{transform:translateZ(.8px)}
body[data-scenery=candlelit-envelope-test] .paper-panel-back{transform:translateZ(-.8px) rotateY(180deg)}
body[data-scenery=candlelit-envelope-test] .paper-cut-edge{position:absolute;display:block;pointer-events:none;background:linear-gradient(90deg,#efdfbf,#bfab87);backface-visibility:visible}
body[data-scenery=candlelit-envelope-test] .paper-cut-edge:is(.edge-top,.edge-bottom){left:0;width:100%;height:var(--paper-thickness);transform-origin:50% 0;transform:translateZ(.8px) rotateX(-90deg)}
body[data-scenery=candlelit-envelope-test] .edge-top{top:0}
body[data-scenery=candlelit-envelope-test] .edge-bottom{top:100%;background:linear-gradient(0deg,#af9c7c,#e1d3b7)}
body[data-scenery=candlelit-envelope-test] .paper-cut-edge:is(.edge-left,.edge-right){top:0;height:100%;width:var(--paper-thickness);transform-origin:0 50%;transform:translateZ(.8px) rotateY(90deg)}
body[data-scenery=candlelit-envelope-test] .edge-left{left:0}
body[data-scenery=candlelit-envelope-test] .edge-right{left:100%;background:linear-gradient(90deg,#d6c8af,#a99574)}
/* Compressed, softly lit crease; moves with the rigid face, never the ink. */
body[data-scenery=candlelit-envelope-test] .paper-panel-front::after{background:linear-gradient(to bottom,#79654616,transparent 3%,transparent 97%,#705b391c);box-shadow:inset 0 .6px 0 #efdfbfa6}
body[data-scenery=candlelit-envelope-test] .paper-panel-back::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(to bottom,#efdfbf5e,transparent 3%,transparent 96%,#6d563026);box-shadow:inset 0 1px 0 #efdfbfa6,inset 0 -1px 0 #bba78388}
body[data-scenery=candlelit-envelope-test] .letter-close{background:transparent;border-color:transparent;padding:8px 0;min-height:44px;text-shadow:0 1px 4px #102118;font-size:12px}
body[data-scenery=candlelit-envelope-test] .letter-close:hover{text-decoration:underline;text-underline-offset:4px}

body[data-scenery=candlelit-envelope-test] .letter-dialog[data-stock-material]{--letter-stock-image:url('/demo/christmas/assets/moment/assets/letter-stock.svg')}

/* One warm stock fallback on every folded/printed face, not white browser paint. */
body[data-scenery=candlelit-envelope-test] .letter-dialog :is(.letter-scroll,.fold-impression,.paper-panel-front,.paper-panel-back){background-color:var(--paper-stock)}
/* Back stock and flap share their real pivot; no projecting painted strip.
   At extraction, the folded sheet meets the pocket lip with a 1px occlusion,
   rather than stopping 10px above it and revealing a patterned room band. */
body[data-scenery=candlelit-envelope-test] :is(.keepsake-envelope,.envelope-theatre)>.envelope-back{top:0}
/* Same intrinsic material mapping on the blank reverse, with no stale two-layer
   background-size list from the earlier gradient-backed face. */
body[data-scenery=candlelit-envelope-test] .paper-panel-back{background-size:512px 512px;background-repeat:repeat}

body[data-scenery=candlelit-envelope-test] .envelope-theatre-title{position:absolute;z-index:6;pointer-events:none;margin:0;padding:0;text-align:center;opacity:0}

/* Cut-edge planes already model the folded stock. Do not paint a second thick
   border/external shadow as a contrasting horizontal band below the blank face. */
body[data-scenery=candlelit-envelope-test] .paper-panel-back{border-bottom:1px solid #dccbab;box-shadow:inset 0 -.5px 0 #bda78733}
body[data-scenery=candlelit-envelope-test] .paper-panel-back::after{box-shadow:inset 0 .5px 0 #efdfbf88}


/* The physical flap faces overlap their shared pivot by one CSS pixel. The
   hinge stays at y=0; moving a whole backing sheet above it creates a stripe.
   Face overlap prevents fractional 3D edge antialiasing from showing the room. */
body[data-scenery=candlelit-envelope-test] .envelope-flap>span:not(.wax-seal){top:-1px;clip-path:polygon(0 0,100% 0,50% 100%)}
/* Wax fractures remain above both embossed halves, including after WAAPI ends. */
body[data-scenery=candlelit-envelope-test] .wax-fracture{z-index:2}
/* A shallow pressed impression, not a raised lump across a fold. Normal flow
   reserves space after the signature, on the bottom panel and in long letters. */
body[data-scenery=candlelit-envelope-test] :is(.letter-scroll,.fold-impression) .letter-wax{
 display:block;position:relative;width:34px;height:34px;margin:20px 0 0 auto;
 border-radius:47% 53% 49% 51% / 52% 47% 53% 48%;
 background:radial-gradient(ellipse at 32% 24%,#9c606655,transparent 64%),#672431;
 border:1px solid #54212d66;box-shadow:inset .7px .7px 1px #c68d7f77,inset -.7px -1px 1px #32131d88,0 .7px 1px #49342433;
}
body[data-scenery=candlelit-envelope-test] .letter-wax::after{
 content:'';position:absolute;inset:12%;background:#ddb0a2;
 mask:url('/demo/christmas/assets/moment/assets/sorelia-monogram-approved.svg') center/contain no-repeat;
 -webkit-mask:url('/demo/christmas/assets/moment/assets/sorelia-monogram-approved.svg') center/contain no-repeat;
 filter:drop-shadow(.4px .6px 0 #30121e);pointer-events:none;
}
/* Neutral shadow follows the existing text; neither the source room nor the
   photographs receive a colour grade. */
body[data-scenery=candlelit-envelope-test] :is(.opening-copy,.ending-copy){text-shadow:0 1px 3px #000000e6,0 0 14px #00000099}
body[data-scenery=candlelit-envelope-test] :is(#envelope-title,.opening .unfold,.letter-close){text-shadow:0 1px 4px #00000099}

/* Keep this tiny wax surface rasterised consistently in and out of the native
   top layer. Without this, the stronger fracture changes antialiasing on return. */
body[data-scenery=candlelit-envelope-test] :is(.wax-seal,.wax-body){will-change:transform}

/* Default 32% centre band (query centre-band=off remains available): one width-spanning, vertically feathered
   black shadow. It belongs to the room plane, not the foreground/story layer.
   Sticky left=0 works in both full-track and bounded-viewport room framing. */
body[data-scenery=candlelit-envelope-test][data-centre-band=on] .candlelit-centre-band{
 position:sticky;left:0;top:0;width:100vw;height:100%;pointer-events:none;z-index:1;
 background:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.02) 12%,rgba(0,0,0,.14) 28%,rgba(0,0,0,.28) 42%,rgba(0,0,0,.32) 50%,rgba(0,0,0,.28) 58%,rgba(0,0,0,.14) 72%,rgba(0,0,0,.02) 88%,transparent 100%);
}
/* Room-band dimming is coordinated with the existing letter/photo shade by
   their finite WAAPI timelines. No additional outro gradient or CSS state jump. */

/* Text-local contrast only: no full-slide gradient or coloured tint. Bounds
   follow the closing copy; feathered edges leave the room/window/candles warm. */
body[data-scenery=candlelit-envelope-test] .ending{isolation:isolate}
body[data-scenery=candlelit-envelope-test] .outro-contrast{position:absolute;z-index:-1;pointer-events:none;background:radial-gradient(ellipse,rgba(0,0,0,.76) 0%,rgba(0,0,0,.70) 48%,rgba(0,0,0,.38) 70%,transparent 100%);filter:blur(24px)}
