/* ==========================================================================
   THIỆP CƯỚI — style.css  (rèm nhung đỏ, lâu đài, hồ thiên nga, hoa hồng cổ điển)
   ========================================================================== */
:root {
  --wine: #511419;        /* trùng màu mã QR */
  --wine-btn: #5c1520;
  --wine-deep: #36090f;
  --rose: #8c1c2c;
  --ink: #4a2326;
  --ink-soft: #6e4b47;
  --tan: #a98a68;
  --line: #dccbb6;
  --paper: #fbf5eb;

  --f-serif: "Cormorant Garamond", "Times New Roman", serif;
  --f-text: "EB Garamond", "Times New Roman", serif;
  --f-script: "Great Vibes", "Segoe Script", cursive;

  --ease: cubic-bezier(.22, .8, .24, 1);
  /* 1% bề ngang thiệp: mọi cỡ trong tranh tính theo đơn vị này để tỉ lệ giữ nguyên trên mọi máy */
  --u: min(1vw, 4.8px);
  --paper-tex: url("assets/mau/giay.webp");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--wine-deep); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--wine-deep) url("assets/mau/rem-nhung.webp") center / cover fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked, body.has-dialog { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--wine); color: #fff; font-size: 1.2rem; z-index: 99; }

/* Lớp hiệu ứng (hoa rơi, chạm bung tim) — nằm trên cùng nhưng không chặn chạm */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* Chữ dùng chung */
.title {
  margin: 0;
  font-family: var(--f-serif); font-size: calc(var(--u) * 6.5); font-weight: 500; line-height: 1.22;
  letter-spacing: .08em; text-transform: uppercase; color: var(--wine);
}
.script { font-family: var(--f-script); font-size: calc(var(--u) * 7.6); line-height: 1.25; color: var(--wine); }
.rule { display: block; width: calc(var(--u) * 46); height: calc(var(--u) * 4.6); margin: calc(var(--u) * 2.6) auto; color: var(--wine); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 24px;
  border: 0; border-radius: 999px;
  background: var(--wine-btn); color: #fbeeda;
  font-family: var(--f-serif); font-size: 1.02rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 14px rgba(81, 20, 25, .28);
  transition: transform .2s var(--ease), background .2s;
}
.btn:hover { background: var(--wine-deep); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .curtain__btn:focus-visible, .slide:focus-visible, .wishbar:focus-visible, .event__map:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.btn--ghost { background: transparent; color: var(--wine); border: 1px solid var(--tan); box-shadow: none; }
.btn--ghost:hover { background: rgba(140, 28, 44, .08); }
.btn--block { width: 100%; }
.btn--grow { flex: 1; min-width: 0; padding-inline: 14px; }
.btn--square { flex: none; width: 46px; padding: 0; border-radius: 50%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ==========================================================================
   RÈM NHUNG
   ========================================================================== */
.curtain { position: fixed; inset: 0; z-index: 50; overflow: hidden; cursor: pointer; }
.curtain__side { position: absolute; top: -2%; bottom: -2%; width: 50.5%; }
.curtain__side::before { content: ""; position: absolute; inset: 0; background: var(--wine-deep) url("assets/mau/rem-nhung.webp") center / cover; }
.curtain__side--l { left: 0; transform-origin: 0 100%; }
.curtain__side--r { right: 0; transform-origin: 100% 100%; }
.curtain__side--r::before { transform: scaleX(-1); }
/* Dải ren: mép sóng hướng vào giữa, hai dải đè lên nhau thành một dải liền khi rèm khép */
.curtain__side i {
  position: absolute; top: 0; bottom: 0; width: 36px;
  background: url("assets/mau/ren-doc.webp") 0 0 / 100% auto repeat-y;
  filter: drop-shadow(0 0 5px rgba(30, 3, 8, .55));
}
.curtain__side--l i { right: -20px; }
.curtain__side--r i { left: -20px; transform: scaleX(-1); z-index: 1; }
.curtain.is-leaving { pointer-events: none; }
.curtain.is-leaving .curtain__side--l { animation: part-l 2.2s cubic-bezier(.6, .02, .3, 1) forwards; }
.curtain.is-leaving .curtain__side--r { animation: part-r 2.2s cubic-bezier(.6, .02, .3, 1) forwards; }
/* Rèm hé từ trên xuống rồi mới kéo hẳn sang hai bên */
@keyframes part-l { 36% { transform: skewX(7deg) translateX(-7%); } 100% { transform: skewX(12deg) translateX(-125%); } }
@keyframes part-r { 36% { transform: skewX(-7deg) translateX(7%); } 100% { transform: skewX(-12deg) translateX(125%); } }

.curtain__btn {
  position: absolute; z-index: 3; left: 50%; bottom: calc(10% + env(safe-area-inset-bottom));
  min-height: 44px; padding: 9px 24px;
  border: 1px solid rgba(251, 235, 214, .78); border-radius: 999px;
  background: rgba(38, 5, 11, .88); color: #fbeeda;
  font-family: var(--f-serif); font-size: .92rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
  animation: breathe 2.8s ease-in-out infinite;
  transition: opacity .4s ease;
}
@keyframes breathe { 50% { box-shadow: 0 0 18px 2px rgba(251, 225, 190, .3); } }
.curtain__invite {
  position: absolute; z-index: 3; left: 50%; top: 32%; transform: translateX(-50%) rotate(-2deg);
  display: grid; place-content: center; gap: 2px;
  width: min(78vw, 340px); aspect-ratio: 700 / 516; padding: 0 9%;
  background: url("assets/mau/giay-note.webp") center / 100% 100% no-repeat;
  text-align: center; color: var(--wine);
  pointer-events: none;
  transition: opacity .4s ease;
}
.curtain__invite span { font-family: var(--f-serif); font-size: .95rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.curtain__invite strong { font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: clamp(1.5rem, 7.4vw, 2.1rem); line-height: 1.2; }
.curtain.is-leaving .curtain__btn, .curtain.is-leaving .curtain__invite { opacity: 0; }

/* ==========================================================================
   THIỆP
   ========================================================================== */
.invite {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: var(--paper) var(--paper-tex);
  box-shadow: 0 0 60px rgba(0, 0, 0, .55);
}

/* ---------- Lâu đài + tên hai bạn ---------- */
.hero { position: relative; z-index: 3; height: 100vh; height: 100svh; min-height: 560px; max-height: 960px; background: #b9b4c4; }
.hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform-origin: 50% 100%; }
body.is-open .hero__photo { animation: settle 8s var(--ease) both; }
@keyframes settle { from { transform: scale(1.1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(38, 14, 18, 0) 26%, rgba(38, 14, 18, .46) 52%, rgba(32, 10, 14, .66) 78%, rgba(32, 10, 14, .5));
  opacity: 0;
}
body.is-open .hero::after { animation: appear 1.6s ease 2.6s forwards; }
@keyframes appear { to { opacity: 1; } }
.hero__text {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(var(--u) * 58);
  text-align: center; color: #fff8ef;
  text-shadow: 0 2px 14px rgba(20, 6, 8, .62);
}
.hero__kicker { font-family: var(--f-serif); font-size: calc(var(--u) * 4.7); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; opacity: 0; }
.hero__names { margin: calc(var(--u) * 1.5) 0 0; font-family: var(--f-serif); font-weight: 500; }
.hero__name { display: block; font-size: calc(var(--u) * 13.4); line-height: 1.12; opacity: 0; }
.hero__amp { display: block; font-family: var(--f-script); font-size: calc(var(--u) * 11); font-weight: 400; line-height: 1; opacity: 0; }
.hero__tagline { margin-top: calc(var(--u) * 1); font-family: var(--f-script); font-size: calc(var(--u) * 7); line-height: 1.2; opacity: 0; }
body.is-open .hero__kicker { animation: rise-in 1.2s var(--ease) 2.8s forwards; }
body.is-open .hero__name:first-child { animation: rise-in 1.2s var(--ease) 3.2s forwards; }
body.is-open .hero__amp { animation: rise-in 1.2s var(--ease) 3.6s forwards; }
body.is-open .hero__name:last-child { animation: rise-in 1.2s var(--ease) 4s forwards; }
body.is-open .hero__tagline { animation: rise-in 1.2s var(--ease) 4.5s forwards; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero__garden { position: absolute; z-index: 3; left: -4%; bottom: calc(var(--u) * -5); width: 108%; max-width: none; pointer-events: none; }

/* ---------- Nền dây hoa chạy dọc hai bên, từ vai khung vòm tới hết phần sự kiện ---------- */
.wall { position: relative; background: var(--paper) var(--paper-tex); }
.wall::before, .wall::after {
  content: ""; position: absolute; top: calc(var(--u) * 100); bottom: 0; width: calc(var(--u) * 30);
  background: url("assets/mau/hoa-cot.webp") 0 0 / 100% auto repeat-y;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 70px, #000 calc(100% - 90px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 70px, #000 calc(100% - 90px), transparent);
  pointer-events: none;
}
.wall::before { left: calc(var(--u) * -3); }
.wall::after { right: calc(var(--u) * -3); transform: scaleX(-1); }

/* ---------- Save the date ---------- */
.save { position: relative; z-index: 1; padding-top: calc(var(--u) * 60); }
.save::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--u) * 118);
  background: url("assets/mau/ho-doc.webp") 50% calc(var(--u) * -14) / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent);
  mask-image: linear-gradient(to bottom, #000 76%, transparent);
}
.save__roses { position: absolute; z-index: 3; left: calc(var(--u) * -15); top: calc(var(--u) * 66); width: calc(var(--u) * 46); max-width: none; pointer-events: none; }
.save__roses--r { left: auto; right: calc(var(--u) * -14); top: calc(var(--u) * 78); width: calc(var(--u) * 38); transform: scaleX(-1); }
.arch {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  width: calc(var(--u) * 88); height: calc(var(--u) * 152.5);
  margin: 0 auto; padding: calc(var(--u) * 47) calc(var(--u) * 10) calc(var(--u) * 8);
  background: url("assets/mau/khung-vom.webp") center / 100% 100% no-repeat;
  text-align: center;
}
.arch__title { font-family: var(--f-serif); font-size: calc(var(--u) * 5); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.arch__date { margin-top: calc(var(--u) * 3); font-family: var(--f-serif); font-size: calc(var(--u) * 13); font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; color: var(--wine); }
.arch__time { margin-top: calc(var(--u) * 2); font-family: var(--f-serif); font-size: calc(var(--u) * 5.2); font-weight: 600; font-variant-numeric: lining-nums; color: var(--ink); }
.arch__place { font-family: var(--f-serif); font-size: calc(var(--u) * 5.2); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.arch__addr { margin-top: calc(var(--u) * 1); font-style: italic; font-size: calc(var(--u) * 4.2); line-height: 1.35; color: var(--ink-soft); text-wrap: balance; }
.arch__seal { width: calc(var(--u) * 50); margin-top: auto; }

/* ---------- Tiệc + lễ ---------- */
.events { position: relative; z-index: 2; padding: 0 calc(var(--u) * 9) calc(var(--u) * 12); text-align: center; }
.event {
  position: relative; z-index: 2;
  margin: 0 auto calc(var(--u) * 3);
  padding: 6px 2px 8px;
  border: 30px solid transparent;
  border-image: url("assets/mau/khung-the.webp") 110 / 30px stretch;
}
.event::before { content: ""; position: absolute; inset: -24px; z-index: -1; background: var(--paper) var(--paper-tex); }
.event__side { margin: 0 0 2px; font-family: var(--f-script); font-size: 1.7rem; line-height: 1.1; color: var(--wine); }
.event__title { margin: 0; font-family: var(--f-serif); font-size: 1.14rem; font-weight: 600; letter-spacing: .06em; line-height: 1.25; text-transform: uppercase; color: var(--ink-soft); }
.event__when { margin-top: 6px; font-family: var(--f-serif); font-size: 1.42rem; font-weight: 600; line-height: 1.2; font-variant-numeric: lining-nums; color: var(--wine); }
.event__when i { padding: 0 .2em; font-style: normal; font-weight: 400; color: var(--tan); }
.event__day { font-size: 1rem; color: var(--ink); }
.event__lunar { font-size: .94rem; font-style: italic; color: var(--ink-soft); text-wrap: balance; }
.event__place { margin-top: 8px; font-family: var(--f-serif); font-size: 1.14rem; font-weight: 600; color: var(--ink); }
.event__addr { font-size: .98rem; line-height: 1.35; color: var(--ink-soft); text-wrap: balance; }
.event__map { display: inline-flex; flex-direction: column; align-items: center; margin-top: 6px; padding: 4px 10px; min-height: 44px; font-size: .94rem; font-style: italic; color: var(--wine); text-decoration: none; }
.event__map svg { width: 20px; height: 20px; }
.event--quote { padding-block: 6px; }
.rings { display: block; width: 58px; height: 46px; margin: 0 auto 6px; color: var(--wine); }
.quote { font-size: 1.04rem; font-style: italic; line-height: 1.5; color: var(--ink); }

.timer { position: relative; z-index: 2; margin-top: calc(var(--u) * 5); padding: 6px 4px 8px; background: var(--paper) var(--paper-tex); }
.timer__title { margin: 0; font-family: var(--f-script); font-size: 2.4rem; font-weight: 400; line-height: 1.2; color: var(--wine); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 300px; margin: 4px auto 0; }
.countdown b { display: block; font-family: var(--f-serif); font-size: 2rem; font-weight: 500; line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; color: var(--wine); }
.countdown span { font-size: .88rem; color: var(--ink-soft); }
.countdown__done { font-size: 1.05rem; font-style: italic; color: var(--ink-soft); }

/* ---------- Chuyện của hai bạn ---------- */
.story { padding: calc(var(--u) * 7) calc(var(--u) * 9) calc(var(--u) * 11); text-align: center; }
.story__flowers { width: calc(var(--u) * 58); margin: 0 auto calc(var(--u) * 1); }
.story__text p { margin-top: calc(var(--u) * 4); font-size: 1.06rem; line-height: 1.62; color: var(--ink); text-wrap: pretty; }

/* ---------- Tấm thiệp trên rèm + lời mời ---------- */
.stage {
  position: relative; height: calc(var(--u) * 112); overflow: hidden;
  background: var(--wine-deep) url("assets/mau/rem-nhung.webp") 50% 40% / 150% auto;
}
.stage::before { /* dải ren vắt ngang đầu tấm rèm */
  content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: calc(var(--u) * 12);
  background: url("assets/mau/ren-ngang.webp") 0 0 / auto 100% repeat-x;
  filter: drop-shadow(0 2px 4px rgba(30, 3, 8, .5));
}
.stage::after { /* mép giấy lượn sóng nhô lên từ phần lời mời */
  content: ""; position: absolute; z-index: 4; left: 0; right: 0; bottom: -1px; height: calc(var(--u) * 15);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath fill='%23fbf5eb' d='M0 60V40q22-14 40-2 16-22 44-14 22-26 56-16 30-12 60-4 30-8 60 4 34-10 56 16 28-8 44 14 18-12 40 2V60Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 -3px 4px rgba(30, 3, 8, .3));
}
.stage__ribbon { /* dải ren dọc treo tấm thiệp */
  position: absolute; z-index: 1; left: 50%; top: calc(var(--u) * -8); bottom: calc(var(--u) * -8); width: calc(var(--u) * 8.5);
  background: url("assets/mau/ren-doc.webp") 0 0 / 100% auto repeat-y;
  transform: rotate(10deg);
  filter: drop-shadow(2px 2px 4px rgba(30, 3, 8, .5));
}
.stage__roses { position: absolute; z-index: 3; left: calc(var(--u) * -8); bottom: calc(var(--u) * 5); width: calc(var(--u) * 62); max-width: none; }
.note.reveal { --r: -4deg; }
.note {
  position: absolute; z-index: 2; right: calc(var(--u) * 6); top: calc(var(--u) * 19);
  display: grid; place-content: center;
  width: calc(var(--u) * 62); aspect-ratio: 700 / 516;
  background: url("assets/mau/giay-note.webp") center / 100% 100% no-repeat;
  text-align: center;
}
.note p { font-family: var(--f-script); font-size: calc(var(--u) * 8.4); line-height: 1.12; color: var(--ink); }
.note .rule { width: calc(var(--u) * 34); height: calc(var(--u) * 3.4); margin: calc(var(--u) * 1) auto 0; color: var(--ink); }
.letter__body { padding: calc(var(--u) * 3) calc(var(--u) * 8) calc(var(--u) * 9); text-align: center; }
.letter__invite { font-size: 1.1rem; line-height: 1.5; color: var(--ink); }
.letter__guest { display: block; margin: 2px 0; font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 2rem; line-height: 1.2; color: var(--wine); }
.parents { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 4); margin-top: calc(var(--u) * 6); }
.family__label { font-family: var(--f-serif); font-size: 1.06rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wine); }
.family__names { margin-top: 3px; font-size: .98rem; line-height: 1.4; color: var(--ink); }
.family__addr { margin-top: 3px; font-size: .9rem; font-style: italic; line-height: 1.3; color: var(--ink-soft); text-wrap: balance; }

/* ---------- Cô dâu chú rể trên giấy cũ ---------- */
.couple { padding-top: calc(var(--u) * 2); text-align: center; }
.couple__card {
  width: calc(var(--u) * 94); margin: 0 auto; padding: calc(var(--u) * 7) calc(var(--u) * 8) calc(var(--u) * 9);
  background: url("assets/mau/giay-xe.webp") center / 100% 100% no-repeat;
}
.couple__card .rule { margin-top: 0; }
.couple__role { font-family: var(--f-serif); font-size: calc(var(--u) * 4.5); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.couple__name { font-family: var(--f-serif); font-style: italic; font-size: calc(var(--u) * 7.2); font-weight: 500; line-height: 1.25; color: var(--wine); }
.couple__amp { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 3); font-family: var(--f-script); font-size: calc(var(--u) * 15); line-height: 1.15; color: var(--wine); }
.couple__amp::before, .couple__amp::after { content: ""; width: calc(var(--u) * 19); height: calc(var(--u) * 15); background: url("assets/mau/hoa-nho.webp") 0 50% / 300% auto no-repeat; }
.couple__amp::after { background-position: 100% 50%; }
.couple__thanks { padding: 0 calc(var(--u) * 12); font-size: 1.08rem; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.couple__band { position: relative; height: calc(var(--u) * 50); margin-top: calc(var(--u) * 2); overflow: hidden; }
.couple__band::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--u) * 13); height: calc(var(--u) * 12);
  background: url("assets/mau/ren-ngang.webp") 0 0 / auto 100% repeat-x;
  filter: sepia(.4) saturate(1.3) hue-rotate(-16deg) brightness(.9) drop-shadow(0 1px 2px rgba(80, 40, 30, .35));
}
.couple__roses { position: absolute; left: calc(var(--u) * -13); bottom: 0; width: calc(var(--u) * 44); max-width: none; }
.couple__roses--r { left: auto; right: calc(var(--u) * -13); transform: scaleX(-1); }
.couple__bow { position: absolute; left: 50%; top: 0; width: calc(var(--u) * 54); max-width: none; transform: translateX(-50%); }

/* ---------- Ảnh cưới ---------- */
.album { padding: calc(var(--u) * 4) 0 calc(var(--u) * 6); text-align: center; }
.album .title { padding: 0 calc(var(--u) * 3); font-size: calc(var(--u) * 5.8); letter-spacing: .05em; }
.gallery {
  position: relative;
  display: flex; gap: calc(var(--u) * 3);
  margin-top: calc(var(--u) * 3); padding: calc(var(--u) * 2) calc(var(--u) * 11) calc(var(--u) * 4);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; outline: 0;
}
.gallery::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 calc(var(--u) * 78); aspect-ratio: 2 / 3; padding: calc(var(--u) * 1.3);
  border: 1px solid var(--line); background: #fff; cursor: zoom-in;
  scroll-snap-align: center;
  box-shadow: 0 8px 18px rgba(70, 25, 25, .22);
}
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; }
.gallery-wrap { position: relative; }
.gallery__nav {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-top: -22px; padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, .75); border-radius: 50%;
  background: rgba(81, 20, 25, .78); color: #fbf7f1;
  font-family: var(--f-serif); font-size: 30px; line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
  cursor: pointer; transition: transform .15s, background .2s;
}
.gallery__nav:hover { background: rgba(81, 20, 25, .92); }
.gallery__nav:active { transform: scale(.9); }
.gallery__nav:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.gallery__nav--prev { left: 8px; }
.gallery__nav--next { right: 8px; }
.album__motto { margin-top: calc(var(--u) * 2); font-family: var(--f-serif); font-size: calc(var(--u) * 4.8); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.album__line { padding: 0 calc(var(--u) * 8); font-size: 1.02rem; font-style: italic; color: var(--ink); }
.album__sign { font-family: var(--f-script); font-size: calc(var(--u) * 6.4); line-height: 1.3; color: var(--wine); }

/* ---------- Xác nhận tham dự ---------- */
.rsvp { padding: 0 calc(var(--u) * 6) calc(var(--u) * 9); text-align: center; }
.rsvp__flowers { width: calc(var(--u) * 46); margin: 0 auto calc(var(--u) * 1); }
.rsvp__lead { margin-top: 6px; font-size: 1.02rem; line-height: 1.45; color: var(--ink-soft); text-wrap: balance; }
.rsvp__form { display: grid; gap: 12px; margin-top: 16px; text-align: left; }
.input {
  display: block; width: 100%; min-height: 46px; padding: 9px 18px;
  border: 1px solid var(--tan); border-radius: 999px;
  background: rgba(255, 255, 255, .72); color: var(--ink);
  font-family: var(--f-text); font-size: 17px; line-height: 1.4;
  resize: vertical;
}
textarea.input { border-radius: 18px; }
.input::placeholder { color: var(--ink-soft); opacity: 1; }
.input:focus { outline: 2px solid var(--rose); outline-offset: 0; border-color: transparent; }
select.input {
  padding-right: 34px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%236e4b47' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.choice { margin: 0; padding: 0 4px; border: 0; }
.choice legend { padding: 0; font-size: 1.04rem; color: var(--ink); }
.choice legend span { color: var(--rose); }
.choice label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 1.04rem; cursor: pointer; }
.choice input { flex: none; width: 19px; height: 19px; margin: 0; accent-color: var(--wine); }
.rsvp__extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsvp__extra select:only-of-type { grid-column: 1 / -1; }
.rsvp__actions { display: flex; gap: 10px; }
.form-error { font-size: .98rem; color: #a3211b; }
.form-error:empty { display: none; }
#btnGift { margin-top: 12px; }
.rsvp-done { margin-top: 18px; text-align: center; }
.rsvp-done__text { margin-bottom: 14px; font-size: 1.1rem; line-height: 1.5; color: var(--wine); }
.rsvp-done__fallback { margin-bottom: 10px; }

/* ---------- Lời cảm ơn ---------- */
.closing { position: relative; text-align: center; }
.closing__lake { position: relative; height: calc(var(--u) * 50); margin-bottom: calc(var(--u) * 14); }
.closing__lake img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.closing__lake::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--u) * -7); height: calc(var(--u) * 12);
  background: url("assets/mau/ren-ngang.webp") 0 0 / auto 100% repeat-x;
  filter: drop-shadow(0 2px 3px rgba(40, 15, 10, .35));
}
.closing .title { font-size: calc(var(--u) * 8); font-weight: 500; letter-spacing: .06em; }
.closing__lines { padding: 0 calc(var(--u) * 10); font-size: 1.08rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.closing__view { position: relative; height: calc(var(--u) * 112); margin-top: calc(var(--u) * 2); overflow: hidden; }
.closing__church {
  position: absolute; left: -12%; bottom: calc(var(--u) * 14); width: 124%; max-width: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 56% at 50% 54%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 56% at 50% 54%, #000 60%, transparent 100%);
}
.closing__garden { position: absolute; left: -4%; bottom: calc(var(--u) * -6); width: 108%; max-width: none; }
.closing__heart {
  position: absolute; left: var(--x); bottom: 34%; width: 16px; height: 16px; opacity: 0;
  background: var(--rose);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S4.200 16.300 2.200 11.500C.8 8 2.900 4.600 6.400 4.600c2.200 0 4 1.200 5.600 3.400 1.600-2.200 3.400-3.400 5.600-3.400 3.500 0 5.600 3.400 4.200 6.900C19.800 16.300 12 21 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S4.200 16.300 2.200 11.500C.8 8 2.900 4.600 6.400 4.600c2.200 0 4 1.200 5.600 3.400 1.600-2.200 3.400-3.400 5.600-3.400 3.500 0 5.600 3.400 4.200 6.900C19.800 16.300 12 21 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: float-up 6s ease-in infinite;
}
.closing__heart:nth-of-type(1) { --x: 14%; }
.closing__heart:nth-of-type(2) { --x: 82%; animation-delay: 1.5s; }
.closing__heart:nth-of-type(3) { --x: 30%; animation-delay: 3s; transform: scale(.7); }
.closing__heart:nth-of-type(4) { --x: 68%; animation-delay: 4.5s; }
@keyframes float-up { 12% { opacity: .75; } 100% { opacity: 0; translate: 10px -220px; } }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal {
  --x: 0px; --y: 26px; --r: 0deg;
  opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r));
  transition: opacity 1s ease, transform 1s var(--ease);
}
.reveal.is-in { opacity: 1; transform: rotate(var(--r)); }

/* ==========================================================================
   NÚT NHẠC + LỜI CHÚC NỔI
   ========================================================================== */
.music-fab {
  position: fixed; z-index: 40;
  right: max(12px, calc(50% - 228px)); bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 2px solid rgba(255, 240, 224, .85); border-radius: 50%;
  color: #fbeeda;
  background: radial-gradient(circle, var(--wine) 0 30%, #1c0508 31% 34%, #3a0a11 35% 52%, #1c0508 53% 56%, #3a0a11 57%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.music-fab.is-playing { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.music-fab.is-waiting::after {
  content: attr(data-hint);
  position: absolute; right: 54px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  font-family: var(--f-text); font-size: .92rem;
  color: var(--wine); background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translate(-4px, -50%); } }

.wishes, .wishbar { transition: opacity .5s ease; }
body:not(.show-wishes) .wishes, body:not(.show-wishes) .wishbar { opacity: 0; pointer-events: none; }
.wishes {
  position: fixed; z-index: 38;
  left: max(12px, calc(50% - 228px)); bottom: calc(66px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  width: min(74vw, 340px);
  pointer-events: none;
}
.wish {
  padding: 6px 12px; border-radius: 14px;
  background: rgba(255, 250, 244, .9); color: var(--ink);
  font-size: .96rem; line-height: 1.3;
  box-shadow: 0 3px 10px rgba(30, 8, 10, .22);
  animation: rise-in .5s var(--ease);
  transition: opacity .6s ease;
}
.wish b { font-weight: 500; color: var(--wine); }
.wish.is-out { opacity: 0; }
.wishbar {
  position: fixed; z-index: 39;
  left: max(12px, calc(50% - 228px)); right: calc(max(12px, 50% - 228px) + 54px); bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: rgba(255, 250, 244, .82); color: var(--ink-soft);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px rgba(30, 8, 10, .25);
  font-family: var(--f-text); font-size: 1rem;
  cursor: pointer;
}
.wishbar svg { flex: none; color: var(--rose); }

/* ==========================================================================
   HỘP THOẠI (thêm vào lịch, quà mừng)
   ========================================================================== */
dialog { color: inherit; }
.sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 30px 20px 22px;
  border: 0; border-radius: 18px;
  background: var(--paper) var(--paper-tex);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 4, 6, .5);
  overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-in .45s var(--ease); }
.sheet::backdrop { background: rgba(30, 6, 10, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet__close {
  position: absolute; top: 10px; right: 10px;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(81, 20, 25, .1); color: var(--wine); font-size: 1rem; cursor: pointer;
}
.sheet__title { margin: 0; text-align: center; font-family: var(--f-serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wine); }
.sheet__sub { margin: 6px 0 18px; text-align: center; font-size: 1.02rem; color: var(--ink-soft); }
.sheet__foot { margin-top: 16px; text-align: center; font-size: .98rem; font-style: italic; color: var(--ink-soft); }
.cal-links { display: grid; gap: 10px; margin-top: 16px; }

/* Quà mừng: thẻ ngân hàng */
.tabs { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.tabs:empty { display: none; }
.tab { min-height: 40px; padding: 6px 18px; border: 1px solid var(--tan); border-radius: 999px; background: #fff; color: var(--ink); font-family: var(--f-text); font-size: 1rem; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--wine-btn); border-color: var(--wine-btn); color: #fbeeda; }
.bank { margin-top: 14px; text-align: center; }
.bank__who { font-weight: 500; font-size: 1.12rem; color: var(--wine); }
.bank__who:empty { display: none; }
.bank__qr { width: min(230px, 70vw); margin: 12px auto; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(70, 25, 25, .16); }
.bank__qr canvas, .bank__qr img { display: block; width: 100%; height: auto; }
.bank__empty { margin: 14px auto; padding: 28px 12px; max-width: 260px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--ink-soft); font-style: italic; }
.bank__name { font-size: 1rem; color: var(--ink-soft); }
.bank__acc { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; font-size: 1.28rem; font-weight: 500; letter-spacing: .03em; font-variant-numeric: lining-nums; color: var(--ink); overflow-wrap: anywhere; }
.bank__acc:has(span:empty) { display: none; }
.copy-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(81, 20, 25, .1); color: var(--wine); cursor: pointer; }
.bank__owner { margin: 2px 0 16px; font-size: .94rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.bank__status { min-height: 1.4em; margin-top: 8px; font-size: .96rem; color: var(--wine); }

/* ---------- Xem ảnh to ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(16, 3, 5, .96); color: #fff;
  overscroll-behavior: contain;
}
.lightbox[open] { display: grid; place-items: center; animation: fade-in .3s ease; }
.lightbox::backdrop { background: transparent; }
@keyframes fade-in { from { opacity: 0; } }
.lightbox__img { max-width: 100%; max-height: 84dvh; object-fit: contain; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lightbox__count { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: 1rem; opacity: .8; }
.lightbox__close, .lightbox__nav { position: absolute; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.lightbox__close { top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; font-size: 1.1rem; }
.lightbox__nav { top: 50%; width: 46px; height: 46px; margin-top: -23px; font-size: 1.8rem; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: rotate(var(--r)); }
  .hero::after, .hero__kicker, .hero__name, .hero__amp, .hero__tagline { opacity: 1; }
  .curtain.is-leaving { opacity: 0; }
}
