:root {
  --rose: #b96e80;
  --rose-dark: #974e60;
  --deep: #744653;
  --blush: #fff7f7;
  --soft: #fbeff2;
  --line: #ecd3d8;
  --gold: #c9a879;
  --gold-dark: #a88858;
  --ink: #543f43;
  --muted: #7a6166;
  --ease: cubic-bezier(0.2, 0.65, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow: 0 16px 40px rgba(185, 110, 128, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #fff9f8;
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, "Times New Roman", serif;
  overflow-x: hidden;
  position: relative;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* Khoá cuộn trang khi đang ở màn mở thiệp hoặc mở menu */
.intro-active body, .menu-open body, .sheet-open body { overflow: hidden; }

/* Canvas hiệu ứng hoa rơi: nằm trên cả màn mở thiệp */
#petalCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
}

/* Icon SVG (sprite trong index.html) */
.icon {
  display: inline-block;
  width: 1.25em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
}
.icon-spin { animation: spin 1s linear infinite; }

.font-cursive { font-family: 'Great Vibes', cursive; }
.font-sans { font-family: 'Montserrat', sans-serif; }

/* ========== Hiệu ứng dùng chung ========== */

/* Hiệu ứng vào kiểu PowerPoint khi cuộn tới. main.js thêm .is-visible khi phần tử vào màn hình
   (trễ --d), chạy xong thì gỡ data-reveal. Trạng thái ẩn chỉ áp dụng khi có JS để không mất nội dung.
   data-reveal = up | left | right | zoom | blur | flip | tilt | wipe-up | split | circle | bounce | expand | title */
.js [data-reveal] {
  transition:
    opacity 0.9s var(--ease), transform 1s var(--ease), filter 1s var(--ease),
    clip-path 1.1s var(--ease-io), letter-spacing 1.2s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal]:not(.is-visible) { opacity: 0; }
/* Bay vào / phóng to / mờ -> nét */
.js [data-reveal=""]:not(.is-visible), .js [data-reveal="up"]:not(.is-visible) { transform: translateY(40px); }
.js [data-reveal="left"]:not(.is-visible) { transform: translateX(-60px); }
.js [data-reveal="right"]:not(.is-visible) { transform: translateX(60px); }
.js [data-reveal="zoom"]:not(.is-visible) { transform: scale(0.85); }
.js [data-reveal="blur"]:not(.is-visible) { filter: blur(10px); transform: translateY(12px); }
/* Lật xuống như tờ lịch / nghiêng 3D rồi dựng lên */
.js [data-reveal="flip"] { transform-origin: 50% 0; }
.js [data-reveal="flip"]:not(.is-visible) { transform: perspective(1000px) rotateX(-80deg); }
.js [data-reveal="tilt"] { transform-origin: 50% 100%; }
.js [data-reveal="tilt"]:not(.is-visible) { transform: perspective(1000px) rotateX(28deg) translateY(60px) scale(0.96); }
/* Kéo rèm (lên / từ trái / từ phải) / mở từ giữa ra / mở theo vòng tròn. Cắt phần tử con chứ không cắt chính nó:
   Chrome coi phần tử bị clip-path che hết là "không nhìn thấy" nên sẽ không bao giờ hiện. Chừa 40px cho bóng đổ. */
.js [data-reveal^="wipe"]:not(.is-visible), .js [data-reveal="split"]:not(.is-visible),
.js [data-reveal="circle"]:not(.is-visible) { opacity: 1; }
.js [data-reveal^="wipe"] > *, .js [data-reveal="split"] > * {
  clip-path: inset(-40px);
  transition: clip-path 1.1s var(--ease-io) var(--d, 0ms);
}
.js [data-reveal="wipe-up"]:not(.is-visible) > * { clip-path: inset(100% 0 0 0); }
/* Float in (kiểu PowerPoint, dùng cho ảnh album): mờ dần hiện ra và trôi nhẹ từ trái / phải vào */
.js [data-reveal="float-left"], .js [data-reveal="float-right"] {
  transition-duration: 1.5s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.js [data-reveal="float-left"]:not(.is-visible) { transform: translateX(-80px); }
.js [data-reveal="float-right"]:not(.is-visible) { transform: translateX(80px); }
.js [data-reveal="split"]:not(.is-visible) > * { clip-path: inset(0 50%); }
.js [data-reveal="circle"] > * { clip-path: circle(75% at 50% 50%); transition: clip-path 1.2s var(--ease-io) var(--d, 0ms); }
.js [data-reveal="circle"]:not(.is-visible) > * { clip-path: circle(0% at 50% 50%); }
/* Nảy lên */
.js [data-reveal="bounce"].is-visible { animation: bounceIn 0.9s var(--ease) var(--d, 0ms) both; }
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  55% { opacity: 1; transform: scale(1.08); }
  75% { transform: scale(0.95); }
  100% { opacity: 1; transform: none; }
}
/* Nhãn nhỏ: chữ dãn rộng rồi co về, hai vạch hai bên dài ra */
.js [data-reveal="expand"]:not(.is-visible) { letter-spacing: 0.9em; }
.js [data-reveal="expand"]::before, .js [data-reveal="expand"]::after { transition: width 1s var(--ease) calc(var(--d, 0ms) + 300ms); }
.js [data-reveal="expand"]:not(.is-visible)::before, .js [data-reveal="expand"]:not(.is-visible)::after { width: 0; }
/* Tiêu đề: từng chữ trồi lên từ dưới (main.js tách chữ vào .word), hoa văn dài dần ra */
.section-title .word {
  display: inline-block;
  overflow: hidden;
  padding: 0.18em 0.04em 0.12em;
  margin: -0.18em -0.04em -0.12em;
  vertical-align: top;
}
.section-title .word > span { display: inline-block; }
.js [data-reveal="title"]:not(.is-visible) { opacity: 1; }
.js [data-reveal="title"] .word > span {
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 90ms);
}
.js [data-reveal="title"]:not(.is-visible) .word > span { transform: translateY(115%) rotate(4deg); }
.js [data-reveal="title"]::after { transition: transform 1s var(--ease) calc(var(--d, 0ms) + 450ms); }
.js [data-reveal="title"]:not(.is-visible)::after { transform: scaleX(0); }
/* Ảnh bên trong thẻ: thu nhỏ dần về đúng cỡ trong lúc thẻ bay vào */
.js .person[data-reveal] .arch img,
.js .event-card[data-reveal] .event-photo img,
.js .tile[data-reveal] img {
  transition: opacity 0.8s ease, filter 1s ease,
    scale 1.4s var(--ease) var(--d, 0ms);
}
.js .person[data-reveal]:not(.is-visible) .arch img,
.js .event-card[data-reveal]:not(.is-visible) .event-photo img { scale: 1.25; }
.js .tile[data-reveal]:not(.is-visible) img { scale: 1.12; }

/* Ảnh tải xong mới hiện dần (mờ -> nét), khung chạy hiệu ứng shimmer trong lúc chờ */
.img-frame {
  background: linear-gradient(110deg, #f5e3e7 30%, #fdf3f5 50%, #f5e3e7 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
.img-frame:has(.is-loaded) { animation: none; }
.js .img-load {
  opacity: 0;
  filter: blur(14px);
  scale: 1.06;
  transition: opacity 0.8s ease, filter 1s ease, scale 1.4s var(--ease);
}
.js .img-load.is-loaded { opacity: 1; filter: none; scale: 1; }

@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes heartBeat {
  0%, 40%, 100% { transform: scale(1); }
  20%, 60% { transform: scale(1.18); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ========== Màn mở thiệp ========== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 38%, #fff 0%, #fbeef1 55%, #f2d9df 100%);
  transition: opacity 0.9s ease, transform 1.1s var(--ease), visibility 0s 1.1s;
}
.intro-skip .intro { display: none; }
.intro.is-done { opacity: 0; visibility: hidden; transform: scale(1.12); pointer-events: none; }

.intro-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--rose);
  animation: fadeUp 1s var(--ease) both;
}
.intro-to {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  animation: fadeUp 1s var(--ease) 0.15s both;
}
.intro-to strong {
  display: block;
  margin-top: 6px;
  font-size: 1.6rem;
  font-style: normal;
  font-weight: 400;
  color: var(--deep);
}
.intro-hint {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--rose-dark);
  animation: fadeUp 1s var(--ease) 0.5s both, blink 2.2s ease-in-out 1.5s infinite;
}
.intro.is-opening .intro-hint { opacity: 0; animation: none; transition: opacity 0.3s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink { 50% { opacity: 0.35; } }

/* Phong bì: lưng (nền .envelope) -> thư -> túi trước -> nắp -> con dấu */
.envelope {
  position: relative;
  width: min(340px, 84vw);
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  background: linear-gradient(160deg, #e3a9b7, #cf8598);
  box-shadow: 0 30px 60px rgba(116, 70, 83, 0.28);
  perspective: 1000px;
  cursor: pointer;
  animation: fadeUp 1s var(--ease) 0.3s both, floatY 4s ease-in-out 1.3s infinite;
}
.intro.is-opening .envelope { animation: none; }
.envelope-letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 7%;
  height: 86%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdfb, #fdf3f0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 1s var(--ease) 0.95s;
}
.letter-kicker { font-size: 0.6rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--rose); }
.letter-names { font-size: 2.3rem; color: var(--deep); line-height: 1.2; }
.letter-date { font-size: 0.75rem; letter-spacing: 0.25em; color: var(--gold-dark); }
.envelope-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 10px;
  background: linear-gradient(to top, #f4cfd8, #ecbac6);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
/* Hai vạt hai bên sáng hơn vạt đáy */
.envelope-pocket::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #f7dbe2, #f1c9d3 50%, #f7dbe2);
  clip-path: polygon(0 0, 50% 54%, 0 100%, 100% 100%, 50% 54%, 100% 0, 100% 100%, 0 100%);
  opacity: 0.55;
}
.envelope-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  z-index: 4;
  background: linear-gradient(to bottom, #e9adbb, #d995a6);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s, z-index 0s 0.7s;
}
.envelope-seal {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d36d84, #973a51 72%);
  box-shadow: 0 6px 16px rgba(116, 40, 60, 0.45), inset 0 -3px 6px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.35);
  color: #ffe6ec;
  font-size: 22px;
  cursor: pointer;
  animation: heartBeat 1.8s ease-in-out infinite;
}
.envelope-seal::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(185, 110, 128, 0.6);
  animation: pulseRing 1.8s ease-out infinite;
}
.envelope-seal:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.intro.is-opening .envelope-seal { animation: sealPop 0.45s ease forwards; }
.intro.is-opening .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.intro.is-opening .envelope-letter { transform: translateY(-58%); }

@keyframes sealPop { to { transform: scale(1.6); opacity: 0; } }
@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ========== Thanh trên cùng & menu ========== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  color: #fff;
  transition: background 0.4s, color 0.4s, box-shadow 0.4s, transform 0.8s var(--ease);
}
.js:not(.is-revealed) .topbar { transform: translateY(-100%); }
.topbar.is-scrolled, .menu-open .topbar {
  background: rgba(255, 249, 248, 0.88);
  color: var(--deep);
  box-shadow: 0 2px 20px rgba(116, 70, 83, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.monogram {
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: inherit;
  text-decoration: none;
}
.monogram span { font-size: 1.5rem; margin: 0 6px; color: var(--gold); letter-spacing: 0; }
.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.menu-btn span { width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.35s, opacity 0.35s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Tab các phần: hàng dưới của thanh trên cùng, chỉ hiện khi đã cuộn qua ảnh bìa (main.js tô tab đang xem). */
.section-tabs {
  position: relative;
  display: flex;
  flex-basis: 100%;
  gap: 4px;
  max-height: 0;
  margin: 0 -20px -12px;
  padding: 0 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  opacity: 0;
  transition: max-height 0.4s var(--ease), opacity 0.3s, margin 0.4s var(--ease);
}
.section-tabs::-webkit-scrollbar { display: none; }
/* Căn giữa khi đủ chỗ, vẫn cuộn ngang được khi thiếu chỗ (justify-content: center sẽ cắt mất tab đầu) */
.section-tabs > :first-child { margin-left: auto; }
.section-tabs > :last-child { margin-right: auto; }
.topbar.is-scrolled .section-tabs { max-height: 48px; margin-top: 8px; opacity: 1; }
.menu-open .topbar .section-tabs { max-height: 0; margin-top: 0; opacity: 0; }
.section-tabs a {
  position: relative;
  flex: none;
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}
.section-tabs a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--rose);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}
.section-tabs a:hover, .section-tabs a.is-active { color: var(--rose-dark); }
.section-tabs a.is-active::after { transform: scaleX(1); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 890;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(255, 247, 247, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity 0.4s; }
.menu a {
  font-size: 1.45rem;
  color: var(--deep);
  text-decoration: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s, transform 0.5s var(--ease), color 0.3s;
}
.menu a:hover, .menu a.is-active { color: var(--rose); }
.menu a.is-active::after { content: ''; display: block; width: 24px; height: 1px; margin: 4px auto 0; background: var(--gold); }
.menu-open .menu a { opacity: 1; transform: none; }
.menu-open .menu a:nth-child(2) { transition-delay: 0.05s; }
.menu-open .menu a:nth-child(3) { transition-delay: 0.1s; }
.menu-open .menu a:nth-child(4) { transition-delay: 0.15s; }
.menu-open .menu a:nth-child(5) { transition-delay: 0.2s; }
.menu-open .menu a:nth-child(6) { transition-delay: 0.25s; }
.menu-open .menu a:nth-child(7) { transition-delay: 0.3s; }

/* ========== Ảnh bìa ========== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: #5b4248;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0;
  scale: 1.18;
  transition: opacity 1.4s ease, scale 7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.hero-bg.is-loaded { opacity: 1; }
.hero-backdrop { display: none; }
.is-revealed .hero-bg.is-loaded { scale: 1; }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40, 22, 30, 0.35) 0%, rgba(40, 22, 30, 0) 22%, rgba(40, 22, 30, 0) 42%, rgba(40, 22, 30, 0.72) 100%);
}
.hero-content {
  position: relative;
  padding: 0 20px calc(13vh + 30px);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.js .hero-content > * {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}
.is-revealed .hero-content > * { opacity: 1; transform: none; filter: none; }
.is-revealed .hero-content > :nth-child(1) { transition-delay: 0.5s; }
.is-revealed .hero-content > :nth-child(2) { transition-delay: 0.75s; }
.is-revealed .hero-content > :nth-child(3) { transition-delay: 1.05s; }
.is-revealed .hero-content > :nth-child(4) { transition-delay: 1.25s; }
.is-revealed .hero-content > :nth-child(5) { transition-delay: 1.45s; }
.hero-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-names {
  font-size: clamp(2.3rem, 9vw, 4.4rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.12;
}
.hero-names span { display: block; }
.hero-amp { font-style: normal; font-size: 1.1em; color: #f3d9a9; line-height: 0.9; }
.js .hero-line { transform: scaleX(0); }
.hero-line { width: 140px; height: 1px; margin: 22px auto 16px; background: rgba(255, 255, 255, 0.75); }
.is-revealed .hero-line { transform: scaleX(1); filter: none; }
.hero-date { font-size: clamp(1.3rem, 4.5vw, 1.7rem); letter-spacing: 0.12em; }
.hero-place { margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.85; }

/* ========== Khung chung của các phần ========== */
.section {
  position: relative;
  /* Nhảy tới #phần: chừa chỗ cho thanh trên cùng + hàng tab */
  scroll-margin-top: 40px;
  padding: clamp(72px, 12vw, 112px) 20px;
  text-align: center;
  /* Phần tử chờ trượt vào từ bên phải không được làm trang rộng ra:
     Chrome điện thoại sẽ thu nhỏ cả trang và đẩy lệch các nút nổi. */
  overflow-x: hidden;
  overflow-x: clip;
}
.bg-soft { background: var(--soft); }
.section-head { max-width: 640px; margin: 0 auto 42px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--rose);
}
.kicker::before, .kicker::after { content: ''; width: 26px; height: 1px; background: currentColor; opacity: 0.5; }
.section-title {
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--deep);
}
/* Hoa văn dưới tiêu đề: đường kẻ vàng có chấm ở giữa */
.section-title::after {
  content: '';
  display: block;
  width: 70px;
  height: 8px;
  margin: 14px auto 0;
  background:
    radial-gradient(circle, var(--gold) 2.5px, transparent 3px) center / 8px 8px no-repeat,
    linear-gradient(var(--gold), var(--gold)) center / 100% 1px no-repeat;
}
.section-subtitle {
  margin-top: 10px;
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--muted);
}
.btn-pill {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(185, 110, 128, 0.3);
  transition: background 0.3s, transform 0.3s;
}
.btn-pill:hover { background: var(--rose-dark); transform: translateY(-2px); }

/* ========== Lịch Save the date ========== */
.calendar {
  max-width: 380px;
  margin: 0 auto;
  padding: 28px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fdf0f3);
  box-shadow: var(--shadow);
}
.calendar-month { font-size: 1.5rem; color: var(--deep); margin-bottom: 18px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; font-size: 0.9rem; }
.calendar-grid .dow { padding-bottom: 8px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; color: var(--rose); }
.calendar-grid .day { position: relative; height: 40px; display: flex; align-items: center; justify-content: center; }
.calendar-grid .day b { position: relative; font-weight: 400; }
.calendar-grid .is-event b { color: #fff; font-weight: 700; }
.calendar-grid .is-event .icon {
  position: absolute;
  width: 38px;
  height: 36px;
  color: var(--rose);
  filter: drop-shadow(0 4px 6px rgba(185, 110, 128, 0.4));
  animation: heartBeat 1.6s ease-in-out infinite;
}
.calendar-grid .is-event + .is-event .icon { animation-delay: 0.3s; }
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.calendar-legend b { color: var(--rose); margin-right: 4px; }

/* ========== Cô dâu & chú rể ========== */
.couple {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}
.arch {
  position: relative;
  width: min(250px, 68vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 24px;
  overflow: hidden;
  border-radius: 999px 999px 18px 18px;
  outline: 1px solid rgba(201, 168, 121, 0.7);
  outline-offset: 8px;
  box-shadow: 0 20px 44px rgba(116, 70, 83, 0.2);
}
.arch img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.person:hover .arch img { transform: scale(1.06); }
.person-role { font-size: 0.7rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--rose); }
.person-name { margin: 6px 0 10px; font-size: 1.65rem; font-weight: 400; color: var(--deep); }
.person-parents { font-size: 0.88rem; line-height: 1.8; color: var(--muted); }
.person-parents strong { font-weight: 600; color: var(--deep); }
.couple-heart { font-size: 28px; color: var(--rose); }
.couple-heart .icon { animation: heartBeat 1.6s ease-in-out infinite; }

/* ========== Sự kiện ========== */
.event-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 860px;
  margin: 0 auto;
}
.event-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.event-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(185, 110, 128, 0.2); }
.event-photo { aspect-ratio: 4 / 3; overflow: hidden; }
.event-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.event-card:hover .event-photo img { transform: scale(1.06); }
.event-body { flex: 1; display: flex; flex-direction: column; padding: 22px 24px 26px; }
/* Thiệp riêng (server/variants.mjs): ẩn phần không thuộc thiệp ngay từ đầu (main.js xoá hẳn sau).
   /29-11 bỏ ngày 28; /20-12 (lễ báo hỷ Sài Gòn) bỏ ngày 28 + phần "no-sg"; phần "sg" chỉ hiện ở /20-12. */
.only-29 .day28, .only-sg .day28, .only-sg .no-sg, html:not(.only-sg) .sg { display: none !important; }
/* Còn 1 thẻ sự kiện thì ở giữa: 29/11 rộng cho nhà gái + nhà trai nằm ngang, lễ báo hỷ 1 địa điểm thì bằng thẻ thường */
.only-29 .event-grid { grid-template-columns: minmax(0, 720px); justify-content: center; }
.only-sg .event-grid { grid-template-columns: minmax(0, 440px); justify-content: center; }
/* Nhà gái và nhà trai nằm ngang nhau, ngăn bằng gạch dọc; nút "Chỉ đường" hai bên thẳng hàng ở đáy */
.only-29 .event-body { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
.only-29 .event-type, .only-29 .event-date { grid-column: 1 / -1; }
.only-29 .event-part { display: flex; flex-direction: column; padding-right: 22px; }
.only-29 .event-part + .event-part { margin-top: 0; padding: 0 0 0 22px; border-top: 0; border-left: 1px dashed var(--line); }
@media (max-width: 480px) {
  .only-29 .event-body { padding-left: 18px; padding-right: 18px; }
  .only-29 .event-part { padding-right: 12px; }
  .only-29 .event-part + .event-part { padding-left: 12px; }
  .only-29 .event-meta { gap: 8px; font-size: 0.84rem; }
  .only-29 .event-meta li { gap: 7px; }
  .only-29 .event-part .btn-outline { padding: 10px 4px; gap: 5px; font-size: 0.7rem; letter-spacing: 0.05em; }
}
.event-type { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.25em; text-transform: uppercase; color: var(--rose); }
.event-date { margin: 8px 0 14px; font-size: 2.1rem; color: var(--deep); }
.event-meta { list-style: none; display: grid; gap: 10px; margin-bottom: 22px; font-size: 0.9rem; line-height: 1.5; }
.event-meta li { display: flex; gap: 10px; }
.event-meta .icon { flex: none; margin-top: 2px; color: var(--rose); }
.btn-outline {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--rose);
  border-radius: 12px;
  color: var(--rose-dark);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s;
}
.btn-outline:hover { background: var(--rose); color: #fff; }
/* 29/11: nhà gái và nhà trai tổ chức riêng, mỗi phần một địa chỉ */
.event-part + .event-part { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.event-part-title { margin-bottom: 10px; font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--deep); }
.event-part .event-meta { margin-bottom: 14px; }

/* ========== Đếm ngược ========== */
.countdown-section {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 16vw, 140px) 20px;
  text-align: center;
  color: #fff;
  background: #4a3238;
}
.countdown-bg { position: absolute; left: 0; top: -15%; width: 100%; height: 130%; object-fit: cover; }
.countdown-shade { position: absolute; inset: 0; background: linear-gradient(rgba(40, 22, 30, 0.6), rgba(40, 22, 30, 0.72)); }
.countdown-inner { position: relative; max-width: 640px; margin: 0 auto; }
.countdown-section .kicker { color: #f7d7df; }
.countdown-section .section-title { color: #fff; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 34px 0 28px; }
.countdown-unit {
  padding: 18px 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.countdown-unit strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
}
.countdown-unit strong.tick { animation: tick 0.5s var(--ease); }
.countdown-unit span { display: block; margin-top: 8px; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; }
.countdown-done { grid-column: 1 / -1; font-family: 'Playfair Display', serif; font-size: 1.6rem; }
.countdown-note { font-size: 1.05rem; font-style: italic; opacity: 0.92; }
@keyframes tick {
  from { opacity: 0; transform: translateY(-40%); }
  to { opacity: 1; transform: none; }
}

/* ========== Dress code ========== */
.dress-code {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 5vw, 36px);
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.color-circle {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), inset 0 0 0 3px #fff;
  transition: transform 0.3s var(--ease);
}
.color-item:hover .color-circle { transform: translateY(-4px) scale(1.08); }
.color-name { font-size: 0.78rem; color: var(--ink); }

/* ========== Album: carousel vuốt ngang, ảnh giữa nổi bật (main.js đánh dấu .is-current, tự chuyển ảnh) ========== */
.album-carousel { position: relative; max-width: 1020px; margin: 0 auto; }
/* Màn hình hẹp: tràn ra sát mép (bỏ lề 20px của section) để thấy mép ảnh hai bên, biết là vuốt được */
@media (max-width: 1060px) { .album-carousel { margin: 0 -20px; } }
.carousel-track {
  position: relative;
  display: flex;
  gap: 14px;
  /* Lề hai bên = nửa phần trống để ảnh đầu và ảnh cuối cũng nằm được giữa khung */
  padding: 12px calc(50% - min(35vw, 190px)) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > .photo-card {
  flex: none;
  width: min(70vw, 380px);
  aspect-ratio: 4 / 5;
  scroll-snap-align: center;
  /* Cỡ và độ rõ do main.js tính liên tục theo vị trí cuộn (markAlbumSlide), nên không cần transition */
  opacity: 0.55;
  transform: scale(0.88);
}
.carousel-nav {
  position: absolute;
  top: calc(50% - 6px);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose-dark);
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(116, 70, 83, 0.18);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.3s, color 0.3s;
}
.carousel-nav:hover { background: var(--rose); color: #fff; }
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }
.carousel-count { margin: 0 0 22px; font-size: 0.75rem; letter-spacing: 0.25em; color: var(--muted); }
.carousel-track .album-message { width: 100%; }

/* ========== Bộ sưu tập "Xem tất cả": masonry (main.js xếp ảnh vào cột thấp nhất), đáy các cột bằng nhau ========== */
.masonry {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
}
.masonry-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.masonry-col > :last-child { flex-grow: 1; }
/* .tile bọc ngoài .photo-card để chạy hiệu ứng kéo rèm (xem data-reveal="wipe-up") */
.tile { display: flex; flex-direction: column; }
.tile > .photo-card { flex-grow: 1; }
.photo-card {
  position: relative;
  aspect-ratio: var(--ratio, 4 / 5);
  overflow: hidden;
  border-radius: 16px;
  cursor: zoom-in;
  box-shadow: 0 10px 26px rgba(116, 70, 83, 0.12);
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform 0.9s var(--ease); }
.photo-card:hover img { transform: scale(1.08); }
.photo-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(116, 70, 83, 0.3);
  color: #fff;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo-card:hover .photo-overlay { opacity: 1; }
.album-message { grid-column: 1 / -1; }

/* Bộ sưu tập toàn màn hình ("Xem tất cả") */
.gallery {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: #fff9f8;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity 0.4s, transform 0.5s var(--ease), visibility 0s 0.5s;
}
.gallery.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.4s, transform 0.5s var(--ease); }
.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.gallery-head h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 400; color: var(--deep); }
.gallery-head p { font-size: 0.78rem; color: var(--muted); }
.gallery-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 12px 40px; }

/* Lightbox: phóng to ảnh, chuyển ảnh bằng nút / phím mũi tên / vuốt */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 10, 15, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
}
.lightbox.active { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.lightbox-img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.45s var(--ease), opacity 0.3s;
}
.lightbox.active .lightbox-img { transform: none; }
.lightbox-img.is-switching { opacity: 0; }
.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s, opacity 0.2s;
}
.lightbox-close { top: 18px; right: 22px; font-size: 2.4rem; }
.lightbox-nav { top: 50%; margin-top: -30px; width: 48px; height: 60px; font-size: 3rem; opacity: 0.75; display: none; }
.lightbox.has-nav .lightbox-nav { display: block; }
.lightbox-prev { left: 6px; }
.lightbox-next { right: 6px; }
.lightbox button:hover { transform: scale(1.15); opacity: 1; }
.lightbox-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 0.8rem; letter-spacing: 0.2em; }

/* ========== Form RSVP & Sổ lưu bút ========== */
.form-card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 40px);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}
.form-group { margin-bottom: 20px; }
.form-group label, .side-picker legend {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--deep);
}
.form-group label .icon, .side-picker legend .icon { color: var(--rose); }
.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffafb;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.form-control:focus { border-color: var(--rose); background: #fff; box-shadow: 0 0 0 4px rgba(185, 110, 128, 0.12); }
textarea.form-control { min-height: 110px; resize: vertical; }
/* Ô chọn: bỏ mũi tên mặc định, thay bằng mũi tên hồng trong vòng tròn nhạt */
select.form-control {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 52px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b96e80' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"),
    radial-gradient(circle, #f9e3e8 15px, transparent 16px);
  background-repeat: no-repeat;
  background-position: right 18px center, right 9px center;
  background-size: 14px, 32px 32px;
  cursor: pointer;
  text-overflow: ellipsis;
}
select.form-control:hover { border-color: var(--rose); }
select.form-control:invalid { color: #a8969a; }
select.form-control option { color: var(--ink); }

/* Ô số người: - [số] + */
.stepper {
  display: flex;
  max-width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffafb;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.stepper:focus-within { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(185, 110, 128, 0.12); }
.stepper-btn {
  flex: none;
  width: 48px;
  border: 0;
  background: #f9e3e8;
  color: var(--rose-dark);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.stepper-btn:hover:not(:disabled) { background: var(--rose); color: #fff; }
.stepper-btn:disabled { opacity: 0.35; cursor: default; }
.stepper .stepper-input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--deep);
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input.bump { animation: numBump 0.35s var(--ease); }
@keyframes numBump {
  from { transform: scale(1.3); color: var(--rose); }
  to { transform: none; }
}

.side-picker { border: 0; min-width: 0; }
.side-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 400px) { .side-options { grid-template-columns: repeat(2, 1fr); } }
.side-option {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.side-option input { position: absolute; opacity: 0; pointer-events: none; }
.side-option img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.6) brightness(0.85); transition: filter 0.4s, transform 0.6s var(--ease); }
.side-option span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 4px 8px;
  background: linear-gradient(transparent, rgba(60, 30, 40, 0.78));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}
.side-option:hover img { filter: none; }
.side-option:has(input:checked) { box-shadow: 0 0 0 3px var(--rose), 0 10px 22px rgba(185, 110, 128, 0.35); transform: translateY(-3px); }
.side-option:has(input:checked) img { filter: none; transform: scale(1.06); }
.side-option:has(input:checked)::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-size: 0.75rem;
  line-height: 22px;
  text-align: center;
  animation: popIn 0.35s var(--ease);
}
.side-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--gold); }
@keyframes popIn { from { transform: scale(0); } }
/* "Bố mẹ": chưa có ảnh nên dùng nền chuyển màu + icon, cùng khung và nhãn với các ô ảnh */
.side-option.is-parents {
  display: grid;
  place-items: center;
  padding-bottom: 22px;
  background: radial-gradient(circle at 30% 20%, #d9a3b0, transparent 60%), linear-gradient(160deg, #b96e80, #5e3a45);
  filter: saturate(0.75) brightness(0.9);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, filter 0.4s;
}
.side-option.is-parents .icon { font-size: 2rem; color: rgba(255, 255, 255, 0.9); transition: transform 0.6s var(--ease); }
.side-option.is-parents:hover, .side-option.is-parents:has(input:checked) { filter: none; }
.side-option.is-parents:has(input:checked) .icon { transform: scale(1.1); }

.btn-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(185, 110, 128, 0.32);
  transition: transform 0.3s, box-shadow 0.3s;
}
/* Vệt sáng lướt qua nút khi rê chuột */
.btn-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(185, 110, 128, 0.4); }
.btn-submit:hover::after { left: 130%; transition: left 0.8s ease; }
.btn-submit:disabled { opacity: 0.65; cursor: wait; transform: none; }
.form-status { min-height: 1.2em; margin-top: 14px; text-align: center; font-size: 0.9rem; font-weight: 600; color: var(--rose); }
.form-status.error { color: #b3261e; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-group label small { font-weight: 400; color: var(--muted); }

/* Ô lời chúc + bảng emoji */
.message-box { position: relative; }
.message-box textarea { padding-bottom: 44px; }
.emoji-btn {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { background: var(--soft); transform: scale(1.1); }
.emoji-picker {
  position: absolute;
  right: 0;
  bottom: 54px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: min(330px, 100%);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(116, 70, 83, 0.2);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
}
.emoji-picker.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.25s var(--ease); }
.emoji-picker button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.emoji-picker button:hover { background: var(--soft); transform: scale(1.15); }

/* Tim bung ra khi gửi thành công */
.heart-burst {
  position: fixed;
  z-index: 1600;
  pointer-events: none;
  color: var(--rose);
  font-size: var(--s, 18px);
  animation: burst 1s ease-out forwards;
}
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1); opacity: 0; }
}

/* ========== Lời chúc: thẻ chạy lần lượt + danh sách đầy đủ ========== */
.wish-carousel { max-width: 680px; margin: 0 auto; scroll-margin-top: 100px; }
.wish-slide { display: grid; min-height: 260px; }
.wish-feature {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  padding: 46px 32px 26px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  animation: wishIn 0.6s var(--ease) both;
}
.wish-feature.is-leaving { animation: wishOut 0.45s var(--ease) both; }
.wish-feature::before {
  content: '“';
  position: absolute;
  top: -22px;
  left: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 8px 18px rgba(185, 110, 128, 0.35);
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  line-height: 62px;
  text-align: center;
}
.wish-feature-text {
  flex: 1;
  font-family: 'Playfair Display', serif;
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.wish-feature-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.wish-name { font-size: 0.92rem; font-weight: 600; color: var(--deep); }
.wish-nick { margin-top: 2px; font-size: 0.76rem; color: var(--muted); }
.wish-time { flex: none; font-size: 0.72rem; color: var(--gold-dark); }
@keyframes wishIn {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: none; }
}
@keyframes wishOut { to { opacity: 0; transform: translateX(-36px); } }
@media (max-width: 480px) { .wish-feature { padding: 42px 22px 22px; } .wish-feature-text { font-size: 1.05rem; } }
.wish-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.wish-nav[hidden] { display: none; }
.wish-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--rose-dark);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.wish-arrow:hover { background: var(--rose); color: #fff; }
.wish-dots { display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 60px; min-height: 10px; font-size: 0.75rem; color: var(--muted); }
.wish-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--line);
  cursor: pointer;
  transition: width 0.3s, background 0.3s;
}
.wish-dots button.is-active { width: 22px; background: var(--rose); }
.wish-cta {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  color: var(--rose-dark);
  font-size: 0.85rem;
  text-underline-offset: 4px;
}
.wishes-empty { padding: 10px 0; text-align: center; font-style: italic; color: #999; }

/* Danh sách đầy đủ: trượt từ dưới lên (điện thoại) / hộp giữa màn hình (máy tính) */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(40, 22, 30, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
}
.sheet.open { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.sheet-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 82vh;
  border-radius: 22px 22px 0 0;
  background: #fff9f8;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease);
}
.sheet.open .sheet-panel { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 400; color: var(--deep); }
.sheet-head p { margin-top: 2px; font-size: 0.78rem; color: var(--muted); }
.sheet-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); color: var(--deep); font-size: 1.4rem; cursor: pointer; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 26px; }
.wish-card {
  position: relative;
  margin-bottom: 12px;
  padding: 16px 16px 14px 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  animation: wishUp 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.wish-card::before {
  content: '“';
  position: absolute;
  top: 6px;
  left: 14px;
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  line-height: 1;
  color: var(--rose);
  opacity: 0.45;
}
@keyframes wishUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.wish-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wish-text { margin-top: 6px; font-size: 0.93rem; font-style: italic; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }

/* Honeypot: ẩn khỏi người dùng, bot vẫn điền */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ========== Hộp mừng cưới ==========
   .gift-stage[data-state]: closed -> opening -> open -> closing -> closed (main.js đổi theo GIFT_OPEN_MS / GIFT_CLOSE_MS).
   Mở: hộp rung, nắp bật bay đi, ánh sáng loé ra, thẻ ngân hàng nhảy ra từ miệng hộp theo đường vòng cung
   rồi đáp xuống chỗ của nó. Đóng: thẻ nhún lấy đà, nhảy vòng ngược vào miệng hộp, nắp rơi xuống đậy lại.
   --fx / --fy (main.js tính): khoảng cách từ chỗ thẻ nằm tới miệng hộp; --h: độ cao cú nhảy. */
.gift-stage { position: relative; scroll-margin-top: 80px; }
.gift-box {
  position: relative;
  display: block;
  width: 160px;
  height: 190px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 1; /* thân hộp che phần thẻ còn "ở trong hộp" lúc nhảy ra / rơi vào (xem z-index trong cardJump*) */
}
.gift-art { position: absolute; inset: 0; transform-origin: 50% 75%; }
/* Quầng sáng hồng phập phồng sau hộp, mời bấm */
.gift-art::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 190px;
  height: 190px;
  margin-left: -95px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 168, 184, 0.45), transparent 65%);
  animation: giftHalo 2.6s ease-in-out infinite;
}
.gift-body, .gift-lid { position: absolute; border-radius: 8px; transform-origin: 50% 100%; }
.gift-body {
  left: 20px;
  right: 20px;
  bottom: 44px;
  height: 86px;
  background: linear-gradient(135deg, #e9a8b8, #c97689);
  box-shadow: 0 16px 30px rgba(185, 110, 128, 0.35);
}
.gift-lid {
  left: 10px;
  right: 10px;
  bottom: 128px;
  height: 28px;
  z-index: 1;
  background: linear-gradient(135deg, #f0b7c5, #d68a9c);
}
/* Dải ruy băng dọc */
.gift-body::before, .gift-lid::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 16px;
  margin-left: -8px;
  background: linear-gradient(90deg, #d8b783, #f1d9a8, #d8b783);
}
.gift-bow { position: absolute; left: 50%; bottom: 100%; width: 0; height: 0; }
.gift-bow::before, .gift-bow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 30px;
  height: 22px;
  border: 6px solid #e2c48f;
  border-radius: 50% 50% 0 50%;
}
.gift-bow::before { right: -2px; transform: rotate(20deg); }
.gift-bow::after { left: -2px; transform: rotate(-20deg) scaleX(-1); }
/* Ánh sáng loé ra từ miệng hộp (nằm sau thân hộp nên như chiếu từ bên trong lên), có tia toả xoay */
.gift-glow {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 240px;
  height: 240px;
  margin-left: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 247, 222, 0.95) 0%, rgba(255, 214, 170, 0.6) 30%, rgba(255, 190, 200, 0) 68%);
  opacity: 0;
  pointer-events: none;
}
.gift-glow::after {
  content: '';
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 228, 170, 0.6) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%);
  mask: radial-gradient(circle, #000 25%, transparent 70%);
}
.gift-label {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--rose-dark);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(185, 110, 128, 0.2);
  transition: opacity 0.3s;
}

/* Đang chờ: hộp lắc lư */
.gift-stage[data-state="closed"] .gift-art { animation: giftWiggle 2.6s ease-in-out infinite; }
.gift-stage[data-state="opening"] .gift-box, .gift-stage[data-state="closing"] .gift-box { pointer-events: none; }
.gift-stage[data-state="opening"] .gift-label, .gift-stage[data-state="closing"] .gift-label { opacity: 0; }

/* Mở: rung, nắp bay đi (mở xong vẫn để hộp không nắp, có ánh sáng bên trong), loé sáng */
.gift-stage[data-state="opening"] .gift-art { animation: giftShake 0.4s ease-in-out; }
.gift-stage[data-state="opening"] .gift-lid { animation: lidOff 0.65s cubic-bezier(0.2, 0.8, 0.3, 1) 0.3s both; }
.gift-stage[data-state="open"] .gift-lid { opacity: 0; transform: translate(70px, -170px) rotate(40deg); }
.gift-stage[data-state="opening"] .gift-glow { animation: glowBurst 1s ease-out 0.4s both; }
.gift-stage[data-state="open"] .gift-glow { animation: glowIdle 2.4s ease-in-out infinite; }

/* Đóng: hộp nảy lên như vừa đón thẻ, nắp rơi xuống đậy */
.gift-stage[data-state="closing"] .gift-art { animation: giftCatch 0.35s ease-out 0.75s; }
.gift-stage[data-state="closing"] .gift-lid { animation: lidOn 0.6s cubic-bezier(0.3, 1.45, 0.5, 1) 0.85s both; }

/* Thẻ ngân hàng: chỉ hiện khi hộp đang/đã mở */
.gift-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 780px;
  margin: 18px auto 0;
}
.gift-stage:not([data-state="closed"]) .gift-grid { display: grid; }
.gift-grid .gift-card { --i: 0; --tilt: -14deg; --fx: 0px; --fy: -200px; --h: 160px; position: relative; z-index: 2; }
.gift-grid .gift-card:nth-child(2) { --i: 1; --tilt: 14deg; }
.gift-stage[data-state="opening"] .gift-card { animation: cardJumpOut 0.9s linear both; animation-delay: calc(0.55s + var(--i) * 0.17s); }
.gift-stage[data-state="closing"] .gift-card { animation: cardJumpIn 0.75s linear both; animation-delay: calc((1 - var(--i)) * 0.15s); }

@keyframes giftWiggle {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
  85% { transform: rotate(-3deg); }
  90% { transform: rotate(2deg); }
}
@keyframes giftHalo {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes giftShake {
  20% { transform: rotate(-7deg) scale(1.03); }
  40% { transform: rotate(6deg) scale(1.05); }
  60% { transform: rotate(-4deg) scale(1.05); }
  80% { transform: rotate(3deg) scale(1.03); }
}
@keyframes giftCatch {
  40% { transform: scale(1.08, 0.94); }
  70% { transform: scale(0.97, 1.03); }
}
@keyframes lidOff {
  30% { transform: translateY(-30px) rotate(-6deg); }
  to { opacity: 0; transform: translate(70px, -170px) rotate(40deg); }
}
@keyframes lidOn {
  from { opacity: 0; transform: translate(0, -150px) rotate(-18deg); }
  50% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes glowBurst {
  0% { opacity: 0; transform: scale(0.2); }
  35% { opacity: 1; transform: scale(1); }
  to { opacity: 0.45; transform: scale(0.6) rotate(25deg); }
}
@keyframes glowIdle {
  0%, 100% { opacity: 0.35; transform: scale(0.55) rotate(25deg); }
  50% { opacity: 0.6; transform: scale(0.62) rotate(40deg); }
}
/* Nhảy theo parabol: ở tiến độ t, lệch (--fx, --fy) * (1 - t) và nhô lên --h * 4t(1 - t) */
@keyframes cardJumpOut {
  0% { z-index: 0; opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.12) rotate(var(--tilt)); }
  10% { opacity: 1; }
  18% { z-index: 0; } /* còn trong hộp: nằm sau thân hộp */
  19% { z-index: 2; }
  25% { transform: translate(calc(var(--fx) * 0.75), calc(var(--fy) * 0.75 - var(--h) * 0.75)) scale(0.36) rotate(calc(var(--tilt) * 0.5)); }
  50% { transform: translate(calc(var(--fx) * 0.5), calc(var(--fy) * 0.5 - var(--h))) scale(0.62) rotate(calc(var(--tilt) * -0.3)); }
  75% { transform: translate(calc(var(--fx) * 0.25), calc(var(--fy) * 0.25 - var(--h) * 0.75)) scale(0.86) rotate(calc(var(--tilt) * -0.15)); }
  90% { transform: translateY(8px) scale(1.03, 0.97); }
  100% { opacity: 1; transform: none; }
}
@keyframes cardJumpIn {
  0% { opacity: 1; transform: none; }
  12% { transform: translateY(10px) scale(1.03, 0.96); }
  37% { transform: translate(calc(var(--fx) * 0.25), calc(var(--fy) * 0.25 - var(--h) * 0.75)) scale(0.82) rotate(calc(var(--tilt) * -0.15)); }
  62% { transform: translate(calc(var(--fx) * 0.5), calc(var(--fy) * 0.5 - var(--h))) scale(0.56) rotate(calc(var(--tilt) * -0.3)); }
  85% { z-index: 2; opacity: 1; transform: translate(calc(var(--fx) * 0.8), calc(var(--fy) * 0.8 - var(--h) * 0.64)) scale(0.28) rotate(calc(var(--tilt) * 0.5)); }
  86% { z-index: 0; } /* rơi vào hộp: ra sau thân hộp */
  100% { z-index: 0; opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.1) rotate(var(--tilt)); }
}

.gift-card {
  padding: 26px 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.gift-title { margin-bottom: 15px; font-size: 1.1rem; font-weight: 600; color: var(--rose-dark); }
.qr-img {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}
.qr-img:hover { transform: scale(1.03); }
.bank-info { margin-top: 15px; font-size: 0.9rem; line-height: 1.8; }
.btn-copy {
  margin-top: 12px;
  padding: 9px 18px;
  border: 1px solid var(--rose);
  border-radius: 999px;
  background: #fdf5f6;
  color: var(--rose-dark);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.btn-copy:hover { background: var(--rose); color: #fff; }

/* ========== Lời cảm ơn & footer ========== */
.thanks-photo { position: relative; width: min(230px, 60vw); aspect-ratio: 1; margin: 0 auto 34px; }
.thanks-photo::before {
  content: '';
  position: absolute;
  inset: -12px;
  border: 1px dashed var(--gold);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}
.thanks-photo .img-frame { width: 100%; height: 100%; overflow: hidden; border-radius: 50%; box-shadow: 0 18px 40px rgba(116, 70, 83, 0.22); }
.thanks-photo img { width: 100%; height: 100%; object-fit: cover; }
.thanks-quote { max-width: 560px; margin: 4px auto 0; font-size: clamp(1.15rem, 4vw, 1.45rem); font-style: italic; line-height: 1.6; color: var(--deep); }
.thanks-sign { margin-top: 16px; font-size: clamp(1.6rem, 5.5vw, 2.3rem); line-height: 1.3; color: var(--rose); }

footer { padding: 40px 20px calc(110px + var(--badge-space)); text-align: center; background: #f3dfe4; color: var(--deep); line-height: 1.8; }
.footer-names { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; }
.footer-date { margin-top: 5px; font-size: 0.85rem; letter-spacing: 0.2em; color: var(--gold-dark); }
/* Credit người thiết kế: tách khỏi phần thiệp bằng đường kẻ mảnh */
.footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  margin: 64px auto 40px; /* + padding footer 110px: nằm trên các nút nổi (~132px) */
  padding-top: 22px;
  border-top: 1px solid rgba(116, 70, 83, 0.18);
  font-size: 0.72rem;
  color: var(--muted);
}
.credit-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.credit-icon .icon { width: 13px; height: 13px; }
.credit-zalo { font-size: 0.55rem; font-weight: 700; letter-spacing: -0.02em; }
.credit-icon:hover, .credit-icon:focus-visible { background: var(--rose); border-color: var(--rose); color: #fff; }

/* ========== Nút nổi ========== */
/* Gói free của Netlify tự chèn badge "Powered by Netlify" (iframe#nl-badge-frame, góc dưới phải, cao ~64px):
   đẩy nút nổi và cuối footer lên trên badge. Không có badge (chạy local, gói trả phí) thì giữ nguyên. */
body { --badge-space: 0px; }
body:has(> #nl-badge-frame) { --badge-space: 64px; }
.floating {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--badge-space));
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  transition: opacity 0.6s 1.6s, transform 0.6s var(--ease) 1.6s;
}
.js:not(.is-revealed) .floating { opacity: 0; transform: translateY(24px); pointer-events: none; }
.float-wish {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--rose-dark);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(116, 70, 83, 0.2);
}
.float-wish .icon { color: var(--rose); animation: heartBeat 1.6s ease-in-out infinite; }
.music-player-btn {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--deep));
  color: #fff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(185, 110, 128, 0.4);
  transition: transform 0.3s ease;
}
.music-player-btn:hover { transform: scale(1.1); }
.music-icon { font-size: 20px; }
.music.is-playing .music-player-btn .music-icon { animation: spin 3.5s linear infinite; }
.music-pulse { position: absolute; inset: 0; border: 2px solid var(--rose); border-radius: 50%; opacity: 0; pointer-events: none; }
.music.is-playing .music-player-btn .music-pulse { animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite; }

/* Bảng nhạc: bấm nút nhạc để bung ra (tên bài, tiến trình, phát/tạm dừng) */
.music { display: flex; align-items: center; gap: 10px; }
.music-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(116, 70, 83, 0.22);
  transform-origin: right center;
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px) scale(0.92);
  transition: opacity 0.3s, transform 0.45s var(--ease), visibility 0s 0.45s;
}
.music.open .music-panel { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s, transform 0.45s var(--ease); }
/* Đĩa nhạc: ảnh cưới làm bìa, lỗ giữa như đĩa than, quay khi đang phát */
.music-disc {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: url('/img/thanks') center / cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line);
  animation: spin 5s linear infinite paused;
}
.music-disc::after {
  content: '';
  position: absolute;
  inset: 50%;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(116, 70, 83, 0.35);
}
.music.is-playing .music-disc { animation-play-state: running; }
.music-info { display: flex; flex-direction: column; width: 150px; min-width: 0; }
.music-title, .music-artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.music-title { font-size: 0.82rem; font-weight: 600; color: var(--deep); }
.music-artist { font-size: 0.68rem; color: var(--muted); }
.music-progress { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: var(--line); }
.music-progress i { display: block; width: 0; height: 100%; background: var(--rose); transition: width 0.25s linear; }
.music-toggle {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.music-toggle:hover { background: var(--rose-dark); }
.music-toggle:active { transform: scale(0.92); }
.music-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.music-toggle .i-pause, .music.is-playing .music-toggle .i-play { display: none; }
.music-next {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--rose-dark);
  cursor: pointer;
}
.music-next[hidden] { display: none; }
.music-next svg { width: 15px; height: 15px; fill: currentColor; }
.music-next:active { transform: scale(0.92); }
.music.is-playing .music-toggle .i-pause { display: block; }

/* ========== Điện thoại ========== */
@media (max-width: 768px) {
  .couple { grid-template-columns: 1fr; gap: 10px; }
  .couple-heart { margin: 6px 0 18px; }
  .event-grid, .gift-grid, .form-row { grid-template-columns: 1fr; }
  .masonry, .masonry-col { gap: 10px; }
  .photo-card { border-radius: 12px; }
  /* Nút "Gửi lời chúc" chỉ còn icon để không che nội dung */
  .float-wish { width: 46px; height: 46px; padding: 0; justify-content: center; font-size: 0; margin-right: 3px; }
  .float-wish .icon { font-size: 18px; }
}

@media (min-width: 769px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 22px; transform: translateY(30px) scale(0.97); }
}

/* Màn hình ngang: ảnh bìa dọc mà phủ kín sẽ bị cắt mất phần lớn ảnh,
   nên chia 2 cột: chữ bên trái, ảnh hiện đủ bên phải, nền là chính ảnh đó làm mờ. */
@media (min-aspect-ratio: 1/1) and (min-width: 768px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    gap: 4vw;
    padding: 90px 6vw 80px;
  }
  .hero-backdrop {
    display: block;
    position: absolute;
    inset: -60px;
    width: calc(100% + 120px);
    max-width: none;
    height: calc(100% + 120px);
    object-fit: cover;
    filter: blur(30px) brightness(0.55) saturate(1.1);
  }
  .hero-bg {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100svh - 190px);
    border-radius: 18px;
    outline: 1px solid rgba(255, 255, 255, 0.4);
    outline-offset: 10px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
    scale: 1.06;
  }
  .hero-shade { background: radial-gradient(ellipse at 25% 50%, rgba(40, 22, 30, 0.35), transparent 70%); }
  .hero-content { grid-column: 1; grid-row: 1; padding: 0; }
  .hero-names { font-size: clamp(2.2rem, 4.4vw, 4.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .img-load, .js .hero-content > * { opacity: 1; transform: none; filter: none; scale: 1; }
  #petalCanvas { display: none; }
}
