/* Black envelope (core/opening/260), INV-27 Midnight Rose · Luxe (A3019; D-502; the opener try the owner approved, A3018,
   docs/plans/evidence_inv27_w1pre/opener_try). The board mock's code envelope: a black body, a straight flap band over its top 45 %, the
   burgundy blossom wax seal on the flap's edge, an ivory dry rose across its lower-left corner; "You are invited", the names above,
   "Tap to open" below. Every screen gets its own layout from the skin's geometry (--k-mr-*): upright screens use the mock's 300 x 630 phone
   scaled to fit, a landscape screen is composed round its centre with a larger envelope.
   The tap: the seal pops 6 % and drops; the envelope pops up with a 4 % bump (D-492); the flap lifts and turns over; the couple's photo
   slides up out of the envelope as a print, to the very place where the hero shows it; the envelope falls away with its rose; the hero's
   photo develops out of the dark round the print (he260), then the print's edge goes. The print and the hero's photo show the same pixels
   in the same place, so nothing grows. The gate ends at 3550 ms, once the print has gone (feedback-opener-unlock-on-landing). */
.op260 { position: fixed; inset: 0; z-index: 100; overflow: hidden; touch-action: none; overscroll-behavior: contain;
  color: var(--k-ink, #F2EBDD); background: var(--k-mr-ground, #070606); text-align: center; }
.op260 > * { position: absolute; margin: 0; }
.op260__words { left: 0; right: 0; top: var(--k-mr-wt, 12svh); z-index: 9; padding-inline: var(--k-gutter, 22px); }
.op260__inv { font-size: var(--k-mr-wc, 11px); color: #CFC5B3; }
.op260__names { margin-top: calc(var(--k-mr-wn, 36px) * .5); font-size: min(var(--k-mr-wn, 36px), calc(80vw / (var(--op260-len, 6) * .86))); }   /* A3060 (cover_fit, stress-full): Bodoni capitals with their spacing run about .86em each, so a long name
   shrinks to one line instead of breaking onto two and running into the envelope; names up to ten letters keep the full size */
.op260__names .k-mr-and { font-size: 1.29em; }
.op260__go { left: 50%; top: calc(560 * var(--k-mr-u, 1.3px) + var(--k-mr-oy, 0px)); z-index: 10; translate: -50% 0; min-height: 44px; padding: 0 22px;
  font-size: var(--k-mr-wc, 11px); letter-spacing: .26em; color: var(--k-champ, #D9B98A); background: none; border: 0; }
.op260 .op260__go:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }   /* A2b (A3060, B64): the skin's ring needs --k-mr-accent */
.op260__tap { inset: 0; z-index: 8; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.op260__pre { width: 2px; left: 0; top: 0; opacity: 0; display: none; }   /* A3060 weight: it preloaded mr-bloom-800, which no section shows (grep: only this element) */
/* W2.1 (A3051): the envelope lies under the same night sky as the page. 11 tiny still stars (one champagne glint among them; owner: "very subtle ... 30% of current and quantity 25%"), on an even, jittered
   grid that keeps off the words and the cue, one small
   picture drawn at the screen's own size, so they stay sharp and round on every screen. Still before the tap: no twinkle, no passing light
   (feedback-no-light-flash-openers). On the tap they fade while the envelope falls away (2050-2900), before the hero's photo comes up;
   the page's own twinkling stars (layer/particles/260) take over after the gate. W2.1b (owner: "I dont see any gliter"): the same spots,
   each now a lit point with a bright centre; the soft 1-2 px dots read as nothing. */
.op260::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3CradialGradient id='s'%3E%3Cstop offset='0' stop-color='%23FFFAF0'/%3E%3Cstop offset='.42' stop-color='%23FFF8EC'/%3E%3Cstop offset='.68' stop-color='%23FFECCE' stop-opacity='.45'/%3E%3Cstop offset='1' stop-color='%23FFE6C4' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23FFF8EC'/%3E%3Cstop offset='.34' stop-color='%23FCE8C4'/%3E%3Cstop offset='.62' stop-color='%23ECCA96' stop-opacity='.4'/%3E%3Cstop offset='1' stop-color='%23E8C48C' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='89.5%25' cy='61.2%25' r='1.27' fill='url(%23s)' opacity='0.89'/%3E%3Ccircle cx='38.9%25' cy='81.7%25' r='1.33' fill='url(%23s)' opacity='0.94'/%3E%3Ccircle cx='11.8%25' cy='30.3%25' r='1.31' fill='url(%23s)' opacity='0.93'/%3E%3Ccircle cx='92.2%25' cy='10.7%25' r='1.06' fill='url(%23s)' opacity='0.83'/%3E%3Ccircle cx='17.1%25' cy='61.4%25' r='1.38' fill='url(%23s)' opacity='0.87'/%3E%3Ccircle cx='89.8%25' cy='82.9%25' r='1.37' fill='url(%23s)' opacity='0.75'/%3E%3Ccircle cx='81.8%25' cy='44.3%25' r='2' fill='url(%23g)' opacity='0.95'/%3E%3Ccircle cx='57.9%25' cy='60.9%25' r='1.14' fill='url(%23s)' opacity='0.85'/%3E%3Ccircle cx='40.9%25' cy='66.1%25' r='1.25' fill='url(%23s)' opacity='0.72'/%3E%3Ccircle cx='11.4%25' cy='91.4%25' r='1.13' fill='url(%23s)' opacity='0.78'/%3E%3Ccircle cx='5.9%25' cy='15.9%25' r='1.37' fill='url(%23s)' opacity='0.9'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
.op260.is-opening::before { animation: op260-gone 850ms ease 2050ms forwards; }

/* the envelope's parts share one box (the envelope at full size) and one scale about its centre, so the print can pass between them */
.op260__g { left: calc(50vw - var(--k-mr-ew, min(96vw, 120svh)) / 2); top: calc(var(--k-mr-ecy, 52svh) - var(--k-mr-eh, min(65.25vw, 81.56svh)) / 2); width: var(--k-mr-ew, min(96vw, 120svh)); height: var(--k-mr-eh, min(65.25vw, 81.56svh));
  scale: var(--k-mr-rest, .9); }
.op260__g--body { z-index: 4; border-radius: 2px; background: var(--op260-tooth) 0 0 / 40% auto repeat, linear-gradient(160deg, #1D1A1A, #121010); background-blend-mode: soft-light, normal;
  box-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 6px 14px 26px rgb(0 0 0 / .75); }
.op260__shade { position: absolute; left: 0; right: 0; top: 0; height: 45%; box-shadow: 0 2px 0 rgb(0 0 0 / .45), 0 8px 14px rgb(0 0 0 / .45); }
.op260__g--flap { z-index: 5; perspective: calc(var(--k-mr-ew, min(96vw, 120svh)) * 3.2); perspective-origin: 50% 0; }
.op260__flap { position: absolute; left: 0; right: 0; top: 0; height: 45%; transform-origin: 50% 0; transform-style: preserve-3d; }
.op260__face { position: absolute; inset: 0; border-radius: 2px 2px 0 0; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--op260-tooth) 31% 17% / 40% auto repeat, linear-gradient(175deg, #252121, #171414); background-blend-mode: soft-light, normal; border-bottom: 1px solid rgb(255 255 255 / .05); }
.op260__face--back { transform: rotateX(180deg); background: var(--op260-tooth) 63% 41% / 40% auto repeat, linear-gradient(0deg, #1A1717, #221E1D); background-blend-mode: soft-light, normal; border: 0; }
/* A3060 (owner, on the iPhone: "make the Envelop Texture more strong"; it had none, only gradients): the paper's tooth, a seamless tile cut from W0's rendered
   black envelope (docs/plans/evidence_inv27_release/texture/env_tooth.py), mid-grey = no change under hard-light; 40 % of the envelope's width, so the grain
   keeps the paper's own scale on every screen; each panel starts the tile somewhere else, so the panels don't repeat each other
   A3086 (owner, 19:25: "very strong now ... I want the texture to be around 20%"): soft-light, not hard-light, with the same tile: on this near-black
   paper soft-light moves the grain about a fifth as far (measured on the 3x cover); a fainter tile instead lost its grain to WebP (std 1 kept 0.13). */
.op260 { --op260-tooth: url("/skins/midnight_rose_luxe/assets/art/env-tooth-512.webp"); }
/* make-ready A2b (A3060, B71): only while opening, drawn 4 % bigger, every scale / 1.04, so the 4 % bump (D-492) peaks at 1 and nothing
   scales over 1; the closed cover keeps its own drawing */
.op260.is-opening :is(.op260__g--body, .op260__g--flap) { left: calc(50vw - var(--k-mr-ew, min(96vw, 120svh)) * .52); top: calc(var(--k-mr-ecy, 52svh) - var(--k-mr-eh, min(65.25vw, 81.56svh)) * .52);
  width: calc(var(--k-mr-ew, min(96vw, 120svh)) * 1.04); height: calc(var(--k-mr-eh, min(65.25vw, 81.56svh)) * 1.04); scale: calc(var(--k-mr-rest, .9) / 1.04); }
.op260.is-opening .op260__g--flap { perspective: calc(var(--k-mr-ew, min(96vw, 120svh)) * 3.328); }
/* W2.1 (A3051): the rose and the seal share one light from the upper left, so both cast the same kind of shadow: a tight contact line where
   they touch the flap and a soft shadow down-right, both measured in --op260-sd (the envelope's width / 240), so every screen gets the same depth */
.op260__g { --op260-sd: calc(var(--k-mr-ew, min(96vw, 120svh)) / 240); }
.op260__g--rose { z-index: 6;
  filter: drop-shadow(calc(var(--op260-sd) * .3) calc(var(--op260-sd) * .6) calc(var(--op260-sd) * .5) rgb(0 0 0 / .75))
    drop-shadow(calc(var(--op260-sd) * 2) calc(var(--op260-sd) * 5) calc(var(--op260-sd) * 6) rgb(0 0 0 / .6)); }
/* the ivory rose is held by the seal, its stem pinned under the wax as in INV-12's opener (owner, W1.1). W1.3 (owner: "the Flower in the
   Opener is still at 8 oclock and basically downwards. make it 2 oclock"): the bloom now lies up and to the right, across the flap, its
   head at 2 o'clock and its stem running down-left under the seal. Mirrored, then turned 50deg anticlockwise, so the light still comes from
   the upper left (as the hero's rose); the shadow sits on the group, so it still falls down-right. */
.op260__rose { left: 43.3%; top: 11.5%; width: 46%; filter: none; scale: -1 1; rotate: -50deg; }
.op260__g--seal { z-index: 7; }
.op260__seal { position: absolute; left: 50%; top: 45%; width: 24.2%; aspect-ratio: 303 / 314; translate: -50% -50%;
  background: url("/skins/midnight_rose_luxe/assets/art/seal-burgundy-320.webp") center / contain no-repeat;
  filter: var(--op260-seal-sh); }
/* W2.1 (A3051; owner: "adjust the seal drop shadow properly so it looks more 3D. make it stronger"): the wax stands proud of the flap. Four
   copies of its own outline: a tight dark ring all round where the wax presses into the paper, then, down-right from the light, a near-black
   contact line, a deeper shadow close under its rim and a long soft cast shadow (was one 1 x 3 px shadow at 70 %). The envelope is near black,
   so the shadow has to be long to be seen at all. On the tap the seal lifts: the ring and the contact line go, the shadows move away and
   soften (AG-T637), so the shadow leaves like a real one. */
/* make-ready A2b (A3060, B71; INV-25's fix): only while opening, the seal is drawn 6 % bigger at .9434, so its pop ends at 1 (opening-check
   allows no scale over 1) and the closed cover stays identical to the pixel; its shadow is drawn before that scale, so it is measured 6 % bigger */
.op260.is-opening .op260__seal { width: 25.652%; scale: .9434; --op260-sd: calc(var(--k-mr-ew, min(96vw, 120svh)) / 240 * 1.06); }
.op260__seal { --op260-sd: calc(var(--k-mr-ew, min(96vw, 120svh)) / 240); --op260-seal-sh:
    drop-shadow(0 0 calc(var(--op260-sd) * .9) rgb(0 0 0 / .6))
    drop-shadow(calc(var(--op260-sd) * .4) calc(var(--op260-sd) * .8) calc(var(--op260-sd) * .5) rgb(0 0 0 / .95))
    drop-shadow(calc(var(--op260-sd) * 1.6) calc(var(--op260-sd) * 3.6) calc(var(--op260-sd) * 2.8) rgb(0 0 0 / .88))
    drop-shadow(calc(var(--op260-sd) * 5) calc(var(--op260-sd) * 12.5) calc(var(--op260-sd) * 13) rgb(0 0 0 / .8));
  --op260-seal-up:
    drop-shadow(0 0 calc(var(--op260-sd) * 2) rgb(0 0 0 / 0))
    drop-shadow(calc(var(--op260-sd) * 1.2) calc(var(--op260-sd) * 2.4) calc(var(--op260-sd) * 1.6) rgb(0 0 0 / 0))
    drop-shadow(calc(var(--op260-sd) * 3.6) calc(var(--op260-sd) * 8) calc(var(--op260-sd) * 6) rgb(0 0 0 / .55))
    drop-shadow(calc(var(--op260-sd) * 8) calc(var(--op260-sd) * 19) calc(var(--op260-sd) * 19) rgb(0 0 0 / .5)); }

/* the print: waits behind the body, inside the envelope, then rises to the hero photo's place */
.op260__print { z-index: 3; left: var(--k-mr-prl, 4.5vw); top: var(--k-mr-prt, 3svh); width: var(--k-mr-prw, 91vw); height: var(--k-mr-prh, 56vw); overflow: hidden; visibility: hidden;
  translate: calc(50vw - var(--k-mr-prw, 91vw) / 2 - var(--k-mr-prl, 4.5vw)) calc(var(--k-mr-ecy, 52svh) - var(--k-mr-eh, min(65.25vw, 81.56svh)) * .43 - var(--k-mr-prt, 3svh)); }
.op260__print img { position: absolute; left: calc(var(--k-mr-pl, 0px) - var(--k-mr-prl, 4.5vw)); top: calc(var(--k-mr-prt, 3svh) * -1); width: var(--k-mr-pw, 100vw); height: var(--k-mr-ph, 64svh);
  max-width: none; object-fit: cover; object-position: var(--op260-pos, 50% 35%); }
.op260__print { box-shadow: 0 2px 3px rgb(0 0 0 / .5), 0 16px 30px rgb(0 0 0 / .55); }
.op260__print::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.op260__print::after { box-shadow: inset 0 0 0 1px rgb(242 235 221 / .14); }

/* a tablet or a landscape screen: the cue sits under the resting envelope (the words' sizes come from the skin's geometry) */
@media (min-aspect-ratio: 62/100) { .op260__go { top: calc(var(--k-mr-ecy, 52svh) + var(--k-mr-er, min(86vw, 70svh)) * .34 + 6svh); } }
@media (min-aspect-ratio: 6/5) { .op260__go { top: calc(var(--k-mr-ecy, 52svh) + var(--k-mr-er, min(86vw, 70svh)) * .34 + 4svh); } }   /* W1.3: the bigger envelope; the cue a little closer */

/* The tap (ms from the tap). Words and cue fade 0-350. Seal: pop 0-170, drop 170-820. Its rose: lifts 220-360, falls 360-1660. Envelope: pops from rest to about 90 % of the screen 240-640, settles 640-1150, falls 2050-2950.
   Flap: its shadow goes 820-1150; it lifts 820-2000 and passes upright at 1410, where it drops behind the print. Print: shows at 1500 (still
   behind the body); 2050-3000 the envelope drops away from round it while it glides to the hero photo's place, edge and shadow go 2750-3150, fades 2950-3500 while he260's photo comes up under it. Gate: 3550. */
.op260.is-opening { pointer-events: none; background: none; }
.op260.is-opening :is(.op260__words, .op260__go) { animation: op260-gone 350ms cubic-bezier(.2, .7, .3, 1) forwards; }
.op260.is-opening .op260__seal { animation: op260-pop 170ms cubic-bezier(.2, .7, .3, 1) both, op260-drop 650ms cubic-bezier(.333, 0, .667, .333) 170ms forwards; }
.op260.is-opening :is(.op260__g--body, .op260__g--flap) {
  animation: op260-env4 1150ms linear both, op260-fall 900ms cubic-bezier(.55, 0, 1, .45) 2050ms forwards; }
/* the rose follows the seal down, on its own: a small lift as the wax lets go, then a lighter, slower fall with a drift (INV-12's sprig) */
.op260.is-opening .op260__rose { animation: op260-rlift 140ms cubic-bezier(.2, .75, .35, 1) 220ms both, op260-rfall 1300ms cubic-bezier(.333, 0, .667, .333) 360ms forwards; }
.op260.is-opening .op260__shade { animation: op260-gone 330ms ease 820ms forwards; }
.op260.is-opening .op260__flap { animation: op260-lift 1180ms cubic-bezier(.65, 0, .35, 1) 820ms forwards; }
.op260.is-opening .op260__g--flap { animation: op260-env4 1150ms linear both, op260-fall 900ms cubic-bezier(.55, 0, 1, .45) 2050ms forwards,
  op260-behind 1ms step-end 1410ms forwards; }
.op260.is-opening .op260__print { animation: op260-show 1ms step-end 1500ms forwards, op260-rise 950ms cubic-bezier(.45, 0, .25, 1) 2050ms forwards,
  op260-unshadow 400ms ease 2750ms forwards, op260-gone 550ms cubic-bezier(.37, 0, .63, 1) 2950ms forwards; }
.op260.is-opening .op260__print::after { animation: op260-gone 400ms ease 2750ms forwards; }
@keyframes op260-gone { to { opacity: 0; } }
@keyframes op260-pop { to { scale: 1; filter: var(--op260-seal-up); } }
@keyframes op260-drop { to { translate: -50% calc(-50% + 130svh); rotate: 24deg; } }
@keyframes op260-rlift { to { translate: -4px -8px; rotate: -58deg; } }
@keyframes op260-rfall { from { translate: -4px -8px; rotate: -58deg; } to { translate: -8vw 140svh; rotate: -26deg; } }
@keyframes op260-env {
  0%, 20.87% { scale: var(--k-mr-rest, .9); animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  55.65% { scale: 1.04; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  100% { scale: 1; } }
@keyframes op260-env4 {
  0%, 20.87% { scale: calc(var(--k-mr-rest, .9) / 1.04); animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  55.65% { scale: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  100% { scale: .96154; } }
@keyframes op260-fall { to { translate: 0 calc(100svh + var(--k-mr-eh, min(65.25vw, 81.56svh))); } }
@keyframes op260-lift { to { transform: rotateX(180deg); } }
@keyframes op260-behind { to { z-index: 2; } }
@keyframes op260-show { to { visibility: visible; } }
/* the envelope drops away from round the print (2050-2950) while the print glides to the hero photo's place: it comes out of the envelope */
@keyframes op260-rise { to { translate: 0 0; } }
@keyframes op260-unshadow { to { box-shadow: 0 2px 3px rgb(0 0 0 / 0), 0 16px 30px rgb(0 0 0 / 0); } }
/* Reduce Motion: the envelope simply fades onto the hero */
html.motion-reduce .op260.is-opening { background: var(--k-mr-ground, #070606); animation: op260-gone .4s ease forwards; }
html.motion-reduce .op260.is-opening :is(.op260__words, .op260__go, .op260__seal, .op260__rose, .op260__g, .op260__shade, .op260__flap, .op260__print, .op260__print::after) { animation: none; }
/* A2b (A3060, B42): the system setting too, not only html.motion-reduce */
@media (prefers-reduced-motion: reduce) {
  html .op260.is-opening { background: var(--k-mr-ground, #070606); animation: op260-gone .4s ease forwards; }
  html .op260.is-opening :is(.op260__words, .op260__go, .op260__seal, .op260__rose, .op260__g, .op260__shade, .op260__flap, .op260__print, .op260__print::after) { animation: none; }
}
