/* =====================================================================
   Thiệp cưới Hồng Phúc & Nguyễn Phương — bố cục "minimalism đỏ đô"
   Nền giấy trải toàn màn hình; nội dung trong cột --col (điện thoại: toàn chiều rộng; máy tính ≈ 60vw, tối đa 1100px).
   Hoa: tranh thực vật cổ ghép (tools/make_bouquet.py); dấu sáp: ảnh dựng từ bản đồ độ cao (tools/make_seal.py).
   ===================================================================== */
:root {
  --wine: #5A1620;
  --wine-2: #5E1720;
  --wine-d: #3E0E13;
  --ivory: #ECE4D8;
  --ivory-70: rgba(236, 228, 216, .72);
  --ivory-40: rgba(236, 228, 216, .4);
  --page: #FFF7EB;
  --ink: #511419;
  --ink-80: rgba(81, 20, 25, .82);
  --gold: #B8925A;
  --gold-line: rgba(184, 146, 90, .7);
  --col: min(100vw, max(30rem, 60vw), 1100px);
  /* nhịp khoảng cách: 0.5 · 0.75 · 1 · 1.5 · 2.5 · 3 · 4 rem */
  --sp-sec: 3rem;
  /* CHỈ 3 vai chữ:
     display = Viaoda Libre (serif tương phản cao của bìa) — tiêu đề mục: chữ hoa nhỏ, giãn .18em, nét Regular
     script  = Great Vibes — chỉ ở hero, ảnh chuyển cảnh, màn kết (và chữ ký thư tay); letter-spacing luôn 0
     body    = Source Serif 4 (nét mảnh) 16px / 1.6
     (Pinyon Script chỉ dùng vẽ monogram PP trong SVG) — cả ba đều có bộ dấu tiếng Việt. */
  --f-title: "Viaoda Libre", Georgia, serif;
  --f-body: "Source Serif 4", Georgia, "Noto Serif", serif;
  --f-name: "Viaoda Libre", Georgia, serif;
  --f-script: "Pinyon Script", cursive;
  --f-flow: "Great Vibes", "Pinyon Script", cursive;
  --f-soft: "Source Serif 4", Georgia, "Noto Serif", serif;
  /* hạt giấy: nhiễu fractal (SVG tự sinh) */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .28 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .05' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  /* hạt giấy rất nhẹ (~3–4%) cho nền đỏ đô phẳng */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .94 0 0 0 0 .88 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --ease-reveal: cubic-bezier(.25, .46, .45, .94);
  --card-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
/* 1rem = 16px trên điện thoại; trên máy tính phóng to theo chiều rộng (giới hạn theo chiều cao để bìa + Save the Date vừa một màn hình) */
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
@media (min-width: 700px) {
  html { font-size: clamp(16px, min(calc(8px + .9vw), 2.25vh), 28px); }
  @supports (height: 1svh) { html { font-size: clamp(16px, min(calc(8px + .9vw), 2.25svh), 28px); } }
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--f-body); font-weight: 300; font-size: 1rem; line-height: 1.6;
  background: #2A090E radial-gradient(120% 70% at 50% 0%, #5A1621 0%, #350B11 55%, #22070B 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { max-width: 100%; }
h1, h2, h3, p, ol, figure { margin: 0; }
p { text-wrap: pretty; }
h1, h2, h3, .announce, .when-where, .party-lead, .lunar, .th-text, .il-small, .ig-text, .venue-addr, .day2-note { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid #B58B2F; outline-offset: 0.1875rem; }
.hp { position: absolute !important; left: -624.9375rem; width: 1px; height: 1px; opacity: 0; }
.only-touch { display: none; }
@media (hover: none), (pointer: coarse) { .only-mouse { display: none; } .only-touch { display: inline; } }

/* ---------- khung trang ---------- */
.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--page);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}
.paper {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--noise);
  mix-blend-mode: multiply; opacity: .35;
}
@keyframes drFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.5rem); } }

/* =====================================================================
   MÀN BÌA
   ===================================================================== */
.cover {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* nhung đỏ đô: sáng ở giữa, tối dần ra mép (vignette) */
  background:
    var(--card-noise),
    radial-gradient(110% 85% at 50% 42%, #7C1F2A 0%, #62161F 38%, #461017 70%, #2C080C 100%);
  box-shadow: inset 0 0 9rem rgba(10, 0, 2, .55);
  overflow: hidden;
  transition: opacity .7s ease;
}
.cover.is-fading { opacity: 0; pointer-events: none; }
.cover-hearts { position: absolute; inset: 0; pointer-events: none; }
.cover-hearts i {
  position: absolute; top: -2.5rem; width: var(--s); height: var(--s);
  border-radius: 50%; opacity: var(--o);
  background: radial-gradient(circle, rgba(var(--c), .75) 0%, rgba(var(--c), .25) 45%, rgba(var(--c), 0) 70%);
  animation: heartFall var(--d) linear var(--delay) infinite;
}
@keyframes heartFall {
  0% { transform: translate(0, 0) rotate(0); }
  100% { transform: translate(var(--dx), 110vh) rotate(var(--r)); }
}
.cover-card {
  position: relative; z-index: 2;
  width: min(19.375rem, 80vw);
  animation: envelopeFloat 4.5s ease-in-out infinite;
  cursor: pointer;
}
.cc-paper {
  position: relative;
  padding: 1.25rem 1.625rem 2.75rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--fibre), var(--noise), linear-gradient(160deg, #FCF7F0 0%, #F6EDE3 55%, #F1E6DA 100%);
  border-radius: 0.375rem;
  /* mép giấy: viền tối mềm phía trong + ánh sáng mép + bóng đổ hai lớp */
  box-shadow:
    inset 0 0 1rem rgba(140, 96, 72, .2), inset 0 0 0.18rem rgba(140, 96, 72, .28), inset 0 1px 0 rgba(255, 255, 255, .8),
    0 1.6rem 3.5rem rgba(0, 0, 0, .42), 0 0.3rem 0.8rem rgba(0, 0, 0, .28);
  overflow: hidden;
}
.cover-card.dwell .cc-paper { transition: box-shadow .3s; box-shadow: 0 1.875rem 4.375rem rgba(0, 0, 0, .55), 0 0 0 0.1875rem rgba(236, 228, 216, .25); }
@keyframes envelopeFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.75rem); } }
@keyframes envelopeAway {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  15% { transform: translateY(0.625rem) rotate(.5deg); opacity: 1; }
  100% { transform: translateY(-120vh) rotate(-2deg); opacity: 0; }
}
.cover-card.is-away { animation: envelopeAway 1.1s cubic-bezier(.5, 0, .75, .35) forwards; }
.cc-seal { position: relative; width: 4.75rem; animation: sealPulse 2.6s ease-in-out infinite; }
.cc-seal .ring {
  position: absolute; inset: 10%; border-radius: 50%; border: 2px solid rgba(124, 23, 36, .55);
  opacity: 0; pointer-events: none;
}
@keyframes sealPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes sealBreak {
  0% { transform: scale(1) rotate(0); opacity: 1; filter: brightness(1); }
  30% { transform: scale(1.15) rotate(5deg); opacity: .9; filter: brightness(1.3); }
  60% { transform: scale(1.05) rotate(-3deg); opacity: .5; filter: brightness(1.5); }
  100% { transform: scale(0) rotate(15deg); opacity: 0; filter: brightness(2); }
}
@keyframes sealRing { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(2.5); opacity: 0; } }
.cc-seal.is-breaking { animation: sealBreak .7s ease-in forwards; }
.cc-seal.is-breaking .ring { animation: sealRing .9s ease-out forwards; }
.cc-seal.is-breaking .ring.r2 { animation-delay: .18s; }
.cc-names {
  margin-top: 1.875rem; display: flex; flex-direction: column; align-items: center;
  font: 400 2rem/1.2 var(--f-name); color: #4A1218; white-space: nowrap;
}
.cc-amp { font: 400 1.25rem/1 var(--f-name); margin: 2px 0 0.25rem; }
.cc-rule { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.125rem; color: #6A2A32; }
.cc-rule i { width: 2.375rem; height: 1px; background: currentColor; opacity: .7; }
.cc-rule b { font: 400 0.8rem/1 "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; color: #A8823C; }
.cc-date { margin-top: 0.75rem; font: 400 1.125rem/1.3 var(--f-soft); color: #6E3A41; white-space: nowrap; }
.cc-to { margin-top: 1.5rem; font: 400 1rem/1.3 var(--f-soft); color: #6E3A41; }
.cc-guest { margin-top: 0.25rem; font: 400 1.75rem/1.25 var(--f-name); text-wrap: balance; color: #4A1218; max-width: 100%; overflow-wrap: anywhere; }
.cc-btn {
  position: relative; overflow: hidden;
  margin-top: 1.5rem; min-width: 9.5rem; min-height: 3rem; padding: 0 1.75rem;
  border: 0; border-radius: 62.4375rem;
  font: 600 1.0625rem/1 var(--f-soft); color: #F6EEE4;
  background: linear-gradient(180deg, #67141F 0%, #4E0E17 100%);
  box-shadow: 0 0.5rem 1.125rem rgba(81, 20, 25, .3);
  transition: transform .2s;
}
.cc-btn::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-12deg); animation: sheen 3.2s ease-in-out infinite;
}
.cc-btn span { position: relative; }
.cc-btn:hover { transform: scale(1.03); }
@keyframes sheen { 0%, 55% { left: -40%; } 100% { left: 120%; } }
.cover-hint {
  position: absolute; bottom: max(1.75rem, env(safe-area-inset-bottom)); left: 0; right: 0;
  text-align: center; font: italic 400 0.875rem/1.4 var(--f-soft); color: rgba(246, 238, 228, .82);
  transition: opacity .3s;
}
.cover.is-opening .cover-hint { opacity: 0; }

/* =====================================================================
   1. SAVE THE DATE
   ===================================================================== */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 1.5rem 1.25rem 2rem;
}
.hero > * { position: relative; z-index: 1; }
.std {
  font: 400 clamp(2.7rem, 14.4vw, 3.6rem)/1.3 var(--f-flow); letter-spacing: 0; color: #5A1118; white-space: nowrap;
  padding: 0 0.2em; margin-bottom: -0.25rem;
  text-shadow: 0 1px 0 rgba(255, 246, 230, .9), 0 0.15rem 0.6rem rgba(181, 139, 47, .22);
}
.std .ch { display: inline-block; }
/* ảnh polaroid nhô cao ~44% bề rộng phong bì → chừa chỗ bằng padding-top (theo % bề rộng) */
.env-wrap { margin-top: 0.25rem; width: min(100%, calc((100vh - 22rem) / 1.39)); width: min(100%, calc((100svh - 22rem) / 1.39)); }
.env { position: relative; aspect-ratio: 333 / 384; margin-top: 20%; }
/* bóng tiếp xúc dưới đáy phong bì */
.env::after {
  content: ""; position: absolute; left: 3%; right: 3%; bottom: -0.55rem; height: 1.1rem; z-index: 5;
  border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, rgba(45, 10, 14, .42), rgba(45, 10, 14, 0) 70%);
  filter: blur(2px);
}
.env-back {
  position: absolute; left: 0; right: 0; top: 40%; bottom: 0; z-index: 10;
  border-radius: 0.3rem;
  background: var(--fibre), var(--card-noise), linear-gradient(180deg, #2E070D 0%, #430D16 22%, #4A1019 100%);
  box-shadow: inset 0 0.6rem 0.9rem -0.4rem rgba(0, 0, 0, .55), 0 0.9rem 1.5rem -0.5rem rgba(40, 8, 12, .5);
}
/* nắp sau đã mở: mép giấy sáng + lớp lót in hoa (ảnh hoa thật, in tông đỏ đô) */
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 41.5%; z-index: 10;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  background: var(--card-noise), linear-gradient(165deg, #93303D 0%, #6E1C28 55%, #5A1620 100%);
}
.env-flap::before {
  content: ""; position: absolute; inset: 0.32rem 0.55rem 0;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  background:
    var(--fibre),
    linear-gradient(180deg, rgba(20, 2, 6, .05) 0%, rgba(20, 2, 6, .1) 70%, rgba(20, 2, 6, .55) 100%),
    url("../assets/flowers/spray-leaves-b.webp") 50% 0 / 6rem auto repeat,
    #5B1823;
  background-blend-mode: normal, multiply, luminosity, normal;
}
.env-flap::after {
  /* chỉ vàng in dọc mép lớp lót */
  content: ""; position: absolute; inset: 0.32rem 0.55rem 0;
  clip-path: polygon(0 100%, 50% 0, 100% 100%, calc(100% - 2px) 100%, 50% 3px, 2px 100%);
  background: rgba(214, 176, 112, .55);
}
.env-photo { position: absolute; left: 40%; top: -10%; width: 55%; z-index: 20; }
.float-a { animation: drFloat 6.5s ease-in-out .4s infinite; will-change: transform; }
.env-frame {
  aspect-ratio: 221 / 309; transform: rotate(12deg); overflow: hidden;
  border: 0.4375rem solid #fff; border-bottom-width: 0.9rem; background: #fff;
  box-shadow: 0.15rem 0.3rem 0.6rem rgba(40, 6, 10, .3), 0 0 1px rgba(0, 0, 0, .2);
}
/* ảnh ngang 4:3 cắt riêng (hero-02-*): hiện trọn cặp đôi + biển tên; Ken Burns rất nhẹ (≤1.06) */
.env-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kb { animation: kenBurns 12s ease-in-out infinite alternate; transform-origin: 45% 70%; will-change: transform; }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.06); } }
/* mặt trước: hai vạt bên + vạt đáy, mép bo nhẹ, bóng mềm ở nếp gấp */
.env-front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 57%; z-index: 30;
  overflow: hidden; border-radius: 0 0 0.3rem 0.3rem;
  filter: drop-shadow(0 -1px 1.5px rgba(0, 0, 0, .3));
}
.env-front::before {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 0, 33% 45%, 67% 45%, 100% 0, 100% 100%, 0 100%);
  background:
    var(--fibre), var(--card-noise),
    linear-gradient(118deg, rgba(255, 225, 225, .07) 0%, rgba(255, 225, 225, 0) 30%),
    linear-gradient(242deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 0) 32%),
    linear-gradient(180deg, #6E1B28 0%, #5C1620 100%);
}
.env-bottom {
  position: absolute; inset: 0;
  /* viền sáng mảnh ở mép vạt + bóng đổ lên hai vạt bên */
  filter: drop-shadow(0 -1px 0 rgba(255, 205, 205, .16)) drop-shadow(0 -0.18rem 0.3rem rgba(20, 0, 4, .42));
}
.env-bottom::before {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 100%, 33% 45%, 67% 45%, 100% 100%);
  background:
    var(--fibre), var(--card-noise),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 220, 220, .09), rgba(255, 220, 220, 0) 60%),
    linear-gradient(180deg, #771F2C 0%, #5F1722 100%);
}
.env-seal { position: absolute; left: 50%; top: 68.6%; z-index: 35; width: 19%; transform: translate(-50%, -50%); }

/* ---------- dấu sáp: ảnh dựng sẵn (assets/seal-gold.webp) ---------- */
.wax {
  display: block; width: 100%; height: auto; max-width: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 0.12rem 0.12rem rgba(30, 8, 0, .45)) drop-shadow(0 0.3rem 0.5rem rgba(30, 8, 0, .25));
}
.hero-names { margin-top: 0.5rem; display: flex; flex-direction: column; align-items: center; width: min(100%, 22rem); }
.names {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  font: 400 clamp(2.3rem, 10.5vw, 3.3rem)/1.4 var(--f-flow); letter-spacing: 0; color: var(--ink);
}
/* dòng 1 lệch trái, dòng 2 lệch phải, nghiêng nhẹ như nét viết */
.nm { position: relative; white-space: nowrap; padding: 0 0.15em; }
.nm-1 { align-self: flex-start; margin-left: 4%; rotate: -2deg; }
.nm-2 { align-self: flex-end; margin-right: 2%; rotate: 2deg; margin-top: 0; }
.names-amp { margin: 0.05em 0 0.15em; font: 400 0.6em/1.2 var(--f-flow); color: var(--gold); } /* tách dòng riêng, không chạm chữ trên/dưới */
.hero-date { margin-top: 0.75rem; font: 400 0.875rem/1.4 var(--f-soft); letter-spacing: .32em; color: var(--ink-80); white-space: nowrap; }
.hero-lunar { margin-top: 0.125rem; font: italic 400 0.75rem/1.4 var(--f-soft); color: var(--ink-80); }

/* =====================================================================
   THẺ ĐỎ ĐÔ
   ===================================================================== */
.card-sec { position: relative; z-index: 2; width: min(88%, calc(var(--col) * .9)); margin: 0 auto; padding-block: 1rem; }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  padding: 2.25rem 1.25rem 2.5rem; border-radius: 0.8125rem; text-align: center;
  color: var(--ivory);
  background: var(--grain), #5A1620;
  box-shadow: 0 1.25rem 2.5rem -1.25rem rgba(50, 8, 14, .45), 0 0.25rem 0.75rem -0.25rem rgba(50, 8, 14, .2);
}
.card--r10 { border-radius: 0.625rem; padding: 2.25rem 1.25rem; }
.card-title, .sec-title, .dlg-head h2 {
  font: 400 1rem/1.5 var(--f-title); letter-spacing: .18em; padding-left: .18em; text-transform: uppercase; text-wrap: balance;
}
.card-title { color: var(--ivory); }
/* nét vàng mảnh dưới tiêu đề */
.card-title::after, .sec-title::after { content: ""; display: block; width: 2.25rem; height: 1px; margin: 0.625rem auto 0; background: var(--gold); opacity: .85; }

.families { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 0.75rem; width: 100%; align-items: start; }
.fam { display: flex; flex-direction: column; align-items: center; gap: 0.1875rem; min-width: 0; }
.fam-label { font-size: 0.75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-70); }
.fam-name { font-size: 0.9375rem; font-weight: 400; line-height: 1.45; white-space: nowrap; color: var(--ivory); }
.fam-addr { margin-top: 0.25rem; font-size: 0.75rem; line-height: 1.45; color: var(--ivory-70); text-wrap: balance; }
.fam-rule { width: 1px; height: 3.125rem; align-self: center; background: var(--ivory-40); }
.fam-label { margin-bottom: 0.25rem; }
.announce { font: italic 300 1rem/1.6 var(--f-body); color: var(--ivory-70); white-space: nowrap; }
.couple { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: 100%; }
.c-name {
  min-height: 4rem; display: flex; align-items: center; justify-content: center;
  font: 400 clamp(1.625rem, 8.4vw, 2rem)/3.25rem var(--f-name); white-space: nowrap; color: var(--ivory);
}
.c-role { font-size: 0.75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-70); }
.c-amp { font: 400 1.375rem/1 var(--f-title); color: var(--gold); }
.invite-guest { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.ig-label { font-size: 0.75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-70); }
.ig-name { font: 400 1.75rem/1.25 var(--f-name); text-wrap: balance; }
.ig-text { max-width: 17rem; font: italic 300 1rem/1.55 var(--f-soft); color: var(--ivory-70); }
.lunar { font: italic 300 0.875rem/1.5 var(--f-body); color: var(--ivory-70); margin-top: -0.75rem; }
.party-when { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; }
.pw-time { font: 400 1.75rem/1.2 var(--f-title); color: var(--ivory); }
.pw-time .js-time { font-variant-numeric: lining-nums; }
.pw-date { font: 300 1rem/1.4 var(--f-body); letter-spacing: .04em; color: var(--ivory); }
.countdown { display: grid; grid-template-columns: repeat(3, 4.5rem); gap: 0.75rem; }
.countdown > div { display: flex; flex-direction: column; align-items: center; padding: 0.625rem 0 0.5rem; border: 1px solid rgba(184, 146, 90, .45); border-radius: 0.375rem; }
.countdown b { font: 400 1.625rem/1.1 var(--f-title); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { margin-top: 0.25rem; font-size: 0.6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory-70); }
.countdown .cd-done { grid-column: 1 / -1; border: 0; font-size: 0.875rem; }

.cal { width: 17.5rem; max-width: 100%; padding: 0.375rem 1rem 0.875rem; border-radius: 0.625rem; background: var(--ivory); color: var(--wine); }
.cal-title { padding: 0.625rem 0 0.5rem; font: 400 0.875rem/1.4 var(--f-title); letter-spacing: .18em; text-transform: uppercase; border-bottom: 1px solid rgba(90, 22, 32, .2); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { border-bottom: 1px solid var(--gold-line); }
.cal-dow span { padding: 0.375rem 0; font-size: 0.75rem; font-weight: 400; color: rgba(90, 22, 32, .78); }
.cal-grid { padding: 0.5rem 0.25rem 0; row-gap: 2px; }
.cal-grid span { height: 2rem; display: grid; place-items: center; font-size: 0.8125rem; position: relative; }
.cal-grid .wed { color: #fff; font-weight: 500; font-size: 0.8125rem; }
.cal-grid .wed::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.6rem; height: 1.6rem; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--wine); box-shadow: 0 0 0 2px var(--ivory), 0 0 0 3px rgba(81, 20, 25, .55);
}
.cal-grid .wed b { position: relative; }
.cal-grid .day2::after { content: ""; position: absolute; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px dashed rgba(81, 20, 25, .6); }
/* "Lưu ngày": một nút, mở bảng chọn nhỏ (Tiệc 28.11 / Lễ 29.11 × Google Calendar / .ics) */
.save-date { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 17.5rem; margin-top: -0.5rem; }
.save-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1.25rem;
  border: 1px solid rgba(184, 146, 90, .7); border-radius: 62.4375rem; background: transparent;
  font: 400 0.9375rem/1 var(--f-body); letter-spacing: .02em; color: var(--ivory); transition: background-color .3s;
}
.save-btn:hover, .save-date.is-open .save-btn { background: rgba(184, 146, 90, .16); }
.save-btn svg { width: 1.0625rem; height: 1.0625rem; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.save-menu { width: 100%; margin-top: 0.625rem; padding: 0.25rem 1rem; border-radius: 0.5rem; background: var(--ivory); color: var(--wine); text-align: left; box-shadow: 0 0.75rem 1.5rem -0.75rem rgba(0, 0, 0, .45); }
.save-menu[hidden] { display: none; }
.sm-row { padding: 0.625rem 0 0.25rem; }
.sm-row + .sm-row { border-top: 1px solid rgba(90, 22, 32, .14); }
.sm-t { font: 400 0.75rem/1.4 var(--f-title); letter-spacing: .16em; text-transform: uppercase; color: rgba(90, 22, 32, .8); }
.sm-links { display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
.sm-links a { min-height: 2.5rem; display: inline-flex; align-items: center; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 0.22rem; text-decoration-thickness: 1px; text-decoration-color: var(--gold); cursor: pointer; }
.rsvp { display: flex; flex-direction: column; align-items: center; }
.rsvp-done { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; }
.rsvp-done[hidden] { display: none; }
.pill[hidden] { display: none; }
button.ul-link { padding: 0 0.25rem; border: 0; background: none; font-family: inherit; }
.rsvp-done-t { padding: 0.625rem 1.25rem; border: 1px solid rgba(184, 146, 90, .6); border-radius: 999px; font: 400 0.9375rem/1.3 var(--f-soft); color: var(--ivory); }
.rsvp-done .ul-link { min-height: 2.25rem; font-size: 0.8125rem; color: var(--ivory-70); }
.ul-link {
  min-height: 2.75rem; display: inline-flex; align-items: center;
  font-size: 0.875rem; color: var(--ivory); text-decoration: underline; text-underline-offset: 0.25rem; text-decoration-thickness: 1px;
}
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.5rem; border: 0; border-radius: 62.4375rem;
  font: 500 0.9375rem/1 var(--f-body); letter-spacing: .03em; text-decoration: none;
  transition: transform .2s, background-color .3s;
}
.pill:hover { transform: scale(1.03); }
.pill:disabled { opacity: .6; cursor: progress; }
.pill--ivory { background: var(--ivory); color: var(--wine); }
.pill--wine { background: var(--wine); color: #F3ECE4; }
/* nút chính: vàng cổ #B8925A, chữ đỏ đô */
.pill--gold { gap: 0.5rem; padding: 0 1.75rem; background: #B8925A; color: #5A1620; box-shadow: 0 0.5rem 1.25rem -0.5rem rgba(90, 22, 32, .45); }
.pill--gold:hover { background: #C29D66; }
.pill--gold svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.pill--block { width: 100%; }

/* =====================================================================
   PHẦN NỀN SÁNG (album, địa điểm, quà)
   ===================================================================== */
.plain-sec {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: min(100%, var(--col)); margin-inline: auto;
  padding: var(--sp-sec) 1.5rem;
}
.plain-sec > * { position: relative; z-index: 1; }
.sec-title { color: var(--ink); }

.sec-sub { margin-top: 0.5rem; font-size: 0.875rem; color: var(--ink-80); }

/* album: xem css/album.css (polaroid deck) */

/* địa điểm: thẻ ngà, đường nét vàng mảnh (SVG), ghim = dấu sáp monogram; bản đồ Google chỉ tải khi bấm */
.loc { width: 100%; max-width: 23.5rem; margin-top: 1.5rem; }
.loc-card {
  position: relative; overflow: hidden; padding: 0 1.5rem 1.5rem; text-align: center; color: var(--ink);
  background: var(--noise), linear-gradient(180deg, #FFFBF3 0%, #F8F0E3 100%);
  border: 1px solid var(--gold-line); border-radius: 0.375rem;
  box-shadow: 0 1rem 2rem -1.25rem rgba(60, 14, 20, .35);
}
.loc-card::before { content: ""; position: absolute; inset: 0.375rem; border: 1px solid rgba(184, 146, 90, .3); border-radius: 0.1875rem; pointer-events: none; }
.loc-map { position: relative; margin: 0 -1.5rem; }
.loc-art { display: block; width: 100%; height: auto; aspect-ratio: 360 / 132; color: var(--gold); }
.loc-pin { position: absolute; left: 50%; top: 50%; width: 3.25rem; translate: -50% -50%; }
.loc-name { margin-top: 0.25rem; font: 400 1.5rem/1.3 var(--f-name); color: var(--wine); }
.loc-addr { max-width: 19rem; margin: 0.375rem auto 0; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-80); text-wrap: balance; }
.loc-actions { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; margin-top: 1.25rem; }
.loc-more { color: var(--ink-80); text-decoration-color: var(--gold); font-size: 0.875rem; }
.map-embed { position: relative; height: 16rem; margin-top: 0.75rem; overflow: hidden; border: 1px solid var(--gold-line); border-radius: 0.375rem; background: #EFE5D8; }
.map-embed[hidden] { display: none; }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .8s ease; }
.map-embed.is-live iframe { opacity: 1; }

/* nút "Xác nhận tham dự" thứ hai, ngay sau lịch trình */
.cta-again { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.25rem 1.5rem 0.5rem; text-align: center; }
.cta-note { font: italic 300 0.9375rem/1.5 var(--f-body); color: var(--ink-80); }

/* lịch trình */
.card--sched { gap: 1rem; padding: 2.25rem 1.5rem; }
.timeline {
  display: grid; grid-template-columns: minmax(0, 1fr) 1rem minmax(0, 1fr);
  column-gap: 1.375rem; row-gap: 2rem; width: 100%; max-width: 28.75rem;
  margin-top: 0.75rem; padding: 0; list-style: none;
}
.timeline li { display: contents; }
.tl-time { text-align: right; font: 400 1rem/1.25 var(--f-title); letter-spacing: .03em; font-variant-numeric: tabular-nums; color: var(--ivory); }
.tl-time small { display: block; margin-top: 0.1875rem; font: 300 0.75rem/1.4 var(--f-body); letter-spacing: .02em; color: var(--ivory-70); }
.tl-time .tl-lunar { margin-top: 0; font-style: italic; }
.tl-dot { position: relative; display: flex; align-items: center; justify-content: center; align-self: stretch; }
.tl-dot::before { content: ""; position: absolute; left: 50%; width: 1px; transform: translateX(-50%); top: -2rem; bottom: -2rem; background: var(--ivory-40); }
.timeline li:first-child .tl-dot::before { top: 50%; }
.timeline li:last-child .tl-dot::before { bottom: 50%; }
.tl-dot i { position: relative; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--ivory); box-shadow: 0 0 0 0.1875rem rgba(236, 228, 216, .15); }
.tl-what { text-align: left; font-size: 0.875rem; line-height: 1.4; color: var(--ivory-70); }
.tl-what b { display: block; font-size: 1rem; font-weight: 400; color: var(--ivory); }
.day2-note { max-width: 21rem; margin-top: 0.5rem; font: italic 300 1rem/1.6 var(--f-soft); color: var(--ivory-70); }

/* =====================================================================
   SỔ LƯU BÚT
   ===================================================================== */
.guestbook { position: relative; z-index: 1; width: min(100%, var(--col)); margin-inline: auto; padding: var(--sp-sec) 1.5rem; }
.note {
  position: relative; z-index: 1; padding: 2.5rem 1.625rem 1.625rem; text-align: center;
  background: var(--noise), linear-gradient(180deg, #FFFDF8 0%, #F9F2E7 100%);
  border-radius: 0.1875rem; box-shadow: 0.25rem 0.25rem 0.25rem rgba(0, 0, 0, .22);
}
.note-wrap { position: relative; max-width: 21.25rem; margin: 0 auto; }
.note-wrap::before {
  content: ""; position: absolute; inset: 0; border-radius: 0.1875rem;
  background: #F1E6D5; transform: rotate(2.6deg); box-shadow: 0.1875rem 0.25rem 0.375rem rgba(0, 0, 0, .16);
}
.gb-form { display: flex; flex-direction: column; gap: 0.875rem; max-width: 17.5rem; margin: 1.375rem auto 0; text-align: left; }
.gb-form input, .gb-form textarea, .field input, .field select {
  width: 100%; min-height: 2.75rem; padding: 0.6875rem 1rem;
  border: 1px solid var(--wine); border-radius: 0.5rem; background: transparent; color: var(--wine);
  font: 400 0.9375rem/1.4 var(--f-body);
}
.gb-form textarea { height: 4.75rem; resize: none; }
::placeholder { color: rgba(81, 20, 25, .72); }
[aria-invalid="true"] { border-color: #A3122A !important; box-shadow: 0 0 0 2px rgba(163, 18, 42, .18); }
.gb-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.icon-btn { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 0; border-radius: 0.625rem; background: rgba(81, 20, 25, .1); color: var(--wine); transition: transform .2s; }
.icon-btn:hover { transform: scale(1.08); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.form-msg { min-height: 1.2em; font: italic 400 0.8125rem/1.5 var(--f-soft); color: var(--wine); text-align: center; }
.form-msg:empty { min-height: 0; }
.wall {
  max-width: 21.25rem; max-height: 26.875rem; margin: 2.875rem auto 0; padding-right: 0.25rem;
  display: flex; flex-direction: column; gap: 0.75rem; overflow-y: auto; overscroll-behavior: contain;
}
.wish { padding: 0.875rem 1rem; border: 1px solid rgba(81, 20, 25, .33); border-radius: 0.5rem; background: rgba(255, 255, 255, .55); font-size: 0.9375rem; line-height: 1.6; color: var(--ink); }
.wish header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.625rem; }
.wish b { font-weight: 500; }
.wish time { font-size: 0.75rem; color: var(--ink-80); white-space: nowrap; }
.wish p { margin-top: 0.375rem; overflow-wrap: anywhere; }
.wall-empty { text-wrap: balance; text-align: center; font: italic 400 0.9375rem/1.6 var(--f-soft); color: var(--ink-80); }

/* =====================================================================
   HỘP QUÀ MỪNG
   ===================================================================== */

.gbox {
  position: relative; width: 15.625rem; height: 22.3125rem; margin-top: 9rem; padding: 0 0 3rem; /* ≥120px trên hộp: thiệp bật lên không đè tiêu đề */
  display: flex; align-items: flex-end; justify-content: center;
  border: 0; background: none; color: var(--wine);
}
.tw {
  position: absolute; z-index: 20; color: var(--gold); line-height: 1;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif;
  animation: twinkle 2.4s ease-in-out infinite;
}
.tw1 { top: 6%; left: 12%; font-size: 1.3125rem; }
.tw2 { top: 14%; right: 8%; font-size: 0.9375rem; animation-delay: .6s; }
.tw3 { top: 34%; left: 3%; font-size: 0.8125rem; animation-delay: 1.1s; }
.tw4 { top: 24%; right: 3%; font-size: 0.8125rem; animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 50% { opacity: .35; transform: scale(.7) rotate(25deg); } }
.gstack { position: relative; display: block; width: 11.875rem; height: 17.1875rem; }
.gshadow { position: absolute; left: 50%; bottom: -0.375rem; width: 7.875rem; height: 0.6875rem; margin-left: -3.9375rem; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(0.25rem); }
.genv {
  position: absolute; left: 6%; right: 6%; bottom: 0; height: 80%; display: block;
  border-radius: 0.375rem;
  background: var(--card-noise), linear-gradient(180deg, #3F0C14, #330910);
  transition: transform .8s cubic-bezier(.3, 1.3, .5, 1), rotate .8s cubic-bezier(.3, 1.3, .5, 1);
}
.genv--back {
  z-index: 1; transform-origin: 50% 100%;
  transform: translateX(20%) translateY(-10%) scale(-.8, .8) rotate(-15deg);
  background: var(--card-noise), linear-gradient(180deg, #6A1A26, #561520);
  filter: drop-shadow(0 0.5rem 0.875rem rgba(0, 0, 0, .18));
}
.genv--front { z-index: 2; rotate: -10deg; filter: drop-shadow(0 0.625rem 1.125rem rgba(0, 0, 0, .22)); }
.genv-pocket {
  position: absolute; inset: 0; z-index: 3; border-radius: 0.375rem;
  background: var(--grain), linear-gradient(170deg, rgba(255, 225, 225, .06), rgba(255, 225, 225, 0) 40%), #5A1620;
  box-shadow: inset 0 0 0.6rem rgba(20, 0, 4, .25), inset 0 -1px 0 rgba(255, 210, 210, .1);
}
.genv-pocket::after {
  /* nếp gấp hai bên */
  content: ""; position: absolute; inset: 0; border-radius: 0.375rem;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(0, 0, 0, .18) 50%, transparent calc(50% + 1px)) left bottom / 50% 60% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(0, 0, 0, .18) 50%, transparent calc(50% + 1px)) right bottom / 50% 60% no-repeat;
}
.genv-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 52%; z-index: 4;
  transform-origin: 50% 0; transition: transform .7s ease, z-index 0s .35s;
  filter: drop-shadow(0 1px 0 rgba(255, 205, 205, .18)) drop-shadow(0 0.15rem 0.22rem rgba(20, 0, 4, .4));
}
.genv-flap::before {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--grain), radial-gradient(90% 80% at 50% 0%, rgba(255, 225, 225, .07), rgba(255, 225, 225, 0) 70%), #66192A;
}
.genv--back .genv-flap::before { background: linear-gradient(180deg, #74202C, #5C1722); }
.genv-card {
  position: absolute; left: 7%; right: 7%; top: 6%; height: 84%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding-top: 0.875rem;
  border-radius: 0.25rem; background: var(--noise), #FBF5EB; color: var(--wine);
  transition: transform .8s cubic-bezier(.3, 1.2, .5, 1) .15s;
}
.genv-card .mono-svg { width: 4.625rem; height: auto; }
.gc-txt { margin-top: 0.25rem; font: 400 0.75rem/1.3 var(--f-title); letter-spacing: .18em; padding-left: .18em; text-transform: uppercase; }
.genv-seal { position: absolute; left: 50%; top: 52%; z-index: 5; width: 3.4rem; margin: -1.7rem 0 0 -1.7rem; transition: opacity .3s, transform .3s; }
.ghint { position: absolute; bottom: 0.5rem; left: 50%; transform: translateX(-50%); white-space: nowrap; font: italic 400 0.875rem/1.4 var(--f-soft); color: var(--wine); transition: opacity .4s, visibility 0s .4s; }
.gift-sec.open .ghint { opacity: 0; visibility: hidden; }
.gift-sec.open .genv-flap { transform: rotateX(180deg); z-index: 1; }
.gift-sec.open .genv--front .genv-flap { transition: transform .7s ease, z-index 0s .3s; }
.gift-sec.open .genv-seal { opacity: 0; transform: scale(.4); }
.gift-sec.open .genv-card { transform: translateY(-64%); }
.gift-sec.open .genv--front { rotate: -4deg; }
.gift-sec.open .genv--back { transform: translateX(34%) translateY(-6%) scale(-.8, .8) rotate(-22deg); }
.gift-panel { display: grid; grid-template-rows: 0fr; width: 100%; transition: grid-template-rows .7s ease; }
.gift-panel > .gifts { overflow: hidden; min-height: 0; }
.gift-sec.open .gift-panel { grid-template-rows: 1fr; }
.gifts { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.125rem; }
.gcard { width: 9.75rem; display: flex; flex-direction: column; align-items: center; padding-top: 0.75rem; color: var(--ink); }
.gcard h3 { min-height: 2.6em; font: 400 0.9375rem/1.3 var(--f-name); color: var(--wine); text-wrap: balance; }
.qr { width: 8.5rem; height: 8.5rem; padding: 0.625rem; display: grid; place-items: center; border-radius: 0.375rem; background: #FBF6EE; border: 1px solid var(--gold-line); }
.qr img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.qr-ph { font-size: 0.75rem; line-height: 1.4; color: var(--ink-80); }
.g-info { margin-top: 0.625rem; font-size: 0.8125rem; line-height: 1.45; }
.g-bank { color: var(--ink-80); }
.g-acc { font: 500 1rem/1.4 var(--f-soft); letter-spacing: .04em; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.g-holder { margin-top: 0.125rem; font: 400 0.6875rem/1.4 var(--f-title); letter-spacing: .14em; color: var(--ink-80); }
.g-memo { margin-top: 0.375rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 0.25rem; font-size: 0.6875rem; line-height: 1.4; color: var(--ink-80); }
.g-memo b { font-weight: 500; color: var(--ink); }
.g-memo-copy { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin: -0.375rem 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--wine); }
.g-memo-copy:hover { background: rgba(81, 20, 25, .09); }
.g-memo-copy svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.g-copy { margin-top: 2px; min-height: 2.75rem; padding: 0 0.875rem; border: 0; border-radius: 62.4375rem; background: rgba(81, 20, 25, .09); color: var(--wine); font-size: 0.8125rem; font-weight: 500; }

/* =====================================================================
   CẢM ƠN
   ===================================================================== */

/* =====================================================================
   HỘP THOẠI XÁC NHẬN
   ===================================================================== */
.dlg {
  width: min(92vw, 25rem); max-height: 90vh; padding: 0; border: 0; border-radius: 1rem; overflow: auto;
  background: var(--page); color: var(--ink); box-shadow: 0 1.875rem 5rem rgba(0, 0, 0, .5);
}
.dlg::backdrop { background: rgba(28, 5, 9, .62); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dlg-head { position: relative; padding: 1.375rem 3.5rem; text-align: center; background: var(--grain), var(--wine); }
.dlg-head h2 { color: #FBF3E8; }
.dlg-head h2::after { display: none; }
.dlg-x { position: absolute; right: 0.5rem; top: 50%; margin-top: -1.375rem; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: rgba(255, 255, 255, .85); }
.dlg-x svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.dlg-body { display: flex; flex-direction: column; gap: 0.875rem; padding: 1.25rem 1.375rem 1.375rem; }
.dlg-lead { font: italic 400 0.9375rem/1.55 var(--f-soft); color: var(--ink-80); text-align: center; }
.field { display: flex; flex-direction: column; gap: 0.375rem; margin: 0; padding: 0; border: 0; font-size: 0.875rem; }
.field > span, .field legend { font-size: 0.875rem; font-weight: 500; padding: 0; margin-bottom: 0.25rem; }
.choice label { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; font-size: 0.9062rem; cursor: pointer; }
.choice input { width: 1.125rem; height: 1.125rem; accent-color: var(--wine); flex: none; }

/* nhạc */
.music {
  position: fixed; z-index: 90; bottom: max(1.125rem, env(safe-area-inset-bottom));
  right: max(0.875rem, calc(50vw - var(--col) / 2 + 0.875rem));
  width: 3.25rem; height: 3.25rem; padding: 0; border-radius: 50%;
  border: 2px solid rgba(236, 228, 216, .55);
  background: radial-gradient(circle at 38% 30%, #7C1724, #4A0C14 70%);
  color: var(--ivory); box-shadow: 0 0.375rem 1.125rem rgba(0, 0, 0, .35);
}
.music[hidden] { display: none; }
.music .disc { display: grid; place-items: center; width: 100%; height: 100%; }
.music .mono-svg { width: 2.125rem; height: auto; }
.music.playing .disc { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.music-tip {
  position: absolute; right: 3.875rem; top: 50%; transform: translateY(-50%); white-space: nowrap;
  padding: 0.5rem 0.875rem; border-radius: 62.4375rem; background: var(--wine); color: #F5EDE3;
  font: 600 0.8125rem/1 var(--f-soft); box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.music.ask .music-tip { opacity: 1; animation: nudge 1.6s ease-in-out infinite; }
.music.ask { animation: ping 1.6s ease-out infinite; }
@keyframes nudge { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(-0.3125rem, -50%); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(236, 228, 216, .5), 0 0.375rem 1.125rem rgba(0, 0, 0, .35); } 100% { box-shadow: 0 0 0 0.875rem rgba(236, 228, 216, 0), 0 0.375rem 1.125rem rgba(0, 0, 0, .35); } }

.toast {
  position: fixed; left: 50%; bottom: 5.375rem; z-index: 120; max-width: min(90vw, 26.25rem);
  padding: 0.6875rem 1.125rem; border-radius: 62.4375rem; background: var(--wine); color: #F5EDE3;
  font-size: 0.875rem; text-align: center; box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, .3);
  transform: translate(-50%, 1.25rem); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }


/* Hiệu ứng luôn bật theo yêu cầu chủ thiệp (kể cả khi Windows tắt "Animation effects"). */

/* Ảnh xoay nghiêng: làm mượt mép (tránh răng cưa ở màn hình thường) */
.env-frame { transform: rotate(12deg) translateZ(0); }

/* =====================================================================
   ẢNH CHÂN DUNG KHUNG VÒM (lễ cưới ↔ áo dài)
   ===================================================================== */
.col { display: contents; }
.arch {
  position: relative; width: min(66%, 14rem); aspect-ratio: 2 / 3; margin: 0 auto;
  border-radius: 999px 999px 0.375rem 0.375rem; overflow: hidden; background: #3A0B10;
  border: 1px solid var(--gold);
  box-shadow: 0 1.25rem 2rem -1rem rgba(0, 0, 0, .45);
}
.arch img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }

/* =====================================================================
   MÁY TÍNH / MÁY TÍNH BẢNG NGANG: cột ~60vw, thẻ hai cột, ảnh chuyển cảnh có nền mờ
   ===================================================================== */
@media (min-width: 900px) {
  /* máy tính: phong bì bên trái, tên bên phải → phong bì & ảnh to hơn mà vẫn vừa một màn hình */
  .hero {
    display: grid; grid-template-columns: auto auto; grid-template-rows: auto 1fr;
    justify-content: center; align-items: center; column-gap: clamp(3rem, 7vw, 8rem); padding: 1.25rem 2rem 2rem;
  }
  .std { grid-column: 1 / -1; }
  .hero-names { width: min(30rem, 34vw); }
  .names { font-size: clamp(3.4rem, 4.6vw, 4.8rem); }
  .std { font-size: 5rem; }
  .env-wrap { width: min(30rem, calc((100vh - 12rem) / 1.39)); width: min(30rem, calc((100svh - 12rem) / 1.39)); margin-top: 0; }

  .card-sec { width: min(94%, var(--col)); padding-block: 1.5rem; }
  .card--2col {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center;
    column-gap: 2.5rem; row-gap: 2rem; padding: 3rem 2.5rem;
  }
  .card--2col > .card-title, .card--2col > .pill, .card--2col > .rsvp { grid-column: 1 / -1; justify-self: center; }
  .card--2col > .col { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; min-width: 0; }
  .card--invite > .families { grid-column: 1 / -1; grid-row: 2; max-width: 38rem; justify-self: center; column-gap: 2rem; }
  /* ảnh vòm & chữ cùng một trục giữa, không còn khoảng trống lớn */
  .card--invite > .col--photo { grid-column: 1; grid-row: 3; justify-content: center; }
  .card--invite > .col--text { grid-column: 2; grid-row: 3; justify-content: center; }
  .card--invite { align-items: center; }
  .card--invite .arch { width: min(100%, 19rem); }
  .card--party > .col:last-of-type { align-self: center; }
  .card--party .cal { width: 19rem; }
  .card--sched { padding: 3rem 3.5rem; }
  .timeline { max-width: 32rem; }

  .loc { max-width: 30rem; }
  .map-embed { height: 20rem; }
  .card-title, .sec-title { font-size: 0.875rem; }

  /* có lời chúc: sổ bên trái, tường lời chúc bên phải; chưa có thì giữ một cột ở giữa */
  .guestbook:has(.wish) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 3rem; align-items: start; }
  .guestbook .note-wrap { max-width: 24rem; width: 100%; }
  .guestbook:has(.wish) .wall { margin: 0; max-width: none; max-height: 30rem; }


}

/* =====================================================================
   MÀN BÌA: các lớp chiều sâu
   ===================================================================== */
.cv-sheen {
  position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 214, 196, .07) 50%, transparent 58%);
  animation: cvSheen 11s ease-in-out infinite alternate; will-change: transform;
}
@keyframes cvSheen { from { transform: translateX(-18%); } to { transform: translateX(18%); } }
.cv-ghost {
  position: absolute; width: min(17rem, 48vw); height: auto; max-width: none; pointer-events: none;
  opacity: .2; filter: blur(6px) saturate(.8); will-change: transform;
  animation: cvDrift 18s ease-in-out infinite alternate;
}
.cv-ghost--tl { left: -9rem; top: -7rem; rotate: 150deg; }
.cv-ghost--br { right: -9rem; bottom: -9rem; rotate: -25deg; animation-delay: -9s; }
@keyframes cvDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(1.5rem, 1rem) scale(1.05); } }
/* cánh hoa rơi: .pt (rơi dọc) > .pt-sway (đung đưa ngang) > .pt-flip (lật X/Y) > img (xoay Z); chỉ transform/opacity */
.pt {
  position: absolute; top: 0; left: 0; width: var(--s); pointer-events: none;
  animation: ptFall var(--d) linear var(--delay) infinite; will-change: transform;
  transition: translate 1.5s cubic-bezier(.2, .7, .3, 1), rotate 1.5s ease-out, opacity 1.3s ease .2s;
}
.pt-sway { display: block; perspective: 22rem; animation: ptSway var(--sw) ease-in-out var(--sd) infinite alternate; }
.pt-flip { display: block; animation: ptFlip var(--fd) linear infinite; }
.pt img { display: block; width: 100%; height: auto; max-width: none; animation: ptSpin var(--zd) linear infinite; }
.pt--far { opacity: .5; filter: blur(1px); }
.pt--mid { opacity: .85; }
.pt--near { opacity: .97; filter: drop-shadow(0 0.35rem 0.35rem rgba(20, 2, 6, .35)); }
@keyframes ptFall { from { transform: translate3d(0, -12vh, 0); } to { transform: translate3d(0, 112vh, 0); } }
@keyframes ptSway { from { transform: translate3d(calc(var(--amp) * -1), 0, 0); } to { transform: translate3d(var(--amp), 0, 0); } }
@keyframes ptFlip { from { transform: rotate3d(var(--fx), var(--fy), .3, 0deg); } to { transform: rotate3d(var(--fx), var(--fy), .3, 360deg); } }
@keyframes ptSpin { from { transform: rotate(0deg); } to { transform: rotate(calc(var(--zr) * 360deg)); } }
/* gió giật: cả đám lệch ngang rồi thả dần */
.cover-hearts, .cover-petals { transition: translate 3.2s cubic-bezier(.3, .6, .3, 1); }
.cover.gusting .cover-hearts { translate: calc(var(--gust, 0rem) * .6) 0; transition-duration: 1.6s; }
.cover.gusting .cover-petals { translate: var(--gust, 0rem) 0; transition-duration: 1.4s; }
/* mở thiệp: cánh hoa xoáy toả ra ngoài */
.cover.swirl .pt { translate: var(--ox, 0) var(--oy, 0); rotate: var(--orot, 360deg); opacity: 0; }
.cover-petals { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.cover-hint { z-index: 6; }

@media (min-width: 900px) {

}

/* an toàn: thuộc tính rotate trên <html> (cờ data-fx-sway của fx.js) sẽ biến <html> thành khối chứa của
   phần tử position:fixed (màn bìa, nút nhạc, toast) → luôn tắt ở gốc */
html[data-fx-sway] { rotate: none !important; }

/* =====================================================================
   ẢNH CHUYỂN CẢNH — nền giấy ngà (không phủ đỏ đô toàn màn hình)
   Điện thoại: ảnh tràn ngang, tan vào giấy ở mép trên/dưới; chữ trên lớp tối mềm chỉ quanh vùng chữ.
   Máy tính: ảnh khung trắng + chữ mực đỏ đô bên cạnh, trên nền giấy.
   ===================================================================== */
.interlude { position: relative; z-index: 1; overflow: hidden; isolation: isolate; height: min(86vh, 150vw); height: min(86svh, 150vw); margin-block: 1.5rem; }
.il-frame { position: absolute; inset: 0; overflow: hidden; }
.il-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 247, 235, 0) 50%, rgba(255, 247, 235, .78) 76%, var(--page) 100%); }
.il-img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; max-width: none; object-fit: cover; object-position: 50% 22%; will-change: transform; }
.il-text {
  position: absolute; left: 50%; bottom: 5%; z-index: 2; translate: -50% 0; width: max-content; max-width: 92%;
  display: flex; flex-direction: column; align-items: center; gap: 0.125rem; text-align: center; color: var(--wine);
}
.il-script { font: 400 clamp(2.6rem, 12vw, 3.25rem)/1.3 var(--f-flow); letter-spacing: 0; white-space: nowrap; }
.il-small { font: italic 300 1rem/1.5 var(--f-soft); color: var(--ink-80); }

/* =====================================================================
   MÀN KẾT — nền giấy ngà; ảnh 08 cắt ngang (trên ghế) thành dải ảnh mép tan; dấu sáp, lời hẹn, chữ ký
   ===================================================================== */
.finale {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 0 3rem; color: var(--ink); text-align: center;
}
/* ảnh màn kết: khung vòm viền vàng 1px (cùng kiểu ảnh vòm ở thẻ lễ cưới), không còn mép mờ */
.fn-photo {
  position: relative; width: min(80%, 22rem); aspect-ratio: 3 / 4; overflow: hidden; margin-inline: auto;
  border: 1px solid var(--gold); border-radius: 999px 999px 0.375rem 0.375rem; background: #EFE5D8;
  box-shadow: 0 1.25rem 2rem -1.25rem rgba(60, 14, 20, .45);
}
.fn-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.fn-body { position: relative; width: min(100%, 30rem); padding: 0 1.5rem; display: flex; flex-direction: column; align-items: center; }
.fn-garland { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 6rem; }
.fn-seal { position: relative; z-index: 3; width: 4.5rem; }
.fn-script { margin-top: 0.75rem; display: flex; flex-direction: column; align-items: center; font: 400 clamp(2.6rem, 12vw, 3.4rem)/1.3 var(--f-flow); letter-spacing: 0; color: var(--wine); }
.fn-script span { font: italic 300 1rem/1.5 var(--f-soft); color: var(--ink-80); text-wrap: balance; }
.fn-rule { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; color: var(--gold); }
.fn-rule i { width: 3rem; height: 1px; background: currentColor; opacity: .8; }
.fn-rule b { font: 400 0.75rem/1 "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; }
.fn-text { margin-top: 1rem; max-width: 21rem; font: italic 300 1rem/1.6 var(--f-soft); color: var(--ink-80); text-wrap: balance; }
.fn-sign { margin-top: 0.75rem; font: 400 clamp(1.75rem, 7.5vw, 2.4rem)/1.35 var(--f-flow); letter-spacing: 0; word-spacing: .1em; color: var(--wine); white-space: nowrap; }
.fn-date { margin-top: 0.25rem; font: 400 0.8125rem/1.4 var(--f-soft); letter-spacing: .32em; color: var(--ink-80); white-space: nowrap; }

@media (min-width: 900px) {
  /* máy tính: ảnh chuyển cảnh vẫn tràn ngang cột, mép thẳng, chân ảnh tan vào giấy ngà */
  .interlude { width: min(100%, var(--col)); margin: 2rem auto; height: min(88vh, 46rem); }
  .il-img { object-position: 50% 26%; }
  .il-script { font-size: 4.25rem; }
  .il-small { font-size: 1.125rem; }
  .fn-photo { width: min(24rem, calc((100vh - 10rem) * .75)); }
  .fn-body { width: min(100%, 36rem); }
  .fn-seal { width: 5.25rem; }
}

/* =====================================================================
   HOA TRANG TRÍ — MỘT HỆ DUY NHẤT: component .floral (js/flora.js dựng ảnh nền + linh kiện lắc lư bên trong,
   cắt gọn trong hộp của nó). Chỉ 3 loại vị trí:
     .floral--hero            cành hoa trong túi phong bì (bên trái, sau vạt trước, sau ảnh)
     .floral--corner-tr / -bl góc thẻ (một góc/thẻ, xen kẽ), nằm TRÊN thẻ như hoa ở phong bì, tràn ~half ra ngoài mép,
                              không chạm chữ (bìa thiệp dùng thêm -tl / -br)
     (không còn cặp hoa đối xứng hai bên tiêu đề — tối đa MỘT cụm mỗi mục, lệch một góc, xoay 6–10°)
   Kích thước chỉ lấy từ token --fl-*.
   ===================================================================== */
:root { --fl-hero: 46%; --fl-corner: 34%; --fl-accent: 18%; }
@media (max-width: 699px) { :root { --fl-corner: 28%; } }
@media (min-width: 700px) { :root { --fl-corner: 22%; } }

.floral { position: absolute; display: block; height: auto; overflow: hidden; pointer-events: none; z-index: 0; }
.floral > .sp-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
.floral .sp-part { position: absolute; display: block; }
.floral .sp-part img {
  display: block; width: 100%; height: auto; max-width: none; transform-origin: 50% 92%;
  animation: spSway 6s ease-in-out infinite alternate; will-change: transform;
}
@keyframes spSway { from { transform: rotate(calc(-1.1deg * var(--boost, 1))); } to { transform: rotate(calc(1.1deg * var(--boost, 1))); } }
.floral .sp-part.d0 img { filter: blur(0.3px); }
.floral { filter: drop-shadow(0.08rem 0.2rem 0.3rem rgba(40, 6, 10, .22)); }
.floral[data-mirror] { scale: -1 1; }

/* phong bì: z giữa lưng phong bì (10) và ảnh (20) / vạt trước (30) */
.floral--hero { left: 0; top: -14%; width: var(--fl-hero); z-index: 14; overflow: visible; }

/* góc thẻ: phần tử anh em đứng trước thẻ trong .card-sec / .note-wrap / .cover-card; thẻ có nền riêng và z cao hơn */
.card-sec > .card, .note-wrap > .note, .cover-card > .cc-paper { position: relative; z-index: 1; }
.floral--corner-tr { top: 0; right: 0; width: var(--fl-corner); translate: 30% -30%; rotate: 8deg; z-index: 3; }
.floral--corner-bl { bottom: 0; left: 0; width: var(--fl-corner); translate: -30% 30%; rotate: -7deg; z-index: 3; }
.floral--corner-tl { top: 0; left: 0; width: var(--fl-corner); translate: -48% -46%; z-index: 3; }
.floral--corner-br { bottom: 0; right: 0; width: var(--fl-corner); translate: 48% 46%; z-index: 3; }

.floral .sp-in, .floral .sp-sw { display: block; }
.card-sec:has(> .floral--corner-tr) { margin-top: 1.5rem; }
.floral.is-var { overflow: visible; }
.floral.is-var .sp-var { position: relative; display: block; }
.floral.is-var .sp-var img { animation-duration: 7s; transform-origin: 50% 100%; }
.fn-script { white-space: nowrap; font-size: clamp(2.2rem, 10vw, 3.4rem); }
.fn-script span { white-space: nowrap; }
.fn-seal { position: relative; width: 4.25rem; margin-top: -2.125rem; z-index: 2; } /* dấu sáp đè lên chân khung vòm */

/* =====================================================================
   PHONG BÌ ẢNH (tranh riêng của cô dâu chú rể: env-back.webp lót ren + env-front.webp túi trước)
   lớp: lưng 10 · ảnh 20 · cành hoa 25 · túi trước 30 · dấu sáp vàng 31 (che dấu tim in sẵn)
   ===================================================================== */
.env-wrap { width: min(78vw, 24rem); }
.env { margin-top: 18%; }
.env::after { display: none; }
.env-img { position: absolute; left: 0; width: 100%; height: auto; max-width: none; display: block; pointer-events: none; user-select: none; }
.env-img--back { top: 0; z-index: 10; filter: drop-shadow(0 0.9rem 1.1rem rgba(40, 8, 12, .32)); }
.env-img--front { bottom: 0; z-index: 30; }
.env-photo { left: 33%; top: -2%; width: 64%; z-index: 20; } /* đúng số đo sample/co-giau.png */
.env-flower { position: absolute; left: -6%; top: -14%; width: 38%; z-index: 25; pointer-events: none; display: block; }
.float-b { display: block; animation: drFloat 5s ease-in-out infinite; will-change: transform; }
.env-flower .floral--hero { position: relative; left: 0; top: 0; width: 100%; rotate: -17deg; z-index: auto; filter: drop-shadow(3px 4px 3px rgba(0, 0, 0, .3)); }
.env-seal { left: 48.8%; top: calc(42.81% + 57.19% * .522); width: 19%; z-index: 31; }
@media (min-width: 900px) { .env-wrap { width: min(28rem, calc((100vh - 12rem) / 1.33)); width: min(28rem, calc((100svh - 12rem) / 1.33)); } }

/* =====================================================================
   THƯ TAY — giấy ngà mép xé (clip-path răng cưa do app.js tạo), chữ nghiêng, ký tên bằng nét script
   ===================================================================== */
.letter-sec { position: relative; z-index: 1; width: min(100% - 2.5rem, 34rem); margin: 0 auto; padding: 1rem 0 2.5rem; }
.letter-sec[hidden] { display: none; }
.letter-wrap { filter: drop-shadow(0 0.75rem 1rem rgba(60, 14, 20, .13)) drop-shadow(0 1px 1px rgba(60, 14, 20, .14)); }
.letter {
  position: relative; padding: 2.5rem 1.875rem 2.25rem;
  background: var(--noise), linear-gradient(172deg, #FFFCF6 0%, #FAF2E5 60%, #F5EADA 100%);
}
.letter::before { content: ""; position: absolute; inset: 0.75rem; border: 1px solid rgba(184, 146, 90, .28); pointer-events: none; }
.letter .sec-title { text-align: center; margin-bottom: 1.375rem; }
.letter-body p { font: italic 300 1.0625rem/1.7 var(--f-body); color: #4E2A2E; text-wrap: pretty; }
.letter-body p + p { margin-top: 0.75rem; }
.letter-sign { margin-top: 1.25rem; text-align: right; font: 400 clamp(1.5rem, 6.6vw, 2rem)/1.3 var(--f-flow); letter-spacing: 0; word-spacing: .08em; white-space: nowrap; color: var(--wine); }
@media (min-width: 900px) {
  .letter-sec { padding: 2rem 0 3.5rem; }
  .letter { padding: 3.25rem 3.25rem 2.75rem; }
}
