:root {
  --cream: #fbf7f1;
  --paper: #ffffff;
  --gold: #b8935a;
  --gold-light: #e6d3ad;
  --rose: #c98b8b;
  --ink: #3d3530;
  --muted: #8a7f76;
  --script: 'Great Vibes', cursive;
  --serif: 'Playfair Display', serif;
  --sans: 'Be Vietnam Pro', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Chặn tràn ngang trên mobile (Safari iOS bỏ qua overflow-x của riêng body) */
html { scroll-behavior: smooth; overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
  /* Hoa trang trí thò ra mép phải/trái bị cắt gọn trong từng mục, không đẩy trang rộng ra */
  .section, .featured, .footer { overflow-x: clip; }
}
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }

/* ---------- Trái tim kép (thay chữ "&") ---------- */
.dbl-heart {
  display: inline-block; vertical-align: middle;
  width: 1.15em; height: .83em;
  margin: 0 .2em; color: inherit;
  overflow: visible;
  animation: beat 1.8s ease-in-out infinite;
}
.title .dbl-heart { width: .8em; height: .58em; margin: 0 .12em; }
.hero-names .dbl-heart { width: 1em; height: .72em; margin: .15em 0; }

/* ---------- Tên cô dâu chú rể: vừa thì 1 dòng, không vừa thì 3 dòng (tên / tim / tên) ---------- */
/* script.js đo độ rộng và thêm class "stack" khi một dòng không đủ chỗ */
.couple-line {
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
.couple-line .cl-heart { display: flex; }
.couple-line.stack { flex-direction: column; }
.couple-line.stack > span { white-space: normal; text-align: center; }
.couple-line.stack .dbl-heart { margin: .05em 0; }

/* ---------- Thánh giá ---------- */
.cross { color: var(--gold); font-size: 1.8rem; line-height: 1; }
.cross.big { font-size: 2.6rem; margin-bottom: 1rem; }

/* ---------- Nút ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .85rem 2rem;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all .3s ease;
}
.btn:hover { background: transparent; color: var(--gold); }
.btn.outline { background: transparent; color: var(--gold); }
.btn.outline:hover { background: var(--gold); color: #fff; }

/* ---------- Phong bì mở thiệp ---------- */
.envelope {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  perspective: 1600px;
  overflow: hidden;
}
.envelope.hidden { visibility: hidden; }

/* Hai cánh cửa */
.door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.7), transparent 70%),
    repeating-linear-gradient(45deg, rgba(184,147,90,.05) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, #fffaf2, #efe3d0);
  transition: transform 1.6s cubic-bezier(.7,0,.25,1) .35s, opacity 1.6s ease .35s;
  backface-visibility: hidden;
}
.door::after {
  content: ''; position: absolute; top: 4%; bottom: 4%;
  width: 70%; border: 1px solid var(--gold-light); border-radius: 6px;
}
.door-left { left: 0; transform-origin: left center; box-shadow: inset -1px 0 0 var(--gold-light); }
.door-left::after { right: 8%; }
.door-right { right: 0; transform-origin: right center; box-shadow: inset 1px 0 0 var(--gold-light); }
.door-right::after { left: 8%; }
.envelope.open .door-left { transform: rotateY(-105deg); opacity: .4; }
.envelope.open .door-right { transform: rotateY(105deg); opacity: .4; }

.envelope-inner {
  position: relative; z-index: 1;
  text-align: center;
  padding: 2.5rem 2rem;
  max-width: 90vw;
  animation: riseIn 1.2s ease both;
  transition: opacity .5s ease, transform .6s ease;
}
.envelope.open .envelope-inner { opacity: 0; transform: scale(1.08); }
.envelope-sub { letter-spacing: .25em; text-transform: uppercase; font-size: .8rem; color: var(--muted); margin: 1rem 0 .5rem; }
.envelope-names { font-family: var(--script); font-weight: 400; font-size: clamp(2.4rem, 8vw, 3.8rem); color: var(--ink); line-height: 1.2; }
.envelope-names .cl-heart { color: var(--gold); }
.envelope-date { font-family: var(--serif); letter-spacing: .2em; color: var(--gold); margin: .4rem 0 2rem; }

/* Con dấu sáp + vòng đếm tự mở */
.seal {
  position: relative;
  width: 104px; height: 104px; border-radius: 50%;
  border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #d8b67e, var(--gold) 55%, #8e6d3d);
  box-shadow: 0 10px 24px rgba(142,109,61,.4), inset 0 2px 6px rgba(255,255,255,.35), inset 0 -4px 8px rgba(0,0,0,.18);
  animation: sealPulse 2.2s ease-in-out infinite;
}
.seal-mono { font-family: var(--script); font-size: 2.3rem; color: #fff8ec; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.seal-mono i { font-style: normal; font-size: .7em; margin: 0 .05em; opacity: .85; }
.seal-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); }
.seal-ring circle {
  fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 296; stroke-dashoffset: 296;
  animation: ringFill var(--auto-open, 3.3s) linear forwards;
}
.envelope-hint { margin-top: 1.4rem; font-size: .78rem; letter-spacing: .12em; color: var(--muted); animation: hintBlink 2.2s ease-in-out infinite; }
.envelope.open .seal { animation: sealBreak .6s ease forwards; }

.envelope-guest { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 4.5vw, 1.4rem); color: var(--rose); margin: -.2rem 0 .4rem; }

/* ---------- Popup lời mời riêng ---------- */
.invite-modal {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding: 1.5rem;
  background: rgba(40,30,25,.45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .6s ease;
}
.invite-modal[hidden] { display: none; }
.invite-modal.show { opacity: 1; }
.invite-card {
  position: relative; isolation: isolate;
  width: min(420px, 100%);
  padding: 2.6rem 1.8rem 2.4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(255,255,255,.9), transparent 70%),
    linear-gradient(160deg, #fffaf2, #f6ecdd);
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--gold-light); outline-offset: -10px;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(60,40,25,.3);
  transform: translateY(24px) scale(.94);
  transition: transform .7s cubic-bezier(.22,1,.36,1);
}
.invite-modal.show .invite-card { transform: none; }
.invite-card .rose { z-index: 1; }
.invite-close {
  position: absolute; top: .7rem; right: .8rem;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent;
  color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.invite-close:hover { color: var(--ink); }
.invite-pre { margin-top: .8rem; letter-spacing: .25em; text-transform: uppercase; font-size: .78rem; color: var(--muted); }
.invite-name {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.25;
  color: var(--rose);
  margin: .3rem 0 .4rem;
  overflow-wrap: anywhere;
}
.invite-text { font-family: var(--serif); font-style: italic; color: var(--ink); }
.invite-couple { font-family: var(--script); font-size: 2rem; color: var(--gold); margin: .3rem 0 .8rem; }
.invite-couple .cl-heart { font-size: .95em; }
.invite-note { font-size: .88rem; color: var(--muted); max-width: 300px; margin: 0 auto 1.6rem; }

/* ---------- Hoa hồng nở ---------- */
.rose {
  position: absolute; z-index: -1;
  width: calc(var(--size, 100px) * var(--k, 1)); aspect-ratio: 1;
  transform: rotate(var(--rot, 0deg)) scaleX(var(--flip, 1));
  pointer-events: none;
  opacity: .92;
}
.rose svg {
  width: 100%; height: 100%; overflow: visible; display: block; transform-origin: 3% 98%;
  transition: opacity 2s ease;
  will-change: transform, opacity; /* đung đưa/mờ dần trên GPU, không vẽ lại SVG */
}
/* --slow: hệ số làm chậm toàn bộ hiệu ứng (1 = nhanh như cũ) */
.rose { --slow: 1.8; }

/* Cành: vẽ dần như đang mọc */
.rose .vine {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(var(--t, 1.2s) * var(--slow)) cubic-bezier(.45,.05,.25,1) calc(var(--d, 0s) * var(--slow));
}
.rose.bloom .vine { stroke-dashoffset: 0; }

/* Lá, nụ, cánh hoa: xoè ra từ gốc */
.rose-grow {
  transform-box: view-box; transform-origin: 0 0;
  opacity: 0;
  transition:
    transform calc(var(--dur, 1.6s) * var(--slow)) cubic-bezier(.22,1,.36,1) calc(var(--d, 0s) * var(--slow)),
    opacity calc(.9s * var(--slow)) ease calc(var(--d, 0s) * var(--slow));
}
.rose .leaf { --dur: 1.1s; transform: scale(0) rotate(-35deg); }
.rose .bud { --dur: 1.2s; transform: scale(0); }
.rose .petals { transform: scale(.15) rotate(-55deg); }
.rose.bloom .rose-grow { transform: none; opacity: 1; }

/* Đung đưa nhẹ quanh gốc cành khi đang nở */
.rose.bloom svg { animation: roseSway 8s ease-in-out 4s infinite; }
@keyframes roseSway { 0%,100% { transform: rotate(0); } 50% { transform: rotate(2.5deg); } }

/* Lặp lại: hoa mờ dần (wilt) rồi về trạng thái nụ ngay lập tức (reset) để nở lại */
.rose.wilt svg { opacity: 0; }
.rose.reset svg, .rose.reset svg * { transition: none !important; animation: none !important; }

/* Khung chứa hoa: hoa nằm dưới nội dung, trên nền */
.section, .featured-photo, .event, .footer { position: relative; isolation: isolate; }
.hero .rose, .envelope .rose { z-index: 1; }
.featured-photo .rose { z-index: 1; }

/* ---------- Ảnh nền mờ toàn trang ---------- */
.page-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.page-bg img {
  display: block; width: 100%;
  height: max(150vh, 150vw);
  object-fit: cover; object-position: center top;
  will-change: transform;
}
.page-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(251,247,241,.84), rgba(251,247,241,.9)); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; gap: 1.8rem; flex-wrap: wrap;
  padding: 1rem;
  font-size: .85rem; letter-spacing: .08em;
  transition: background .3s, box-shadow .3s;
}
.nav a {
  position: relative;
  color: #fff; text-decoration: none; opacity: .9;
  transition: color .5s ease, opacity .5s ease;
}
.nav a:hover { opacity: 1; }
/* Gạch chân vàng mảnh: mở rộng từ giữa ra khi mục được chọn */
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; border-radius: 1px;
  background: currentColor;
  transform: scaleX(0); opacity: 0;
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .5s ease;
}
.nav a.active { opacity: 1; color: var(--gold-light); }
.nav a.active::after { transform: scaleX(1); opacity: .9; }
.nav.scrolled { background: rgba(251,247,241,.62); box-shadow: 0 2px 16px rgba(0,0,0,.04); }
.nav.scrolled a { color: var(--ink); }
.nav.scrolled a.active { color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid; place-items: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  color: #fff;
  background: #6f5a4a;
  overflow: hidden;
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg { will-change: transform; }
.hero-bg img { object-fit: cover; object-position: center 30%; animation: slowZoom 20s ease-out both; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(30,22,18,.35), rgba(30,22,18,.6) 55%, rgba(30,22,18,.75));
}
.hero-content, .scroll-hint { position: relative; z-index: 1; }
.hero-content { text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero .cross { color: var(--gold-light); }
.hero-pre { letter-spacing: .35em; text-transform: uppercase; font-size: .85rem; opacity: .9; }
.hero-names {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  line-height: 1.1;
  margin: 1rem 0;
  display: flex; flex-direction: column; align-items: center;
}
.hero-names em { font-style: normal; color: var(--gold-light); font-size: .6em; line-height: 1; }
.hero-date { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .2em; }
.verse {
  font-family: var(--serif); font-style: italic;
  max-width: 520px; margin: 2rem auto 0;
  opacity: .92;
}
.verse cite { display: block; font-style: normal; font-size: .85rem; margin-top: .4rem; color: var(--gold-light); }

.countdown { display: flex; gap: 1rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
/* Mỗi ô là một trái tim kính mờ viền trắng; chữ số nằm ở phần rộng của tim */
.countdown div {
  position: relative; isolation: isolate;
  width: 96px; height: 88px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: 16px;
}
.countdown div::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 87C23 68 4 51 4 30C4 15 15 4 29 4C38 4 46 9 50 17C54 9 62 4 71 4C85 4 96 15 96 30C96 51 77 68 50 87Z' fill='rgba(255,255,255,.13)' stroke='rgba(255,255,255,.5)' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.countdown b { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 400; line-height: 1.1; }
.countdown small { font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; opacity: .8; }
/* 4 tim đập lần lượt từ trái sang phải như làn sóng, rồi nghỉ một chút và lặp lại */
.countdown div::before { animation: heartTick 2.4s ease-in-out infinite; transition: filter .4s ease; }
.countdown div:hover::before { filter: brightness(1.8) drop-shadow(0 0 8px rgba(255,220,225,.6)); }
.countdown div:nth-child(2)::before { animation-delay: .3s; }
.countdown div:nth-child(3)::before { animation-delay: .6s; }
.countdown div:nth-child(4)::before { animation-delay: .9s; }
@keyframes heartTick {
  0%, 30%, 100% { transform: scale(1); }
  10% { transform: scale(1.09); }
  20% { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) { .countdown div::before, .dbl-heart { animation: none; } }

.scroll-hint {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 2rem; text-decoration: none;
  animation: bounce 2s infinite;
}

/* ---------- Section chung ---------- */
.section { padding: 6rem 1.5rem; text-align: center; max-width: 1100px; margin: 0 auto; }
.section.alt { max-width: none; background: rgba(255,255,255,.55); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.title { font-family: var(--script); font-weight: 400; font-size: clamp(2.6rem, 7vw, 3.8rem); color: var(--gold); }
.subtitle { color: var(--muted); margin: .3rem auto 3rem; max-width: 560px; }

/* ---------- Cặp đôi ---------- */
.couple { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.person { flex: 1 1 280px; max-width: 360px; }
.avatar {
  width: 220px; height: 280px; margin: 0 auto 1.5rem;
  border-radius: 110px 110px 12px 12px;
  padding: 8px;
  border: 1px solid var(--gold-light);
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 104px 104px 8px 8px;
  object-fit: cover;
  background: #efe3d0;
  display: block;
}

/* ---------- Ảnh phóng ---------- */
.featured {
  display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 420px);
  gap: 3rem; align-items: center; justify-content: center;
  padding: 5rem 1.5rem;
  background: rgba(255,255,255,.55);
}
.featured-photo { padding: 10px; border: 1px solid var(--gold-light); background: var(--cream); }
.featured-photo img { width: 100%; display: block; aspect-ratio: 2 / 3; object-fit: cover; }
.featured-quote { font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.6; color: var(--ink); }
.featured-quote cite { display: block; margin-top: 1rem; font-style: normal; font-size: .9rem; color: var(--gold); letter-spacing: .1em; }
/* Cặp nhẫn: cột chữ kéo cao bằng ảnh, nhẫn nằm ở góc dưới bên phải */
.featured-quote {
  position: relative; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 7rem;
}
.rings {
  position: absolute; right: 0; bottom: 0;
  width: 170px; height: auto;
}

.saint { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.15rem; }
.person h3 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: .1rem 0 .4rem; }
.role { letter-spacing: .3em; text-transform: uppercase; font-size: .75rem; color: var(--rose); margin-bottom: 1rem; }
.parents { color: var(--muted); font-size: .92rem; }
.parents b { font-weight: 500; color: var(--ink); }
.btn.small { padding: .55rem 1.4rem; font-size: .75rem; }

/* ---------- Tư gia ---------- */
.home-card {
  position: relative;
  margin: 2.2rem auto 0;
  max-width: 320px;
  padding: 2rem 1.5rem 1.6rem;
  background: linear-gradient(180deg, #fff 0%, #fdf8f0 100%);
  border: 1px solid var(--gold-light);
  border-radius: 14px;
  outline: 1px solid var(--gold-light);
  outline-offset: 5px;
  box-shadow: 0 14px 34px rgba(184,147,90,.16);
  transition: transform .35s ease, box-shadow .35s ease;
}
.home-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(184,147,90,.26); }
.home-label {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: .35rem 1.1rem;
  background: var(--gold); color: #fff;
  border-radius: 999px;
  font-size: .72rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(184,147,90,.35);
}
.home-icon { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.home-addr { font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; color: var(--ink); margin: .4rem 0 1.1rem; }
.heart { font-size: 2.4rem; color: var(--rose); animation: beat 1.6s infinite; }

/* ---------- Sự kiện ---------- */
.events { display: grid; grid-template-columns: minmax(0, 480px); justify-content: center; gap: 2rem; }
.event {
  background: var(--paper);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  border: 1px solid var(--gold-light);
  transition: transform .3s, box-shadow .3s;
}
.event:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(184,147,90,.18); }
.event-icon { font-size: 2.4rem; }
.event h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: .8rem 0 .3rem; }
.event-time { color: var(--gold); font-weight: 500; }
.event-place { color: var(--muted); margin: .8rem 0 1.5rem; }
.event-place b { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 1.1rem; }

/* ---------- Gallery ---------- */
.gallery { columns: 3 240px; column-gap: 1rem; }
.g-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: #efe3d0;
  cursor: zoom-in;
}
.g-item img { width: 100%; height: auto; display: block; transition: transform .6s ease; }
.g-item:hover img { transform: scale(1.05); }

/* Khung xem ảnh: ảnh lớn ở giữa, dải ảnh nhỏ ở dưới */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: rgba(20,15,12,.94);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
  touch-action: pan-y;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lb-stage {
  position: relative; flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 3.5rem 5rem .5rem;
  perspective: 2400px;
}
.lb-img {
  max-width: calc(100vw - 10rem); max-height: calc(100vh - 11.5rem); max-height: calc(100dvh - 11.5rem);
  object-fit: contain; display: block;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  user-select: none; -webkit-user-drag: none;
}
/* Trang đang lật: bản sao ảnh cũ nằm đè lên ảnh mới rồi xoay quanh mép như lật giấy */
.lb-flip {
  position: absolute; z-index: 2; pointer-events: none;
  border-radius: 6px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  will-change: transform;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.lb-flip img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lb-shade { position: absolute; inset: 0; opacity: 0; }
.lb-flip.to-left .lb-shade { background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.55)); }
.lb-flip.to-right .lb-shade { background: linear-gradient(270deg, rgba(0,0,0,.05), rgba(0,0,0,.55)); }

.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1);
  color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
  transition: background .3s, border-color .3s;
}
.lb-btn:hover { background: rgba(255,255,255,.22); border-color: var(--gold-light); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-close { top: 1rem; right: 1rem; transform: none; font-size: 1.2rem; }

.lb-bottom { flex: none; padding: .2rem 0 .9rem; text-align: center; }
.lb-count { display: block; color: #e9dfd2; font-size: .8rem; letter-spacing: .15em; margin-bottom: .35rem; }
.lb-thumbs {
  display: flex; gap: .5rem; justify-content: safe center;
  overflow-x: auto; padding: .45rem 1rem;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumb {
  flex: none; width: 52px; height: 70px; padding: 0;
  border: 2px solid transparent; border-radius: 7px; overflow: hidden;
  background: #2a221d; cursor: pointer;
  opacity: .45;
  transition: opacity .35s, transform .35s, border-color .35s;
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { opacity: .8; }
.lb-thumb.active { opacity: 1; border-color: var(--gold-light); transform: translateY(-4px); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 4rem 1.5rem; background: var(--ink); color: #e9dfd2; }
.footer-names { font-family: var(--script); font-size: 2.2rem; color: var(--gold-light); margin: .6rem 0; }
.footer-names .dbl-heart { width: 1em; height: .72em; }

/* ---------- Nút nhạc ---------- */
.music-btn {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--gold); color: #fff;
  font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.music-btn.playing { animation: spin 4s linear infinite; }

/* ---------- Cánh hoa rơi ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.petal {
  position: absolute; top: -20px;
  width: 12px; height: 12px;
  background: #f3c6c6;
  border-radius: 12px 0;
  opacity: .8;
  animation: fall linear forwards;
  will-change: transform, opacity;
}

/* ---------- Trái tim bắn ra khi chạm ---------- */
/* Chỉ dùng transform + opacity để chạy trên GPU, không làm trang giật */
.tap-hearts { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.tap-heart {
  position: absolute; line-height: 1;
  text-shadow: 0 1px 3px rgba(120,60,60,.25);
  transform: translate(-50%, -50%) scale(.2);
  animation: heartBurst 1.1s cubic-bezier(.15,.7,.3,1) forwards;
  will-change: transform, opacity;
}
@keyframes heartBurst {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 1; }
  25% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--r)) scale(1); opacity: 0; }
}

/* ---------- Hạt sáng vàng lơ lửng ---------- */
.sparkles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.footer .sparkles { z-index: 0; }
.sparkle {
  position: absolute; bottom: -10px;
  width: var(--s, 4px); height: var(--s, 4px); border-radius: 50%;
  background: radial-gradient(circle, #fff8e1 0%, #f3d98f 45%, rgba(230,200,120,0) 72%);
  box-shadow: 0 0 6px 1px rgba(255,226,150,.55);
  opacity: 0;
  animation: sparkleRise var(--dur, 12s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes sparkleRise {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  12% { opacity: .9; }
  30% { opacity: .35; }
  45% { opacity: .95; }
  65% { opacity: .4; }
  85% { opacity: .8; }
  100% { transform: translate(var(--dx, 20px), calc(-1 * var(--rise, 90vh))) scale(1); opacity: 0; }
}

/* ---------- Hào quang thánh giá ---------- */
.cross { animation: crossGlow 4.5s ease-in-out infinite; }
@keyframes crossGlow {
  0%,100% { text-shadow: 0 0 4px rgba(230,200,140,.25); }
  50% { text-shadow: 0 0 10px rgba(255,226,160,.85), 0 0 26px rgba(230,190,110,.45); }
}

/* ---------- Ánh vàng lướt qua tiêu đề ---------- */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title {
    background: linear-gradient(100deg, var(--gold) 0%, var(--gold) 40%, #f4e2b4 50%, var(--gold) 60%, var(--gold) 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .title.in { animation: titleShine 7s ease-in-out .6s infinite; }
}
@keyframes titleShine {
  0% { background-position: 100% 0; }
  30%, 100% { background-position: 0 0; }
}

/* ---------- Nhạc: tên bài hát + nốt nhạc bay lên ---------- */
.now-playing {
  position: fixed; right: 4.3rem; bottom: 1.75rem; z-index: 60;
  padding: .35rem .95rem;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--gold-light);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  font-family: var(--serif); font-style: italic; font-size: .85rem;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; transform: translateX(10px);
  transition: opacity .6s ease, transform .6s ease;
}
.now-playing i { font-style: normal; color: var(--gold); margin-right: .2rem; }
.now-playing.show, .music-btn.playing:hover + .now-playing { opacity: 1; transform: none; }

.music-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0; pointer-events: none;
}
.music-btn.playing::before { animation: ripple 2.6s ease-out infinite; }
@keyframes ripple {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}
/* Nút xoay: viền gợn sóng đứng yên ở ngoài, chỉ chữ ♪ bên trong xoay */
.music-btn.playing { animation: none; }
.music-btn span { display: inline-block; }
.music-btn.playing span { animation: spin 4s linear infinite; }

.music-notes { position: fixed; inset: 0; pointer-events: none; z-index: 59; overflow: hidden; }
.music-note {
  position: absolute; right: 2.2rem; bottom: 3.6rem;
  color: var(--gold); font-size: var(--fs, 1rem);
  text-shadow: 0 1px 4px rgba(255,255,255,.8);
  opacity: 0;
  animation: noteFloat 3.6s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes noteFloat {
  0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(var(--dx, -30px), -120px) rotate(var(--r, -15deg)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sparkles, .music-notes { display: none; }
  .cross, .title.in, .music-btn.playing span, .music-btn.playing::before { animation: none; }
}

/* ---------- Hiệu ứng xuất hiện khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes floatIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes riseIn { from { transform: translateY(16px); } to { transform: none; } }
@keyframes ringFill { to { stroke-dashoffset: 0; } }
@keyframes sealPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes sealBreak { to { transform: scale(1.5) rotate(20deg); opacity: 0; } }
@keyframes hintBlink { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes slowZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes fall {
  to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0; }
}

@media (max-width: 760px) {
  .featured { grid-template-columns: minmax(0, 420px); text-align: center; gap: 2rem; }
  .featured-quote { padding-bottom: 6rem; }
  .rings { width: 120px; right: .5rem; }
}
@media (max-width: 640px) {
  .rose { --k: .65; }
  .featured-photo .rose { right: -22px !important; bottom: -30px !important; }
  .event .rose { right: -20px !important; top: -32px !important; }
  .lb-stage { padding: 3.5rem .75rem .25rem; }
  .lb-img { max-width: calc(100vw - 1.5rem); max-height: calc(100vh - 10.5rem); max-height: calc(100dvh - 10.5rem); }
  .lb-btn:not(.lb-close) { width: 40px; height: 40px; font-size: 1.3rem; background: rgba(20,15,12,.45); }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
  .lb-thumb { width: 44px; height: 60px; }
  .nav { gap: .9rem; font-size: .75rem; }
  .heart { width: 100%; }
  .countdown { gap: .5rem; }
  .countdown div { width: 72px; height: 66px; padding-bottom: 11px; }
  .countdown b { font-size: 1.5rem; }
  .countdown small { font-size: .55rem; letter-spacing: .1em; }
}
