/* The gift site: layout shared by every theme, then the five themes. Loaded by the published
   gift and by the editor (which adds editor.css on top). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
html.bp-locked, html.bp-locked body { overflow: hidden; }

:root {
  --ui-font: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Edge shapes for a chapter's band, used as masks: 28px strips stretched over the full width. */
  --solid: linear-gradient(#000, #000);
  --tilt-t: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28 1200 0v28z'/%3E%3C/svg%3E");
  --tilt-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1200L0 28z'/%3E%3C/svg%3E");
  --wave-t: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V16C100 4 200 4 300 16s200 12 300 0 200-12 300 0 200 12 300 0v12z'/%3E%3C/svg%3E");
  --wave-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0v12c100 12 200 12 300 0s200-12 300 0 200 12 300 0 200-12 300 0V0z'/%3E%3C/svg%3E");
  --curve-t: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28Q600-28 1200 28z'/%3E%3C/svg%3E");
  --zig-t: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V14L30 0L60 14L90 0L120 14L150 0L180 14L210 0L240 14L270 0L300 14L330 0L360 14L390 0L420 14L450 0L480 14L510 0L540 14L570 0L600 14L630 0L660 14L690 0L720 14L750 0L780 14L810 0L840 14L870 0L900 14L930 0L960 14L990 0L1020 14L1050 0L1080 14L1110 0L1140 14L1170 0L1200 14V28z'/%3E%3C/svg%3E");
  --zig-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0V14L30 28L60 14L90 28L120 14L150 28L180 14L210 28L240 14L270 28L300 14L330 28L360 14L390 28L420 14L450 28L480 14L510 28L540 14L570 28L600 14L630 28L660 14L690 28L720 14L750 28L780 14L810 28L840 14L870 28L900 14L930 28L960 14L990 28L1020 14L1050 28L1080 14L1110 28L1140 14L1170 28L1200 14V0z'/%3E%3C/svg%3E");
  --curve-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0q600 56 1200 0z'/%3E%3C/svg%3E");
}

/* ---------- themes: colours, type and the shape floating in the background ---------- */
[data-theme='blush'] {
  --bg: #fff3f6; --sky: radial-gradient(90% 55% at 50% 0%, #ffd9e3 0%, transparent 70%), linear-gradient(#fff7f8, #ffecf1);
  --ink: #4a1c2b; --soft: #8a5565; --accent: #d6336c; --accent-2: #ff9fb8; --card: #fff;
  --font-head: 'Frank Ruhl Libre', 'Times New Roman', serif; --head-weight: 900; --font-body: 'Assistant', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Amatic SC', 'Frank Ruhl Libre', cursive; --sign-size: 2.1em; --sign-weight: 400;
  --deco-color: #f0688f; --deco-op: .42; --deco-anim: deco-rise;
  --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  --gift: #e8457a; --gift-top: #f0688f; --band: #fff1c9; --knot: #ffd98a; --orn: '♥';
  --btn-bg: #d6336c; --btn-ink: #fff;
  /* section looks: band colours and textures, the text panel, picture frames */
  --wash-1: #ffe4eb; --wash-2: #fff0df; --wash-3: #fbe3f1; --dot: rgba(214, 51, 108, .13); --stripe: rgba(214, 51, 108, .07); --glow: rgba(255, 159, 184, .5);
  --panel: rgba(255, 255, 255, .74); --panel-line: rgba(214, 51, 108, .12);
  --f-line: rgba(214, 51, 108, .5); --f-paper: #fff; --f-tape: rgba(255, 159, 184, .7); --f-border: #4a1c2b; --f-block: #ff9fb8; --f-shadow: rgba(180, 40, 90, .5);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%23e8457a' fill-opacity='.12'%3E%3Cpath transform='translate(18 20) scale(1.5)' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3Cpath transform='translate(96 92) rotate(18 12 12) scale(.95)' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme='party'] {
  --bg: #fffaf0; --sky: radial-gradient(circle, rgba(29, 17, 71, .07) 1.5px, transparent 2px) 0 0 / 22px 22px, #fffaf0;
  --ink: #1d1147; --soft: #56498a; --accent: #ff3d77; --accent-2: #ffc400; --card: #fff;
  --font-head: 'Fredoka', 'Rubik', sans-serif; --head-weight: 700; --font-body: 'Fredoka', 'Rubik', sans-serif;
  --font-sign: 'Fredoka', sans-serif; --sign-size: 1.5em;
  --deco-color: #ff3d77; --deco-op: .5; --deco-anim: deco-rise; --deco-shape: none;
  --gift: #7a5cff; --gift-top: #9079ff; --band: #ffc400; --knot: #ff3d77; --orn: '●  ●  ●';
  --btn-bg: #1d1147; --btn-ink: #fff;
  /* section looks: band colours and textures, the text panel, picture frames */
  --wash-1: #ffefc2; --wash-2: #dff5f2; --wash-3: #ffe1ea; --dot: rgba(29, 17, 71, .1); --stripe: rgba(122, 92, 255, .13); --glow: rgba(122, 92, 255, .2);
  --panel: #fff; --panel-line: #1d1147;
  --f-line: #1d1147; --f-paper: #fff; --f-tape: rgba(46, 196, 182, .6); --f-border: #1d1147; --f-block: #ffc400; --f-shadow: rgba(29, 17, 71, .38);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Crect x='20' y='24' width='22' height='9' rx='3' fill='%23ff3d77' fill-opacity='.28' transform='rotate(-24 31 28)'/%3E%3Ccircle cx='112' cy='40' r='7' fill='%237a5cff' fill-opacity='.22'/%3E%3Crect x='84' y='104' width='22' height='9' rx='3' fill='%232ec4b6' fill-opacity='.32' transform='rotate(32 95 108)'/%3E%3Ccircle cx='34' cy='112' r='5' fill='%23ffc400' fill-opacity='.5'/%3E%3C/svg%3E");
}
[data-theme='night'] {
  --bg: #0a0e22; --sky: radial-gradient(1100px 620px at 85% -10%, #2c2065 0%, transparent 62%), radial-gradient(900px 560px at -5% 45%, #14245a 0%, transparent 60%), #0a0e22;
  --ink: #f6efe0; --soft: #bdb8cf; --accent: #f3c969; --accent-2: #b8a1ff; --card: #151a36;
  --font-head: 'Bellefair', 'Frank Ruhl Libre', serif; --head-weight: 400; --font-body: 'Heebo', system-ui, sans-serif;
  --font-sign: 'Bellefair', serif; --sign-size: 1.7em;
  --deco-color: #f7e3a6; --deco-op: .9; --deco-anim: deco-twinkle;
  --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/svg%3E");
  --gift: #1d2452; --gift-top: #2a3270; --band: #f3c969; --knot: #ffe29a; --orn: '✦';
  --btn-bg: #f3c969; --btn-ink: #1a1330;
  /* section looks: band colours and textures, the text panel, picture frames */
  --wash-1: rgba(255, 255, 255, .05); --wash-2: rgba(184, 161, 255, .1); --wash-3: rgba(243, 201, 105, .07); --dot: rgba(247, 227, 166, .17); --stripe: rgba(255, 255, 255, .045); --glow: rgba(184, 161, 255, .3);
  --panel: rgba(255, 255, 255, .055); --panel-line: rgba(243, 201, 105, .3);
  --f-line: rgba(243, 201, 105, .65); --f-paper: #f6efe0; --f-tape: rgba(243, 201, 105, .6); --f-border: #f3c969; --f-block: #b8a1ff; --f-shadow: rgba(0, 0, 0, .6);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%23f3c969' fill-opacity='.17'%3E%3Cpath transform='translate(18 20) scale(1.5)' d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3Cpath transform='translate(96 92) rotate(0 12 12) scale(.95)' d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/g%3E%3Ccircle cx='118' cy='32' r='2.5' fill='%23fff' fill-opacity='.3'/%3E%3Ccircle cx='40' cy='116' r='2' fill='%23fff' fill-opacity='.3'/%3E%3C/svg%3E");
}
[data-theme='garden'] {
  --bg: #f8f4ea; --sky: linear-gradient(#faf6ec, #eef2e4);
  --ink: #2f3b33; --soft: #5f6f64; --accent: #b5654a; --accent-2: #8fae8b; --card: #fffdf8;
  --font-head: 'Noto Serif Hebrew', 'Frank Ruhl Libre', serif; --head-weight: 700; --font-body: 'Assistant', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Amatic SC', 'Noto Serif Hebrew', cursive; --sign-size: 2.1em; --sign-weight: 400;
  --deco-color: #8fae8b; --deco-op: .5; --deco-anim: deco-fall;
  --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3C10 3 3 9 3 21c12 0 18-7 18-18zM3 21C8 14 13 9 21 3'/%3E%3C/svg%3E");
  --gift: #b5654a; --gift-top: #c9785c; --band: #f3ead7; --knot: #e9c46a; --orn: '❀';
  --btn-bg: #2f3b33; --btn-ink: #fffdf8;
  /* section looks: band colours and textures, the text panel, picture frames */
  --wash-1: #e9efdf; --wash-2: #f6e6d8; --wash-3: #f1ead2; --dot: rgba(47, 59, 51, .1); --stripe: rgba(143, 174, 139, .24); --glow: rgba(233, 196, 106, .38);
  --panel: rgba(255, 253, 248, .82); --panel-line: rgba(47, 59, 51, .1);
  --f-line: rgba(181, 101, 74, .55); --f-paper: #fffdf8; --f-tape: rgba(143, 174, 139, .65); --f-border: #2f3b33; --f-block: #8fae8b; --f-shadow: rgba(60, 50, 30, .4);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%238fae8b' fill-opacity='.26'%3E%3Cpath transform='translate(18 20) scale(1.5)' d='M21 3C10 3 3 9 3 21c12 0 18-7 18-18z'/%3E%3Cpath transform='translate(96 92) rotate(120 12 12) scale(.95)' d='M21 3C10 3 3 9 3 21c12 0 18-7 18-18z'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme='sunset'] {
  --bg: #ff7f8a; --sky: linear-gradient(165deg, #ffb07c 0%, #ff7a8c 46%, #8a5cf6 100%);
  --ink: #fff; --soft: rgba(255, 255, 255, .88); --accent: #fff2b3; --accent-2: #ffd0e0; --card: rgba(255, 255, 255, .16);
  --font-head: 'Rubik', system-ui, sans-serif; --head-weight: 900; --font-body: 'Rubik', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Amatic SC', 'Rubik', cursive; --sign-size: 2.1em; --sign-weight: 400;
  --deco-color: #fff; --deco-op: .12; --deco-anim: deco-rise; --deco-shape: none;
  --gift: #fff; --gift-top: #fff6dc; --band: #e8457a; --knot: #8a5cf6; --orn: '☀';
  --btn-bg: #fff; --btn-ink: #c2386b;
  /* section looks: band colours and textures, the text panel, picture frames */
  --wash-1: rgba(255, 255, 255, .12); --wash-2: rgba(90, 30, 140, .17); --wash-3: rgba(255, 242, 179, .15); --dot: rgba(255, 255, 255, .22); --stripe: rgba(255, 255, 255, .09); --glow: rgba(255, 242, 179, .38);
  --panel: rgba(255, 255, 255, .17); --panel-line: rgba(255, 255, 255, .38);
  --f-line: rgba(255, 255, 255, .75); --f-paper: #fff; --f-tape: rgba(255, 242, 179, .85); --f-border: #fff; --f-block: #fff2b3; --f-shadow: rgba(60, 10, 90, .6);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Ccircle cx='40' cy='42' r='17' fill='none' stroke='%23fff' stroke-opacity='.17' stroke-width='3'/%3E%3Ccircle cx='112' cy='108' r='9' fill='%23fff' fill-opacity='.12'/%3E%3Ccircle cx='118' cy='30' r='4' fill='%23fff' fill-opacity='.2'/%3E%3C/svg%3E");
}
[data-theme='unicorn'] {
  --bg: #fdf4ff; --sky: linear-gradient(160deg, #ffe3f4 0%, #ece4ff 50%, #dff4ff 100%);
  --ink: #4b2a6b; --soft: #7d5c9c; --accent: #e054b0; --accent-2: #9b7bff; --card: #fff;
  --font-head: 'Fredoka', 'Rubik', sans-serif; --head-weight: 700; --font-body: 'Fredoka', 'Rubik', sans-serif;
  --font-sign: 'Fredoka', sans-serif; --sign-size: 1.5em;
  --deco-color: #c79bff; --deco-op: .5; --deco-anim: deco-rise; --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/svg%3E");
  --gift: #b79cff; --gift-top: #cdb8ff; --band: #ff8fd0; --knot: #ffe27a; --orn: '✦  ✦  ✦';
  --btn-bg: #e054b0; --btn-ink: #fff;
  --wash-1: #ffe6f6; --wash-2: #ece6ff; --wash-3: #e2f6ff; --dot: rgba(155, 123, 255, .17); --stripe: rgba(224, 84, 176, .09); --glow: rgba(183, 156, 255, .45);
  --panel: rgba(255, 255, 255, .8); --panel-line: rgba(155, 123, 255, .22);
  --f-line: rgba(224, 84, 176, .5); --f-paper: #fff; --f-tape: rgba(127, 216, 255, .75); --f-border: #4b2a6b; --f-block: #ffb3e0; --f-shadow: rgba(120, 60, 170, .42);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%23b79cff' fill-opacity='.18'%3E%3Cpath transform='translate(18 20) scale(1.5)' d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3Cpath transform='translate(96 92) rotate(20 12 12) scale(.95)' d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme='space'] {
  --bg: #070b1f; --sky: radial-gradient(900px 560px at 15% -5%, #1b2a6b 0%, transparent 60%), radial-gradient(1000px 640px at 100% 55%, #3a1a66 0%, transparent 62%), #070b1f;
  --ink: #eaf2ff; --soft: #a9b6d8; --accent: #7ee0ff; --accent-2: #ffd76a; --card: #121a3a;
  --font-head: 'Rubik', system-ui, sans-serif; --head-weight: 900; --font-body: 'Rubik', system-ui, sans-serif;
  --font-sign: 'Rubik', sans-serif; --sign-size: 1.5em;
  --deco-color: #cfe6ff; --deco-op: .9; --deco-anim: deco-twinkle; --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/svg%3E");
  --gift: #3b2f8f; --gift-top: #5647c2; --band: #7ee0ff; --knot: #ffd76a; --orn: '✹';
  --btn-bg: #7ee0ff; --btn-ink: #06102a;
  --wash-1: rgba(126, 224, 255, .07); --wash-2: rgba(183, 156, 255, .11); --wash-3: rgba(255, 215, 106, .06); --dot: rgba(207, 230, 255, .2); --stripe: rgba(255, 255, 255, .045); --glow: rgba(126, 224, 255, .26);
  --panel: rgba(255, 255, 255, .065); --panel-line: rgba(126, 224, 255, .3);
  --f-line: rgba(126, 224, 255, .6); --f-paper: #eaf2ff; --f-tape: rgba(255, 215, 106, .75); --f-border: #7ee0ff; --f-block: #ff7eb6; --f-shadow: rgba(0, 0, 0, .65);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='none' stroke='%237ee0ff' stroke-opacity='.2' stroke-width='2.5'%3E%3Ccircle cx='40' cy='42' r='13'/%3E%3Cellipse cx='40' cy='42' rx='24' ry='7' transform='rotate(-20 40 42)'/%3E%3C/g%3E%3Ccircle cx='112' cy='104' r='6' fill='%23ffd76a' fill-opacity='.22'/%3E%3Ccircle cx='118' cy='30' r='2.5' fill='%23fff' fill-opacity='.4'/%3E%3C/svg%3E");
}
[data-theme='football'] {
  --bg: #0f5c33; --sky: repeating-linear-gradient(90deg, #126b3b 0 90px, #0f5f34 90px 180px);
  --ink: #fff; --soft: rgba(255, 255, 255, .9); --accent: #ffd400; --accent-2: #fff; --card: rgba(255, 255, 255, .15);
  --font-head: 'Rubik', system-ui, sans-serif; --head-weight: 900; --font-body: 'Rubik', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Amatic SC', 'Rubik', cursive; --sign-size: 2.1em; --sign-weight: 400;
  --deco-color: #fff; --deco-op: .13; --deco-anim: deco-rise; --deco-shape: none;
  --gift: #fff; --gift-top: #f1f1f1; --band: #111; --knot: #ffd400; --orn: '●  ●  ●';
  --btn-bg: #ffd400; --btn-ink: #0b3d24;
  --wash-1: rgba(255, 255, 255, .09); --wash-2: rgba(0, 0, 0, .15); --wash-3: rgba(255, 212, 0, .11); --dot: rgba(255, 255, 255, .2); --stripe: rgba(255, 255, 255, .07); --glow: rgba(255, 212, 0, .26);
  --panel: rgba(255, 255, 255, .15); --panel-line: rgba(255, 255, 255, .38);
  --f-line: rgba(255, 255, 255, .78); --f-paper: #fff; --f-tape: rgba(255, 212, 0, .88); --f-border: #fff; --f-block: #ffd400; --f-shadow: rgba(0, 30, 10, .62);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.17' stroke-width='3'%3E%3Ccircle cx='40' cy='42' r='16'/%3E%3Cpath d='M40 34l7 5-3 8h-8l-3-8z'/%3E%3C/g%3E%3Ccircle cx='112' cy='106' r='8' fill='%23fff' fill-opacity='.1'/%3E%3C/svg%3E");
}
[data-theme='dino'] {
  --bg: #f3f7e6; --sky: linear-gradient(#f7fbea, #e5f0d0);
  --ink: #24432f; --soft: #4f6b57; --accent: #ff7a2f; --accent-2: #3aa66b; --card: #fff;
  --font-head: 'Fredoka', 'Rubik', sans-serif; --head-weight: 700; --font-body: 'Fredoka', 'Rubik', sans-serif;
  --font-sign: 'Fredoka', sans-serif; --sign-size: 1.5em;
  --deco-color: #3aa66b; --deco-op: .45; --deco-anim: deco-fall; --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3C10 3 3 9 3 21c12 0 18-7 18-18z'/%3E%3C/svg%3E");
  --gift: #3aa66b; --gift-top: #57c088; --band: #ffd166; --knot: #ff7a2f; --orn: '▲  ▲  ▲';
  --btn-bg: #24432f; --btn-ink: #fff;
  --wash-1: #e2efc9; --wash-2: #ffecd2; --wash-3: #d9f0e3; --dot: rgba(36, 67, 47, .12); --stripe: rgba(58, 166, 107, .18); --glow: rgba(255, 209, 102, .48);
  --panel: rgba(255, 255, 255, .86); --panel-line: rgba(36, 67, 47, .15);
  --f-line: rgba(255, 122, 47, .6); --f-paper: #fff; --f-tape: rgba(255, 209, 102, .85); --f-border: #24432f; --f-block: #ff7a2f; --f-shadow: rgba(36, 67, 47, .42);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%233aa66b' fill-opacity='.2'%3E%3Cpath d='M22 58l14-26 14 26zM44 58l12-20 12 20z'/%3E%3Cpath d='M92 124l12-22 12 22zM112 124l9-15 9 15z'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme='classic'] {
  --bg: #faf7f0; --sky: linear-gradient(#fcfaf5, #f2ecdf);
  --ink: #1c1a17; --soft: #5e584d; --accent: #a8823a; --accent-2: #c8a45c; --card: #fff;
  --font-head: 'Bellefair', 'Frank Ruhl Libre', serif; --head-weight: 400; --font-body: 'Assistant', system-ui, sans-serif;
  --font-sign: 'Bellefair', serif; --sign-size: 1.8em;
  --deco-color: #c8a45c; --deco-op: .55; --deco-anim: deco-twinkle; --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.6 5.4 11.1 12 12-6.6.9-11.1 5.4-12 12-.9-6.6-5.4-11.1-12-12C6.6 11.1 11.1 6.6 12 0z'/%3E%3C/svg%3E");
  --gift: #1c1a17; --gift-top: #2e2a24; --band: #c8a45c; --knot: #e9dcc0; --orn: '◆';
  --btn-bg: #1c1a17; --btn-ink: #f6efe0;
  --wash-1: #f1eadb; --wash-2: #ffffff; --wash-3: #ece4d2; --dot: rgba(28, 26, 23, .1); --stripe: rgba(168, 130, 58, .14); --glow: rgba(200, 164, 92, .32);
  --panel: rgba(255, 255, 255, .88); --panel-line: rgba(168, 130, 58, .32);
  --f-line: rgba(168, 130, 58, .7); --f-paper: #fff; --f-tape: rgba(200, 164, 92, .6); --f-border: #1c1a17; --f-block: #c8a45c; --f-shadow: rgba(40, 30, 10, .36);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cg fill='%23c8a45c' fill-opacity='.2'%3E%3Cpath d='M40 24l12 18-12 18-12-18z'/%3E%3Cpath d='M110 92l8 12-8 12-8-12z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- the page ---------- */
.story {
  --pad: clamp(20px, 5vw, 48px);
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.06rem, .98rem + .35vw, 1.22rem);
  line-height: 1.75;
  direction: rtl;
}
.story h1, .story h2, .story p, .story figure { margin: 0; }
.story img { -webkit-user-drag: none; user-select: none; }

/* Back to front: the fixed sky, each chapter's tint, the theme's floating shapes, the content. */
.story::before { content: ''; position: fixed; inset: 0; z-index: -3; background: var(--sky); pointer-events: none; }
.story-deco { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.story-deco i {
  position: absolute; top: 0; left: calc(var(--x) * 1%);
  width: calc(var(--s) * 1px); aspect-ratio: 1;
  background: var(--deco-color); border-radius: 50%;
  -webkit-mask: var(--deco-shape) center / contain no-repeat; mask: var(--deco-shape) center / contain no-repeat;
  opacity: 0; will-change: transform, opacity;
  animation: var(--deco-anim) calc(var(--d) * 1s) linear calc(var(--delay) * -1s) infinite;
}
[data-theme='night'] .story-deco i, [data-theme='blush'] .story-deco i, [data-theme='garden'] .story-deco i,
[data-theme='unicorn'] .story-deco i, [data-theme='space'] .story-deco i, [data-theme='dino'] .story-deco i, [data-theme='classic'] .story-deco i { border-radius: 0; }
[data-theme='night'] .story-deco i, [data-theme='space'] .story-deco i, [data-theme='classic'] .story-deco i { top: calc(var(--y) * 1%); width: calc(var(--s) * .55px); animation-duration: calc(var(--d) * .22s); }
[data-theme='party'] .story-deco i:nth-child(4n + 2) { background: #ffc400; }
[data-theme='party'] .story-deco i:nth-child(4n + 3) { background: #2ec4b6; border-radius: 4px; }
[data-theme='party'] .story-deco i:nth-child(4n) { background: #7a5cff; }
[data-theme='party'] .story-deco i { width: calc(var(--s) * .6px); }
[data-theme='sunset'] .story-deco i, [data-theme='football'] .story-deco i { width: calc(var(--s) * 4px); filter: blur(2px); }
[data-theme='space'] .hero-title { background: linear-gradient(180deg, #fff, #7ee0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes deco-rise {
  from { transform: translate3d(0, 108vh, 0) rotate(0deg); opacity: 0; }
  12%, 82% { opacity: var(--deco-op); }
  to { transform: translate3d(calc(var(--r) * 1px), -22vh, 0) rotate(calc(var(--r) * 1deg)); opacity: 0; }
}
@keyframes deco-fall {
  from { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  12%, 82% { opacity: var(--deco-op); }
  to { transform: translate3d(calc(var(--r) * 1.5px), 108vh, 0) rotate(calc(var(--r) * 4deg)); opacity: 0; }
}
@keyframes deco-twinkle {
  0%, 100% { opacity: .12; transform: scale(.55); }
  50% { opacity: var(--deco-op); transform: scale(1); }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 96px var(--pad) 120px; text-align: center; }
.hero-in { display: grid; justify-items: center; gap: clamp(14px, 2.4vw, 24px); max-width: 980px; }
.hero-title {
  font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: clamp(2.8rem, 10.5vw, 6.4rem); line-height: 1.04; letter-spacing: -.01em; text-wrap: balance;
}
.hero-sub { font-size: clamp(1.15rem, 2.6vw, 1.6rem); line-height: 1.5; color: var(--soft); max-width: 30em; white-space: pre-wrap; text-wrap: balance; }
.hero-photo {
  width: clamp(136px, 30vw, 208px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 5px solid var(--card); box-shadow: 0 0 0 3px var(--accent), 0 24px 50px -22px rgba(0, 0, 0, .45);
}
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scroll-hint {
  position: absolute; inset-inline: 0; bottom: 30px; display: grid; justify-items: center; gap: 2px;
  font: 500 .8rem var(--ui-font); letter-spacing: .04em; color: var(--soft); opacity: .85;
}
.scroll-hint .ic { width: 22px; height: 22px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.ic { display: inline-grid; place-items: center; }
.ic svg { width: 100%; height: 100%; display: block; }

/* ---------- chapters ---------- */
.chapter { position: relative; padding: clamp(60px, 9vw, 116px) var(--pad); }
/* The chapter's band: a coloured, textured strip behind it with shaped edges. It reaches 30px
   into its neighbours, so the next band's top edge always lands on this one's flat body. */
.chapter::before {
  content: ''; position: absolute; inset: -30px 0; z-index: -2; pointer-events: none;
  background: var(--sec-bg, none); -webkit-mask: var(--sec-edge, none); mask: var(--sec-edge, none);
}
.chapter-in {
  max-width: 1060px; margin-inline: auto; display: grid; gap: clamp(30px, 5.5vw, 76px);
  align-items: center; justify-items: center; text-align: center;
}
.chapter-media { display: flex; justify-content: center; width: 100%; }
.frame { position: relative; width: min(100%, 450px); }
.frame.hero-photo { width: clamp(136px, 30vw, 208px); } /* the round picture at the top keeps its own size */
.chapter-photo img { display: block; width: 100%; height: auto; max-height: min(74svh, 620px); object-fit: cover; }
.chapter-body { display: grid; gap: clamp(12px, 1.8vw, 20px); max-width: 34em; }
.chapter-title { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.9rem, 5.4vw, 3.1rem); line-height: 1.14; text-wrap: balance; }
.chapter-text { white-space: pre-wrap; color: var(--soft); overflow-wrap: anywhere; }
.chapter.no-media .chapter-in { max-width: 760px; }
.orn { display: block; text-align: center; color: var(--accent); font-size: 1.25rem; line-height: 1; letter-spacing: .2em; opacity: .85; }
.orn::before { content: var(--orn); }
.chapter > .orn { position: absolute; inset-inline: 0; top: -.6em; }
@media (min-width: 860px) {
  /* Picture beside text, sides alternating. A chapter with only one of the two stays centred. */
  .chapter:not(.no-media, .only-media, [data-look='spotlight']) .chapter-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); text-align: start; justify-items: start; }
  .chapter:not(.no-media, .only-media, [data-look='spotlight']):nth-of-type(even) .chapter-media { order: 2; }
  .chapter.only-media .frame, .chapter[data-look='spotlight'] .frame { width: min(100%, 560px); }
}

/* ---------- section looks: five ways a chapter can be dressed ----------
   Each look is a band (colour, texture, edge shape), a picture frame and, for two of them, a
   layout. The geometry is shared; every theme colours it through its --wash, --f-* and --panel
   values. story.js deals the looks out in turn, and the editor lets a chapter pick its own
   (its style sheet draws small previews with these same rules, which is why the band values
   are set on any element that carries data-look). */

/* soft: no band, the picture rounded with a thin ring askew behind it */
[data-look='soft'] .chapter-photo img { border-radius: 22px; box-shadow: 0 26px 60px -26px var(--f-shadow); }
[data-look='soft'] .chapter-photo::before {
  content: ''; position: absolute; inset: -12px; border: 1.5px solid var(--f-line); border-radius: 32px; transform: rotate(-2.2deg); pointer-events: none;
}

/* polaroid: the theme's motif on a slanted band, the picture as a taped paper print */
[data-look='polaroid'] {
  --sec-bg: var(--motif) 0 0 / 150px 150px, var(--wash-1);
  --sec-edge: var(--tilt-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--tilt-b) bottom / 100% 28px no-repeat;
}
[data-look='polaroid'] .chapter-photo {
  padding: 13px 13px 48px; background: var(--f-paper); border-radius: 4px; transform: rotate(-1.8deg);
  box-shadow: 0 20px 44px -20px var(--f-shadow), 0 2px 5px rgba(0, 0, 0, .12);
}
[data-look='polaroid'] .chapter-photo::before {
  content: ''; position: absolute; top: -13px; left: 50%; z-index: 1; width: 104px; height: 28px; transform: translateX(-50%) rotate(-3deg);
  background: var(--f-tape); pointer-events: none;
}
[data-look='polaroid'] .chapter-photo img { border-radius: 2px; }
.chapter:nth-of-type(even)[data-look='polaroid'] .chapter-photo { transform: rotate(1.6deg); }

/* pop: dots on a wavy band, the picture with a bold outline and a solid offset block */
[data-look='pop'] {
  --sec-bg: radial-gradient(circle, var(--dot) 2.2px, transparent 2.800px) 0 0 / 26px 26px, var(--wash-2);
  --sec-edge: var(--wave-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--wave-b) bottom / 100% 28px no-repeat;
}
[data-look='pop'] .chapter-photo { transform: rotate(2deg); }
[data-look='pop'] .chapter-photo img { border-radius: 26px; border: 4px solid var(--f-border); box-shadow: 10px 10px 0 var(--f-block); }
.chapter:nth-of-type(even)[data-look='pop'] .chapter-photo { transform: rotate(-2deg); }

/* spotlight: a soft glow, the picture large and centred in a thin matte, the words below it */
[data-look='spotlight'] { --sec-bg: radial-gradient(62% 58% at 50% 40%, var(--glow), transparent 72%); }
[data-look='spotlight'] .chapter-photo {
  padding: 10px; border: 1px solid var(--f-line); border-radius: 8px; background: color-mix(in srgb, var(--f-paper) 12%, transparent);
  box-shadow: 0 30px 80px -30px var(--f-shadow);
}
[data-look='spotlight'] .chapter-photo img { border-radius: 3px; }

/* card: stripes on a curved band, a wide white border on the picture, the words on a panel */
[data-look='card'] {
  --sec-bg: repeating-linear-gradient(135deg, var(--stripe) 0 2px, transparent 2px 24px), var(--wash-3);
  --sec-edge: var(--curve-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--curve-b) bottom / 100% 28px no-repeat;
}
[data-look='card'] .chapter-photo { transform: rotate(-1.5deg); }
[data-look='card'] .chapter-photo img { border-radius: 30px; border: 6px solid var(--f-paper); box-shadow: 0 32px 70px -28px var(--f-shadow); }
.chapter:nth-of-type(even)[data-look='card'] .chapter-photo { transform: rotate(1.5deg); }
[data-look='card'] .chapter-body {
  padding: clamp(20px, 3.2vw, 36px); border-radius: 26px; background: var(--panel); border: 1px solid var(--panel-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 26px 50px -36px var(--f-shadow);
}

/* ---------- ending ---------- */
.ending { position: relative; padding: clamp(80px, 13vw, 150px) var(--pad) 40px; text-align: center; display: grid; justify-items: center; gap: clamp(48px, 8vw, 84px); }
.ending-in { display: grid; justify-items: center; gap: 22px; max-width: 800px; }
.ending-words { display: grid; justify-items: center; gap: 22px; width: 100%; }

/* candles to blow out: a cake first, the last words after the flames are gone */
.cake { width: clamp(160px, 44vw, 220px); }
.is-play .cake { cursor: pointer; }
.cake svg { display: block; width: 100%; overflow: visible; }
.cake-shadow { fill: rgba(0, 0, 0, .13); }
.cake-plate { fill: var(--f-paper); }
.cake-body { fill: var(--gift-top); }
.cake-icing { fill: var(--band); }
.candle { fill: var(--accent); }
.candle.alt { fill: var(--accent-2); }
.flame { fill: #ffb02e; transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1s ease-in-out calc(var(--i) * -.23s) infinite alternate; }
.flame-core { fill: #fff3c4; }
.smoke { fill: none; stroke: var(--soft); stroke-width: 2.500; stroke-linecap: round; opacity: 0; transform-box: fill-box; }
.wish { font-size: 1.05em; color: var(--soft); text-wrap: balance; }
.blow-btn { margin-top: 2px; }
.is-play .ending.has-candles:not(.is-told) .ending-words { display: none; }
.is-blown .flame { animation: none; transform: scale(.1) translateX(14px); opacity: 0; transition: transform .3s ease calc(var(--i) * .07s), opacity .3s ease calc(var(--i) * .07s); }
.is-blown .smoke { animation: smoke 1.500s ease-out calc(var(--i) * .07s + .2s) forwards; }
.is-blown .wish, .is-blown .blow-btn, .is-blown .blow-hint { display: none; }
.is-blown .cake { cursor: default; }
.is-told .ending-words { animation: rise-in 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
@keyframes flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.1, .92) rotate(4deg); } }
@keyframes smoke { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: .5; } 100% { opacity: 0; transform: translateY(-24px); } }

/* a heart back to the sender */
.heart-btn {
  appearance: none; cursor: pointer; margin-top: 6px; padding: 13px 24px; border-radius: 999px;
  border: 1.500px solid color-mix(in srgb, var(--ink) 24%, transparent); background: var(--card); color: var(--ink);
  font: 700 1rem var(--ui-font); transition: transform .15s ease;
}
.heart-btn:hover:not(:disabled) { transform: translateY(-2px); }
.heart-btn:disabled { cursor: default; opacity: .85; }

/* the tune: one round button in the corner */
.music-btn {
  position: fixed; z-index: 45; top: max(14px, env(safe-area-inset-top)); inset-inline-start: 14px; appearance: none; cursor: pointer;
  display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #1d1a2b; box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .5);
}
.music-btn .ic { width: 22px; height: 22px; }
.music-btn[aria-pressed='true'] { animation: music-pulse 2.400s ease-in-out infinite; }
@keyframes music-pulse { 50% { box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .5), 0 0 0 7px rgba(255, 255, 255, .28); } }
.ending-text { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.55rem, 4.4vw, 2.5rem); line-height: 1.32; white-space: pre-wrap; text-wrap: balance; }
.ending-sign { font-family: var(--font-sign); font-weight: 700; font-size: var(--sign-size); line-height: 1.1; color: var(--accent); }
.made {
  display: inline-block; padding: 9px 16px; border-radius: 999px; font: 500 .82rem var(--ui-font);
  color: var(--ink); text-decoration: none; background: var(--card); opacity: .8;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.made:hover { opacity: 1; }

/* ---------- type details that belong to one theme ---------- */
[data-theme='night'] .hero-title, [data-theme='night'] .chapter-title, [data-theme='night'] .gate-text { letter-spacing: .01em; }
[data-theme='night'] .hero-title { background: linear-gradient(180deg, #fff6dc, #f3c969); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme='night'] .chapter-text { font-weight: 300; }
[data-theme='party'] [data-look='card'] .chapter-body { border-width: 3px; box-shadow: 8px 8px 0 var(--accent); }
[data-theme='sunset'] .hero-title, [data-theme='sunset'] .chapter-title, [data-theme='sunset'] .ending-text { text-shadow: 0 2px 24px rgba(120, 30, 90, .25); }

/* ---------- opening screen ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 28px;
  background: var(--sky); background-color: var(--bg); color: var(--ink); text-align: center; cursor: pointer;
  transition: opacity .9s ease .25s, visibility 0s linear 1.2s;
}
.gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-in { display: grid; justify-items: center; gap: clamp(14px, 3vw, 22px); max-width: 620px; }
.gate-text { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.8rem, 6.6vw, 3.1rem); line-height: 1.18; text-wrap: balance; }
.gift { width: clamp(150px, 40vw, 216px); animation: gift-wobble 2.8s ease-in-out infinite; transform-origin: 50% 90%; }
.gift svg { display: block; width: 100%; overflow: visible; }
.gift-shadow { fill: rgba(0, 0, 0, .14); }
.gift-box { fill: var(--gift); }
.gift-top { fill: var(--gift-top); }
.gift-band { fill: var(--band); }
.gift-knot { fill: var(--knot); }
.gift-glow { opacity: 0; transform-box: fill-box; transform-origin: center; }
.gift-glow circle { fill: #fff8d6; }
.gift-lid { transform-box: fill-box; transform-origin: center; transition: transform .7s cubic-bezier(.3, .8, .3, 1), opacity .5s ease .25s; }
:is(.gate, .door).is-opening .gift { animation: none; }
:is(.gate, .door).is-opening .gift-lid { transform: translateY(-74px) rotate(-16deg); opacity: 0; }
:is(.gate, .door).is-opening .gift-glow { opacity: .9; transform: scale(3.2); transition: transform .9s ease, opacity .9s ease; }
:is(.gate, .door).is-opening .gate-text, :is(.gate, .door).is-opening .gate-btn { opacity: 0; transition: opacity .35s ease; }
.gate-btn {
  appearance: none; border: 0; cursor: pointer; padding: 15px 30px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink); font: 700 1.08rem var(--ui-font);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .5); animation: gate-pulse 2.2s ease-in-out infinite;
}
@keyframes gift-wobble { 0%, 100% { transform: rotate(0deg); } 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 55% { transform: rotate(-1.5deg); } 70% { transform: rotate(0deg); } }
@keyframes gate-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ---------- playing: reveal on scroll ---------- */
.is-play .reveal { opacity: 0; transform: translateY(34px); }
.is-play .chapter-media.reveal { transform: translateY(34px) scale(.95); }
.is-play .reveal.in { opacity: 1; transform: none; transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.is-play .chapter-body.reveal.in { transition-delay: .15s; }
.is-play .hero-in > *, .is-play .scroll-hint { opacity: 0; }
.is-live .hero-in > * { animation: rise-in 1s cubic-bezier(.2, .7, .2, 1) both; }
.is-live .hero-in > :nth-child(2) { animation-delay: .18s; }
.is-live .hero-in > :nth-child(3) { animation-delay: .36s; }
.is-live .hero-in > :nth-child(4) { animation-delay: .54s; }
.is-live .scroll-hint { animation: rise-in 1s ease 1.3s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .story-deco i, .gift, .gate-btn, .scroll-hint .ic, .flame, .music-btn { animation: none !important; }
  .is-play .reveal, .is-play .chapter-media.reveal { transform: none; }
}

/* ---------- three more looks ---------- */
/* stack: the picture on top of two loose sheets, on a band of wide diagonal stripes */
[data-look='stack'] {
  --sec-bg: repeating-linear-gradient(45deg, var(--stripe) 0 16px, transparent 16px 32px), var(--wash-2);
  --sec-edge: var(--tilt-b) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--tilt-t) bottom / 100% 28px no-repeat;
}
[data-look='stack'] .chapter-photo { transform: rotate(1.2deg); }
[data-look='stack'] .chapter-photo img { position: relative; border: 9px solid var(--f-paper); border-radius: 6px; box-shadow: 0 20px 44px -22px var(--f-shadow); }
[data-look='stack'] .chapter-photo::before, [data-look='stack'] .chapter-photo::after {
  content: ''; position: absolute; inset: 0; border-radius: 6px; background: var(--f-paper); box-shadow: 0 10px 26px -16px var(--f-shadow); pointer-events: none;
}
[data-look='stack'] .chapter-photo::before { transform: rotate(-5deg); }
[data-look='stack'] .chapter-photo::after { transform: rotate(3.500deg); z-index: 0; }
[data-look='stack'] .chapter-photo img, [data-look='stack'] .chapter-photo .slot-tools { z-index: 1; }

/* arch: a window with a round top and a thin ring around it, on a curved dotted band */
[data-look='arch'] {
  --sec-bg: radial-gradient(circle, var(--dot) 3px, transparent 3.600px) 0 0 / 34px 34px, var(--wash-1);
  --sec-edge: var(--curve-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--curve-b) bottom / 100% 28px no-repeat;
}
[data-look='arch'] .chapter-photo { width: min(100%, 380px); }
[data-look='arch'] .chapter-photo img { aspect-ratio: 3 / 4; max-height: none; border-radius: 999px 999px 20px 20px; box-shadow: 0 26px 60px -28px var(--f-shadow); }
[data-look='arch'] .chapter-photo::before {
  content: ''; position: absolute; inset: -11px; border: 1.500px solid var(--f-line); border-radius: 999px 999px 30px 30px; pointer-events: none;
}

/* ticket: a dashed frame like an entrance ticket, on a band with a zigzag edge */
[data-look='ticket'] {
  --sec-bg: repeating-linear-gradient(90deg, var(--stripe) 0 3px, transparent 3px 30px), var(--wash-3);
  --sec-edge: var(--zig-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--zig-b) bottom / 100% 28px no-repeat;
}
[data-look='ticket'] .chapter-photo { padding: 11px; border: 3px dashed var(--f-border); border-radius: 18px; background: color-mix(in srgb, var(--f-paper) 55%, transparent); transform: rotate(-1.2deg); }
[data-look='ticket'] .chapter-photo img { border-radius: 9px; }
.chapter:nth-of-type(even)[data-look='ticket'] .chapter-photo { transform: rotate(1.2deg); }

/* ---------- four more looks, only ever chosen by hand ---------- */
/* tape: a paper print held by a strip of tape at each top corner, on a band of small dots */
[data-look='tape'] {
  --sec-bg: radial-gradient(circle, var(--dot) 2px, transparent 2.600px) 0 0 / 22px 22px, var(--wash-2);
  --sec-edge: var(--wave-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--wave-b) bottom / 100% 28px no-repeat;
}
[data-look='tape'] .chapter-photo { padding: 10px; background: var(--f-paper); border-radius: 4px; transform: rotate(-1.6deg); box-shadow: 0 22px 46px -24px var(--f-shadow), 0 2px 5px rgba(0, 0, 0, .1); }
[data-look='tape'] .chapter-photo img { border-radius: 2px; }
[data-look='tape'] .chapter-photo::before, [data-look='tape'] .chapter-photo::after {
  content: ''; position: absolute; top: -9px; z-index: 2; width: 82px; height: 26px; background: var(--f-tape); pointer-events: none;
}
[data-look='tape'] .chapter-photo::before { left: -26px; transform: rotate(-38deg); }
[data-look='tape'] .chapter-photo::after { right: -26px; transform: rotate(38deg); }
.chapter:nth-of-type(even)[data-look='tape'] .chapter-photo { transform: rotate(1.6deg); }

/* film: the picture in a strip of film, with its holes along the top and the bottom */
[data-look='film'] {
  --sec-bg: var(--wash-3);
  --sec-edge: var(--tilt-b) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--tilt-t) bottom / 100% 28px no-repeat;
}
[data-look='film'] .chapter-photo {
  padding: 30px 12px; border-radius: 10px; transform: rotate(-1deg); box-shadow: 0 24px 50px -24px var(--f-shadow);
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #f6f1e6 8px 22px, transparent 22px 30px) 0 9px / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 8px, #f6f1e6 8px 22px, transparent 22px 30px) 0 calc(100% - 9px) / 100% 12px no-repeat,
    #1f1b24;
}
[data-look='film'] .chapter-photo img { border-radius: 3px; }

/* round: the picture in a circle with a ring, a disc of colour behind it, on the theme's own motif */
[data-look='round'] {
  --sec-bg: var(--motif) 0 0 / 150px 150px, var(--wash-1);
  --sec-edge: var(--curve-t) top / 100% 28px no-repeat, var(--solid) 0 27px / 100% calc(100% - 54px) no-repeat, var(--curve-b) bottom / 100% 28px no-repeat;
}
[data-look='round'] .chapter-photo { width: min(86%, 340px); }
[data-look='round'] .chapter-photo img { position: relative; z-index: 1; aspect-ratio: 1; max-height: none; border-radius: 50%; border: 7px solid var(--f-paper); box-shadow: 0 0 0 3px var(--accent), 0 26px 54px -26px var(--f-shadow); }
[data-look='round'] .chapter-photo::before { content: ''; position: absolute; inset: 7% -8% -6% 10%; z-index: 0; border-radius: 50%; background: var(--f-block); pointer-events: none; }

/* frame: a wide paper mat and a thin line inside it, like a picture hung on a wall */
[data-look='frame'] { --sec-bg: repeating-linear-gradient(0deg, var(--stripe) 0 2px, transparent 2px 26px), var(--wash-2); }
[data-look='frame'] .chapter-photo { padding: 20px; background: var(--f-paper); border: 3px solid var(--f-border); border-radius: 6px; box-shadow: 0 26px 56px -28px var(--f-shadow); }
[data-look='frame'] .chapter-photo img { border-radius: 2px; outline: 1.500px solid var(--f-line); outline-offset: 6px; }

/* ---------- the other cakes ---------- */
.cake-choco { fill: #7b4a2d; }
.cake-drip { fill: #4e2c1a; }
.cake-dot { fill: var(--accent); }
.cake-top { fill: var(--gift); }
.cake-wrap { fill: var(--accent-2); }
.cake-rib { fill: none; stroke: rgba(0, 0, 0, .14); stroke-width: 2; stroke-linecap: round; }
.cake-sponge { fill: #f1d7a7; }

/* ---------- a chapter with several pictures ---------- */
.chapter-media.is-collage { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2.200vw, 22px); align-items: center; max-width: 540px; margin-inline: auto; }
.is-collage .frame { width: 100%; }
.is-collage .chapter-photo img { aspect-ratio: 4 / 5; max-height: none; }
.is-collage.has-3 .frame:first-child { grid-column: 1 / -1; }
.is-collage.has-3 .frame:first-child img { aspect-ratio: 16 / 10; }
.is-collage.has-2 .frame:nth-child(2) { margin-top: 22%; }

/* ---------- then and now ---------- */
.then { position: relative; width: min(100%, 460px); aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; box-shadow: 0 26px 60px -26px var(--f-shadow); touch-action: pan-y; }
.then img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.then-old { clip-path: inset(0 calc(100% - var(--pos) * 1%) 0 0); }
.then-handle { position: absolute; top: 0; bottom: 0; left: calc(var(--pos) * 1%); width: 3px; margin-left: -1.500px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); pointer-events: none; }
.then-handle::after {
  content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: #fff; color: #1d1a2b; font: 700 1rem var(--ui-font); letter-spacing: .1em; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
.then-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; direction: ltr; }
.then-tag { position: absolute; bottom: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(29, 26, 43, .7); color: #fff; font: 700 .8rem var(--ui-font); pointer-events: none; }
.then-tag.is-old { left: 12px; }
.then-tag.is-new { right: 12px; }

/* ---------- chapters that do something ---------- */
.chapter-body.is-wide { max-width: 760px; width: 100%; justify-items: center; text-align: center; }
.reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; width: 100%; margin-top: 8px; }
.reason {
  appearance: none; position: relative; min-height: 132px; padding: 0; border: 0; border-radius: 18px; background: none; cursor: pointer; perspective: 800px;
  color: var(--ink); font-family: inherit;
}
.reason span { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border-radius: 18px; backface-visibility: hidden; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.reason-front { background: var(--btn-bg); color: var(--btn-ink); font: var(--head-weight) 2.600rem var(--font-head); box-shadow: 0 14px 30px -18px var(--f-shadow); }
.reason-back { background: var(--f-paper); color: #2a2233; font-size: .95rem; line-height: 1.45; transform: rotateY(180deg); box-shadow: 0 14px 30px -18px var(--f-shadow); overflow-wrap: anywhere; }
.reason.is-open .reason-front { transform: rotateY(180deg); }
.reason.is-open .reason-back { transform: none; }

.answers { display: grid; gap: 10px; width: min(100%, 460px); margin-top: 6px; }
.answer {
  appearance: none; cursor: pointer; padding: 15px 18px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--ink) 22%, transparent);
  background: var(--panel); color: var(--ink); font: 600 1.05rem var(--font-body); transition: transform .15s ease, border-color .15s ease;
}
.answer:hover { transform: translateY(-2px); }
.answer.is-right { border-color: #1fa855; background: #1fa855; color: #fff; }
.answer.is-wrong { animation: shake .4s ease; border-color: #d9485f; }
.quiz .chapter-text { display: none; }
.quiz.is-solved .chapter-text { display: block; animation: rise-in .7s ease both; }
.is-edit .quiz .chapter-text, .is-edit .chapter-text { display: block; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

.voucher {
  position: relative; display: grid; place-items: center; gap: 8px; width: min(100%, 460px); min-height: 150px; padding: 26px 22px; border-radius: 20px;
  background: var(--f-paper); color: #2a2233; border: 3px dashed var(--accent); box-shadow: 0 20px 44px -24px var(--f-shadow);
}
.voucher .chapter-text { color: #2a2233; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.300rem, 4vw, 1.900rem); line-height: 1.3; text-align: center; }
.voucher:not(.is-revealed) { user-select: none; -webkit-user-select: none; }
.scratch { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); border-radius: 20px; cursor: grab; touch-action: none; transition: opacity .6s ease; }
.voucher.is-revealed .scratch { opacity: 0; pointer-events: none; }
.scratch-hint { font-size: .9em; color: var(--soft); }
.voucher.is-revealed + .scratch-hint { visibility: hidden; }

/* ---------- friends' notes, the closing gallery ---------- */
.wall, .gallery { position: relative; padding: clamp(50px, 8vw, 96px) var(--pad); display: grid; justify-items: center; gap: clamp(22px, 4vw, 40px); text-align: center; }
.notes { columns: 3 240px; column-gap: 18px; width: min(100%, 980px); }
.note {
  display: grid; gap: 10px; break-inside: avoid; margin: 0 0 18px; padding: 16px 16px 14px; border-radius: 16px; background: var(--f-paper); color: #2a2233;
  text-align: start; transform: rotate(var(--tilt)); box-shadow: 0 16px 34px -22px var(--f-shadow);
}
.note img { width: 100%; border-radius: 10px; cursor: zoom-in; }
.note blockquote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .98rem; line-height: 1.6; }
.note figcaption { font-weight: 700; font-size: .9rem; color: #6a4a7a; }
.note figcaption::before { content: '— '; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; width: min(100%, 900px); }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.is-play .chapter-photo img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; background: rgba(12, 8, 20, .88); cursor: zoom-out; animation: rise-in .25s ease both; }
.lightbox img { max-width: calc(100vw - 36px); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); border-radius: 12px; object-fit: contain; }

/* ---------- the end: a voice, words back ---------- */
.voice-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink); font: 700 1rem var(--ui-font); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .55);
}
.reply { display: grid; justify-items: center; gap: 10px; width: min(100%, 420px); }
.reply-text {
  width: 100%; padding: 12px 14px; border-radius: 16px; border: 1.500px solid color-mix(in srgb, var(--ink) 24%, transparent); background: var(--f-paper); color: #2a2233;
  font: 500 1rem var(--ui-font); resize: none;
}
.reply-done { font-family: var(--ui-font); font-weight: 600; }

/* ---------- a gift that is still locked ---------- */
.gate.is-locked { cursor: default; }
.gate.is-locked .gift { animation: none; opacity: .92; }
.lock-status { min-height: 1.5em; font: 600 1.05rem var(--ui-font); color: var(--soft); font-variant-numeric: tabular-nums; }
.lock-form { display: grid; justify-items: center; gap: 12px; }
.lock-form[hidden] { display: none; }
.lock-question { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.200rem, 4vw, 1.600rem); line-height: 1.3; }
.lock-input {
  width: min(280px, 80vw); height: 52px; padding: 0 16px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent);
  background: var(--f-paper); color: #2a2233; font: 600 1.05rem var(--ui-font); text-align: center;
}
.gate.is-shaking .gate-in { animation: shake .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .reason span { transition: none; }
  .answer.is-wrong, .gate.is-shaking .gate-in { animation: none; }
}

/* ---------- type and rhythm ---------- */
/* On a wide screen the words stand up to the picture beside them: larger, darker, less air. */
.chapter { padding-block: clamp(54px, 7vw, 92px); }
.chapter-text { font-size: clamp(1.06rem, .93rem + .56vw, 1.36rem); color: color-mix(in srgb, var(--ink) 82%, transparent); }
.voucher .chapter-text { color: #2a2233; }
/* One short line is not a paragraph: it is shown as a caption that matters. */
.chapter-text.is-short { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.72rem); line-height: 1.5; color: var(--ink); text-wrap: balance; }
.frame.hero-photo { width: clamp(140px, 30vw, 264px); }
/* A small line above the title: when, where. */
.chapter-label { font: 700 .82rem var(--ui-font); letter-spacing: .06em; color: var(--accent); }
.chapter-label::before { content: ''; display: inline-block; width: 22px; height: 2px; margin-inline-end: 9px; vertical-align: middle; background: currentColor; border-radius: 2px; }
/* A highlighted word: a stroke of the theme's marker under it. */
.story mark.hl {
  padding: 0 .1em; border-radius: 3px; color: inherit; font-weight: 700;
  background: linear-gradient(transparent 56%, color-mix(in srgb, var(--accent) 38%, transparent) 0);
}

/* ---------- the typeface pair chosen for the whole gift ---------- */
[data-font='serif'] { --font-head: 'Frank Ruhl Libre', 'Times New Roman', serif; --head-weight: 900; --font-body: 'Assistant', system-ui, sans-serif; }
[data-font='round'] { --font-head: 'Fredoka', 'Rubik', sans-serif; --head-weight: 700; --font-body: 'Fredoka', 'Rubik', sans-serif; }
[data-font='bold'] { --font-head: 'Rubik', system-ui, sans-serif; --head-weight: 900; --font-body: 'Heebo', system-ui, sans-serif; }
[data-font='hand'] { --font-head: 'Playpen Sans Hebrew', 'Fredoka', cursive; --head-weight: 700; --font-body: 'Playpen Sans Hebrew', 'Assistant', cursive; }
.story[data-font='hand'] .hero-title { letter-spacing: 0; line-height: 1.12; }

/* ---------- chapters made of words: one big sentence, a letter ---------- */
.story blockquote { margin: 0; }
.quote { position: relative; gap: 14px; padding-top: clamp(3.2rem, 9vw, 5rem); }
.quote::before {
  content: '”'; position: absolute; top: 0; inset-inline: 0; text-align: center; pointer-events: none;
  font: var(--head-weight) clamp(4.5rem, 13vw, 7.5rem) / 1 var(--font-head); color: var(--accent); opacity: .55;
}
.quote-text { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.7rem, 5.2vw, 3rem); line-height: 1.24; white-space: pre-wrap; text-wrap: balance; overflow-wrap: anywhere; }
.quote-by { font: 600 .95rem var(--ui-font); color: var(--soft); }
.is-play .quote-by::before, .quote-by:not(:empty)::before { content: '— '; }
.letter {
  position: relative; display: grid; gap: 14px; width: min(100%, 640px); padding: clamp(28px, 5.5vw, 50px) clamp(20px, 5vw, 46px) clamp(24px, 5vw, 44px);
  border-radius: 4px; background: var(--f-paper); color: #2a2233; text-align: start; transform: rotate(-.5deg);
  box-shadow: 0 34px 60px -36px var(--f-shadow), 0 1px 0 rgba(0, 0, 0, .05);
}
.letter::before { content: ''; position: absolute; top: -13px; left: 50%; width: 104px; height: 28px; transform: translateX(-50%) rotate(-2deg); background: var(--f-tape); }
.letter-hello { font-family: var(--font-sign); font-weight: var(--sign-weight, 700); font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; }
.letter-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(1.04rem, .96rem + .3vw, 1.2rem); line-height: 1.9; color: #3a3247; }

/* ---------- the ending: last words and signature together, then a quiet way back ---------- */
.ending-say { display: grid; justify-items: center; gap: 10px; }
.ending-sign { font-weight: var(--sign-weight, 700); color: color-mix(in srgb, var(--accent) 68%, var(--ink)); }
.back-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.back-btn {
  appearance: none; cursor: pointer; padding: 10px 18px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--ink); font: 600 .92rem var(--ui-font); transition: transform .15s ease;
}
.back-btn:hover:not(:disabled) { transform: translateY(-2px); }
.back-btn:disabled { cursor: default; opacity: .8; }
.back-btn.is-main { background: var(--btn-bg); color: var(--btn-ink); border-color: transparent; }
.reply[hidden] { display: none; }

/* ---------- the end of every gift: a card from BestPresent ---------- */
/* It keeps the brand's colours whatever the gift's design is: the one place a recipient meets us. */
.made-card {
  display: grid; justify-items: center; gap: 8px; width: min(100%, 360px); margin-top: 8px; padding: 20px 20px 18px; border-radius: 24px;
  background: #fdf6ee; color: #3c0a22; text-align: center; box-shadow: 0 24px 50px -30px rgba(60, 10, 34, .6), 0 0 0 1px rgba(60, 10, 34, .06);
  font-family: 'Heebo', var(--ui-font);
}
.made-logo { display: inline-flex; align-items: center; gap: 7px; direction: ltr; font-family: 'Rubik', var(--ui-font); font-weight: 800; font-size: 1.12rem; }
.made-logo .ic { width: 26px; height: 26px; color: #b8104a; }
.made-card p { font-size: .98rem; line-height: 1.45; color: #5b2840; }
.made-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 26px; border-radius: 999px; text-decoration: none;
  background: linear-gradient(100deg, #b8104a, #9a1b55); color: #fff; font: 700 1rem 'Rubik', var(--ui-font); box-shadow: 0 12px 24px -12px rgba(150, 10, 60, .8);
  transition: transform .15s ease;
}
.made-btn:hover { transform: translateY(-2px); }

/* ---------- how much of the gift is left: a line along the top ---------- */
.read-bar { position: fixed; z-index: 44; top: 0; inset-inline: 0; height: 3px; pointer-events: none; }
.read-bar i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform: scaleX(var(--read, 0));
  transform-origin: right; transition: transform .12s linear; box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ---------- the cinematic opening: the name lands, the age is counted, the pictures rise ---------- */
.intro {
  --gold: #ffd36b;
  position: fixed; inset: 0; z-index: 49; overflow: hidden; display: grid; place-items: center; padding: 24px; cursor: pointer;
  background: radial-gradient(120% 80% at 50% 30%, color-mix(in srgb, var(--accent) 62%, #1c0712) 0%, color-mix(in srgb, var(--accent) 22%, #12040b) 55%, #0b0207 100%);
  color: #fff; text-align: center; transition: opacity .7s ease, transform .7s ease;
}
.intro.is-done { opacity: 0; transform: scale(1.04); pointer-events: none; }
.intro-rays {
  position: absolute; inset: -50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .07) 0 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 58%); mask: radial-gradient(circle, #000 0, transparent 58%);
  animation: intro-spin 50s linear infinite;
}
.intro-in { position: relative; display: grid; justify-items: center; margin-top: -12svh; }
.intro-top { font: 500 clamp(1rem, 4.4vw, 1.45rem) var(--ui-font); letter-spacing: .02em; opacity: .9; }
.intro-name {
  display: flex; justify-content: center; margin-top: .1em; line-height: 1.08;
  font-family: var(--font-head); font-weight: var(--head-weight); font-size: calc(min(24vw, 15svh, 150px) * min(1, 4.6 / var(--len)));
}
.intro-name span { display: inline-block; white-space: pre; text-shadow: 0 .05em 0 rgba(0, 0, 0, .28); }
.intro-age { position: relative; margin-top: -.04em; font: 900 calc(min(66vw, 36svh) * (1.25 - var(--digits) * .25)) / .9 'Rubik', var(--ui-font); }
.intro-num, .intro-gold { display: block; font-style: normal; font-weight: 900; font-variant-numeric: tabular-nums; }
.intro-num { color: var(--gold); filter: drop-shadow(0 .03em 0 rgba(0, 0, 0, .3)); }
.intro-num.has-pics {
  color: transparent; background-color: var(--gold); background-repeat: no-repeat; background-position: 30% 30%;
  -webkit-background-clip: text; background-clip: text; animation: intro-pan 8s ease-in-out infinite alternate;
}
.intro-num[data-pics='2'] { background-position: 0% 40%, 100% 60%; animation-name: intro-pan2; }
.intro-gold { position: absolute; inset: 0; color: var(--gold); opacity: 0; pointer-events: none; }
.intro-sub { margin-top: .3em; font: 800 clamp(1.25rem, 6vw, 2rem) var(--ui-font); }
.intro-pols { position: absolute; bottom: max(24px, 4svh); inset-inline: 0; display: flex; justify-content: center; pointer-events: none; }
.intro-pols img {
  width: clamp(80px, 24vw, 150px); aspect-ratio: 4 / 5; object-fit: cover; margin-inline: -1.6vw; border: 5px solid #fff; border-bottom-width: 16px; border-radius: 4px;
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, .6); opacity: 0;
}
.intro-pols img:nth-child(1) { rotate: -9deg; }
.intro-pols img:nth-child(2) { rotate: 3deg; translate: 0 -14px; z-index: 1; }
.intro-pols img:nth-child(3) { rotate: 10deg; }
.intro-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.intro.go .intro-top { animation: intro-up .6s .15s both; }
.intro.go .intro-name span { animation: intro-drop .7s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(.45s + var(--i) * .1s); }
.intro.go .intro-age { animation: intro-pop .7s 1.15s cubic-bezier(.2, 1.6, .4, 1) both; }
.intro.go .has-pics + .intro-gold { animation: intro-gold calc(var(--flash) + .45s) both; }
/* forwards, not both: before its moment the flash must not cover the opening */
.intro.go .intro-flash { animation: intro-flash .7s var(--flash) forwards; }
.intro.go .intro-sub { animation: intro-up .6s calc(var(--flash) + .2s) both; }
.intro.go .intro-pols img { animation: intro-rise .8s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--flash) + .4s + var(--i) * .12s); }
.intro.is-calm .intro-pols img { opacity: 1; }
.intro.is-calm *, .intro.is-calm .intro-name span { animation: none !important; }
@keyframes intro-spin { to { transform: rotate(1turn); } }
@keyframes intro-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes intro-drop { from { opacity: 0; transform: translateY(-60vw) rotate(-14deg) scale(.5); } }
@keyframes intro-pop { from { opacity: 0; transform: scale(.15) rotate(8deg); } }
@keyframes intro-gold { 0%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes intro-flash { from { opacity: .9; } to { opacity: 0; } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(60vh); } to { opacity: 1; } }
@keyframes intro-pan { from { background-position: 30% 30%; } to { background-position: 70% 70%; } }
@keyframes intro-pan2 { from { background-position: 0% 40%, 100% 60%; } to { background-position: 10% 60%, 90% 40%; } }

/* ---------- the years in numbers ---------- */
.chapter-body.is-bare { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.years { display: grid; gap: 10px; width: min(100%, 600px); margin-top: 8px; }
.year {
  --from: 60px;
  position: relative; display: grid; justify-items: start; align-content: center; min-height: clamp(104px, 24vw, 150px); padding: 12px clamp(20px, 5vw, 34px);
  overflow: hidden; border-radius: 22px; text-align: start; background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 18px 40px -26px var(--f-shadow);
}
.year:nth-child(2) { --from: -60px; background: var(--accent-2); color: #1d1a2b; }
.year:nth-child(3) { background: var(--ink); color: var(--bg); }
.year:nth-child(4) { --from: -60px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), 0 18px 40px -26px var(--f-shadow); }
.year-n { position: relative; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(2.9rem, 13vw, 5.2rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.year-label { position: relative; font: 700 clamp(1rem, 3.8vw, 1.3rem) var(--ui-font); }
.year-shape { position: absolute; top: 50%; inset-inline-end: -18px; width: clamp(110px, 30vw, 170px); aspect-ratio: 1; translate: 0 -50%; opacity: .2; animation: intro-spin 18s linear infinite; }
.year-shape svg { display: block; width: 100%; height: 100%; }
.is-play .years:not(.is-on) .year { opacity: 0; }
.years.is-on .year { animation: year-in .75s cubic-bezier(.2, 1, .3, 1) both; animation-delay: calc(var(--i) * .42s); }
@keyframes year-in { from { opacity: 0; transform: translateX(var(--from)) scale(.96); } }
.years-ask {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 14px 22px; border-radius: 999px;
  border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: var(--card); color: var(--ink); font: 700 1rem var(--ui-font);
}
.years-ask .ic { width: 22px; height: 22px; color: var(--accent); }

/* ---------- a magazine cover ---------- */
.cover {
  position: relative; width: min(100%, 440px); aspect-ratio: 4 / 5.3; overflow: hidden; container-type: inline-size; border-radius: 6px;
  background: var(--btn-bg); color: #fff; text-align: center; transform: rotate(-1deg);
  box-shadow: 0 44px 80px -44px var(--f-shadow), 0 0 0 1px rgba(0, 0, 0, .06);
}
.chapter:nth-of-type(even) .cover { transform: rotate(1deg); }
.cover .frame { position: absolute; inset: 30cqw 0 0; width: auto; margin: 0; }
.cover .frame img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: 50% 15%; }
.is-play .cover .frame img { animation: cover-ken 14s ease-in-out infinite alternate; }
.cover .slot-add { width: 100%; height: 100%; border-radius: 0; }
.cover-scrim { position: absolute; inset: 30cqw 0 0; background: linear-gradient(180deg, transparent 38%, rgba(15, 4, 10, .9) 100%); pointer-events: none; }
.cover-kicker { position: absolute; top: 4.6cqw; inset-inline: 0; font: 700 3.2cqw var(--ui-font); letter-spacing: .26em; color: var(--btn-ink); opacity: .82; }
.cover-title {
  position: absolute; top: 7.5cqw; inset-inline: 3cqw; color: var(--btn-ink); white-space: nowrap; overflow: hidden;
  font: 900 calc(26cqw * min(1, 4.6 / var(--len, 4))) / 1.05 'Frank Ruhl Libre', var(--font-head);
}
.cover-badge {
  position: absolute; top: 37cqw; inset-inline-start: 5cqw; display: grid; place-content: center; width: 23cqw; aspect-ratio: 1; border-radius: 50%;
  background: var(--accent-2); color: #1d1a2b; rotate: -12deg; box-shadow: 0 2cqw 5cqw -1cqw rgba(0, 0, 0, .5);
}
.cover-badge b { font: 900 10cqw/1 'Rubik', var(--ui-font); }
.cover-badge span { font: 800 2.5cqw 'Rubik', var(--ui-font); }
.cover-heads { position: absolute; bottom: 13cqw; inset-inline: 6cqw; display: grid; gap: 2cqw; margin: 0; padding: 0; list-style: none; text-align: start; color: #fff; }
.cover-heads li { padding-top: 2cqw; border-top: 1px solid rgba(255, 255, 255, .35); font: 500 4.4cqw/1.25 var(--ui-font); }
.cover-heads li:first-child { padding: 0; border: 0; font: var(--head-weight) 8.2cqw/1.1 var(--font-head); color: var(--accent-2); }
.cover-heads.is-edit-list { bottom: 4cqw; padding: 6px 8px; border-radius: 12px; background: rgba(15, 4, 10, .6); }
.cover-heads .item-text { color: #fff; font-size: .95rem; }
.cover-bars {
  position: absolute; bottom: 5cqw; inset-inline-end: 6cqw; width: 20cqw; height: 7cqw; opacity: .9;
  background: repeating-linear-gradient(90deg, #fff 0 .6cqw, transparent .6cqw 1.1cqw, #fff 1.1cqw 1.4cqw, transparent 1.4cqw 2.4cqw);
}
.cover:has(.is-edit-list) .cover-bars { display: none; }
.cover-shine { position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .32) 50%, transparent 58%); translate: -70% 0; animation: cover-shine 5.5s 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes cover-shine { 0% { translate: -70% 0; } 40%, 100% { translate: 70% 0; } }
@keyframes cover-ken { from { transform: scale(1.02); } to { transform: scale(1.14); } }

/* ---------- a champion's card ---------- */
.pcard {
  position: relative; width: min(100%, 340px); padding: 20px 20px 24px; overflow: hidden; border-radius: 26px; color: #3a2500; text-align: center;
  background: linear-gradient(160deg, #fff3c4, #f2b632 45%, #c98a12);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .4);
  transform: perspective(900px) rotateY(-8deg) rotateX(3deg);
}
.is-play .pcard { animation: pcard-tilt 4.5s ease-in-out infinite alternate; }
.pcard-top { display: flex; align-items: flex-start; gap: 12px; }
.pcard-rate { display: grid; justify-items: center; flex: none; width: 31%; }
.pcard-rate b { font: 900 clamp(3.3rem, 15vw, 4.3rem)/.95 'Rubik', var(--ui-font); }
.pcard-role { font: 800 .8rem/1.2 'Rubik', var(--ui-font); }
.pcard .frame { flex: 1; min-width: 0; width: auto; }
.pcard .frame img { display: block; width: 100%; aspect-ratio: 1; max-height: none; object-fit: cover; border-radius: 50% 50% 10% 10% / 60% 60% 10% 10%; border: 3px solid rgba(58, 37, 0, .35); }
.pcard .slot-add { aspect-ratio: 1; }
.pcard-name { margin: 14px 0 10px; padding-block: 8px; border-block: 2px solid rgba(58, 37, 0, .3); font: 900 clamp(1.8rem, 8vw, 2.4rem)/1 'Rubik', var(--ui-font); overflow-wrap: anywhere; }
.pcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; margin: 0; padding: 0; list-style: none; font: 700 1rem var(--ui-font); }
.pcard-stats li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: start; }
.pcard-stats b { font: 900 1.2rem 'Rubik', var(--ui-font); font-variant-numeric: tabular-nums; }
.pcard-edit .item-text { color: #3a2500; }
.pcard-holo {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .6) 45%, rgba(255, 120, 200, .3) 50%, rgba(120, 220, 255, .3) 55%, transparent 70%) 120% 0 / 250% 100%;
  animation: holo 3.2s linear infinite;
}
@keyframes pcard-tilt { from { transform: perspective(900px) rotateY(-9deg) rotateX(4deg); } to { transform: perspective(900px) rotateY(9deg) rotateX(-3deg); } }
@keyframes holo { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* ---------- the site as a film ---------- */
.film-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; padding: 8px 20px 8px 10px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--ink); font: 700 1rem var(--ui-font);
  box-shadow: 0 14px 30px -18px var(--f-shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 14%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: transform .15s ease;
}
.film-btn:hover { transform: translateY(-2px); }
.film-btn .ic { width: 34px; height: 34px; padding: 9px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); }
.film { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #050205; color: #fff; cursor: pointer; animation: film-in .35s ease both; }
.film.is-out { opacity: 0; transition: opacity .45s ease; }
.film-frame { position: relative; width: min(100%, calc(100svh * 9 / 16)); height: 100%; overflow: hidden; }
.film-shots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.film-shots img.on { opacity: 1; animation: film-kb var(--shot) linear both; }
.film-shots img:nth-child(even).on { animation-name: film-kb2; }
.film-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 20%, transparent 52%, rgba(0, 0, 0, .82)); pointer-events: none; }
.film-bars { position: absolute; top: max(14px, env(safe-area-inset-top)); inset-inline: 14px; display: flex; gap: 5px; }
.film-bars i { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .35); }
.film-bars u { display: block; width: 0; height: 100%; background: #fff; }
.film-bars i.done u { width: 100%; }
.film-bars i.now u { animation: film-fill var(--shot) linear both; }
.film.at-end .film-bars i.now u { animation-duration: 4.2s; }
.film-tag { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 16px); inset-inline-start: 14px; display: flex; align-items: flex-end; gap: 7px; font: 600 .8rem var(--ui-font); opacity: .85; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: #fff; transform-origin: bottom; animation: eq .5s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.15s; }
.film-cap {
  position: absolute; bottom: max(44px, calc(env(safe-area-inset-bottom) + 30px)); inset-inline: 22px; margin: 0; text-wrap: balance;
  font: var(--head-weight) clamp(1.9rem, 8.5vw, 2.8rem)/1.15 var(--font-head); text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
.film-cap span { display: inline-block; animation: film-word .5s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(.2s + var(--i) * .09s); }
.film-x {
  position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 10px); inset-inline-end: 10px; z-index: 2; display: grid; place-items: center;
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer;
}
.film-x .ic { width: 22px; height: 22px; }
.film-end {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; opacity: 0; transition: opacity .8s ease;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 70%, #000), #0b0207 75%); pointer-events: none;
}
.film.at-end .film-end { opacity: 1; }
.film-end b { font: var(--head-weight) clamp(2.4rem, 11vw, 4.2rem)/1.1 var(--font-head); text-wrap: balance; }
.film-end span { font-family: var(--font-sign); font-size: var(--sign-size); line-height: 1.1; color: var(--accent-2); }
.film.is-calm .film-shots img.on, .film.is-calm .film-cap span { animation: none; }
@keyframes film-in { from { opacity: 0; } }
@keyframes film-fill { from { width: 0; } to { width: 100%; } }
@keyframes film-kb { from { transform: scale(1.05); } to { transform: scale(1.2) translate(2%, -2%); } }
@keyframes film-kb2 { from { transform: scale(1.2) translate(-2%, 1%); } to { transform: scale(1.05); } }
@keyframes film-word { from { opacity: 0; transform: translateY(18px) rotate(4deg); } }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ---------- blowing out the candles ---------- */
.blow-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
.blow-btn .ic { position: relative; width: 20px; height: 20px; }
.blow-btn.is-hold .ic { display: none; }
.blow-label { position: relative; }
.blow-fill { position: absolute; inset: 0; background: color-mix(in srgb, var(--btn-ink) 28%, transparent); transform-origin: right; transform: scaleX(var(--k, 0)); transition: transform .08s linear; }
.blow-hint { min-height: 1.4em; font: 500 .92rem var(--ui-font); color: var(--soft); }
.is-windy .flame { animation: flame-lean .16s ease-in-out infinite alternate; }
@keyframes flame-lean {
  from { transform: rotate(calc(var(--wind, 0) * 32deg)) scale(1, calc(1 - var(--wind, 0) * .3)); }
  to { transform: rotate(calc(var(--wind, 0) * 52deg + 3deg)) scale(1.05, calc(1 - var(--wind, 0) * .45)); }
}

/* ---------- the name in fireworks ---------- */
.fw { position: fixed; inset: 0; z-index: 58; background: rgba(6, 2, 10, 0); cursor: pointer; transition: background .8s ease, opacity .9s ease; }
.fw.go { background: rgba(var(--fw-bg, 6, 2, 10), .6); }
.fw.is-out { opacity: 0; pointer-events: none; }
.fw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fw-wish {
  position: absolute; top: 56%; inset-inline: 20px; margin: 0; text-align: center; color: #ffd36b; opacity: 0; transform: translateY(14px);
  font: var(--head-weight) clamp(1.5rem, 6vw, 2.5rem)/1.2 var(--font-head); transition: opacity .9s ease, transform .9s ease;
}
.fw-wish.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .intro-rays, .year-shape, .cover-shine, .pcard-holo, .is-play .pcard, .is-play .cover .frame img, .eq i, .is-windy .flame { animation: none !important; }
  .years.is-on .year { animation: none; }
}

/* ---------- the years in numbers: other numbers ---------- */
.years-shuffle {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--ink); font: 700 .95rem var(--ui-font); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 18%, transparent);
}
.years-shuffle .ic { width: 18px; height: 18px; color: var(--accent); }

/* ---------- the cover's posters ---------- */
.poster { position: relative; width: min(100%, 440px); overflow: hidden; container-type: inline-size; text-align: center; box-shadow: 0 44px 80px -44px var(--f-shadow), 0 0 0 1px rgba(0, 0, 0, .06); }
.poster .frame { margin: 0; }
.poster .frame img { max-height: none; }
.poster-lines { display: grid; gap: 6px; width: min(100%, 440px); margin-top: 16px; padding: 12px; border-radius: 16px; background: var(--card); text-align: start; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 14%, transparent); }

/* a film poster */
.poster.is-movie { aspect-ratio: 2 / 3; border-radius: 4px; background: #0b0a10; color: #fff; }
.is-movie .frame { position: absolute; inset: 0; width: auto; }
.is-movie .frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: contrast(1.08) saturate(1.1); }
.is-play .is-movie .frame img { animation: cover-ken 16s ease-in-out infinite alternate; }
.is-movie .slot-add { width: 100%; height: 100%; border-radius: 0; }
.pm-scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5, 4, 10, .75) 0%, transparent 26%, transparent 46%, rgba(5, 4, 10, .94) 80%); }
.pm-tag { position: absolute; top: 5cqw; inset-inline: 6cqw; font: 600 3.3cqw var(--ui-font); letter-spacing: .16em; color: rgba(255, 255, 255, .86); }
.pm-laurel { position: absolute; top: 13cqw; left: 50%; display: flex; align-items: center; gap: 1cqw; translate: -50% 0; color: #f2d58a; }
.pm-leaf svg { display: block; width: 6cqw; height: 13cqw; }
.pm-leaf:last-child svg { transform: scaleX(-1); }
.pm-laurel > span:not(.pm-leaf) { display: grid; line-height: 1.15; }
.pm-laurel small { font: 700 2.4cqw var(--ui-font); letter-spacing: .1em; }
.pm-laurel b { font: 800 3cqw 'Rubik', var(--ui-font); }
.pm-title {
  position: absolute; bottom: 31cqw; inset-inline: 4cqw; overflow: hidden; white-space: nowrap; letter-spacing: -.02em;
  font: 900 calc(24cqw * min(1, 4.6 / var(--len, 4))) / 1 'Rubik', var(--ui-font); text-shadow: 0 .03em 0 rgba(0, 0, 0, .4), 0 0 40px rgba(0, 0, 0, .6);
}
.pm-sub { position: absolute; bottom: 24cqw; inset-inline: 0; font: 700 5cqw var(--ui-font); letter-spacing: .22em; color: var(--accent-2); }
.pm-date { position: absolute; bottom: 16cqw; inset-inline: 0; font: 800 4cqw 'Rubik', var(--ui-font); }
.pm-credits { position: absolute; bottom: 5cqw; inset-inline: 7cqw; padding-top: 2cqw; border-top: 1px solid rgba(255, 255, 255, .25); font: 500 2.8cqw/1.5 var(--ui-font); letter-spacing: .05em; color: rgba(255, 255, 255, .72); }

/* a newspaper's front page */
.poster.is-news {
  padding: clamp(14px, 4.6vw, 22px) clamp(14px, 4.6vw, 22px) clamp(16px, 5.4vw, 26px); border-radius: 2px; color: #1d1b16; transform: rotate(-.8deg);
  background: #f4efe2 linear-gradient(rgba(0, 0, 0, .025) 1px, transparent 1px) 0 0 / 100% 3px;
}
.chapter:nth-of-type(even) .poster.is-news { transform: rotate(.8deg); }
.pn-mast { padding-bottom: 2cqw; border-bottom: 3px double #1d1b16; font: 900 11cqw/1 'Frank Ruhl Libre', serif; }
.pn-date { display: flex; justify-content: space-between; gap: 2cqw; padding: 1.5cqw 0; border-bottom: 1px solid #1d1b16; font: 600 2.6cqw var(--ui-font); color: #4a463c; }
.pn-head { margin: 3cqw 0 2.6cqw; font: 900 9.4cqw/1.08 'Frank Ruhl Libre', serif; text-wrap: balance; }
.is-news .frame { width: 100%; }
.is-news .frame img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1) contrast(1.15) sepia(.15); transition: filter 1.6s ease .6s; }
.is-play .reveal.in .is-news .frame img { filter: none; }
.pn-caption { margin-top: 1.4cqw; font: italic 500 2.8cqw var(--ui-font); color: #4a463c; text-align: start; }
.pn-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3cqw; margin-top: 3cqw; padding-top: 2cqw; border-top: 1px solid #1d1b16; text-align: start; }
.pn-col { display: grid; align-content: start; gap: 1.2cqw; }
.pn-col b { font: 800 3.4cqw/1.25 'Frank Ruhl Libre', serif; }
.pn-col i { display: block; height: 1.2cqw; border-radius: 1px; background: #bdb6a4; }
.pn-col i.is-short { width: 60%; }

/* a boarding pass to next year */
.poster.is-pass {
  display: grid; grid-template-columns: minmax(0, 1fr) 30%; border-radius: 18px; background: #fff; color: #1d1a2b; text-align: start;
  -webkit-mask: radial-gradient(circle 13px at 30% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 13px at 30% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 13px at 30% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 13px at 30% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.pp-main { display: grid; gap: 3cqw; padding: 5cqw; background: linear-gradient(135deg, var(--btn-bg), color-mix(in srgb, var(--btn-bg) 72%, #000)); color: var(--btn-ink); }
.pp-air { display: flex; align-items: center; gap: 2cqw; font: 800 3.6cqw 'Rubik', var(--ui-font); letter-spacing: .04em; }
.pp-air .ic { width: 5cqw; height: 5cqw; }
.pp-route { display: flex; align-items: center; justify-content: space-between; }
.pp-route div { display: grid; }
.pp-route small, .pp-info small { font: 600 2.4cqw var(--ui-font); opacity: .78; }
.pp-route b { font: 900 15cqw/1 'Rubik', var(--ui-font); font-variant-numeric: tabular-nums; }
.pp-plane .ic { width: 10cqw; height: 10cqw; transform: rotate(-90deg); }
.is-play .reveal.in .pp-plane { animation: pp-fly 2.4s ease-in-out infinite alternate; }
@keyframes pp-fly { from { translate: 4cqw 1cqw; } to { translate: -4cqw -1cqw; } }
.pp-info { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 2cqw; }
.pp-info div { display: grid; min-width: 0; }
.pp-info b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 800 3.6cqw 'Rubik', var(--ui-font); }
.pp-plans { display: grid; gap: 1cqw; margin: 0; padding: 2.4cqw 0 0; list-style: none; border-top: 1px dashed color-mix(in srgb, var(--btn-ink) 45%, transparent); font: 600 3.1cqw var(--ui-font); }
.pp-plans li::before { content: '✓ '; }
.pp-stub { display: grid; justify-items: center; align-content: center; gap: 2.4cqw; padding: 4cqw 3cqw; border-inline-start: 2px dashed #c9c3d6; }
.pp-stub .frame { width: 21cqw; }
.pp-stub .frame img { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.pp-stub .slot-add { aspect-ratio: 1; border-radius: 50%; font-size: .7rem; }
.pp-code { width: 18cqw; height: 22cqw; background: repeating-linear-gradient(0deg, #1d1a2b 0 2px, transparent 2px 4px, #1d1a2b 4px 7px, transparent 7px 9px); }
.pp-stub small { font: 700 2.4cqw var(--ui-font); color: #6b6680; }

/* a certificate */
.poster.is-cert {
  padding: clamp(28px, 8vw, 36px) clamp(24px, 7vw, 32px) clamp(22px, 6vw, 28px); border-radius: 4px; background: #fffaf0; color: #2a2233;
  box-shadow: 0 44px 80px -44px var(--f-shadow), inset 0 0 0 10px #fffaf0, inset 0 0 0 12px #c8a45c, inset 0 0 0 15px #fffaf0, inset 0 0 0 16.5px #c8a45c;
}
.poster.is-cert::before { content: '✦ ✦ ✦'; display: block; margin-bottom: 2cqw; font-size: 3cqw; letter-spacing: .4em; color: #c8a45c; }
.is-cert .frame { width: 22cqw; margin: 0 auto 2cqw; }
.is-cert .frame img { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1cqw #fffaf0, 0 0 0 1.4cqw #c8a45c; }
.is-cert .slot-add { aspect-ratio: 1; border-radius: 50%; font-size: .7rem; }
.pc-title { font: 900 8.4cqw/1.1 'Frank Ruhl Libre', serif; color: #8a6420; }
.pc-give { margin-top: 3cqw; font: 500 3.6cqw var(--ui-font); color: #6b6080; }
.pc-name {
  margin: 1cqw 0 2cqw; padding-bottom: 1.5cqw; border-bottom: 1px solid #c8a45c; line-height: 1.15; color: #2a2233;
  font-family: 'Gveret Levin', 'Amatic SC', cursive; font-weight: 400; font-size: calc(14cqw * min(1, 5 / var(--len, 4)));
}
.pc-why { display: grid; gap: 1cqw; font: 500 3.6cqw/1.45 var(--ui-font); color: #3a3247; }
.pc-why p:first-child { font: 700 4.2cqw/1.4 'Frank Ruhl Libre', serif; }
.pc-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 5cqw; }
.pc-seal { display: grid; place-content: center; width: 20cqw; aspect-ratio: 1; border-radius: 50%; color: #fff; rotate: -10deg; background: radial-gradient(circle at 35% 30%, #e0605a, #9b1c1c 70%); box-shadow: 0 0 0 1.4cqw rgba(155, 28, 28, .22), 0 6px 14px -6px rgba(0, 0, 0, .5); }
.pc-seal b { font: 900 8cqw/1 'Rubik', var(--ui-font); }
.pc-seal span { font: 700 2.4cqw var(--ui-font); }
.pc-sign { display: grid; justify-items: center; min-width: 34cqw; margin-inline-start: auto; }
.pc-sign b { padding: 0 2cqw; border-bottom: 1px solid #2a2233; font: 400 7cqw/1.1 'Gveret Levin', cursive; color: #1d3a8a; }
.pc-sign span { margin-top: 1cqw; font: 600 2.4cqw var(--ui-font); color: #6b6080; }

/* ---------- balloons with wishes ---------- */
.balloons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 4px; width: min(100%, 560px); margin-top: 6px; }
.balloon {
  appearance: none; position: relative; display: grid; place-items: center; width: clamp(84px, 28%, 130px); aspect-ratio: 60 / 112; padding: 0; border: 0;
  background: none; color: var(--ink); cursor: pointer; font: inherit;
}
.balloon-art { position: absolute; inset: 0; animation: balloon-bob 3.2s calc(var(--i) * -.45s) ease-in-out infinite alternate; transform-origin: 50% 70%; }
.balloon-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.b-body, .b-knot { fill: var(--c); }
.b-string { fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1.4; }
.b-shine { fill: rgba(255, 255, 255, .45); }
@keyframes balloon-bob { from { transform: translateY(-4px) rotate(-3deg); } to { transform: translateY(6px) rotate(3deg); } }
.balloon-wish {
  position: relative; display: grid; place-items: center; width: 132%; min-height: 54%; padding: 10px; border-radius: 16px; background: var(--f-paper); color: #2a2233;
  font: 700 .95rem/1.3 var(--font-body); text-wrap: balance; box-shadow: 0 16px 30px -18px var(--f-shadow); opacity: 0; transform: scale(.4); pointer-events: none;
}
.balloon.is-popped { cursor: default; }
.balloon.is-popped .balloon-art { animation: balloon-pop .25s ease-out forwards; }
.balloon.is-popped .balloon-wish { animation: balloon-wish .5s .15s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes balloon-pop { to { transform: scale(1.35); opacity: 0; } }
@keyframes balloon-wish { to { opacity: 1; transform: none; } }
.balloon-bit { position: absolute; top: 30%; left: 50%; width: 8px; height: 5px; margin: -2px -4px; border-radius: 2px; background: var(--c); animation: balloon-bit .55s ease-out forwards; }
@keyframes balloon-bit { to { transform: rotate(var(--a)) translateY(-70px) rotate(90deg); opacity: 0; } }
.balloon.is-wait { cursor: default; opacity: .55; }

/* ---------- a wheel of surprises ---------- */
.wheel { position: relative; width: min(86vw, 380px); aspect-ratio: 1; margin-top: 10px; }
.wheel-disc { width: 100%; height: 100%; transition: transform 4.4s cubic-bezier(.12, .7, .1, 1); }
.wheel-disc svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px var(--f-shadow)); }
.wheel-rim { fill: var(--f-paper); stroke: var(--ink); stroke-width: 3; }
.wheel-slice { stroke: rgba(255, 255, 255, .8); stroke-width: 1.5; transition: filter .3s ease; }
.wheel-slice.is-won { filter: brightness(1.25) saturate(1.2); }
.wheel-disc text { fill: #fff; font: 800 11px 'Rubik', var(--ui-font); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: 2.5px; direction: rtl; }
.wheel-disc text.is-dark { fill: #2a2233; stroke: rgba(255, 255, 255, .55); }
.wheel-hub { fill: var(--f-paper); stroke: var(--ink); stroke-width: 3; }
.wheel-pin {
  position: absolute; top: -10px; left: 50%; width: 30px; height: 40px; margin-left: -15px; background: var(--ink);
  clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3));
}
.wheel-spin {
  position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 28%; aspect-ratio: 1; translate: -50% -50%; border: 0; border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-ink); font: 800 1.05rem var(--ui-font); cursor: pointer; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6), 0 0 0 5px var(--f-paper);
}
.wheel.is-spinning .wheel-spin { cursor: default; opacity: .85; }
.wheel-result { min-height: 1.5em; margin-top: 10px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.5rem, 5vw, 2.2rem); color: var(--accent); }
.wheel-result:not(:empty) { animation: rise-in .6s cubic-bezier(.2, 1.4, .4, 1) both; }

/* ---------- the film as a cinema: a title, black bars, subtitles, credits ---------- */
.film.is-cinema .film-frame { width: 100%; }
.film.is-cinema .film-shots { position: absolute; inset: 22% 0; overflow: hidden; }
.film.is-cinema .film-shots img { animation-duration: calc(var(--shot) * 1.2); }
.film.is-cinema .film-scrim, .film.is-cinema .film-bars { display: none; }
@media (min-aspect-ratio: 1 / 1) { .film.is-cinema .film-shots { inset: 9% 0; } }
.film.is-cinema .film-cap {
  inset-inline: 8%; bottom: auto; top: 79%; margin-top: 10px; text-align: center; font: 600 clamp(1.05rem, 4.4vw, 1.5rem)/1.4 var(--ui-font); color: #fff7d6;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
@media (min-aspect-ratio: 1 / 1) { .film.is-cinema .film-cap { top: auto; bottom: 1.2%; } }
.film.is-cinema .film-cap span { animation: film-in .5s both; animation-delay: .3s; }
.film-grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .14; mix-blend-mode: overlay; animation: grain .5s steps(4) infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-6%, 4%); } 50% { transform: translate(5%, -3%); } 75% { transform: translate(-3%, -6%); } 100% { transform: translate(4%, 5%); } }
.film-title { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 8px; text-align: center; background: #050205; opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.film.at-title .film-title { opacity: 1; }
.film-title small { font: 600 .8rem var(--ui-font); letter-spacing: .18em; color: rgba(255, 255, 255, .6); }
.film-title b { font: 900 clamp(3rem, 16vw, 6rem)/1 'Frank Ruhl Libre', serif; color: #f2d58a; }
.film-title span { font: 600 1.1rem var(--ui-font); letter-spacing: .3em; color: rgba(255, 255, 255, .8); }
.film.at-title .film-title b { animation: film-word 1.4s .3s both; }
.film-end.is-credits { align-content: center; gap: 18px; background: #050205; }
.film-end.is-credits p { display: grid; gap: 2px; }
.film-end.is-credits small { font: 600 .78rem var(--ui-font); letter-spacing: .14em; color: rgba(255, 255, 255, .55); }
.film-end.is-credits p b { font: 700 1.3rem var(--ui-font); }
.film.at-end .film-end.is-credits > * { animation: rise-in 1s both; }
.film.at-end .film-end.is-credits > :nth-child(2) { animation-delay: .5s; }
.film.at-end .film-end.is-credits > :nth-child(3) { animation-delay: 1s; }
.film.at-end .film-end.is-credits > :nth-child(4) { animation-delay: 1.5s; }
.film.at-end .film-end.is-credits > :nth-child(5) { animation-delay: 2.2s; }
.film-fin { margin-top: 10px; font: var(--head-weight) clamp(2rem, 9vw, 3.4rem)/1.1 var(--font-head); color: #f2d58a; }

/* ---------- the film as a clip: cuts on the beat ---------- */
.film.is-clip .film-shots img { transition: opacity .08s linear; }
.film.is-clip .film-shots img.on { animation: clip-punch var(--shot) cubic-bezier(.2, .9, .3, 1) both; }
@keyframes clip-punch { from { transform: scale(1.28) rotate(-1.5deg); } 40% { transform: scale(1.08); } to { transform: scale(1.04); } }
.film-flash { position: absolute; inset: 0; z-index: 1; background: #fff; opacity: 0; pointer-events: none; mix-blend-mode: overlay; }
.film.is-cut .film-flash { animation: clip-flash .28s ease-out both; }
@keyframes clip-flash { from { opacity: .85; } to { opacity: 0; } }
.film.is-clip .film-cap { inset-inline: 12px; bottom: 40%; text-align: center; font: 900 clamp(2.4rem, 13vw, 4.6rem)/1 'Rubik', var(--ui-font); text-transform: uppercase; }
.film.is-clip .film-cap span { animation: clip-word .35s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * .12s); }
@keyframes clip-word { from { opacity: 0; transform: scale(2.2); } }
.film.is-clip .film-scrim { background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 25%, transparent 30%, color-mix(in srgb, var(--accent) 38%, transparent) 100%); mix-blend-mode: multiply; }

/* ---------- a poster kept as a picture ---------- */
.keep-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 18px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--ink); font: 700 .95rem var(--ui-font); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 18%, transparent), 0 10px 22px -16px var(--f-shadow);
}
.keep-btn .ic { width: 18px; height: 18px; color: var(--accent); }
.keep-btn:disabled { cursor: progress; opacity: .75; }

/* ---------- the page's scrollbar, in the design's colours (paintScrollbar in story.js) ---------- */
html.sb-themed { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
html.sb-themed::-webkit-scrollbar { width: 10px; }
html.sb-themed::-webkit-scrollbar-track { background: var(--sb-track); }
html.sb-themed::-webkit-scrollbar-thumb { border: 3px solid var(--sb-track); border-radius: 10px; background: var(--sb-thumb); }

/* =================== the wedding =================== */
/* Its design: ivory and champagne, blush flowers and gold, script for the names. */
[data-theme='wedding'] {
  --bg: #fbf7f0; --sky: radial-gradient(110% 60% at 50% 0%, #fffdf8 0%, transparent 70%), linear-gradient(#fbf6ee, #f5ece0);
  --ink: #2f2722; --soft: #7a6b5f; --accent: #b08a45; --accent-2: #e8b7c0; --card: #fffdf9;
  --font-head: 'Bellefair', 'Frank Ruhl Libre', serif; --head-weight: 400; --font-body: 'Assistant', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Bellefair', cursive; --sign-size: 2.2em; --sign-weight: 400;
  --deco-color: #e8b7c0; --deco-op: .5; --deco-anim: deco-fall; --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c5 4 7 9 5 14-1.4 3.4-3.4 5.5-5 6-1.6-.5-3.6-2.6-5-6C5 11 7 6 12 2z'/%3E%3C/svg%3E");
  --gift: #fffaf2; --gift-top: #efe2cf; --band: #c9a45c; --knot: #8e2a3a; --orn: '❦';
  --btn-bg: #2f2722; --btn-ink: #fbf3e4;
  --wash-1: #f6ecdf; --wash-2: #fffdf9; --wash-3: #f8e6e8; --dot: rgba(47, 39, 34, .08); --stripe: rgba(176, 138, 69, .12); --glow: rgba(232, 183, 192, .4);
  --panel: rgba(255, 253, 249, .9); --panel-line: rgba(176, 138, 69, .3);
  --f-line: rgba(176, 138, 69, .65); --f-paper: #fffdf8; --f-tape: rgba(232, 183, 192, .65); --f-border: #2f2722; --f-block: #e8b7c0; --f-shadow: rgba(70, 45, 20, .3);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23b8904a' stroke-opacity='.22' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M20 40c14-6 26-6 38 2'/%3E%3Cpath d='M30 37c-2-6 0-10 6-12M42 36c-1-6 2-10 8-11M30 41c-3 5-2 9 3 12M42 42c-2 6 0 9 5 11'/%3E%3Cpath d='M100 118c14-6 26-6 38 2'/%3E%3Cpath d='M110 115c-2-6 0-10 6-12M122 114c-1-6 2-10 8-11M110 119c-3 5-2 9 3 12M122 120c-2 6 0 9 5 11'/%3E%3C/g%3E%3Cg fill='%23e8b7c0' fill-opacity='.28'%3E%3Ccircle cx='60' cy='42' r='4'/%3E%3Ccircle cx='140' cy='120' r='4'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme='wedding'] .story-deco i { width: calc(var(--s) * .7px); border-radius: 0; }
[data-theme='wedding'] .hero-title { font-family: var(--font-sign); font-weight: 400; font-size: clamp(2.6rem, 11vw, 4.8rem); }

/* The way in: an envelope sealed in wax with the couple's initials; the flap lifts, the card rises. */
.gift.is-envelope { width: clamp(176px, 48vw, 244px); animation: env-float 3.4s ease-in-out infinite; }
@keyframes env-float { 50% { transform: translateY(-7px) rotate(-1.5deg); } }
.env-back { fill: var(--gift-top); }
.env-card rect { fill: #fffdf8; stroke: color-mix(in srgb, var(--band) 40%, transparent); }
.env-card path { fill: none; stroke: var(--band); stroke-width: 3; stroke-linecap: round; opacity: .65; }
.env-front { fill: var(--gift); stroke: color-mix(in srgb, var(--band) 45%, transparent); stroke-width: 1.5; }
.env-flap { fill: var(--gift); stroke: color-mix(in srgb, var(--band) 60%, transparent); stroke-width: 1.5; transform-box: fill-box; transform-origin: 50% 0; transition: transform .8s cubic-bezier(.3, .8, .3, 1); }
.env-seal circle { fill: var(--knot); }
.env-seal .env-seal-ring { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.5; }
.env-seal text { fill: #fff3e0; font: 700 13px var(--font-head), serif; }
.env-seal { transform-box: fill-box; transform-origin: center; transition: transform .45s ease, opacity .4s ease; }
.env-card { transition: transform .9s cubic-bezier(.2, .9, .3, 1) .35s; }
:is(.gate, .door).is-opening .gift.is-envelope { animation: none; }
:is(.gate, .door).is-opening .env-seal { transform: scale(1.4) rotate(-16deg); opacity: 0; }
:is(.gate, .door).is-opening .env-flap { transform: scaleY(-1); }
:is(.gate, .door).is-opening .env-card { transform: translateY(-54px); }

/* The story of the two: a line of moments down the page; the last, today, holds a heart. */
.timeline { position: relative; display: grid; gap: 14px; width: 100%; margin: 14px 0 0; padding: 0; padding-inline-start: 36px; list-style: none; text-align: start; }
.timeline::before { content: ''; position: absolute; top: 10px; bottom: 18px; inset-inline-start: 12px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.tl-step { position: relative; display: grid; gap: 2px; padding: 12px 16px; border-radius: 16px; background: var(--panel); box-shadow: 0 0 0 1px var(--panel-line), 0 12px 24px -20px var(--f-shadow); }
.tl-dot { position: absolute; top: 16px; inset-inline-start: -31px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 3px var(--accent); }
.tl-step:last-child .tl-dot { top: 12px; inset-inline-start: -35px; display: grid; place-items: center; width: 24px; height: 24px; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.tl-step:last-child .tl-dot::after { content: '♥'; color: #fff; font-size: 12px; line-height: 1; }
.tl-when { font: 700 .86rem var(--font-body); letter-spacing: .04em; color: var(--accent); }
.tl-what { margin: 0; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); line-height: 1.3; }
.is-play .reveal.in .tl-step { animation: tl-in .7s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(.2s + var(--i) * .14s); }
@keyframes tl-in { from { opacity: 0; transform: translateX(14px); } }

/* Seven blessings: envelopes sealed with א to ז; a tap opens one, the seventh brings confetti. */
.blessings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 138px), 1fr)); gap: 12px; width: 100%; margin-top: 12px; }
.blessing {
  appearance: none; position: relative; display: grid; place-items: center; min-height: 132px; padding: 16px 12px; overflow: hidden; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--card); color: var(--ink); font: inherit; box-shadow: 0 0 0 1px var(--panel-line), 0 14px 26px -18px var(--f-shadow);
}
.blessing::before { content: ''; position: absolute; inset: 0 0 auto; height: 58%; background: color-mix(in srgb, var(--accent-2) 32%, var(--card)); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .5s ease; }
.bs-seal {
  position: relative; z-index: 1; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink);
  font: 700 1.25rem var(--font-head), serif; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(255, 255, 255, .22); transition: transform .45s ease, opacity .35s ease;
}
.bs-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; font-family: var(--font-head); font-size: 1.02rem; line-height: 1.35; opacity: 0; transform: translateY(10px); transition: opacity .5s ease .15s, transform .5s ease .15s; }
.blessing.is-open::before { transform: scaleY(0); }
.blessing.is-open .bs-seal { transform: translateY(-70px) scale(.5); opacity: 0; }
.blessing.is-open .bs-text { opacity: 1; transform: none; }
.blessing:not(.is-open, .is-wait) { animation: bs-wait 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes bs-wait { 50% { transform: translateY(-3px); } }
.blessing.is-wait { cursor: default; opacity: .6; }

/* The ketubah: a scroll under an arch, an inner frame, the names in script, the promises. */
.ketubah {
  position: relative; width: min(100%, 560px); margin: 0 auto; padding: 58px clamp(22px, 6vw, 40px) 34px; text-align: center; background: var(--f-paper); color: var(--ink);
  border-radius: 170px 170px 18px 18px / 130px 130px 18px 18px;
  box-shadow: 0 0 0 1px var(--panel-line), 0 0 0 9px var(--card), 0 0 0 10.5px color-mix(in srgb, var(--accent) 55%, transparent), 0 32px 50px -28px var(--f-shadow);
}
.kt-arch { position: absolute; inset: 12px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 160px 160px 12px 12px / 120px 120px 12px 12px; pointer-events: none; }
.kt-orn { display: block; font-size: 1.8rem; line-height: 1; color: var(--accent); }
.kt-head { margin: 6px 0 0; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.7rem, 6vw, 2.5rem); letter-spacing: .02em; }
.kt-names { margin: 8px 0 0; font-family: var(--font-sign); font-size: clamp(2rem, 8vw, 3rem); line-height: 1.1; color: var(--accent); }
.kt-date { margin: 6px 0 14px; color: var(--soft); letter-spacing: .08em; }
.kt-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-head); font-size: clamp(1.08rem, 1rem + .3vw, 1.25rem); line-height: 1.85; }
.kt-sign { display: flex; justify-content: space-around; gap: 20px; margin-top: 26px; }
.kt-sign span { flex: 1; max-width: 150px; padding-top: 6px; border-top: 1px solid var(--f-line); color: var(--soft); font-size: .8rem; }

/* Their song: a record that turns, their picture on its label, the tone arm resting on it. */
.chapter-media.is-record { display: grid; place-items: center; }
.record { position: relative; width: min(76vw, 340px); aspect-ratio: 1; }
.rc-disc { position: absolute; inset: 0; border-radius: 50%; background: repeating-radial-gradient(circle, #151311 0 2px, #211d1a 2px 4px); box-shadow: 0 26px 44px -22px rgba(0, 0, 0, .65), inset 0 0 0 6px #0d0c0b; animation: rc-spin 7s linear infinite; }
.rc-disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 18%, rgba(255, 255, 255, .13) 24%, transparent 30% 68%, rgba(255, 255, 255, .09) 74%, transparent 80%); }
.rc-label { position: absolute; inset: 30%; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--card); animation: rc-spin 7s linear infinite; }
.rc-label .frame { width: 100%; height: 100%; margin: 0; border-radius: 50%; }
.rc-label .frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--card); }
.rc-arm { position: absolute; top: -2%; inset-inline-end: 4%; width: 7px; height: 56%; border-radius: 4px; background: #d8cfc2; transform-origin: 50% 6%; rotate: 22deg; box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .4); }
.rc-arm::before { content: ''; position: absolute; top: -10px; left: 50%; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #bfb4a5; box-shadow: inset 0 0 0 5px #d8cfc2; }
.rc-arm::after { content: ''; position: absolute; bottom: -8px; left: 50%; width: 16px; height: 20px; margin-left: -8px; border-radius: 3px; background: #8a8075; }
@keyframes rc-spin { to { rotate: 1turn; } }
.is-edit .rc-disc, .is-edit .rc-label { animation: none; }
.sg-kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.sg-kicker .ic { width: 18px; height: 18px; }
.sg-by { margin: 2px 0 10px; color: var(--soft); font-size: 1.05rem; }

/* The invitation, kept as a memento: a deckled ivory card, a thin gold double frame, sprigs, the names in script. */
.poster.is-invite {
  position: relative; display: grid; justify-items: center; gap: 6px; width: min(100%, 440px); margin: 0 auto; padding: 46px 30px 40px; overflow: hidden; text-align: center;
  background: #fffdf8; color: #3a2f28; border-radius: 6px; box-shadow: 0 30px 50px -26px rgba(60, 40, 20, .45), 0 0 0 1px rgba(184, 144, 74, .22); font-family: 'Bellefair', var(--font-head), serif;
}
.pi-frame { position: absolute; inset: 12px; border: 1px solid #c9a45c; border-radius: 3px; pointer-events: none; }
.pi-frame::after { content: ''; position: absolute; inset: 4px; border: .5px solid rgba(201, 164, 92, .6); border-radius: 2px; }
.pi-sprig { display: block; width: 120px; height: 28px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 28'%3E%3Cg fill='none' stroke='%23c9a45c' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M8 20c30-14 74-14 104 0'/%3E%3Cpath d='M28 15c-3-6-1-10 5-12M44 11c-2-6 1-10 7-10M60 10V2M76 11c2-6-1-10-7-10M92 15c3-6 1-10-5-12'/%3E%3C/g%3E%3Ccircle cx='60' cy='12' r='3' fill='%23e8b7c0'/%3E%3C/svg%3E") center / contain no-repeat; }
.pi-sprig.is-bottom { rotate: 180deg; }
.pi-kicker { margin: 6px 0 0; font: 600 .8rem var(--font-body); letter-spacing: .3em; color: #b08a45; }
.pi-photo { width: 60%; margin: 10px 0 4px; overflow: hidden; border-radius: 999px 999px 8px 8px; aspect-ratio: 4 / 5; box-shadow: 0 0 0 5px #fff, 0 0 0 6px rgba(201, 164, 92, .6); }
.pi-photo img { width: 100%; height: 100%; object-fit: cover; }
.pi-names { margin: 4px 0 0; font: 400 calc(clamp(2.4rem, 10vw, 3.6rem) * min(1, 9 / var(--len, 9))) / 1.1 'Gveret Levin', 'Bellefair', cursive; color: #3a2f28; }
.pi-orn { margin: 0; color: #c9a45c; font-size: 1.4rem; line-height: 1; }
.pi-lines p { margin: 2px 0; color: #5a4a3e; font-size: 1.06rem; }

/* The ending: the glass in its napkin, broken with a tap; the pieces fly, "מזל טוב!", then the last words. */
.glass { width: clamp(170px, 46vw, 230px); cursor: pointer; animation: gl-wait 2.6s ease-in-out infinite; }
.glass svg { display: block; width: 100%; overflow: visible; }
@keyframes gl-wait { 50% { transform: rotate(-2deg) translateY(-4px); } }
.gl-glass { fill: rgba(255, 255, 255, .55); stroke: color-mix(in srgb, var(--ink) 35%, transparent); stroke-width: 2; transition: opacity .1s; }
.gl-shine { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .85; transition: opacity .1s; }
.gl-napkin { fill: #fffdf8; stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1.5; }
.gl-fold { fill: none; stroke: color-mix(in srgb, var(--ink) 12%, transparent); stroke-width: 2; stroke-linecap: round; }
.gl-tie { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.gl-knot { fill: var(--accent); }
.gl-wrap { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.gl-shards path { fill: rgba(222, 236, 246, .95); stroke: rgba(120, 140, 160, .7); stroke-width: .8; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ending.is-broken .glass { animation: none; cursor: default; }
.ending.is-broken .gl-wrap { transform: scale(1.12, .7); }
.ending.is-broken .gl-glass, .ending.is-broken .gl-shine { opacity: 0; }
.ending.is-broken .gl-shards path { animation: gl-fly 1s cubic-bezier(.15, .7, .3, 1) forwards; animation-delay: calc(var(--i) * 14ms); }
@keyframes gl-fly { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.7); } }
.glass-mazal { margin: 0; font: 400 clamp(2.6rem, 12vw, 4.2rem)/1 var(--font-sign); color: var(--accent); }
.glass-mazal:empty { display: none; }
.ending.is-broken .glass-mazal { animation: gl-shout .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes gl-shout { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }
.ending.is-broken .glass-btn, .ending.is-broken .wish { display: none; }
.is-play .ending.has-glass:not(.is-told) .ending-words { display: none; }

@media (prefers-reduced-motion: reduce) {
  .gift.is-envelope, .blessing, .rc-disc, .rc-label, .glass, .is-play .reveal.in .tl-step { animation: none !important; }
}

/* =================== after the wedding =================== */
/* Its design: the first morning. Cream linen, a soft sky blue and coral, the words by hand. */
[data-theme='morning'] {
  --bg: #fdf8ef; --sky: radial-gradient(120% 60% at 50% 0%, #ffe3d3 0%, transparent 65%), linear-gradient(#fdf6ec, #f3efe8);
  --ink: #23324a; --soft: #5f6b7d; --accent: #d4664c; --accent-2: #8fb3d9; --card: #fffdf9;
  --font-head: 'Playpen Sans Hebrew', 'Fredoka', cursive; --head-weight: 700; --font-body: 'Assistant', system-ui, sans-serif;
  --font-sign: 'Gveret Levin', 'Playpen Sans Hebrew', cursive; --sign-size: 2.1em; --sign-weight: 400;
  --deco-color: #e8836b; --deco-op: .34; --deco-anim: deco-rise;
  --deco-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.420 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  --gift: #fffdf9; --gift-top: #f6d68b; --band: #e8836b; --knot: #23324a; --orn: '♥';
  --btn-bg: #23324a; --btn-ink: #fdf8ef;
  --wash-1: #fde7dc; --wash-2: #fffdf9; --wash-3: #e3edf7; --dot: rgba(35, 50, 74, .08); --stripe: rgba(143, 179, 217, .22); --glow: rgba(246, 214, 139, .45);
  --panel: rgba(255, 253, 249, .9); --panel-line: rgba(35, 50, 74, .14);
  --f-line: rgba(212, 102, 76, .55); --f-paper: #fffdf9; --f-tape: rgba(143, 179, 217, .7); --f-border: #23324a; --f-block: #8fb3d9; --f-shadow: rgba(35, 50, 74, .3);
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%238fb3d9' stroke-opacity='.35' stroke-width='2' stroke-linecap='round' stroke-dasharray='8 9'%3E%3Cpath d='M10 50c30-18 60-18 90 0'/%3E%3Cpath d='M70 130c25-14 50-14 80 0'/%3E%3C/g%3E%3Cg fill='%23e8836b' fill-opacity='.25'%3E%3Cpath d='M118 34c-4-3-6-5-6-7a2.6 2.6 0 0 1 6-1.4 2.6 2.6 0 0 1 6 1.4c0 2-2 4-6 7z'/%3E%3Cpath d='M30 112c-4-3-6-5-6-7a2.6 2.6 0 0 1 6-1.4 2.6 2.6 0 0 1 6 1.4c0 2-2 4-6 7z'/%3E%3C/g%3E%3C/svg%3E");
}

/* The way in: "do not disturb" hanging on the door handle, swaying; it falls as the door opens. */
.gift.is-hanger { width: clamp(168px, 46vw, 226px); animation: none; }
.hg-knob { fill: #c9b79a; stroke: #a8946f; stroke-width: 2; }
.hg-stem { fill: #d9c9ad; }
.hg-swing { transform-box: view-box; transform-origin: 100px 40px; animation: hg-sway 3.2s ease-in-out infinite; }
@keyframes hg-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.hg-card { fill: var(--btn-bg); filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .22)); }
.hg-slit { stroke: var(--bg); stroke-width: 4; stroke-linecap: round; }
.hg-big { fill: var(--btn-ink); font: 700 30px var(--font-head), sans-serif; }
/* textLength in the drawing keeps it inside the card in every design's hand, and before the hand has loaded */
.hg-small { fill: var(--btn-ink); font: 400 20px var(--font-sign), cursive; }
.hg-line { stroke: color-mix(in srgb, var(--btn-ink) 35%, transparent); stroke-width: 2; stroke-dasharray: 4 5; }
.hg-heart { fill: var(--band); }
:is(.gate, .door).is-opening .hg-swing { animation: hg-fall .9s cubic-bezier(.5, 0, .8, .5) forwards; }
@keyframes hg-fall { 0% { transform: rotate(-5deg); } 30% { transform: rotate(18deg) translateY(-14px); } 100% { transform: rotate(34deg) translateY(260px); opacity: 0; } }

/* The guest book: notes in a pile, each a little tilted; a tap sends the top one to the back. */
.guestbook { display: grid; width: min(100%, 420px); margin: 22px auto 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gb-note {
  position: relative; grid-area: 1 / 1; display: grid; align-content: center; gap: 12px; min-height: 230px; margin: 0; padding: 30px 26px 24px; border-radius: 6px;
  background: var(--f-paper) repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--accent-2) 28%, transparent) 31px 32px);
  color: var(--ink); text-align: center; transform: rotate(var(--tilt)); box-shadow: 0 1px 0 var(--panel-line), 0 18px 30px -20px var(--f-shadow);
  transition: transform .38s cubic-bezier(.4, 0, .6, 1), opacity .38s ease;
}
.gb-note::before { content: ''; position: absolute; top: -10px; left: 50%; width: 78px; height: 22px; margin-left: -39px; background: var(--f-tape); transform: rotate(-3deg); }
.gb-note blockquote { margin: 0; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); line-height: 1.45; text-wrap: balance; }
.gb-note figcaption { font-family: var(--font-sign); font-size: 1.7rem; line-height: 1.1; color: var(--accent); }
.gb-note:last-child { transform: rotate(calc(var(--tilt) * .4)); }
.gb-note.is-going { transform: translate(-115%, -10px) rotate(-14deg); opacity: 0; }
.gb-hint { margin: 16px 0 0; color: var(--soft); font-size: .92rem; }
.gb-hint b { color: var(--accent); }

/* The first year: first times with a box to tick; the ticks stay on the phone. */
.firsts { display: grid; gap: 10px; width: min(100%, 460px); margin: 16px auto 0; padding: 0; list-style: none; text-align: start; }
.first {
  appearance: none; display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--panel); color: var(--ink); font: 600 1.08rem var(--font-body); text-align: start; box-shadow: 0 0 0 1px var(--panel-line), 0 10px 20px -18px var(--f-shadow);
  transition: background .25s ease, transform .2s ease;
}
.first:active { transform: scale(.98); }
.fs-box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; box-shadow: inset 0 0 0 2.5px var(--accent); transition: background .25s ease, box-shadow .25s ease; }
.fs-box::after { content: '✓'; color: #fff; font: 800 17px/1 var(--ui-font); transform: scale(0); transition: transform .3s cubic-bezier(.2, 1.8, .4, 1); }
.first[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.first[aria-pressed='true'] .fs-box { background: var(--accent); box-shadow: none; }
.first[aria-pressed='true'] .fs-box::after { transform: none; }
.first[aria-pressed='true'] .fs-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-decoration-thickness: 2px; }
.fs-count { margin: 14px 0 0; color: var(--soft); }
.fs-count b { color: var(--accent); font-size: 1.15em; }

/* The new home: a house with dark windows; each tap lights one and reads its wish. */
.house { position: relative; width: min(78vw, 330px); margin: 34px auto 0; padding-top: 104px; }
.hs-roof { position: absolute; top: 0; inset-inline: -8%; height: 110px; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.hs-chimney { position: absolute; top: 18px; inset-inline-end: 16%; width: 34px; height: 60px; background: color-mix(in srgb, var(--accent) 70%, #3a1d14); border-radius: 3px 3px 0 0; z-index: -1; }
.hs-chimney i { position: absolute; bottom: 100%; left: 50%; color: var(--accent); font-style: normal; font-size: 1.2rem; opacity: 0; }
.house.is-all .hs-chimney i { animation: hs-smoke 2.4s ease-out infinite; }
.house.is-all .hs-chimney i:nth-child(2) { animation-delay: .8s; }
.house.is-all .hs-chimney i:nth-child(3) { animation-delay: 1.6s; }
@keyframes hs-smoke { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-10%, -70px) scale(1.3); } }
.hs-wall { position: relative; display: grid; justify-items: center; gap: 16px; padding: 22px 10% 0; border-radius: 0 0 10px 10px; background: var(--card); box-shadow: 0 0 0 1px var(--panel-line), 0 26px 40px -26px var(--f-shadow); }
.hs-windows { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 14px 18px; width: 100%; }
.house.has-3 .hs-windows, .house.has-5 .hs-windows, .house.has-6 .hs-windows { --cols: 3; }
.hs-window {
  appearance: none; position: relative; aspect-ratio: 1; padding: 0; border: 4px solid #3b4660; border-radius: 6px; cursor: pointer;
  background: #2b3550 linear-gradient(transparent calc(50% - 2px), #3b4660 calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px));
  transition: background-color .4s ease, box-shadow .4s ease;
}
.hs-window::after { content: ''; position: absolute; inset: 0 calc(50% - 2px); background: #3b4660; }
.hs-window:not(.is-lit, [disabled]) { animation: hs-wait 2.6s ease-in-out infinite; }
@keyframes hs-wait { 50% { box-shadow: 0 0 0 4px rgba(246, 214, 139, .6); } }
.hs-window.is-lit { background-color: #ffd77a; box-shadow: 0 0 26px 6px rgba(255, 205, 100, .55); }
.hs-window[disabled] { cursor: default; opacity: .7; }
.hs-door { position: relative; width: 26%; aspect-ratio: 3 / 5; border-radius: 40px 40px 0 0; background: color-mix(in srgb, var(--accent) 70%, #3a1d14); }
.hs-door::after { content: ''; position: absolute; top: 55%; inset-inline-start: 18%; width: 7px; height: 7px; border-radius: 50%; background: #ffd77a; }
.hs-wish { min-height: 2.8em; margin: 20px auto 0; max-width: 30ch; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); line-height: 1.35; text-wrap: balance; color: var(--ink); }
.hs-wish.is-new { animation: intro-up .5s ease both; }

/* The letter to the future: an airmail envelope, stamped, postmarked with its day and sealed in
   wax; a clock counts down under it. From its day the seal breaks and the letter unfolds. */
.capsule { display: grid; justify-items: center; gap: 10px; width: min(100%, 460px); margin: 0 auto; padding: 28px 20px 26px; border-radius: 22px; text-align: center; background: var(--panel); box-shadow: 0 0 0 1px var(--panel-line), 0 24px 44px -28px var(--f-shadow); }
.capsule .chapter-title { margin: 0 0 4px; }
.cp-env {
  position: relative; width: min(100%, 360px); aspect-ratio: 1.62; margin: 4px auto 18px; padding: 8px; border-radius: 12px; cursor: pointer;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, #fff 12px 18px, var(--accent-2) 18px 30px, #fff 30px 36px);
  box-shadow: 0 24px 36px -24px var(--f-shadow), 0 0 0 1px rgba(0, 0, 0, .05); -webkit-tap-highlight-color: transparent;
}
.cp-env::before { content: ''; position: absolute; inset: 8px; border-radius: 5px; background: #fffaf2; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }
.cp-env > * { position: absolute; z-index: 1; }
.capsule.is-sealed .cp-env { animation: cp-wait 4s ease-in-out infinite; }
@keyframes cp-wait { 50% { transform: translateY(-4px) rotate(-1deg); } }
.capsule.is-nudged .cp-env { animation: cp-shake .55s ease; }
@keyframes cp-shake { 20% { transform: rotate(-4deg); } 40% { transform: rotate(3.5deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
/* the stamp, top right as on any envelope, and the postmark that crosses it with the day it opens */
.cp-stamp { top: 20px; right: 20px; display: grid; padding: 4px; background: #fff; border: 2px dashed rgba(0, 0, 0, .14); box-shadow: 0 3px 8px -3px rgba(0, 0, 0, .3); transform: rotate(4deg); }
.cp-stamp i { display: grid; place-items: center; width: 46px; height: 54px; background: var(--accent); font-style: normal; font-size: 1.6rem; }
.cp-post {
  top: 30px; right: 76px; display: grid; place-content: center; width: 78px; aspect-ratio: 1; border: 2px solid currentColor; border-radius: 50%;
  color: color-mix(in srgb, var(--ink) 55%, transparent); line-height: 1.1; transform: rotate(-14deg);
}
.cp-post::after { content: ''; position: absolute; top: 28px; right: 100%; width: 64px; height: 20px; background: repeating-linear-gradient(180deg, currentColor 0 2px, transparent 2px 6px); opacity: .7; }
.cp-post small { font: 600 .66rem var(--ui-font); }
.cp-post b { font: 800 .8rem var(--ui-font); direction: ltr; }
/* to whom, in a hand, on a line */
.cp-to { inset-inline: 16%; bottom: 26%; display: grid; justify-items: start; gap: 0; text-align: start; }
.cp-to small { font: 600 .8rem var(--ui-font); color: var(--soft); }
.cp-to b { width: 100%; padding-bottom: 2px; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); color: var(--ink); font-family: var(--font-sign); font-weight: var(--sign-weight, 400); font-size: clamp(1.4rem, 6.4vw, 1.9rem); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the wax seal, half over the edge */
.cp-seal {
  bottom: -22px; left: 50%; display: grid; place-items: center; width: 56px; height: 56px; margin-left: -28px; border-radius: 47% 53% 50% 50% / 52% 48% 54% 46%;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--accent) 55%, #fff), var(--accent) 52%, color-mix(in srgb, var(--accent) 70%, #000));
  color: #fff; font-size: 1.2rem; box-shadow: 0 6px 12px -5px rgba(0, 0, 0, .5), inset 0 0 0 5px color-mix(in srgb, var(--accent) 80%, #000);
}
.cp-seal .ic { width: 20px; height: 20px; }
.cp-nope { min-height: 1.4em; margin: 0; color: var(--accent); font: 700 1rem var(--ui-font); opacity: 0; }
.capsule.is-nudged .cp-nope { animation: cp-nope 2.4s ease both; }
@keyframes cp-nope { 10%, 75% { opacity: 1; } }
/* the clock: days, hours, minutes and seconds, each on a little flip card */
.cp-clock { display: flex; justify-content: center; gap: clamp(6px, 2vw, 10px); }
.cp-clock[hidden] { display: none; }
.gate .cp-clock { margin-top: 10px; }
.cp-unit { display: grid; justify-items: center; gap: 5px; }
.cp-unit b {
  position: relative; min-width: 2.3ch; padding: 9px 8px; border-radius: 12px; background: var(--btn-bg); color: var(--btn-ink);
  font: 800 clamp(1.5rem, 7vw, 2.1rem)/1 var(--ui-font); font-variant-numeric: tabular-nums; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), 0 10px 18px -12px var(--f-shadow);
}
.cp-unit b::after { content: ''; position: absolute; inset: 50% 0 auto; height: 1px; background: rgba(0, 0, 0, .2); }
.cp-unit b.is-tick { animation: cp-flip .4s ease; }
@keyframes cp-flip { from { transform: perspective(240px) rotateX(-70deg); } }
.cp-unit small { color: var(--soft); font: 600 .78rem var(--ui-font); }
.cp-when { margin: 6px 0 0; color: var(--soft); }
.cp-cal {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 11px 18px; border-radius: 999px; text-decoration: none;
  background: var(--card); color: var(--ink); font: 700 .98rem var(--ui-font); box-shadow: 0 0 0 1.5px var(--panel-line), 0 8px 18px -12px var(--f-shadow);
}
.cp-cal .ic { width: 18px; height: 18px; color: var(--accent); }
.cp-open { margin-top: 10px; }
.cp-letter { display: none; width: 100%; margin-top: 8px; padding: 26px 22px; border-radius: 6px; background: var(--f-paper); text-align: start; box-shadow: 0 18px 30px -22px var(--f-shadow); }
.cp-letter .chapter-text { margin: 0; font-family: var(--font-head); font-size: clamp(1.08rem, 1rem + .3vw, 1.25rem); line-height: 1.75; white-space: pre-wrap; }
.capsule.is-open .cp-seal { animation: cp-break .5s ease forwards; }
@keyframes cp-break { 40% { transform: scale(1.15) rotate(-8deg); } to { transform: scale(.2) rotate(20deg) translateY(30px); opacity: 0; } }
.capsule.is-open .cp-env { animation: cp-away .55s .35s ease forwards; }
@keyframes cp-away { to { transform: translateY(24px) scale(.94); opacity: 0; } }
.capsule.is-open .cp-open { display: none; }
.capsule.is-open .cp-letter { display: block; transform-origin: top; animation: cp-unfold .8s .7s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes cp-unfold { from { opacity: 0; transform: perspective(900px) rotateX(-75deg); } }
.cp-day-edit { font: 700 1.2rem var(--ui-font); color: var(--accent); }

/* The ending: a paper lantern let go into the sky; a sky of lanterns rises with it. */
.lantern { width: clamp(150px, 42vw, 200px); cursor: pointer; }
.lantern svg { display: block; width: 100%; overflow: visible; }
.lt-lamp { transform-box: view-box; transform-origin: 80px 140px; animation: lt-float 3s ease-in-out infinite; }
@keyframes lt-float { 50% { transform: translateY(-6px) rotate(1.5deg); } }
.lt-glow { fill: rgba(255, 196, 102, .3); filter: blur(10px); }
.lt-paper { fill: #ffd08a; stroke: #e9a75b; stroke-width: 2; }
.lt-rib { fill: none; stroke: rgba(196, 120, 50, .45); stroke-width: 2; }
.lt-rim { fill: #e39a52; }
.lt-flame { fill: #fff3c4; filter: drop-shadow(0 0 6px #ffcf6b); transform-box: fill-box; transform-origin: 50% 100%; animation: lt-flicker .3s ease-in-out infinite alternate; }
@keyframes lt-flicker { to { transform: scaleY(.85) scaleX(1.08); } }
.ending.is-released .lt-lamp { animation: lt-go 3.6s cubic-bezier(.4, 0, .7, .6) forwards; }
@keyframes lt-go { to { transform: translateY(-115vh) rotate(-6deg) scale(.7); opacity: .2; } }
.ending.is-released .lantern-btn, .ending.is-released .wish { visibility: hidden; }
.is-play .ending.has-lantern:not(.is-told) .ending-words { display: none; }
.sky-lanterns { position: fixed; inset: 0; z-index: 57; overflow: hidden; pointer-events: none; }
.sky-lanterns i {
  position: absolute; bottom: -80px; left: calc(var(--x) * 1%); width: calc(var(--s) * 34px); aspect-ratio: 3 / 4; border-radius: 40% 40% 30% 30% / 50% 50% 22% 22%; opacity: 0;
  background: radial-gradient(circle at 50% 75%, #fff3c4 0, #ffc46b 35%, #e8834b 100%); box-shadow: 0 0 24px 8px rgba(255, 190, 90, .45);
  animation: sky-up 7s calc(var(--d) * 1s) cubic-bezier(.3, 0, .7, 1) forwards;
}
@keyframes sky-up { 0% { opacity: 0; transform: translate(0, 0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--w), -118vh); } }

@media (prefers-reduced-motion: reduce) {
  .hg-swing, .lt-lamp, .lt-flame, .capsule.is-sealed .cp-env, .capsule.is-nudged .cp-env, .cp-unit b.is-tick, .hs-window { animation: none !important; }
  .capsule.is-nudged .cp-nope { animation: none; opacity: 1; }
  .sky-lanterns { display: none; }
}

/* ---------- the events' closed doors (story.js GATES): a soldier's bag, a moon, a ring's box ---------- */
.gift.is-event { width: clamp(176px, 48vw, 240px); animation: env-float 3.4s ease-in-out infinite; }
:is(.gate, .door).is-opening .gift.is-event { animation: none; }
.kb-body, .kb-flap path:first-child { fill: var(--gift); stroke: color-mix(in srgb, var(--band) 45%, transparent); stroke-width: 1.5; }
.kb-flap path:first-child { fill: var(--gift-top); }
.kb-strap { fill: none; stroke: var(--gift-top); stroke-width: 11; stroke-linecap: round; }
.kb-pocket { fill: color-mix(in srgb, var(--gift) 84%, #000); }
.kb-line { fill: none; stroke: var(--band); stroke-width: 2.5; stroke-dasharray: 5 4; }
.kb-buckle { fill: none; stroke: var(--band); stroke-width: 7; stroke-linecap: round; }
.kb-clip, .kb-heart, .rb-heart { fill: var(--knot); }
.kb-flap { transform-box: fill-box; transform-origin: 85% 100%; transition: transform .7s cubic-bezier(.3, 1, .5, 1), opacity .5s ease .25s; }
.kb-tag { transform-box: fill-box; transform-origin: 20% 0; animation: kb-swing 2.6s ease-in-out infinite; }
@keyframes kb-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(8deg); } }
.kb-cord, .mn-cord { fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 2.5; }
.kb-tag rect { fill: #fffaf0; stroke: color-mix(in srgb, var(--ink) 25%, transparent); stroke-width: 1.5; }
.kb-hole { fill: color-mix(in srgb, var(--ink) 35%, transparent); }
.kb-tag text { fill: #d6336c; font: 700 17px sans-serif; }
:is(.gate, .door).is-opening .kb-flap { transform: translateY(-46px) rotate(22deg); opacity: 0; }
:is(.gate, .door).is-opening .kb-tag { animation: none; }
.mn-moon { fill: #ffe3a1; stroke: #f0c766; stroke-width: 2; }
.mn-eye { fill: none; stroke: #8a6a2c; stroke-width: 3; stroke-linecap: round; }
.mn-cheek { fill: #f7b6a0; opacity: .7; }
.mn-sky { fill: #f3c969; }
.mn-sky > * { animation: mn-blink 2.8s ease-in-out infinite; }
.mn-sky > :nth-child(2n) { animation-delay: 1.2s; }
@keyframes mn-blink { 50% { opacity: .25; } }
.mn-rock { transform-box: fill-box; transform-origin: 50% 60%; animation: mn-rock 4.2s ease-in-out infinite; }
@keyframes mn-rock { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.mn-star { transform-box: fill-box; transform-origin: 50% 0; animation: kb-swing 3.2s ease-in-out infinite; }
.mn-body { fill: #ffd36b; stroke: #eab54a; stroke-width: 1.5; }
:is(.gate, .door).is-opening .mn-star { animation: mn-fall .9s cubic-bezier(.4, 0, .7, 1) forwards; }
@keyframes mn-fall { 30% { transform: translateY(-12px) scale(1.2); } to { transform: translateY(120px) scale(.3); opacity: 0; } }
.rb-base { fill: var(--gift); stroke: color-mix(in srgb, var(--band) 45%, transparent); stroke-width: 1.5; }
.rb-slot { fill: none; stroke: var(--band); stroke-width: 5; stroke-linecap: round; }
.rb-lid path:first-child { fill: var(--gift-top); stroke: color-mix(in srgb, var(--band) 45%, transparent); stroke-width: 1.5; }
.rb-shine { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 5; stroke-linecap: round; }
.rb-band { fill: none; stroke: #e6bd5a; stroke-width: 7; }
.rb-gem { fill: #dff3ff; stroke: #7fb9e0; stroke-width: 2; }
.rb-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .7s cubic-bezier(.3, 1.2, .5, 1); }
.rb-ring { opacity: 0; transition: transform .9s cubic-bezier(.2, .9, .3, 1.1) .2s, opacity .4s ease .2s; }
:is(.gate, .door).is-opening .rb-lid { transform: translateY(-30px) scaleY(.35); opacity: .5; }
:is(.gate, .door).is-opening .rb-ring { opacity: 1; transform: translateY(-42px); }
@media (prefers-reduced-motion: reduce) {
  .gift.is-event, .kb-tag, .mn-rock, .mn-star, .mn-sky > * { animation: none !important; }
}
