/* =========================================================
   THIỆP CƯỚI — Như Ngọc & Hải Đăng
   ========================================================= */
:root {
  /* bảng màu thạch cao — giữ tên biến cũ để các phần dùng chung */
  --ivory: #F2EEE8;        /* nền giấy mỹ thuật (trùng màu trung bình của giay-my-thuat.jpg) */
  --ivory-2: #F2ECE2;
  --surface: #FCF9F4;      /* mặt khối nổi */
  --gold: #B3A497;         /* đá xám ấm (thay vàng) */
  --gold-light: #D8CFC5;
  --gold-deep: #7D6E64;
  --blush: #E4DDD5;
  --blush-soft: #F4EEE5;
  --ink: #4A403A;
  --ink-soft: #7A6D64;
  --plaster-ink: #6A5D55;
  --plaster-soft: #8C7F76;

  --f-script: "Great Vibes", cursive;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-sans: "Be Vietnam Pro", system-ui, sans-serif;

  --gold-text: linear-gradient(100deg, #6A5D55 0%, #9A8B80 25%, #6F6158 45%, #B5A89D 60%, #6A5D55 80%, #8C7F76 100%);
  --radius: 18px;
  /* khối nổi: sáng phía trên-trái, bóng phía dưới-phải */
  --shadow: -8px -8px 20px rgba(255,255,255,.9), 10px 14px 28px -6px rgba(110,95,82,.22);
  --shadow-sm: -4px -4px 10px rgba(255,255,255,.9), 5px 7px 14px -4px rgba(110,95,82,.25);
  --inset: inset 3px 3px 7px rgba(110,95,82,.18), inset -3px -3px 7px rgba(255,255,255,.9);
  --emboss: drop-shadow(-1px -1px 0 rgba(255,255,255,.85)) drop-shadow(1px 1.5px 1.5px rgba(90,75,65,.22));
  --halo: 78% 42%;          /* vùng sáng sau chữ ở hero */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

@media (min-width: 820px) { :root { --halo: 40% 46%; } }

/* ---------- chữ dùng chung ---------- */
.eyebrow {
  font-family: var(--f-serif);
  font-style: italic;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-size: .82rem;
  color: var(--gold-deep);
  margin: 0 0 .4rem;
}
.title {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  padding: 0 .2em;
  background: var(--gold-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
  filter: var(--emboss);
}
.lead { font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; color: var(--ink-soft); max-width: 560px; margin: 0 auto 2rem; }
.script { font-family: var(--f-script); font-size: 2.2rem; line-height: 1.2; color: var(--gold-deep); }
.script.big { font-size: clamp(2rem, 8.4vw, 4.4rem); white-space: nowrap; background: var(--gold-text); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s linear infinite; padding: 0 .2em; filter: var(--emboss); }

@keyframes shimmer { to { background-position: 200% center; } }

.section {
  position: relative;
  padding: clamp(4.5rem, 12vw, 7rem) 16px;
  text-align: center;
  overflow: hidden;
}

/* ---------- reveal khi cuộn ---------- */
/* hiện dần khi cuộn: mờ nhoè → rõ, trôi nhẹ lên */
.reveal { opacity: 0; transform: translateY(26px); filter: blur(6px);
  transition: opacity 1.4s ease, transform 1.5s cubic-bezier(.2,.7,.2,1), filter 1.3s ease; transition-delay: var(--rd, 0s); }
.reveal.from-left { transform: translateX(-50px); }
.reveal.from-right { transform: translateX(50px); }
.reveal.zoom { transform: scale(.85); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* tiêu đề & tên viết tay: hiện như mực loang từ trái sang phải (mép mềm) */
.ink {
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%); mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  transition: -webkit-mask-position 2.2s cubic-bezier(.45,.05,.25,1), mask-position 2.2s cubic-bezier(.45,.05,.25,1);
  transition-delay: calc(var(--rd, 0s) + .15s);
}
.reveal.ink { transition: opacity 1.4s ease, transform 1.5s cubic-bezier(.2,.7,.2,1), filter 1.3s ease,
  -webkit-mask-position 2.2s cubic-bezier(.45,.05,.25,1), mask-position 2.2s cubic-bezier(.45,.05,.25,1);
  transition-delay: var(--rd, 0s), var(--rd, 0s), var(--rd, 0s), calc(var(--rd, 0s) + .15s), calc(var(--rd, 0s) + .15s); }
.ink.in, .in .ink { -webkit-mask-position: 0 0; mask-position: 0 0; }

/* chữ trong thẻ: từng dòng hiện lần lượt sau khi thẻ hiện */
.rv-line { opacity: 0; transform: translateY(10px); filter: blur(3px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1), filter 1s ease;
  transition-delay: calc(var(--rd, 0s) + .35s + var(--li, 0) * .14s); }
.in .rv-line { opacity: 1; transform: none; filter: none; }
.rv-line.ink { transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1), filter 1s ease,
  -webkit-mask-position 2.2s cubic-bezier(.45,.05,.25,1), mask-position 2.2s cubic-bezier(.45,.05,.25,1);
  transition-delay: calc(var(--rd, 0s) + .35s + var(--li, 0) * .14s); }

/* =========================================================
   0. MÀN MỞ THIỆP — hai cánh cửa thạch cao
   ========================================================= */
body.gate-lock { overflow: hidden; height: 100vh; height: 100svh; }
.gate { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; overflow: hidden; cursor: pointer; color: var(--plaster-ink); }
.gate-door { position: absolute; top: 0; bottom: 0; width: 50.5%; overflow: hidden; will-change: transform;
  transition: transform 1.6s cubic-bezier(.7,0,.25,1) .55s; }
.gate-left { left: 0; box-shadow: 6px 0 22px -10px rgba(90,75,65,.35); }
.gate-right { right: 0; box-shadow: -6px 0 22px -10px rgba(90,75,65,.35); }
/* cùng một ảnh trải cả màn hình, mỗi cánh cửa chỉ lộ một nửa → khép lại liền mạch */
.gate-bg { position: absolute; top: 0; bottom: 0; width: 100vw; background: #F2EFEA url("../assets/images/hero-relief.jpg") center / cover no-repeat; }
.gate-left .gate-bg { left: 0; }
.gate-right .gate-bg { right: 0; }
@media (max-width: 700px) and (orientation: portrait) {
  .gate-bg { background-image: url("../assets/images/hero-relief-mobile.jpg"); }
}
.gate-veil { position: absolute; inset: 0; pointer-events: none; transition: opacity .8s ease;
  background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(250,248,244,.86), rgba(250,248,244,.55) 55%, rgba(250,248,244,.18) 90%); }
@media (min-width: 820px) { .gate-veil { background: radial-gradient(ellipse 38% 60% at 50% 50%, rgba(250,248,244,.88), rgba(250,248,244,.55) 55%, rgba(250,248,244,.15) 90%); } }
.gate-seam { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(179,164,151,.55) 18%, rgba(179,164,151,.55) 82%, transparent); transition: opacity .5s ease; }
.gate-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 16px;
  transition: opacity .7s ease, transform .9s cubic-bezier(.4,0,.2,1), filter .7s ease; }
.gate-inner > * { opacity: 0; animation: gateIn 1.1s cubic-bezier(.25,.6,.3,1) forwards; }
.gate-inner > :nth-child(1) { animation-delay: .2s; }
.gate-inner > :nth-child(2) { animation-delay: .45s; }
.gate-inner > :nth-child(3) { animation-delay: .75s; }
.gate-inner > :nth-child(4) { animation-delay: 1.05s; }
.gate-inner > :nth-child(5) { animation-delay: 1.2s; }
.gate-inner > :nth-child(6) { animation-delay: 1.35s; }
.gate-inner > :nth-child(7) { animation-delay: 1.6s; }
@keyframes gateIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

.gate-eyebrow { font-family: var(--f-serif); font-style: italic; text-transform: uppercase; letter-spacing: .32em; font-size: clamp(.72rem, 2.8vw, .85rem); color: var(--plaster-soft); margin: 0 0 1.4rem; }
/* con dấu thạch cao: vòng nổi + vòng khắc chìm bên trong */
.gate-seal {
  position: relative; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  width: clamp(130px, 38vw, 172px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, var(--surface) 55%, #EEE8E0);
  box-shadow: -10px -10px 24px rgba(255,255,255,.95), 12px 16px 30px -8px rgba(110,95,82,.35);
  transition: transform .4s ease;
}
/* con dấu "thở" rất nhẹ để mời chạm */
.gate-inner > .gate-seal { animation: gateIn 1.1s cubic-bezier(.25,.6,.3,1) .3s forwards, sealBreath 3.2s ease-in-out 1.6s infinite; }
@keyframes sealBreath { 50% { transform: scale(1.035); box-shadow: -10px -10px 24px rgba(255,255,255,.95), 12px 16px 30px -8px rgba(110,95,82,.35), 0 0 0 12px rgba(255,255,255,.35); } }
.gate-seal:hover { transform: scale(1.04); }
.gate-seal:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.gate-seal::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; box-shadow: var(--inset); }
.gate-seal::after { content: ""; position: absolute; inset: 16px; border-radius: 50%; border: 1px solid rgba(179,164,151,.45); }
/* logo chữ lồng D N (PNG nền trong suốt) — hơi nổi như in dập trên thạch cao */
.gate-seal img { position: relative; height: 54%; width: auto; filter: drop-shadow(-1px -1px 0 rgba(255,255,255,.9)) drop-shadow(1px 1.5px 1.5px rgba(90,75,65,.25)); }
.gate-names { display: flex; flex-direction: column; align-items: center; margin: 1.5rem 0 1rem; font-weight: 400; line-height: 1.12; }
.gate-names span { font-family: var(--f-script); font-size: clamp(2.6rem, 12vw, 4.4rem); padding: 0 .2em; color: var(--plaster-ink); filter: var(--emboss); white-space: nowrap; }
.gate-names i { font-family: var(--f-serif); font-size: clamp(1.2rem, 4.6vw, 1.6rem); color: var(--plaster-soft); margin: .1em 0; }
.gate-date { display: flex; align-items: center; gap: 12px; font-family: var(--f-serif); font-size: clamp(1rem, 4.2vw, 1.25rem); letter-spacing: .26em; color: var(--plaster-ink); }
.gate-date .line { width: 38px; height: 1px; background: linear-gradient(90deg, transparent, #B5A99F, transparent); }
.gate-guest { display: flex; flex-direction: column; gap: .2rem; margin: 1.4rem 0 0; font-family: var(--f-serif); font-style: italic; font-size: clamp(.95rem, 3.8vw, 1.05rem); color: var(--ink-soft); }
.gate-guest b { font-family: var(--f-script); font-style: normal; font-weight: 400; font-size: clamp(1.8rem, 7.5vw, 2.3rem); line-height: 1.2; color: var(--plaster-ink); }
.gate-guest[hidden] { display: none; }
.gate-btn {
  margin-top: clamp(1.8rem, 6vw, 2.4rem); display: inline-flex; align-items: center; gap: 10px;
  padding: .85rem 1.9rem; border: 0; border-radius: 50px; cursor: pointer;
  font-family: var(--f-serif); font-weight: 600; text-transform: uppercase; letter-spacing: .22em; font-size: clamp(.82rem, 3.4vw, .92rem);
  color: var(--plaster-ink); background: linear-gradient(145deg, #FFFFFF, #ECE6DE);
  box-shadow: -6px -6px 14px rgba(255,255,255,.95), 8px 10px 22px -6px rgba(110,95,82,.35);
  transition: transform .3s, box-shadow .3s;
}
.gate-btn svg { width: 20px; height: 20px; color: var(--gold-deep); }
.gate-btn:hover { transform: translateY(-2px); box-shadow: -8px -8px 18px rgba(255,255,255,.95), 10px 14px 28px -6px rgba(110,95,82,.4); }
.gate-btn:active { transform: none; box-shadow: var(--inset); }
.gate-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
/* nút "thở" nhẹ để mời chạm */
.gate-inner > .gate-btn { animation: gateIn 1.1s cubic-bezier(.25,.6,.3,1) 1.35s forwards, gateBreath 2.8s ease-in-out 2.6s infinite; }
@keyframes gateBreath { 50% { box-shadow: -6px -6px 14px rgba(255,255,255,.95), 8px 10px 22px -6px rgba(110,95,82,.35), 0 0 0 10px rgba(179,164,151,.12); } }
.gate-hint { margin: .9rem 0 0; font-family: var(--f-serif); font-style: italic; font-size: .88rem; color: var(--plaster-soft); }

/* khi mở: chữ tan đi, cửa trượt sang hai bên */
.gate.opening { pointer-events: none; }
.gate.opening .gate-inner { opacity: 0; transform: scale(1.04); filter: blur(4px); }
.gate.opening .gate-veil, .gate.opening .gate-seam { opacity: 0; }
.gate.opening .gate-left { transform: translateX(-101%); }
.gate.opening .gate-right { transform: translateX(101%); }

@media (prefers-reduced-motion: reduce) {
  .gate-door { transition: none; }
  .gate.opening { opacity: 0; transition: opacity .5s; }
}

/* =========================================================
   BƯỚM BAY (2 con) — trên nội dung, không chặn thao tác
   ========================================================= */
#page { position: relative; z-index: 1; }
.ambient { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.amb-bf {
  position: absolute; left: 0; top: 0; aspect-ratio: 6 / 5; will-change: transform;
  filter: drop-shadow(0 5px 6px rgba(150,118,78,.25)); opacity: .96;
}
.amb-bf svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bf-flap { transform-box: view-box; transform-origin: 0 0; /* = giữa thân bướm (gốc toạ độ SVG) */ animation: bfFlap var(--flap, .3s) ease-in-out infinite alternate; }
@keyframes bfFlap { from { transform: scaleX(1); } to { transform: scaleX(.3); } }

/* =========================================================
   TỜ GIẤY MỸ THUẬT: vân giấy sần + khung dập nổi bo góc
   ========================================================= */
.paper {
  --inset: clamp(10px, 2.4vw, 26px);
  position: relative;
  background: var(--ivory) url("../assets/images/giay-my-thuat.jpg") 0 0 / 512px repeat;
}
/* khung dập chìm (blind emboss): mép trên-trái sáng, mép dưới-phải tối nhẹ */
.paper::before {
  content: ""; position: absolute; inset: var(--inset); z-index: 0; pointer-events: none;
  border-radius: clamp(14px, 2.6vw, 26px);
  box-shadow:
    -1px -1px 0 rgba(255,255,255,.95),
    1px 1px 0 rgba(150,135,118,.22),
    inset 1px 1px 0 rgba(150,135,118,.22),
    inset -1px -1px 0 rgba(255,255,255,.95),
    inset 0 0 14px rgba(255,255,255,.25);
}
/* mép trên tờ giấy mờ dần, nối liền với đáy trang chủ */
.paper::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 160px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(242,238,232,.7), rgba(242,238,232,0));
}
.paper > * { position: relative; z-index: 1; }
.paper > .section:not(.gallery-sec) { padding-left: calc(var(--inset) + 8px); padding-right: calc(var(--inset) + 8px); }

/* =========================================================
   1. HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  color: var(--plaster-ink); overflow: hidden; padding: 80px 16px;
  background: var(--ivory) url("../assets/images/giay-my-thuat.jpg") 0 0 / 512px repeat;
}
/* nền thạch cao nổi 3D — chỉ dùng ở trang chủ */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url("../assets/images/hero-relief.jpg") center / cover no-repeat;
  transform: scale(1.08); transform-origin: 50% 30%;
  transition: transform 6s cubic-bezier(.2,.6,.2,1);
  /* ảnh tan dần từ giữa trang xuống đáy */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.8) 72%, rgba(0,0,0,.4) 88%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.8) 72%, rgba(0,0,0,.4) 88%, transparent 100%);
}
/* lớp nhoè tăng dần ở nửa dưới — chuyển cảnh mềm sang nền kem */
.hero-blur {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%; z-index: 1; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.45) 50%, #000 85%);
          mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.45) 50%, #000 85%);
}
/* điện thoại (màn dọc): ảnh nền riêng */
@media (max-width: 700px) and (orientation: portrait) {
  .hero-bg { background-image: url("../assets/images/hero-relief-mobile.jpg"); }
}
body.started .hero-bg { transform: scale(1); }
/* làm dịu vùng giữa cho chữ dễ đọc + mép dưới tan dần vào nền trắng kem của các phần sau */
.hero-light {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, transparent 66%, rgba(242,238,232,.3) 86%, rgba(242,238,232,.55) 100%),
    radial-gradient(ellipse var(--halo) at 50% 48%, rgba(250,248,244,.75), rgba(250,248,244,.35) 55%, transparent 85%);
}

.hero-inner { position: relative; z-index: 3; }
.hero .eyebrow { color: var(--plaster-soft); margin-bottom: .7rem; }
.hero-sub { font-family: var(--f-serif); font-style: italic; font-size: 1.25rem; margin: 0 0 .5rem; color: var(--plaster-soft); }
.hero-names { margin: .8rem 0 1.8rem; font-weight: 400; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.sig {
  font-family: var(--f-script);
  font-size: clamp(3.6rem, 17vw, 7.5rem);
  padding: 0 .25em .1em;
  color: var(--plaster-ink);
  white-space: nowrap;
}
.sig .ch {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(.18em);
  /* chữ nổi như khắc trên thạch cao */
  text-shadow: -1px -1px 0 rgba(255,255,255,.9), 1px 2px 3px rgba(80,68,60,.22);
}
.sig .ch.sp { width: .28em; }
body.started .sig .ch { animation: reliefIn 1.4s cubic-bezier(.25,.6,.3,1) calc(var(--d) + var(--i) * .12s) forwards; }
@keyframes reliefIn {
  0%   { opacity: 0; filter: blur(10px); transform: translateY(.18em); color: #fff; }
  60%  { opacity: 1; filter: blur(0); color: #A3968C; }
  100% { opacity: 1; filter: blur(0); transform: none; color: var(--plaster-ink); }
}
.amp { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--plaster-soft); margin: .15em 0 .7em; }
.hero-date { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--f-serif); font-size: clamp(1.2rem, 5vw, 1.6rem); letter-spacing: .25em; color: var(--plaster-ink); }
.hero-date .line { width: 50px; height: 1px; background: linear-gradient(90deg, transparent, #B5A99F, transparent); }
.hero-quote { font-family: var(--f-serif); font-style: italic; font-size: 1.1rem; max-width: 440px; margin: 1.8rem auto 0; color: var(--plaster-soft); }

.fade-up { opacity: 0; transform: translateY(20px); }
body.started .fade-up { animation: fadeUp 1.2s ease var(--d) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

.scroll-down { position: absolute; z-index: 3; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 1.5px solid rgba(140,127,118,.55); border-radius: 14px; }
.scroll-down span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--plaster-soft); animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }


/* =========================================================
   3. ĐẾM NGƯỢC
   ========================================================= */
.countdown-sec { background: transparent; }
.countdown { display: flex; justify-content: center; gap: clamp(10px, 3vw, 22px); margin: 1.5rem 0; }
.cd span { display: block; margin-top: .6rem; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.cd-num {
  width: clamp(64px, 18vw, 104px); height: clamp(76px, 21vw, 120px);
  display: grid; place-items: center;
  font-family: var(--f-serif); font-weight: 500; font-size: clamp(2rem, 8vw, 3.2rem);
  color: var(--gold-deep);
  background: var(--surface);
  border-radius: 14px; position: relative;
  box-shadow: var(--shadow);
}
.cd-num::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(140,127,118,.15); }
.cd-num.flip { animation: flip .6s ease; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); } }
.lunar { font-family: var(--f-serif); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; }

/* =========================================================
   4. LỜI MỜI
   ========================================================= */
.invite { background: transparent; }
/* tiêu đề lời mời */
.invite-head { display: flex; flex-direction: column; align-items: center; }
.invite-title {
  font-family: var(--f-serif); font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.45rem, 6.4vw, 2.3rem); letter-spacing: .04em; line-height: 1.2;
  color: var(--plaster-ink); margin: 0; filter: var(--emboss);
}
.invite-line { display: block; width: 1.5px; height: 46px; margin: 1rem 0; background: linear-gradient(180deg, transparent, var(--gold), transparent); }
.invite-sub { font-family: var(--f-serif); font-size: clamp(1.15rem, 4.6vw, 1.45rem); color: var(--ink-soft); margin: 0; }

/* cô dâu – chú rể: hai cột so le */
.couple {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(10px, 3vw, 28px);
  max-width: 720px; margin: clamp(2.2rem, 7vw, 3.5rem) auto clamp(3rem, 9vw, 4.5rem);
  align-items: start;
}
.couple-col { display: flex; flex-direction: column; }
.c-name { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(1.4rem, 6vw, 2.6rem) 0; }
.couple-col:first-child .c-name { padding-top: clamp(.4rem, 3vw, 1.2rem); min-height: clamp(150px, 42vw, 260px); }
.c-role { font-family: var(--f-script); font-size: clamp(2.4rem, 10.5vw, 4rem); line-height: 1.5; color: var(--plaster-ink); padding: 0 .15em; filter: var(--emboss); }
.c-full { font-family: var(--f-serif); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(1.25rem, 5.6vw, 2rem); color: var(--gold-deep); margin-top: .5rem; }
.c-photo { margin: 0; aspect-ratio: 2 / 3; overflow: hidden; border-radius: clamp(10px, 2vw, 18px); background: var(--surface); box-shadow: var(--shadow); }
.c-photo img, .c-photo .ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.c-photo:hover img { transform: scale(1.04); }
/* gia đình: hai cột chữ, giữa là chữ lồng */
.families {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: clamp(10px, 4vw, 40px); max-width: 860px; margin: 0 auto;
}
.family { min-width: 0; }
.family-left { text-align: right; }
.family-right { text-align: left; }
.family h3 {
  font-family: var(--f-serif); font-weight: 600; text-transform: uppercase;
  letter-spacing: .28em; font-size: clamp(.8rem, 3vw, 1rem); color: var(--plaster-soft); margin: 0 0 .8rem;
}
.family p { font-family: var(--f-serif); font-weight: 500; font-size: clamp(1.15rem, 4.6vw, 1.6rem); line-height: 1.35; color: var(--plaster-ink); margin: .2rem 0; }
.family small { display: block; margin-top: .7rem; font-family: var(--f-serif); font-style: italic; font-size: clamp(.95rem, 3.6vw, 1.15rem); line-height: 1.45; color: var(--ink-soft); }
.family-mid { display: flex; flex-direction: column; align-items: center; gap: 10px; align-self: stretch; }
.fm-line { flex: 1; width: 1px; min-height: 28px; background: linear-gradient(180deg, transparent, var(--gold), transparent); }
.fm-mono {
  display: flex; align-items: center; justify-content: center; width: clamp(50px, 14vw, 64px); height: clamp(50px, 14vw, 64px); flex: none; white-space: nowrap; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-family: var(--f-serif); font-weight: 600; font-size: clamp(.95rem, 4vw, 1.15rem); letter-spacing: .02em; color: var(--gold-deep);
}
.fm-mono i { font-style: italic; font-weight: 400; margin: 0 1px; color: var(--plaster-soft); }
/* điện thoại: chữ lồng lên trên, hai cột tên dùng trọn bề ngang (ngăn bởi 1 vạch mảnh) → tên dài không bị xuống dòng */
@media (max-width: 560px) {
  .families { grid-template-columns: 1fr 1fr; grid-template-areas: "mid mid" "left right"; gap: 18px 0; }
  .family-mid { grid-area: mid; flex-direction: row; justify-content: center; align-self: auto; }
  .fm-mono { flex: none; white-space: nowrap; }
  .fm-line { flex: 0 1 70px; width: auto; height: 1px; min-height: 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
  .family-left { grid-area: left; padding-right: 14px; border-right: 1px solid rgba(179,164,151,.45); }
  .family-right { grid-area: right; padding-left: 14px; }
  .family p { font-size: clamp(.86rem, 4.4vw, 1.2rem); }
  /* căn giữa toàn bộ thông tin hai nhà */
  .family-left, .family-right { text-align: center; }
  .family-left { padding-right: 6px; }
  .family-right { padding-left: 6px; }
  /* địa chỉ 2 dòng: dòng trên đến xã, dòng dưới là tỉnh */
  .family small { font-size: clamp(.74rem, 3.6vw, .95rem); }
  .family small .addr-1, .family small .addr-2 { display: block; white-space: nowrap; }
  .family small .addr-sep { display: none; }
}

/* =========================================================
   5. TIMELINE
   ========================================================= */
.story { background: transparent; }
.timeline { position: relative; max-width: 980px; margin: 2rem auto 0; }
/* đường kẻ mảnh; đoạn đã cuộn qua đậm hơn */
.tl-track { position: absolute; left: 23px; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: rgba(140,127,118,.28); }
.tl-progress { width: 100%; height: 0; background: var(--plaster-soft); position: relative; }
.tl-progress::after { content: ""; position: absolute; bottom: -3px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--plaster-soft); }
.tl-item { position: relative; padding-left: 60px; margin-bottom: 3rem; text-align: left; }
/* vòng tròn trắng viền mảnh, icon nét */
.tl-dot {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFFDFA; border: 1px solid rgba(179,164,151,.45);
  box-shadow: 0 0 0 5px var(--ivory), 0 4px 14px -6px rgba(110,95,82,.25);
  color: var(--plaster-ink); z-index: 1;
}
.tl-dot svg { width: 20px; height: 20px; }
.tl-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tl-photo { aspect-ratio: 16/10; overflow: hidden; }
.tl-photo img, .tl-photo .ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.tl-card:hover .tl-photo img { transform: scale(1.06); }
.tl-body { padding: 1.2rem 1.4rem 1.5rem; }
.tl-year { font-family: var(--f-serif); font-size: 2.4rem; font-weight: 600; line-height: 1; background: var(--gold-text); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-body h3 { font-family: var(--f-serif); font-size: 1.5rem; font-weight: 600; margin: .3rem 0 .4rem; }
.tl-body p { margin: 0; color: var(--ink-soft); }

@media (min-width: 820px) {
  .tl-track { left: 50%; margin-left: -.5px; }
  .tl-item { width: 50%; padding: 0 60px 0 0; }
  .tl-item:nth-child(odd) { margin-left: 50%; padding: 0 0 0 60px; }
  .tl-item .tl-dot { left: auto; right: -23px; }
  .tl-item:nth-child(odd) .tl-dot { left: -23px; right: auto; }
  .tl-item:nth-child(even) { text-align: right; }
  .tl-item { margin-bottom: -2rem; }
  .tl-item:last-child { margin-bottom: 0; }
}

/* =========================================================
   6. ALBUM
   ========================================================= */
.gallery-sec { background: transparent; padding-left: 0; padding-right: 0; }
/* cụm ảnh: 1 ảnh to + ảnh nhỏ quanh. Điện thoại 3 cột (ảnh to trái/phải), màn hình rộng 4 cột (ảnh to trái/giữa/phải) */
.gallery { margin: 2rem auto 0; max-width: 980px; padding: 0 clamp(10px, 4vw, 28px); --g: clamp(6px, 1.8vw, 14px); --r-photo: clamp(8px, 1.6vw, 14px); }
.mg { display: grid; gap: var(--g); }
.mg-group { display: grid; gap: var(--g); grid-template-columns: repeat(3, 1fr); grid-auto-flow: row dense; }
.mg-small { aspect-ratio: 3 / 4; }
/* ảnh ngang mở đầu album: trọn bề ngang, đúng khổ 3:2 */
.mg-hero { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
/* ảnh to giữ đúng khổ dọc 2:3 nên cao hơn 2 ảnh nhỏ cạnh nó → 2 ảnh nhỏ đó dồn vào giữa theo chiều dọc
   (ảnh ở hàng trên bám đáy hàng, ảnh ở hàng dưới bám đỉnh hàng) */
.mg-big { grid-column: 1 / span 2; grid-row: span 2; aspect-ratio: 2 / 3; }
.mg-big.m-r { grid-column: 2 / span 2; }
.mg-big + .mg-small { align-self: end; }
.mg-big + .mg-small + .mg-small { align-self: start; }
.mg-small.wide-m { grid-column: span 2; aspect-ratio: 3 / 2; }
.mg-small.full-m { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
@media (min-width: 760px) {
  .mg-group { grid-template-columns: repeat(4, 1fr); }
  .mg-big.d-l { grid-column: 1 / span 2; }
  .mg-big.d-c { grid-column: 2 / span 2; }
  .mg-big.d-r { grid-column: 3 / span 2; }
  /* 4 ảnh nhỏ cạnh ảnh to: 2 ảnh hàng trên bám đáy, 2 ảnh hàng dưới bám đỉnh */
  .mg-big + .mg-small + .mg-small { align-self: end; }
  .mg-big + .mg-small + .mg-small + .mg-small,
  .mg-big + .mg-small + .mg-small + .mg-small + .mg-small { align-self: start; }
  .mg-small.wide-m, .mg-small.full-m { grid-column: auto; aspect-ratio: 3 / 4; }
  .mg-small.wide-d { grid-column: span 2; aspect-ratio: 3 / 2; }
  .mg-small.full-d { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
}
.mg-item {
  display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: var(--r-photo); overflow: hidden; cursor: zoom-in; background: var(--surface);
  box-shadow: 0 14px 26px -14px rgba(70,55,40,.45), 0 4px 8px -4px rgba(70,55,40,.25);
  /* trạng thái chờ: mờ, nằm thấp, hơi nhỏ */
  opacity: 0; transform: translateY(46px) scale(.96); filter: blur(4px);
  transition: opacity 1.5s ease var(--d, 0s), transform 1.7s cubic-bezier(.2,.7,.2,1) var(--d, 0s), filter 1.4s ease var(--d, 0s);
}
.mg-big { box-shadow: 0 22px 40px -18px rgba(70,55,40,.55), 0 6px 12px -6px rgba(70,55,40,.3); }
.mg-item.in { opacity: 1; transform: none; filter: none; }
.mg-item img, .mg-item .ph { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s ease; }
.mg-item:hover img { transform: scale(1.04); }
.mg-hint { margin: .8rem 0 0; font-family: var(--f-serif); font-style: italic; font-size: .9rem; color: var(--plaster-soft); }
@media (prefers-reduced-motion: reduce) { .mg-item { opacity: 1; transform: none; filter: none; transition: none; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(240,236,230,.97); display: grid; place-items: center; animation: fadeIn .35s ease; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 10px; box-shadow: 0 30px 70px -20px rgba(90,75,65,.45); animation: zoomIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } }
.lb-close, .lb-nav { position: absolute; background: var(--surface); color: var(--plaster-ink); border: none; box-shadow: var(--shadow-sm); border-radius: 50%; width: 46px; height: 46px; font-size: 1.6rem; line-height: 1; display: grid; place-items: center; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; color: var(--plaster-soft); font-family: var(--f-serif); letter-spacing: .2em; }

/* =========================================================
   7. THỜI GIAN & ĐỊA ĐIỂM (nằm trong phần Lời mời)
   ========================================================= */
/* thời gian & địa điểm: thẻ "vé mời" */
.events-head { margin-top: clamp(3.5rem, 11vw, 5rem); }
.events-title { font-family: var(--f-script); font-weight: 400; font-size: clamp(2.3rem, 9vw, 3.2rem); line-height: 1.2; margin: 0; color: var(--plaster-ink); filter: var(--emboss); }
.events { display: grid; gap: clamp(18px, 4vw, 26px); max-width: 640px; margin: clamp(1.6rem, 5vw, 2.4rem) auto 0; }
.ticket {
  --stub: clamp(96px, 27vw, 170px);
  position: relative; display: grid; grid-template-columns: var(--stub) 1fr;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
  text-align: left;
}
/* đường xé răng cưa + hai khuyết tròn */
.ticket::before {
  content: ""; position: absolute; left: var(--stub); top: 16px; bottom: 16px; width: 0;
  border-left: 1.5px dashed rgba(140,127,118,.35);
}
.ticket::after {
  content: ""; position: absolute; left: calc(var(--stub) - 11px); top: -11px; bottom: -11px; width: 22px;
  background:
    radial-gradient(circle at 50% 11px, var(--ivory) 10.5px, transparent 11px) top / 22px 22px no-repeat,
    radial-gradient(circle at 50% 11px, var(--ivory) 10.5px, transparent 11px) bottom / 22px 22px no-repeat;
  pointer-events: none;
}
.t-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 1.4rem .5rem; color: var(--plaster-ink);
}
.t-week { font-family: var(--f-serif); text-transform: uppercase; letter-spacing: .16em; font-size: clamp(.64rem, 2.5vw, .8rem); color: var(--plaster-soft); }
.t-day { font-family: var(--f-serif); font-weight: 500; font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1; margin: .15rem 0 .2rem; color: var(--gold-deep); filter: var(--emboss); }
.t-month { font-family: var(--f-serif); font-size: clamp(.72rem, 2.8vw, .9rem); letter-spacing: .04em; color: var(--ink-soft); }
.t-time {
  margin-top: .8rem; padding: .25rem .8rem; border-radius: 30px;
  font-family: var(--f-serif); font-weight: 600; font-size: clamp(1rem, 4.2vw, 1.25rem); letter-spacing: .06em;
  color: var(--plaster-ink); box-shadow: var(--inset); background: var(--ivory);
}
.t-body { padding: clamp(1.3rem, 5vw, 1.9rem) clamp(1.1rem, 5vw, 2rem) clamp(1.2rem, 4.5vw, 1.7rem) clamp(1.3rem, 5.5vw, 2.2rem); min-width: 0; }
.t-side { font-family: var(--f-serif); text-transform: uppercase; letter-spacing: .2em; font-size: clamp(.66rem, 2.6vw, .78rem); color: var(--plaster-soft); }
.t-name { font-family: var(--f-script); font-weight: 400; font-size: clamp(2.5rem, 11vw, 3.4rem); line-height: 1.5; margin: 0 0 .35rem; padding: 0 .2em; text-align: center; color: var(--plaster-ink); filter: var(--emboss); }
.t-place { font-family: var(--f-serif); font-weight: 600; font-size: clamp(1.02rem, 4.2vw, 1.2rem); line-height: 1.4; margin: 0 0 1rem; text-align: center; color: var(--plaster-ink); }
.t-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding-top: .85rem; border-top: 1px solid rgba(140,127,118,.18); }
.t-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--f-sans); font-weight: 500; font-size: .82rem; letter-spacing: .04em; color: var(--gold-deep); text-decoration: none;
  transition: color .25s, transform .25s;
}
.t-link svg { width: 17px; height: 17px; flex: none; }
.t-link span { border-bottom: 1px solid transparent; transition: border-color .25s; }
.t-link:hover { color: var(--plaster-ink); }
.t-link:hover span { border-color: currentColor; }
.t-link:active { transform: translateY(1px); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: .72rem 1.4rem; border-radius: 40px; border: none; font-size: .88rem; letter-spacing: .05em; text-decoration: none; transition: transform .25s, box-shadow .25s, background .25s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; box-shadow: var(--inset) !important; }
.btn-gold { background: linear-gradient(145deg, #FBF9F6, #E9E3DC); color: var(--plaster-ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.btn-gold:hover { box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--plaster-ink); box-shadow: inset 0 0 0 1px rgba(140,127,118,.4); }
.btn-ghost.light { color: var(--gold-deep); }

/* =========================================================
   8. MỪNG CƯỚI
   ========================================================= */
.gift-sec { background: transparent; }
.gifts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; max-width: 720px; margin: 0 auto; }
.gift { background: var(--surface); border-radius: 22px; padding: 1.8rem 1.2rem; box-shadow: var(--shadow); transition: transform .4s; }
.gift:hover { transform: translateY(-6px) rotate(-.5deg); }
.gift h3 { font-family: var(--f-serif); font-weight: 600; font-size: 1.25rem; margin: 0 0 1rem; }
.qr { width: 200px; margin: 0 auto 1rem; padding: 10px; border-radius: 14px; background: #fff; box-shadow: var(--inset); }
.qr img, .qr svg { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.gift .bank { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.gift .acc { font-family: var(--f-serif); font-size: 1.6rem; font-weight: 600; letter-spacing: .08em; margin: .1rem 0; color: var(--gold-deep); }
.gift .holder { margin: 0 0 1rem; font-weight: 500; }

/* =========================================================
   9. FOOTER
   ========================================================= */
.footer { position: relative; min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 6rem 16px; overflow: hidden; }
.footer { background: transparent; color: var(--plaster-ink); }
.footer-inner { position: relative; z-index: 2; }
.footer-title { font-family: var(--f-serif); font-weight: 500; color: var(--plaster-ink); font-size: clamp(1.6rem, 6vw, 2.4rem); margin: 0 0 .5rem; }
.footer-date { letter-spacing: .3em; font-family: var(--f-serif); color: var(--ink-soft); }

/* =========================================================
   NÚT NỔI, TOAST, ẢNH DỰ PHÒNG
   ========================================================= */
.fab { position: fixed; z-index: 90; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--surface); color: var(--plaster-ink); display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--shadow-sm); transition: opacity .4s, transform .4s; }
.fab[hidden] { display: none; }
.music { bottom: 78px; }
.music .disc { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.music.playing .disc { animation: spin 4s linear infinite; background: radial-gradient(circle, transparent 30%, rgba(140,127,118,.12) 31%, transparent 60%); }
.music:not(.playing)::after { content: ""; position: absolute; width: 60%; height: 1.5px; background: var(--plaster-soft); transform: rotate(-45deg); }
.totop { bottom: 20px; opacity: 0; transform: translateY(20px); pointer-events: none; }
.totop.show { opacity: 1; transform: none; pointer-events: auto; }

.toast { position: fixed; z-index: 300; left: 50%; bottom: 30px; transform: translate(-50%, 30px); background: var(--plaster-ink); color: #F6F3EF; padding: .7rem 1.4rem; border-radius: 30px; font-size: .9rem; opacity: 0; transition: all .4s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.ph { /* khung ảnh dự phòng khi ảnh lỗi */
  display: grid; place-items: center;
  background: linear-gradient(135deg, #EEE9E3, var(--gold-light) 60%, var(--gold));
  font-family: var(--f-script); font-size: 3.4rem; color: rgba(255,255,255,.9);
  min-height: 120px;
}

/* =========================================================
   GIẢM CHUYỂN ĐỘNG
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
  .sig .ch { opacity: 1; filter: none; transform: none; }
  .ink { -webkit-mask-image: none; mask-image: none; }
  .reveal, .rv-line { filter: none !important; }
  .fade-up { opacity: 1; transform: none; }
  /* không chạy tự động — cho vuốt ngang để xem */
}

/* giữ một cụm chữ trên cùng một dòng */
.nobr { white-space: nowrap; }
