/* 谭铭清 & 刘寅 · 婚礼请柬
   手机：内容列按 390px 设计，用 zoom 缩放到屏幕宽度（js/app.js 设置 --z）。
   电脑（≥960px）：左边固定封面海报，右边 440px 内容列滚动。
   动画原则：风景跟着滚动走（可倒放）；收到的东西（拆开的信、写好的字、打印好的请柬）完成后保持。 */

/* ---------- 颜色 ----------
   每个颜色只在这里定义一次，其余地方都用变量。
   · 整体换色：改 :root 这一组。
   · 某张照片要换一套搭配色（复古内景、中式红）：在 config.js 里给照片写 tone，
     放这张照片的那一段会套用下面对应的 [data-tone] 一组。
   · *-rgb 是同一颜色的 RGB 分量，用来写半透明：rgb(var(--ink-rgb) / 0.2)。
   · card-* 是浮在页面上的纸（信纸、卡片、票根、请柬）上的字色；深色调里纸还是浅色，字要单独定。 */
:root {
  color-scheme: light;
  /* 外景 · 海边暮色（默认） */
  --paper: #F1EFEA;                          /* 页面底色：海盐白 */
  --paper-alt: #DFE4E7;                      /* 交替段落：暮色雾蓝 */
  --paper-raised: #FBFAF7;                   /* 卡片 */
  --paper-letter: #F7F5F0;                   /* 信纸、撕边纸 */
  --ink: #1F2A36; --ink-rgb: 31 42 54;       /* 正文：礁石深蓝 */
  --ink-muted: #5A626C;
  --accent: #3F5E7C; --accent-rgb: 63 94 124; /* 主色：暮色海面蓝 */
  --accent-2: #4D6D8B;                       /* 信封翻盖，比主色亮一档 */
  --deep: #1C2B3B;                           /* 深色块：夜海 */
  --on-accent: #F1EFEA; --on-accent-rgb: 241 239 234; /* 主色和深色块上的字 */
  --glow: #E3BE86;                           /* 点缀：烟花金 */
  --wall: #D7E3EC;                           /* 照片墙：浅海蓝纸 */
  --twine: #A58763; --twine-light: #CDB590;   /* 挂照片的麻绳 */
  --peg: #C9A47A; --peg-dark: #9E7B54;       /* 小木夹 */
  --stripe: #3F5E7C; --stripe-bg: #F1EFEA;   /* 手刷条纹和它的底 */
  --liner-bg: #E3E7EA;                       /* 信封内衬 */
  --photo-placeholder: #C9CFD4;
  --photo-shade: #2C3E51;                    /* 深色照片位的占位 */
  --photo-shade-ink: rgb(241 239 234 / 0.75);  /* 深色占位上的说明字 */
  --led: #9CC6E4;
  --shadow-rgb: 20 30 42;                    /* 投影 */
  --scrim-rgb: 12 20 30;                     /* 照片上的暗色遮罩、弹层底 */
  --light-rgb: 241 239 234;                  /* 压在照片上的白字 */
  --card-ink: #1F2A36; --card-ink-rgb: 31 42 54; --card-muted: #5A626C; --card-accent: #3F5E7C;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --hand: "Long Cang", "Noto Serif SC", cursive;
  --script: "Caveat", "Noto Serif SC", cursive;
  --caps: "Forum", "Noto Serif SC", serif;
  --stamp: "Cinzel", "Forum", serif;

  --grain: url(../assets/img/grain.png);
  --stripe-mask: url(../assets/img/stripes-hand.svg) 0 0 / 100% 100% no-repeat;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --z: 1;
}

/* 内景 · 复古：赭红墙、墨绿墙、奶油蕾丝 → 浅奶油底、墨绿主色、驼色点缀 */
[data-tone="vintage"] {
  --paper: #F5EFE6; --paper-alt: #EFE7DA; --paper-raised: #FCF9F4; --paper-letter: #F9F4EC;
  --ink: #2E2723; --ink-rgb: 46 39 35; --ink-muted: #6E6158;
  --accent: #46675F; --accent-rgb: 70 103 95; --accent-2: #55766D;
  --deep: #2E433C;
  --on-accent: #F5EFE6; --on-accent-rgb: 245 239 230;
  --glow: #D9B48C;
  --stripe: #9DB1A9; --stripe-bg: #F5EFE6;
  --liner-bg: #EDE5D8;
  --photo-placeholder: #E2D6C6; --photo-shade: #D3C2AE; --photo-shade-ink: #6E6158;
  --led: #D9B48C;
  --shadow-rgb: 70 52 38; --scrim-rgb: 30 20 14;
  --card-ink: #2E2723; --card-ink-rgb: 46 39 35; --card-muted: #6E6158; --card-accent: #46675F;
}

/* 内景 · 中式红：米白宣纸底、浅金条纹、墨色字；红色只留在照片里 */
[data-tone="red"] {
  --paper: #F6F0E6; --paper-alt: #F0E7D9; --paper-raised: #FCF9F3; --paper-letter: #FAF5EC;
  --ink: #2C2420; --ink-rgb: 44 36 32; --ink-muted: #6F6359;
  --accent: #977245; --accent-rgb: 151 114 69; --accent-2: #A6824F;
  --deep: #2C2420;
  --on-accent: #FAF5EC; --on-accent-rgb: 250 245 236;
  --glow: #D9B57E;
  --stripe: #DDC9A6; --stripe-bg: #F6F0E6;
  --liner-bg: #EFE6D7;
  --photo-placeholder: #E6DACA; --photo-shade: #D9C8B1; --photo-shade-ink: #6F6359;
  --led: #D9B57E;
  --shadow-rgb: 70 50 30; --scrim-rgb: 30 20 14;
  --card-ink: #2C2420; --card-ink-rgb: 44 36 32; --card-muted: #6F6359; --card-accent: #977245;
}

/* 由上面推出来的颜色：在每个可能换色的地方重新算一次 */
:root, [data-tone], .torn, .letter, .env-letter, .polaroid, .pq-small, .v-map, .v-card, .ticket, .card, .sheet-panel, .strip-btn {
  --hairline: rgb(var(--ink-rgb) / 0.2);
  --ink-soft: rgb(var(--ink-rgb) / 0.6);
}
/* 浮在页面上的纸：深色段落里也保持深色字 */
.torn, .letter, .env-letter, .polaroid, .pq-small, .v-map, .v-card, .ticket, .card, .sheet-panel, .strip-btn {
  --ink: var(--card-ink); --ink-rgb: var(--card-ink-rgb); --ink-muted: var(--card-muted); --accent: var(--card-accent);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--deep); color: var(--ink); font-family: var(--serif); }
p, h1, h2 { margin: 0; font-weight: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.s-date :focus-visible, .r-panel :focus-visible { outline-color: var(--on-accent); }

.hand { font-family: var(--hand); }
.amp { font-family: var(--script); }
.torn { filter: drop-shadow(0 4px 8px rgb(var(--shadow-rgb) / 0.22)); }
.torn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paper-letter); -webkit-mask: url(../assets/img/paper-torn.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/paper-torn.svg) 0 0 / 100% 100% no-repeat; }

/* ---------- layout ---------- */
.layout { min-height: 100vh; }
.col { width: 390px; zoom: var(--z); margin: 0 auto; background: var(--paper) var(--grain); background-size: 256px 256px; }
.s { position: relative; overflow: hidden; }
/* a section that holds a toned photo repaints itself with that tone */
[data-tone] { color: var(--ink); background-color: var(--paper); background-image: var(--grain); background-size: 256px 256px; }
@supports (overflow: clip) { .s { overflow: clip; } }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; align-items: start; }
  .col { margin: 0; }
  .poster-scroll { display: none; }
}

/* ---------- tone-on-tone emboss (压纹) frames, drawn by app.js ---------- */
.emboss-frame { position: absolute; pointer-events: none; }
.emboss-frame svg { display: block; overflow: visible; }

/* ---------- photo placeholders ---------- */
.ph { display: flex; align-items: center; justify-content: center; background-color: var(--photo-placeholder); background-image: var(--grain); background-size: 180px 180px; }
.ph.dark { background-color: var(--photo-shade); }
.ph-label { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-muted); }
.ph.dark .ph-label { color: var(--photo-shade-ink); }
.photo { background-size: cover; background-position: center; }

/* ---------- section header ---------- */
.sh { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--hairline); padding-bottom: 10px; }
.sh-en { font-family: var(--script); font-size: 34px; line-height: 1; color: var(--accent); }
.sh-cn { font-size: 18px; font-weight: 600; letter-spacing: 0.2em; }

/* ---------- 1 · poster ---------- */
.poster { position: relative; height: 100vh; height: 100svh; min-height: 600px; max-height: 1000px; overflow: hidden; color: rgb(var(--light-rgb)); background: var(--photo-shade); }
@media (min-width: 960px) { .poster { position: sticky; top: 0; height: 100vh; min-height: 0; max-height: none; } }
.poster-photo { position: absolute; inset: -4% 0; will-change: transform; }
.poster-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(var(--scrim-rgb) / 0.5) 0%, rgb(var(--scrim-rgb) / 0.12) 26%, rgb(var(--scrim-rgb) / 0.14) 60%, rgb(var(--scrim-rgb) / 0.72) 100%); }
.poster-text { position: absolute; inset: 0; }
.poster-names { position: absolute; left: 0; right: 0; top: max(8.5%, 56px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center; }
.poster-names > div { display: flex; flex-direction: column; gap: 8px; }
.pn-cn { font-size: clamp(18px, 5.4vw, 26px); font-weight: 600; letter-spacing: 0.3em; padding-left: 0.3em; }
.pn-en { font-family: var(--caps); font-size: clamp(10px, 2.7vw, 13px); letter-spacing: 0.28em; color: rgb(var(--light-rgb) / 0.82); }
.poster-center { position: absolute; left: 0; right: 0; top: 38%; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.pc-eyebrow { font-family: var(--caps); font-size: clamp(11px, 3vw, 14px); letter-spacing: 0.5em; padding-left: 0.5em; color: rgb(var(--light-rgb) / 0.85); }
.pc-title { font-size: clamp(34px, 11.3vw, 60px); font-weight: 600; line-height: 1.1; letter-spacing: 0.3em; padding-left: 0.3em; }
.pc-rule { width: 40px; height: 1px; background: rgb(var(--light-rgb) / 0.7); }
.pc-date { font-family: var(--caps); font-size: clamp(17px, 5.1vw, 24px); letter-spacing: 0.18em; padding-left: 0.18em; }
.poster-foot { position: absolute; left: 24px; right: 24px; bottom: max(7%, 52px); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.poster-foot p { font-size: clamp(13px, 3.6vw, 16px); letter-spacing: 0.24em; }
.poster-foot .pf-en { margin-top: 6px; font-family: var(--caps); font-size: clamp(9.5px, 2.6vw, 11px); letter-spacing: 0.32em; color: rgb(var(--light-rgb) / 0.8); }
.poster-sample { position: absolute; right: 12px; top: 14px; font-size: 10px; color: rgb(var(--light-rgb) / 0.75); }
.poster-scroll { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.4em; padding-left: 0.4em; color: rgb(var(--light-rgb) / 0.75); }
.poster-scroll span { width: 1px; height: 18px; background: rgb(var(--light-rgb) / 0.7); animation: scrollCue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes scrollCue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@media (min-width: 960px) {
  .pn-cn { font-size: clamp(20px, 1.8vw, 28px); }
  .pn-en { font-size: 12px; }
  .pc-eyebrow { font-size: 14px; }
  .pc-title { font-size: clamp(44px, 4.4vw, 72px); }
  .pc-date { font-size: clamp(20px, 1.8vw, 26px); }
  .poster-foot p { font-size: 16px; }
  .poster-foot .pf-en { font-size: 12px; }
}

/* ---------- 2 · envelope ---------- */
.s-envelope { height: 560px; }
.script-pattern { position: absolute; left: -90px; top: -30px; width: 620px; transform: rotate(-12deg); font-family: var(--script); font-size: 34px; line-height: 52px; color: rgb(var(--accent-rgb) / 0.16); white-space: nowrap; -webkit-mask-image: linear-gradient(192deg, #000 60%, transparent 90%); mask-image: linear-gradient(192deg, #000 60%, transparent 90%); }
.script-pattern p:nth-child(even) { margin-left: -70px; }
.env { position: absolute; left: 46px; top: 214px; width: 298px; height: 186px; padding: 0; border: 0; background: none; transform: rotate(-3deg); }
.env::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -18px; height: 26px; border-radius: 50%; background: rgb(var(--shadow-rgb) / 0.28); filter: blur(10px); z-index: -1; }
.env.idle { animation: envIdle 3.6s ease-in-out 1.2s infinite; }
@keyframes envIdle {
  0%, 30%, 100% { transform: rotate(-3deg) translateY(0); }
  6% { transform: rotate(-6deg) translateY(-6px); }
  12% { transform: rotate(0deg) translateY(-3px); }
  18% { transform: rotate(-4.5deg) translateY(-1px); }
  24% { transform: rotate(-2.5deg) translateY(0); }
}
.env-back { position: absolute; inset: 0; border-radius: 3px; overflow: hidden; background: var(--liner-bg); }
.env-back::after, .flap-in::after { content: ""; position: absolute; inset: 0; background: var(--stripe); opacity: 0.45; -webkit-mask: var(--stripe-mask); mask: var(--stripe-mask); }
.env-letter { position: absolute; z-index: 2; left: 14px; top: 10px; width: 270px; height: 170px; padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--paper-raised) var(--grain); background-size: 256px 256px; box-shadow: 0 2px 10px rgb(var(--shadow-rgb) / 0.16); transform-origin: 50% 100%; will-change: transform; }
.el-to { font-size: 28px; line-height: 1.1; color: var(--ink); }
.el-sub { font-size: 12px; letter-spacing: 0.12em; color: var(--ink-muted); }
.el-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--hairline); padding-top: 8px; }
.el-names { font-size: 20px; color: var(--accent); }
.el-date { font-family: var(--caps); font-size: 13px; letter-spacing: 0.1em; color: var(--ink-muted); }
.env-front { position: absolute; z-index: 3; inset: 0; border-radius: 0 0 3px 3px; clip-path: polygon(0 0, 50% 64%, 100% 0, 100% 100%, 0 100%); background: var(--accent) var(--grain); background-size: 256px 256px; }
.env-front::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 100%, 50% 58%, 100% 100%); background: rgb(0 0 0 / 0.08); }
.env-love { position: absolute; left: 22px; bottom: 14px; font-family: var(--script); font-size: 26px; color: var(--glow); }
.env-stamp { position: absolute; right: 2px; bottom: 12px; width: 124px; height: 68px; transform: rotate(-12deg); }
.env-stamp .pm { width: 124px; height: 68px; overflow: visible; }
.env-flap { position: absolute; z-index: 4; left: 0; top: 0; width: 298px; height: 119px; transform-origin: 50% 0; transform-style: preserve-3d; transform: perspective(700px) rotateX(0deg); will-change: transform; }
.env-flap > span { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-out { background: var(--accent-2) var(--grain); background-size: 256px 256px; }
.flap-out::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.12)); }
.env-flap > .flap-in { clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--liner-bg); transform: rotateX(180deg); }
.env-hint { position: absolute; left: 0; right: 0; top: 462px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 0.24em; padding-left: 0.24em; color: var(--accent); }
.env-hint svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; animation: hintBounce 1.4s ease-in-out infinite; }
@keyframes hintBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- 3 · letter ---------- */
.s-letter { height: 540px; }
.letter { position: absolute; left: 16px; right: 16px; top: 30px; height: 480px; padding: 38px 26px 28px; display: flex; flex-direction: column; gap: 10px; transform: rotate(0.6deg); filter: drop-shadow(0 6px 14px rgb(var(--shadow-rgb) / 0.18)); }
.letter::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paper-letter); -webkit-mask: url(../assets/img/letter-torn.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/letter-torn.svg) 0 0 / 100% 100% no-repeat; }
.l-script { font-family: var(--script); font-size: 30px; line-height: 1; color: var(--accent); }
.l-title { font-size: 24px; font-weight: 600; letter-spacing: 0.08em; }
.l-rule { height: 1px; background: rgb(var(--ink-rgb) / 0.45); }
.l-body { font-size: 16px; line-height: 34px; text-align: justify; text-wrap: pretty; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 33px, rgb(var(--ink-rgb) / 0.24) 33px, rgb(var(--ink-rgb) / 0.24) 34px); }
.l-ink { --wp: 1.3; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(var(--wp) * 100% - 34px), transparent calc(var(--wp) * 100%)); mask-image: linear-gradient(to bottom, #000 0, #000 calc(var(--wp) * 100% - 34px), transparent calc(var(--wp) * 100%)); }
.l-body.has-img { background: none; }
.l-hand-img { width: 100%; height: auto; }
.l-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.l-date { font-family: var(--caps); font-size: 16px; letter-spacing: 0.1em; color: var(--ink-muted); }
.l-sign { --sp: 1; display: flex; flex-direction: column; align-items: flex-end; transform: rotate(-5deg); clip-path: inset(-20px calc((1 - var(--sp)) * 100% - 20px) -20px -20px); }
.l-sign .hand { font-size: 34px; line-height: 1.1; color: var(--accent); }
.l-sign img { max-width: 180px; height: auto; }
.l-respect { font-size: 12px; letter-spacing: 0.3em; color: var(--ink-muted); }

/* ---------- 4 · story: a photo wall — prints pegged on a line ---------- */
.s-story { height: 884px; background: var(--wall) var(--grain); background-size: 256px 256px; }
.s-story::before { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 200px; background: rgb(var(--light-rgb) / 0.75); -webkit-mask: url(../assets/img/waves-hand.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/waves-hand.svg) 0 0 / 100% 100% no-repeat; }
.s-story::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 200px; background: rgb(var(--accent-rgb) / 0.16); -webkit-mask: url(../assets/img/waves-hand.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/waves-hand.svg) 0 0 / 100% 100% no-repeat; }
.story-card { position: absolute; z-index: 1; left: 16px; right: 16px; top: 34px; height: 214px; padding: 30px 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.story-card .sh { border-bottom: none; padding-bottom: 0; }
.story-text-wrap { height: 96px; overflow: hidden; }
.story-text { font-size: 16px; line-height: 1.95; text-align: justify; text-wrap: pretty; transition: opacity 0.26s ease, translate 0.32s cubic-bezier(.2, .7, .2, 1); }
.story-text.out { opacity: 0; translate: 0 -12px; }
.story-text.pre { opacity: 0; translate: 0 12px; transition: none; }
.strip { position: absolute; z-index: 2; left: 0; right: 0; top: 262px; height: 332px; }
.twine { position: absolute; left: 0; top: 0; width: 390px; height: 60px; overflow: visible; fill: none; stroke-linecap: round; }
.twine .tw-a { stroke: var(--twine); stroke-width: 2.4; }
.twine .tw-b { stroke: var(--twine-light); stroke-width: 1; stroke-dasharray: 3 4; }
.strip-track { position: relative; display: flex; gap: 18px; height: 100%; padding: 29px 0 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.strip-track::-webkit-scrollbar { display: none; }
/* end spacers instead of side padding: Safari leaves out end padding when it measures how far the strip scrolls,
   which let the swinging prints change the scroll width and set off endless re-snapping */
.strip-track::before, .strip-track::after { content: ""; flex: 0 0 72px; }
.strip-item { position: relative; flex: 0 0 210px; height: 262px; scroll-snap-align: center; scroll-snap-stop: always; transform-origin: 50% 0; will-change: transform; }
/* a plain box shadow under the print (a filter here flickers on iPhone while the prints swing) */
.print-shadow { position: absolute; left: 3px; right: 3px; top: 4px; bottom: 2px; box-shadow: 0 7px 12px rgb(var(--shadow-rgb) / 0.2), 0 1px 3px rgb(var(--shadow-rgb) / 0.14); }
.print { position: absolute; inset: 0; background: var(--paper-raised); -webkit-mask: url(../assets/img/deckle.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/deckle.svg) 0 0 / 100% 100% no-repeat; }
.print-photo { position: absolute; left: 12px; right: 12px; top: 12px; height: 206px; overflow: hidden; }
.print-photo > div { position: absolute; inset: 0 -12%; }
.print-cap { position: absolute; left: 12px; right: 12px; bottom: 9px; text-align: center; font-family: var(--script); font-size: 20px; line-height: 1; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peg { position: absolute; left: 50%; top: -15px; width: 10px; height: 30px; margin-left: -5px; border-radius: 2px 2px 3px 3px; background: linear-gradient(90deg, var(--peg) 0 44%, var(--peg-dark) 44% 56%, var(--peg) 56% 100%); box-shadow: 0 2px 3px rgb(var(--shadow-rgb) / 0.25); }
.peg::after { content: ""; position: absolute; left: -2px; right: -2px; top: 11px; height: 4px; border-radius: 2px; background: #8E9296; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.strip-btn { position: absolute; top: 140px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgb(var(--shadow-rgb) / 0.22); transition: transform 0.25s var(--bounce), opacity 0.25s; }
.strip-btn:active { transform: scale(0.9); }
.strip-btn[disabled] { opacity: 0; pointer-events: none; }
.strip-btn.prev { left: 66px; } .strip-btn.next { left: 280px; }
.strip-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.swipe-hint { position: absolute; left: 50%; top: 214px; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; background: rgb(var(--scrim-rgb) / 0.6); color: rgb(var(--light-rgb)); font-size: 12px; letter-spacing: 0.2em; transform: translateX(-50%); pointer-events: none; transition: opacity 0.4s; }
.swipe-hint svg { width: 54px; height: 18px; fill: none; stroke: rgb(var(--light-rgb)); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation: swipeCue 1.6s ease-in-out infinite; }
@keyframes swipeCue { 0%, 100% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
.swipe-hint.hide { opacity: 0; }
.swipe-hint.hide svg { animation: none; }
.strip-meta { position: absolute; z-index: 2; left: 28px; right: 28px; top: 606px; display: flex; justify-content: center; }
.strip-dots { display: flex; align-items: center; gap: 6px; }
.strip-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgb(var(--ink-rgb) / 0.25); transition: width 0.35s var(--bounce), background 0.3s; }
.strip-dots i.on { width: 20px; background: var(--accent); }
.polaroid { position: absolute; z-index: 1; width: 132px; padding: 7px 7px 30px; background: var(--paper-raised); box-shadow: 0 4px 14px rgb(var(--shadow-rgb) / 0.2); }
.polaroid .photo, .polaroid .ph { height: 118px; }
.polaroid p { margin-top: 6px; text-align: center; font-family: var(--script); font-size: 20px; line-height: 1; }
.polaroid.p0 { left: 44px; top: 660px; transform: rotate(-5deg); }
.polaroid.p1 { left: 206px; top: 670px; transform: rotate(4deg); }
.polaroid-amp { position: absolute; z-index: 1; left: 176px; top: 716px; font-family: var(--script); font-size: 36px; color: var(--accent); }

/* ---------- 5 · photo + quote ---------- */
.s-quote { height: 560px; background: var(--paper-alt) var(--grain); background-size: 256px 256px; }
.pq-large { position: absolute; left: 28px; top: 44px; width: 232px; height: 300px; overflow: hidden; }
.pq-img { position: absolute; left: 0; right: 0; top: -36px; bottom: -36px; will-change: transform; }
.pq-small { position: absolute; right: 22px; top: 248px; width: 150px; padding: 7px; background: var(--paper-raised); box-shadow: 0 8px 20px rgb(var(--shadow-rgb) / 0.2); transform: rotate(3deg); will-change: transform; }
.pq-small > div { height: 186px; }
.pq-text { position: absolute; left: 28px; top: 368px; width: 176px; display: flex; flex-direction: column; gap: 8px; }
.pq-line { font-size: 25px; font-weight: 600; line-height: 1.45; letter-spacing: 0.04em; }
.pq-note { font-family: var(--script); font-size: 24px; color: var(--accent); transform: rotate(-4deg); transform-origin: left center; }

/* ---------- 6 · stripes + wavy frame ---------- */
.s-stripe { height: 460px; background: var(--stripe-bg); }
.s-stripe::before { content: ""; position: absolute; inset: 0; background: var(--stripe); -webkit-mask: var(--stripe-mask); mask: var(--stripe-mask); }
.sf-frame { position: absolute; left: 55px; top: 40px; width: 280px; height: 364px; }
.sf-photo { position: absolute; inset: 0; overflow: hidden; -webkit-mask: url(../assets/img/frame-mask.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/frame-mask.svg) 0 0 / 100% 100% no-repeat; }
.sf-img { position: absolute; inset: 0; will-change: transform; }
.sf-wavy { position: absolute; inset: 0; background: var(--stripe-bg); -webkit-mask: url(../assets/img/frame-wavy.svg) 0 0 / 100% 100% no-repeat; mask: url(../assets/img/frame-wavy.svg) 0 0 / 100% 100% no-repeat; }
.sf-tag { position: absolute; right: 16px; bottom: 24px; width: 196px; height: 70px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; transform: rotate(5deg); will-change: transform; }
.sf-en { font-family: var(--script); font-size: 24px; line-height: 1; color: var(--accent); }
.sf-cn { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-muted); }
.sf-vert { display: none; }
/* 中式版式：直边照片、两道细金线、竖排名字；不用条纹和波浪边 */
[data-tone="red"].s-stripe::before, [data-tone="red"] .sf-wavy, [data-tone="red"] .sf-tag { display: none; }
[data-tone="red"] .sf-frame { left: 40px; top: 66px; width: 228px; height: 304px; box-shadow: 0 8px 18px rgb(var(--shadow-rgb) / 0.16); }
.sf-cn-frame { display: none; }
[data-tone="red"] .sf-cn-frame { display: block; position: absolute; left: 10px; top: 36px; width: 288px; height: 364px; pointer-events: none; }
[data-tone="red"] .sf-cn-frame svg { display: block; overflow: visible; }
[data-tone="red"] .sf-photo { -webkit-mask: none; mask: none; }
[data-tone="red"] .sf-vert { position: absolute; right: 24px; top: 58px; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 8px; will-change: transform; }
.sf-vn { writing-mode: vertical-rl; font-size: 34px; line-height: 1; letter-spacing: 0.06em; color: var(--ink); }
.sf-vn span + span { margin-top: 0.8em; }
.sf-vd { writing-mode: vertical-rl; margin-top: 150px; font-size: 12px; letter-spacing: 0.42em; color: var(--accent); }

/* ---------- 7 · date ---------- */
.s-date { height: 340px; padding: 40px 28px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--on-accent); background: var(--accent) var(--grain); background-size: 256px 256px; }
.d-frame { position: absolute; inset: 0; pointer-events: none; }
.d-frame svg { display: block; }
.d-month { position: relative; font-family: var(--caps); font-size: 13px; letter-spacing: 0.32em; }
.d-month b { font-family: var(--serif); font-weight: 600; }
.d-days { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgb(var(--on-accent-rgb) / 0.5); border-bottom: 1px solid rgb(var(--on-accent-rgb) / 0.5); }
.d-day { position: relative; padding: 8px 0 10px; }
.d-day.on { border-left: 1px solid rgb(var(--on-accent-rgb) / 0.5); border-right: 1px solid rgb(var(--on-accent-rgb) / 0.5); }
.d-wk { font-size: 13px; }
.d-num { font-family: var(--caps); font-size: 60px; line-height: 1.1; }
.d-circle { position: absolute; left: 50%; top: 24px; width: 98px; height: 82px; margin-left: -49px; fill: none; stroke: var(--on-accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.d-count { display: flex; align-items: baseline; gap: 10px; font-size: 13px; letter-spacing: 0.16em; }
.d-count b { font-family: var(--caps); font-size: 36px; line-height: 1; font-weight: 400; letter-spacing: 0; }
.d-note { font-family: var(--script); font-size: 26px; }

/* ---------- 8 · venue: hand-drawn map ---------- */
.s-venue { height: 660px; padding: 36px 28px 0; background: var(--paper-alt) var(--grain); background-size: 256px 256px; }
.v-map { position: absolute; left: 16px; top: 96px; width: 358px; height: 316px; padding: 8px 12px; overflow: hidden; background: var(--paper-letter) var(--grain); background-size: 256px 256px; box-shadow: 0 6px 16px rgb(var(--shadow-rgb) / 0.16); transform: rotate(0.8deg); }
.v-map-inner { position: relative; width: 334px; height: 300px; transform-origin: 69% 28%; transition: transform 0.8s cubic-bezier(.2, .8, .2, 1); }
.v-map-svg { position: absolute; inset: 0; width: 334px; height: 300px; overflow: visible; --road: 0; --street: 0; --water: 0; --route: 0; }
.v-map-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.m-road path { stroke: var(--ink); stroke-width: 1.6; stroke-dashoffset: calc(1 - var(--road)); }
.m-street path, .m-bridge path, .m-compass path { stroke: var(--ink-soft); stroke-width: 1; stroke-dashoffset: calc(1 - var(--street)); }
.m-water path, .m-park path { stroke: var(--accent); stroke-width: 1.2; stroke-dashoffset: calc(1 - var(--water)); }
.m-hotel path { stroke: var(--ink); stroke-width: 1.4; stroke-dashoffset: calc(1 - var(--street)); }
.m-compass text { font-family: var(--caps); font-size: 11px; fill: var(--ink); text-anchor: middle; opacity: var(--street); }
.v-map-svg .route { stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 2 7; }
.v-map-svg .route-reveal { stroke: #fff; stroke-width: 10; stroke-dashoffset: calc(1 - var(--route)); }
.v-pin { position: absolute; left: 218px; top: 50px; width: 24px; height: 32px; transform-origin: 50% 100%; opacity: 0; transform: translateY(-36px) scale(0.6); }
.v-pin svg { width: 24px; height: 32px; }
.v-pin path { fill: var(--accent); stroke: var(--ink); stroke-width: 0.8; }
.v-pin circle { fill: rgb(var(--light-rgb)); }
.v-pin.drop { animation: pinDrop 0.7s var(--bounce) forwards; }
@keyframes pinDrop { 0% { opacity: 0; transform: translateY(-36px) scale(0.6); } 55% { opacity: 1; transform: translateY(3px) scale(1.08, 0.9); } 75% { transform: translateY(-4px) scale(0.96, 1.04); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.v-pulse { position: absolute; left: 50%; bottom: -6px; width: 30px; height: 12px; margin-left: -15px; border: 1.5px solid var(--accent); border-radius: 50%; opacity: 0; }
.v-map-label { position: absolute; right: 124px; top: 54px; padding: 2px 7px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; background: var(--paper-raised); border: 1px solid var(--hairline); opacity: 0; transform: translateY(4px); transition: opacity 0.4s, transform 0.4s; }
.v-pin.drop ~ .v-map-label { opacity: 1; transform: none; }
.v-city { position: absolute; right: 22px; top: 436px; writing-mode: vertical-rl; font-size: 40px; font-weight: 600; letter-spacing: 0.2em; line-height: 1; color: var(--ink); }
.v-card { position: absolute; left: 22px; top: 428px; width: 262px; padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; background: var(--paper-raised); box-shadow: 0 10px 22px rgb(var(--shadow-rgb) / 0.2); transform: rotate(-1.5deg); transition: transform 0.55s var(--bounce), box-shadow 0.5s; }
.v-hotel { font-size: 26px; font-weight: 600; line-height: 1.2; }
.v-hall { font-size: 14px; }
.v-addr { font-size: 13px; line-height: 1.7; color: var(--ink-muted); }
.btn-nav { position: absolute; left: 22px; right: 22px; bottom: 30px; height: 54px; border: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--on-accent); font-size: 16px; letter-spacing: 0.14em; background: var(--accent) var(--grain); background-size: 256px 256px; box-shadow: 0 8px 20px rgb(var(--shadow-rgb) / 0.28); transition: transform 0.3s var(--bounce); }
.btn-nav:active { transform: scale(0.96); }
.btn-nav svg { width: 18px; height: 18px; fill: none; stroke: var(--on-accent); stroke-width: 1.5; }
.s-venue.go .v-map-inner { transform: scale(1.55); }
.s-venue.go .v-card { transform: translateY(-14px) rotate(0deg); box-shadow: 0 20px 36px rgb(var(--shadow-rgb) / 0.28); }
.s-venue.go .v-pulse { animation: pinPulse 1.3s ease-out infinite; }
@keyframes pinPulse { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.2); } }

/* ---------- 9 · the day ---------- */
.s-day { height: 480px; padding: 36px 28px 0; }
.day-map { position: relative; height: 380px; margin-top: 8px; }
.day-map svg { position: absolute; inset: 0; width: 334px; height: 380px; }
.dm-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.dm-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.dm-dot.d0 { left: 34px; top: 44px; } .dm-dot.d1 { left: 284px; top: 164px; } .dm-dot.d2 { left: 54px; top: 294px; }
.dm-stop { position: absolute; display: flex; flex-direction: column; gap: 2px; }
.dm-stop.s0 { left: 58px; top: 66px; }
.dm-stop.s1 { right: 62px; top: 150px; align-items: flex-end; }
.dm-stop.s2 { left: 84px; top: 286px; }
.dm-time { font-family: var(--caps); font-size: 26px; line-height: 1; }
.dm-label { font-size: 15px; letter-spacing: 0.16em; }
.anim .dm-dot { transform: scale(0); transition: transform 0.55s var(--bounce); }
.anim .dm-stop { opacity: 0; translate: 0 8px; transition: opacity 0.45s, translate 0.55s var(--bounce); }
.anim .dm-dot.on { transform: scale(1); }
.anim .dm-stop.on { opacity: 1; translate: 0 0; }

/* ---------- 10 · RSVP ---------- */
.s-rsvp { min-height: 760px; }
.r-band { height: 240px; display: flex; align-items: flex-start; justify-content: center; padding-top: 28px; }
.r-panel { min-height: 520px; padding: 104px 30px 40px; color: var(--on-accent); background: var(--accent) var(--grain); background-size: 256px 256px; }
#rsvpForm { display: flex; flex-direction: column; gap: 14px; }
.r-opts { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.r-opts label { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.box { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex-shrink: 0; border: 1.5px solid var(--on-accent); border-radius: 2px; background: transparent; display: grid; place-content: center; }
.box:checked::after { content: ""; width: 10px; height: 10px; background: var(--on-accent); transform: rotate(-4deg); animation: tick 0.3s var(--bounce); }
@keyframes tick { from { transform: scale(0) rotate(-4deg); } }
.r-field { font-size: 12px; }
.line { display: block; width: 100%; border: 0; border-bottom: 1px solid rgb(var(--on-accent-rgb) / 0.6); border-radius: 0; background: transparent; padding: 6px 0; font: inherit; font-size: 16px; color: var(--on-accent); }
.line:focus { outline: none; border-bottom-color: var(--on-accent); }
.btn-outline { margin-top: 6px; height: 50px; border: 1px solid var(--on-accent); border-radius: 3px; background: transparent; color: var(--on-accent); font-size: 16px; letter-spacing: 0.3em; transition: transform 0.25s var(--bounce); }
.btn-outline:active { transform: scale(0.97); }
.btn-outline[disabled] { opacity: 0.6; }
.r-error { min-height: 1em; font-size: 13px; font-weight: 600; text-decoration: underline; }
.r-error:empty { display: none; }
.r-note { text-align: center; font-size: 12px; line-height: 1.7; }
.r-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; text-align: center; }
.r-done-en { font-family: var(--script); font-size: 40px; line-height: 1; color: var(--glow); }
.r-done-cn { font-size: 18px; font-weight: 600; letter-spacing: 0.2em; }
.r-done-sum { font-size: 14px; line-height: 1.8; }
.r-done .btn-outline { width: 100%; margin-top: 12px; }
.ticket { position: absolute; left: 20px; top: 136px; width: 350px; height: 176px; display: flex; background: var(--paper-raised); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); transform: rotate(-1.5deg); will-change: transform; }
.t-main { flex: 1; padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.t-en { font-family: var(--script); font-size: 40px; line-height: 1; color: var(--accent); }
.t-cn { font-size: 19px; font-weight: 600; letter-spacing: 0.16em; }
.t-dl { margin-top: auto; font-size: 12px; line-height: 1.6; color: var(--ink-muted); }
.t-stub { width: 54px; padding: 12px 0; border-left: 1.5px dashed rgb(var(--ink-rgb) / 0.35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.t-bar { width: 24px; height: 90px; background-image: repeating-linear-gradient(0deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 13px); }
.t-no { writing-mode: vertical-rl; font-family: var(--caps); font-size: 12px; letter-spacing: 0.12em; }

/* ---------- 11 · your invitation (pinned scene) ---------- */
.s-card { height: calc(var(--vhc, 800px) * 1.7); overflow: visible; }
.cs-stage { position: sticky; top: 0; height: var(--vhc, 800px); min-height: 640px; padding: 24px 28px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.cs-stage > .cs-after { margin-bottom: 0; }
.cs-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 58%, rgb(var(--shadow-rgb) / 0) 38%, rgb(var(--shadow-rgb) / 0.26) 100%); opacity: 0; }
.cs-stage .sh { align-self: stretch; border-bottom: none; position: relative; }
.printer { position: relative; z-index: 3; width: 314px; height: 44px; margin-top: 22px; border-radius: 10px; background: var(--deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -3px 6px rgba(0, 0, 0, 0.25), 0 10px 20px rgb(var(--shadow-rgb) / 0.28); will-change: transform; }
.pr-led { position: absolute; left: 14px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led); animation: led 1.2s steps(2) infinite; }
@keyframes led { 50% { opacity: 0.35; } }
.printer.printing .pr-led { animation-duration: 0.4s; }
.pr-name { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-family: var(--caps); font-size: 8.5px; letter-spacing: 0.3em; color: rgb(var(--light-rgb) / 0.5); }
.pr-slot { position: absolute; left: 16px; right: 16px; bottom: 8px; height: 5px; border-radius: 3px; background: rgb(0 0 0 / 0.45); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.feed { position: relative; z-index: 2; width: 330px; height: 480px; margin-top: -11px; clip-path: inset(0 -100px -200px -100px); }
.card-move { position: absolute; left: 22px; top: 0; width: 286px; transform-origin: 50% 0; will-change: transform; }
.card { position: relative; width: 286px; padding: 14px 14px 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--paper-raised) var(--grain); background-size: 256px 256px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 12px 28px rgb(var(--shadow-rgb) / 0.22); overflow: hidden; }
.card-photo { width: 100%; height: 196px; }
.card-frame { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.card-frame svg { display: block; }
.card-names { margin-top: 8px; font-size: 36px; line-height: 1; color: var(--accent); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.card-script { font-family: var(--script); font-size: 22px; line-height: 1; color: var(--ink-muted); }
.card-invite { margin-top: 4px; font-size: 13px; letter-spacing: 0.1em; }
.card-date { display: flex; align-items: baseline; gap: 8px; font-family: var(--caps); font-size: 19px; letter-spacing: 0.06em; }
.cd-cn { font-family: var(--serif); font-size: 13px; letter-spacing: 0; }
.card-venue { font-size: 12px; color: var(--ink-muted); }
.card-sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 62%); background-size: 260% 100%; background-position: 130% 0; }
.card-img { position: absolute; z-index: 3; left: -28px; top: -28px; width: 342px; max-width: none; -webkit-touch-callout: default; }
.card-move.printed .card, .card-move.printed .card-pm { visibility: hidden; }
.card-move.printed { filter: drop-shadow(0 10px 14px rgb(var(--shadow-rgb) / 0.22)); }
/* the postmark, same as the envelope's, inked onto the card: a card-sized canvas drawn by app.js (composePm) */
.card-pm { position: absolute; z-index: 2; left: 0; top: 0; width: 286px; transform: scale(1.45); opacity: 0; pointer-events: none; }
.cs-after { position: relative; z-index: 3; margin-top: -24px; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.6s var(--bounce); }
.cs-after.on { opacity: 1; transform: none; }
.c-hint { font-size: 14px; letter-spacing: 0.1em; }
.c-links { display: flex; gap: 6px; }
.link { border: 0; background: none; padding: 10px; font-size: 13px; color: var(--accent); text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: max-content; max-width: min(340px, calc(100vw - 32px)); margin: 0; padding: 11px 16px; border-radius: 10px; background: var(--deep); color: var(--on-accent); font-size: 14px; line-height: 1.6; text-align: center; box-shadow: 0 8px 22px rgb(var(--shadow-rgb) / 0.3); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 0.3s, transform 0.4s var(--bounce); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 12 · sign-off ---------- */
.s-sign { height: 240px; padding: 64px 30px 0; color: var(--on-accent); background: var(--accent) var(--grain); background-size: 256px 256px; }
.sg-en { font-family: var(--script); font-size: 48px; line-height: 1; }
.sg-cn { margin-top: 14px; font-size: 17px; font-weight: 600; letter-spacing: 0.3em; }

.file-warn { position: fixed; left: 12px; right: 12px; top: 12px; z-index: 30; margin: 0 auto; max-width: 420px; padding: 12px 14px; border-radius: 8px; background: var(--deep); color: var(--on-accent); font-size: 14px; line-height: 1.6; box-shadow: 0 8px 20px rgb(var(--shadow-rgb) / 0.3); }

/* ---------- map sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgb(var(--scrim-rgb) / 0); transition: background 0.35s; }
.sheet.open { background: rgb(var(--scrim-rgb) / 0.45); }
.sheet-panel { width: min(440px, 100%); padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; background: var(--paper-raised); border-radius: 14px 14px 0 0; transform: translateY(110%); transition: transform 0.5s cubic-bezier(.32, 1.32, .5, 1); }
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet.closing .sheet-panel { transition: transform 0.3s cubic-bezier(.5, 0, .75, 0); }
.sheet-grip { align-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--hairline); }
.sheet-title { padding: 6px 0 8px; text-align: center; font-size: 14px; color: var(--ink-muted); }
.sheet-item, .sheet-cancel { display: flex; align-items: center; justify-content: center; min-height: 50px; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 16px; text-decoration: none; transition: transform 0.2s var(--bounce); }
.sheet-item:active { transform: scale(0.97); }
.sheet-cancel { margin-top: 4px; background: transparent; color: var(--ink-muted); }

/* ---------- reduced motion: everything rests in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .s-card { height: auto; }
  .cs-stage { position: static; height: auto; min-height: 0; padding-bottom: 48px; }
}
