/* The Art of Gratitude: a Thanksgiving greeting in gold, white and silver. One screen, no scrolling. The body's data-s says where the story stands:
   idle -> seal -> open -> card -> ribbons -> greeting -> message -> complete, and each step of it is a class on the body (s-crack, s-flap, s-dance, s-arcs ...).
   Speed first: there is no canvas and no filter anywhere. The room is three flat pictures drawn once; every ribbon and leaf is a picture drawn once; the only things
   that ever change while it plays are transform (with its partners rotate and scale) and opacity.
   Lettering from the font library: Gloock (the greeting), Libre Caslon Text (the message), Urbanist (the small capitals and the controls). */
:root {
  --champagne: #D6B56E; --gold: #B58A35; --pearl: #FAF9F6; --platinum: #C5C9CF; --shadow: #858D98; --ivory: #F0EDE6; --bright: #F3DA9B; --deep: #866424; --white: #FFFFFF; --polished: #E1E5EA;
  --ink: #454B54; --ink-soft: #5E6670; --gold-ink: #6E5119;
  --luxury-gold: linear-gradient(125deg, #866424 0%, #B58A35 22%, #F3DA9B 43%, #D6B56E 62%, #97742D 80%, #F3DA9B 100%);
  --luxury-silver: linear-gradient(125deg, #858D98 0%, #C5C9CF 24%, #FFFFFF 46%, #E1E5EA 64%, #9299A3 83%, #F4F5F7 100%);
  --display: 'Gloock', 'Bodoni MT', Didot, Georgia, serif; --text: 'Libre Caslon Text', Georgia, 'Times New Roman', serif; --caps: 'Urbanist', 'Segoe UI', system-ui, sans-serif;
  /* the envelope's width decides the envelope (3 by 2), the folded card inside it and how far the card rises */
  --ew: clamp(220px, min(76vw, 58svh), 500px); --eh: calc(var(--ew) * 2 / 3);
  --cw: calc(var(--ew) * .9); --ch: calc(var(--cw) * 340 / 540);
  /* the frame round the greeting (1000 by 740, like the ribbons' drawing), where it rests once the message is open, and how small it becomes there */
  --fw: min(92vw, 78svh, 660px); --fh: calc(var(--fw) * .74);
  --top: calc(env(safe-area-inset-top, 0px) + 14px); --k: .5;
  --mtop: calc(var(--top) + var(--fh) * var(--k) + 32px); --mw: min(90vw, 470px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: #F4F2ED; color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 4px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pic { display: block; } .pic svg, .pic img { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }

/* ---------- the white dining room, the family at the table after dinner: four flat pictures (wall, floor, dinner, light), each drawn once ---------- */
#room { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
/* the room stands still: no drifting with the pointer, no zoom between scenes, nothing floating in the air. Only the light crosses it. */
#roomin { position: absolute; inset: 0; }
.rl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-select: none; user-select: none; pointer-events: none; }
/* the light crosses the room, slowly, and comes up when the greeting is shown */
.rl-light { opacity: .8; animation: light 17s ease-in-out infinite alternate; transition: opacity 1.600s ease; will-change: transform; }
@keyframes light { from { transform: translateX(-5%); } to { transform: translateX(6%); } }
/* a little champagne warmth in the middle of the room while the gold is out: a veil that only fades */
/* while the gold is out and the words are read, the dining room steps back behind a white veil that only fades (nothing in the room may cross the words) */
#room::before { content: ''; position: absolute; inset: 0; z-index: 2; background: #FAF9F6; opacity: 0; transition: opacity 1.200s ease; pointer-events: none; }
body:is([data-s="ribbons"], [data-s="greeting"]) #room::before { opacity: .72; }
body:is([data-s="message"], [data-s="complete"]) #room::before { opacity: .5; }
#room::after { content: ''; z-index: 3; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 48%, rgba(243, 218, 155, .34), rgba(243, 218, 155, 0) 62%); opacity: 0; transition: opacity 1.400s ease; pointer-events: none; }
body:is([data-s="ribbons"], [data-s="greeting"]) #room::after { opacity: 1; }
body:is([data-s="message"], [data-s="complete"]) #room::after { opacity: .45; }
body:is([data-s="ribbons"], [data-s="greeting"]) .rl-light { opacity: 1; }

/* ---------- the stage ---------- */
#stage { position: fixed; left: 0; top: 0; width: 100%; height: 100svh; z-index: 2; text-align: center; pointer-events: none; }
.hello, .cue { position: absolute; left: 0; right: 0; margin: 0; padding: 0 22px; pointer-events: none; transition: opacity .35s ease; text-wrap: balance; }
/* both lines stand ABOVE the envelope: below it is the dinner table, and nothing in the room may cross the words */
.hello { bottom: calc(50% + var(--eh) / 2 + clamp(46px, 8svh, 74px)); font-family: var(--display); font-weight: 400; font-size: clamp(25px, 6.600vw, 44px); line-height: 1.12; color: var(--deep); }
.cue { bottom: calc(50% + var(--eh) / 2 + clamp(14px, 2.600svh, 26px)); font-family: var(--caps); font-weight: 600; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: var(--ink-soft); animation: cue 2.600s ease-in-out infinite; }
@keyframes cue { 50% { opacity: .5; } }
body:not([data-s="idle"]) .hello, body:not([data-s="idle"]) .cue { opacity: 0; animation: none; }

/* ---------- the envelope. Layers inside .envwrap: light 0, back and liner 1, the card 2, the pocket 3, the flap 4 (1 once it is open), the button 6.
   The WHOLE wrap floats and comes forward: nothing moves the envelope's own frame while the card lies between its layers. ---------- */
.envwrap { position: absolute; left: 50%; top: 50%; margin: calc(var(--eh) / -2) 0 0 calc(var(--ew) / -2); display: grid; place-items: center; isolation: isolate; width: var(--ew); height: var(--eh); pointer-events: auto; transition: transform .7s cubic-bezier(.3, 0, .2, 1); will-change: transform; }
.envwrap > * { grid-area: 1 / 1; }
body[data-s="idle"] .envwrap { animation: float 6.500s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(-1.800%) rotate(-1.600deg); } 50% { transform: translateY(2.200%) rotate(1.200deg); } }
.s-near .envwrap { transform: translateY(8%) scale(1.06); }
.s-rise .envwrap { transform: translateY(20%) scale(1.07); }
.envframe { position: relative; width: var(--ew); height: var(--eh); }
.ev { position: absolute; display: block; }
/* a crisp, close shadow: the envelope is a real thing just in front of the wall */
.env-back { inset: 0; z-index: 1; border-radius: 1.400%; box-shadow: 0 calc(var(--ew) * .034) calc(var(--ew) * .05) rgba(133, 141, 152, .38), 0 1px 2px rgba(133, 141, 152, .6); }
.env-front { inset: 0; z-index: 3; }
.env-flapbox { left: 0; top: 0; width: 100%; height: 64.500%; z-index: 4; perspective: 1500px; perspective-origin: 50% 0; }
.flap { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.45, .05, .3, 1); will-change: transform; }
.ff, .fb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* the inside of the flap faces the back without being stood on its head, so the open flap points up from the fold */
.fb { transform: rotateX(180deg) scaleY(-1); }
.seal { position: absolute; left: 50%; top: 96.900%; width: 19%; aspect-ratio: 1; transform: translate(-50%, -50%) translateZ(1px); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* the fine gold line that appears round the seal under the finger: a ring that only fades and grows */
.seal::before { content: ''; position: absolute; inset: -13%; border-radius: 50%; border: 1.500px solid var(--champagne); box-shadow: 0 0 0 1px rgba(134, 100, 36, .35); opacity: 0; transform: scale(.82); transition: opacity .14s ease, transform .3s cubic-bezier(.2, .8, .3, 1); }
.seal svg { overflow: visible; }
.seal .cracks { opacity: 0; transition: opacity .1s ease; }
.seal .shard { transition: transform .55s cubic-bezier(.2, .7, .3, 1), opacity .5s ease .05s; transform-box: fill-box; transform-origin: 50% 50%; }
.s-glow .seal::before { opacity: 1; transform: scale(1); }
.s-break .seal::before { opacity: 0; transform: scale(1.5); transition-duration: .5s; }
.s-crack .seal .cracks { opacity: 1; }
.s-break .seal .cracks { opacity: 0; }
.s-break .seal .s0 { transform: translate(40%, -110%) rotate(40deg); opacity: 0; } .s-break .seal .s1 { transform: translate(120%, 10%) rotate(-50deg); opacity: 0; }
.s-break .seal .s2 { transform: translate(30%, 120%) rotate(60deg); opacity: 0; } .s-break .seal .s3 { transform: translate(-110%, 70%) rotate(-40deg); opacity: 0; }
.s-break .seal .s4 { transform: translate(-100%, -70%) rotate(50deg); opacity: 0; } .s-break .seal .s5 { transform: scale(1.4); opacity: 0; }
.s-flap .flap { transform: rotateX(178deg); }
.s-back .env-flapbox { z-index: 1; }
.open { inset: -6%; z-index: 6; padding: 0; border: 0; background: none; border-radius: 8px; }
body:not([data-s="idle"]) .open { display: none; }
/* the restrained champagne light that comes out of the envelope, between the liner and the card */
.glowin { z-index: 0; width: 86%; height: 60%; align-self: start; border-radius: 50%; background: radial-gradient(ellipse at 50% 60%, rgba(243, 218, 155, .85), rgba(243, 218, 155, .34) 42%, rgba(243, 218, 155, 0) 70%); opacity: 0; transform: translateY(-10%) scale(.6); transition: opacity .7s ease, transform .9s ease; pointer-events: none; }
.s-back .glowin { opacity: 1; transform: translateY(-46%) scale(1.2); }
.s-open .glowin { opacity: 0; }

/* ---------- the card: folded inside the envelope, it rises from behind the pocket, comes free, and opens along its crease ---------- */
.fcard { position: relative; z-index: 2; width: var(--cw); height: var(--ch); perspective: 1600px; transition: transform .8s cubic-bezier(.3, 0, .2, 1), opacity .9s ease; }
body[data-s="idle"] .fcard { visibility: hidden; }
.fc-base, .fc-cover { position: absolute; inset: 0; }
.fc-base > .pic { position: absolute; inset: 0; }
.fc-cover { transform-origin: 50% 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.fc-out, .fc-in { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc-in { transform: rotateX(180deg); }
.s-out .fcard { transform: translateY(calc(var(--eh) * -.78)); }
/* free of the envelope: the card is in front now, its crease at the middle of the screen, and only now may the envelope sink away */
.s-free .fcard { z-index: 7; transform: translateY(calc(var(--eh) * -.2 - var(--ch) * .5 * var(--grow, 1.2))) scale(var(--grow, 1.2)); }
.s-free .envframe, .s-free .glowin { animation: envgo .7s ease both; }
@keyframes envgo { to { opacity: 0; transform: translateY(46%) scale(.94); } }
.s-open .fc-cover { transform: rotateX(-180deg); }
/* the ribbons come out of the crease, and the card gives way to them */
.s-dance .fcard { opacity: 0; transition: transform .8s cubic-bezier(.3, 0, .2, 1), opacity .9s ease .35s; }

/* ---------- the frame round the greeting: four ribbons, twelve leaves, the words, one gold sparkle.
   It is one piece, so when the message opens the whole of it moves up and grows small together. ---------- */
#crest { position: absolute; left: 50%; top: 50%; width: var(--fw); height: var(--fh); margin: calc(var(--fh) / -2) 0 0 calc(var(--fw) / -2); transform-origin: 50% 0; transition: transform 1.100s cubic-bezier(.3, 0, .2, 1); will-change: transform; z-index: 3; }
.s-wish #crest { transform: translateY(calc(var(--fh) * .5 - 50svh + var(--top))) scale(var(--k)); }
#ribbons, #leaves { position: absolute; inset: 0; }
/* a ribbon: one flat picture the size of the frame (and a little over). It comes out of the middle small and turned, the four of them wound into a rosette that
   slowly unwinds; then each swings to its place and they stand as two arcs, left and right. Turning and growing run on clocks of their own. */
.rb { position: absolute; left: -4%; top: -5.405%; width: 108%; height: 110.810%; opacity: 0; rotate: var(--r0); scale: .02; transition: rotate 3.300s cubic-bezier(.25, .1, .25, 1), scale 1.300s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; will-change: transform; }
.rb img { display: block; width: 100%; height: 100%; -webkit-user-select: none; user-select: none; pointer-events: none; }
.rb-g1 { --r0: -205deg; --r1: -72deg; } .rb-g2 { --r0: 205deg; --r1: 72deg; } .rb-s1 { --r0: 165deg; --r1: 38deg; } .rb-s2 { --r0: -165deg; --r1: -38deg; }
.s-dance .rb { opacity: 1; rotate: var(--r1); scale: .47; }
.s-arcs .rb { rotate: 0deg; scale: 1; transition: rotate 1.900s cubic-bezier(.4, 0, .2, 1), scale 1.900s cubic-bezier(.4, 0, .2, 1), opacity .4s ease; pointer-events: auto; }
/* each ribbon breathes a little on its own, never in step with its neighbour */
.s-dance .rb img { animation: rbw 3.400s ease-in-out infinite alternate; }
.rb-g2 img { animation-duration: 4.100s !important; animation-delay: -1.300s; } .rb-s1 img { animation-duration: 3.800s !important; animation-delay: -.700s; } .rb-s2 img { animation-duration: 4.600s !important; animation-delay: -2.100s; }
@keyframes rbw { from { transform: rotate(-1.400deg) scale(.992, 1); } to { transform: rotate(1.400deg) scale(1, .992); } }
.rb.tap img { animation: rbtap .7s ease both !important; }
@keyframes rbtap { 40% { transform: scale(1.035); } }
/* a leaf: it leaves the middle with the ribbons, circles close, then flies to its own place on the frame */
.lf { position: absolute; left: 50%; top: 50%; width: calc(var(--fw) * .062 * var(--z, 1)); height: calc(var(--fw) * .124 * var(--z, 1)); margin: calc(var(--fw) * -.062 * var(--z, 1)) 0 0 calc(var(--fw) * -.031 * var(--z, 1)); opacity: 0; transform: rotate(calc(var(--a) - 230deg)) scale(.1); transition: transform 1.400s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; will-change: transform; pointer-events: none; }
.s-dance .lf { opacity: 1; transform: translate(calc(var(--x) * var(--fw) * .36), calc(var(--y) * var(--fw) * .36)) rotate(calc(var(--a) - 150deg)) scale(.62); transition-delay: calc(var(--i) * 55ms + 450ms); }
.s-arcs .lf { transform: translate(calc(var(--x) * var(--fw)), calc(var(--y) * var(--fw))) rotate(var(--a)) scale(1); transition: transform 1.700s cubic-bezier(.3, .1, .2, 1), opacity .4s ease; transition-delay: calc(var(--i) * 40ms); }
.s-arcs .lf .pic { animation: lfs 4.400s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.410s); }
@keyframes lfs { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* Happy Thanksgiving: gold foil. The letters are drawn twice on purpose, once in deep gold and, a hair above, once in the foil, so the foil has an edge to stand on.
   It fades in and settles; it never bounces, spins or glows. */
#t-greet { position: absolute; left: 0; right: 0; top: 50%; margin: 0; padding: 0; font-family: var(--display); font-weight: 400; font-size: calc(var(--fw) * .104); line-height: 1.04; letter-spacing: .005em; opacity: 0; transform: translateY(-50%) translateY(12px) scale(.965); transition: opacity .9s ease .55s, transform 1.300s cubic-bezier(.2, .8, .3, 1) .55s; pointer-events: none; }
.s-arcs #t-greet { opacity: 1; transform: translateY(-50%); }
.gw { display: block; position: relative; color: var(--deep); }
.gw::before { content: attr(data-t); content: attr(data-t) / ''; position: absolute; left: 0; right: 0; top: 0; transform: translateY(-.016em); background: var(--luxury-gold); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
/* the highlight that crosses the metal once when the greeting stands, and again when a ribbon is touched: a pale band that only slides (on the white wall it cannot be seen; on gold and silver it reads as light) */
#sheen { position: absolute; left: 0; top: -8%; width: 26%; height: 116%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, 0)); opacity: 0; transform: translateX(-140%) skewX(-16deg); pointer-events: none; z-index: 4; }
#sheen.go { animation: sheen 1.300s cubic-bezier(.4, 0, .3, 1) both; }
@keyframes sheen { from { transform: translateX(-140%) skewX(-16deg); opacity: 1; } to { transform: translateX(520%) skewX(-16deg); opacity: 1; } }
/* the one gold sparkle, at the head of the frame where the gold ribbons meet. It is a real button (and big enough to find once the frame is small). */
.spark { position: absolute; left: 50%; top: 4.600%; width: 92px; height: 92px; margin: -46px 0 0 -46px; padding: 0; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; opacity: 0; transform: scale(.3); transition: opacity .6s ease 1.200s, transform .8s cubic-bezier(.2, .8, .3, 1) 1.200s; pointer-events: none; z-index: 5; }
.spark .pic { width: calc(var(--fw) * .078); height: calc(var(--fw) * .078); min-width: 30px; min-height: 30px; }
.s-arcs .spark { opacity: 1; transform: none; pointer-events: auto; }
.s-arcs .spark .pic { animation: twinkle 2.800s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.8) rotate(45deg); opacity: .7; } }
.spark.on .pic { animation: sparkon .9s ease both; }
@keyframes sparkon { 50% { transform: scale(1.5) rotate(90deg); } to { transform: rotate(180deg); } }

/* ---------- the silver ornament: it comes down from the foot of the frame on a thread and opens like a locket ---------- */
.locket { position: absolute; left: 50%; top: calc(var(--mtop) - 26px); width: 44px; height: 44px; margin-left: -22px; z-index: 7; perspective: 320px; animation: drop .85s cubic-bezier(.3, .9, .3, 1) .5s both; }
.locket::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 12px; background: #9299A3; }
.locket .pic { position: absolute; inset: 0; }
.lk-lid { transform-origin: 0 50%; transition: transform .5s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.s-locket .lk-lid { transform: rotateY(-152deg); }
@keyframes drop { from { transform: translateY(calc(var(--fh) * -.32)) scale(.5); opacity: 0; } 25% { opacity: 1; } to { transform: none; opacity: 1; } }

/* ---------- the message: pearl paper, a thin silver border, a hair of gold inside it. It unfolds from its top edge, under the locket, and stays. ---------- */
#msg { position: absolute; left: 50%; top: var(--mtop); width: var(--mw); margin-left: calc(var(--mw) / -2); max-height: calc(100svh - var(--mtop) - 128px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(28px, 6vw, 38px) clamp(20px, 5.500vw, 40px) clamp(18px, 4vw, 26px); background: linear-gradient(170deg, #FFFFFF, #F6F4EF); color: var(--ink); border-radius: 3px; z-index: 6; pointer-events: auto;
  box-shadow: inset 0 0 0 1px var(--platinum), inset 0 0 0 6px #FBFAF8, inset 0 0 0 7px rgba(181, 138, 53, .8), 0 16px 30px rgba(133, 141, 152, .3), 0 2px 4px rgba(133, 141, 152, .35); transform-origin: 50% 0; animation: unfold .85s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes unfold { from { transform: perspective(1200px) rotateX(-86deg); opacity: 0; } 30% { opacity: 1; } to { transform: perspective(1200px) rotateX(0); opacity: 1; } }
.m-for { margin: 0 0 .9em; font-family: var(--caps); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: clamp(11.500px, 3vw, 13px); color: var(--gold-ink); text-wrap: balance; }
.m-text { margin: 0; font-size: clamp(16.500px, 4.200vw, 20px); line-height: 1.6; text-wrap: pretty; overflow-wrap: anywhere; white-space: pre-line; }
.m-thanks { margin: .75em 0 0; font-family: var(--display); font-size: clamp(24px, 6.400vw, 32px); line-height: 1.15; color: var(--deep); }
.m-sign { margin: .6em 0 0; font-style: italic; font-size: clamp(16px, 4vw, 19px); color: var(--ink-soft); }
#ctrl { position: absolute; left: 0; right: 0; bottom: max(26px, calc(env(safe-area-inset-bottom, 0px) + 18px)); display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; padding: 0 14px; z-index: 6; pointer-events: none; animation: fadeup .5s ease both; }
#ctrl > * { pointer-events: auto; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }
.btn { min-height: 48px; padding: 8px 22px; border: 1px solid var(--deep); border-radius: 2px; background: var(--luxury-gold); color: #33260B; font-family: var(--caps); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; box-shadow: 0 5px 12px rgba(133, 141, 152, .35); transition: transform .12s ease; }
.btn.ghost { background: #fff; border-color: #9299A3; color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.985); }
.fine { flex-basis: 100%; margin: 0; min-height: 1.3em; font-family: var(--caps); font-size: 14px; color: var(--ink); }
.linkish { position: fixed; z-index: 9030; left: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px); min-height: 44px; padding: 0 16px; border: 1px solid #9299A3; border-radius: 2px; background: rgba(255, 255, 255, .94); color: var(--ink); font-family: var(--caps); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: 12.500px; }

.extra { position: fixed; z-index: 8; left: 50%; bottom: clamp(118px, 19svh, 168px); transform: translateX(-50%); width: max-content; max-width: 90vw; margin: 0; padding: 9px 20px; border: 1px solid var(--champagne); border-radius: 99px; background: #fff; color: var(--gold-ink); font-family: var(--text); font-style: italic; font-size: clamp(16px, 4.200vw, 19px); line-height: 1.25; text-wrap: balance; box-shadow: 0 8px 18px rgba(133, 141, 152, .35); animation: fadeup .4s ease both; }

/* ---------- a jump (Skip, Replay): everything takes its place at once ---------- */
body.jump *, body.jump *::before, body.jump *::after { transition: none !important; animation-duration: .01s !important; animation-delay: 0s !important; }
/* ---------- the page is not being looked at: nothing runs ---------- */
body.away *, body.away *::before, body.away *::after { animation-play-state: paused !important; }
/* ---------- a slower device: the room is still, nothing sways; the story itself is the same ---------- */
body.lite .rl-light, body.lite .rb img, body.lite .lf .pic, body.lite .spark .pic { animation: none !important; }
/* ---------- less motion: the room is still, the story is told in one plain step ---------- */
body.rm .rl-light, body.rm .envwrap, body.rm .cue, body.rm .rb img, body.rm .lf .pic, body.rm .spark .pic, body.rm #msg, body.rm #ctrl, body.rm .locket, body.rm #sheen.go { animation: none !important; }
body.rm * { transition-duration: .01s !important; transition-delay: 0s !important; }

/* ---------- a phone held sideways: the frame stands on the left, the message on the right ---------- */
@media (max-height: 560px) and (orientation: landscape) {
  :root { --ew: clamp(190px, 50svh, 340px); --fw: min(46vw, 96svh); --k: .62; --mtop: 34px; --mw: 46vw; }
  #crest { transform-origin: 50% 50%; }
  .s-wish #crest { transform: translate(-25vw, -22px) scale(var(--k)); }
  .locket { left: 74vw; animation-name: dropside; }
  #msg { left: 74vw; max-height: calc(100svh - var(--mtop) - 26px); }
  #ctrl { right: auto; width: 50vw; bottom: 14px; }
  .fine { font-size: 12.500px; }
}
@keyframes dropside { from { transform: translateY(-30px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
