/*
 * GIAO DIỆN THIỆP — "Song Hỷ": đỏ đô, vàng kim, giấy ngà.
 * Muốn đổi màu / cỡ chữ: sửa các biến ngay bên dưới.
 */
:root {
  --red-950: #3d0609;
  --red-900: #4f070c;
  --red-800: #63090f;
  --red-700: #7a1019;
  --red-600: #8f1a24;
  --gold-600: #b08a45;
  --gold-500: #c9a45c;
  --gold-300: #e3c88f;
  --gold-200: #f0dfb8;
  --ivory: #fbf5ea;
  --paper: #fffaf1;
  --blush: #f6e6df;
  --ink: #3a2224;
  --ink-soft: #6f5557;
  --line: #e6d6c6;

  --script: 'Great Vibes', 'Segoe Script', 'Brush Script MT', cursive;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --col: 480px;
  --pad: 24px;
  --lb-bg: rgba(40, 5, 8, 0.96);
  --toast-bg: rgba(61, 6, 9, 0.94);
  --heart-color: #e2485f;
  --lattice: repeating-linear-gradient(45deg, rgba(227, 200, 143, 0.045) 0, rgba(227, 200, 143, 0.045) 1px, transparent 1px, transparent 16px),
    repeating-linear-gradient(-45deg, rgba(227, 200, 143, 0.045) 0, rgba(227, 200, 143, 0.045) 1px, transparent 1px, transparent 16px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--red-950);
  background-image: var(--lattice);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
p,
h1,
h2,
h3,
figure,
ul,
ol,
fieldset {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
fieldset {
  border: 0;
  min-width: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

/* ───────── chữ ───────── */
.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
.amp {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.script .amp {
  font-size: 0.6em;
  margin: 0 0.08em;
  color: var(--gold-300);
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red-600);
}
.eyebrow--gold {
  color: var(--gold-300);
}
.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.25;
  color: var(--red-700);
}
.title--gold {
  color: var(--gold-200);
}
.orn {
  display: block;
  width: 168px;
  height: 17px;
  margin: 12px auto 0;
  color: var(--gold-500);
}
.head {
  text-align: center;
  margin-bottom: 30px;
}
.head .title {
  margin-top: 8px;
}
.lead {
  max-width: 34ch;
  margin: -12px auto 26px;
  text-align: center;
  color: var(--ink-soft);
}

/* ───────── nút ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn--solid {
  background: var(--red-700);
  color: var(--ivory);
  box-shadow: 0 6px 16px rgba(122, 16, 25, 0.22);
}
.btn--solid:hover {
  background: var(--red-600);
}
.btn--line {
  background: transparent;
  border-color: var(--red-700);
  color: var(--red-700);
}
.btn--line:hover {
  background: rgba(122, 16, 25, 0.06);
}
.btn--gold {
  background: linear-gradient(180deg, #f1dfb2 0%, #d2ae66 100%);
  color: var(--red-900);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--block {
  display: flex;
  width: 100%;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.link {
  padding: 10px 6px;
  border: 0;
  background: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--red-700);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ───────── khung trang ───────── */
.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.55);
}
.sec {
  position: relative;
  padding: 68px var(--pad);
}
.sec--paper {
  background: var(--paper);
}
.sec--blush {
  background: linear-gradient(180deg, var(--blush) 0%, var(--paper) 100%);
}
.sec--red {
  background-color: var(--red-800);
  background-image: var(--lattice), radial-gradient(120% 70% at 50% 30%, var(--red-700) 0%, var(--red-800) 55%, var(--red-900) 100%);
  color: var(--ivory);
}
.sec--red :focus-visible {
  outline-color: var(--gold-200);
}
.frame {
  position: relative;
  padding: 34px 24px 32px;
  border: 1px solid var(--gold-500);
  background: rgba(255, 253, 248, 0.86);
}
.frame::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  border: 1px solid rgba(201, 164, 92, 0.5);
  pointer-events: none;
}
.arch {
  position: relative;
  overflow: hidden;
  border-radius: 999px 999px 6px 6px;
  background: var(--blush);
}
.arch img {
  width: 100%;
}

/* ═════════ MÀN HÌNH MỞ THIỆP ═════════ */
.gate {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background-color: var(--red-800);
  background-image: var(--lattice), radial-gradient(90% 60% at 50% 42%, #84121b 0%, var(--red-800) 55%, var(--red-950) 100%);
  color: var(--ivory);
  text-align: center;
}
.gate__inner {
  width: 100%;
  max-width: 360px;
  margin: auto;
}
.gate__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory);
}
.gate__names {
  margin-top: 10px;
  font-size: 38px;
  font-size: min(10.6vw, 42px);
  white-space: nowrap;
  line-height: 1.4;
  color: var(--gold-200);
  text-shadow: 0 2px 16px rgba(40, 0, 4, 0.5);
}
.gate__date {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ivory);
}

.env {
  position: relative;
  width: 100%;
  max-width: 318px;
  margin: 26px auto 0;
}
.env__body {
  position: relative;
  height: 0;
  padding-bottom: 66%;
  border-radius: 8px;
  background: linear-gradient(180deg, #7d121b 0%, #5c0a11 100%);
  box-shadow: 0 22px 44px rgba(20, 0, 2, 0.5), inset 0 0 0 1px rgba(227, 200, 143, 0.4);
  -webkit-perspective: 900px;
  perspective: 900px;
}
.env__letter {
  position: absolute;
  top: 9%;
  right: 7%;
  bottom: 7%;
  left: 7%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 9%;
  border-radius: 4px;
  background: var(--paper);
  color: var(--red-700);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.env__letter-hy {
  width: 44px;
  height: 44px;
  color: var(--red-700);
}
.env__letter .script {
  margin-top: 4px;
  font-size: 24px;
  white-space: nowrap;
}
.env__letter .amp {
  color: var(--red-600);
}
.env__pocket {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #8b1721 0%, #6a0d15 100%);
  -webkit-clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}
.env__pocket::after {
  /* hai nếp gấp chéo của phong bì */
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(227, 200, 143, 0.28) 50%, transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(227, 200, 143, 0.28) 50%, transparent calc(50% + 1px));
  opacity: 0.7;
}
.env__flap {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  height: 60%;
  -webkit-transform-origin: 50% 0;
  transform-origin: 50% 0;
  -webkit-filter: drop-shadow(0 5px 6px rgba(20, 0, 2, 0.35));
  filter: drop-shadow(0 5px 6px rgba(20, 0, 2, 0.35));
}
.env__flap-shape {
  width: 100%;
  height: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #a3222e 0%, #84151f 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env__seal {
  position: absolute;
  top: 60%;
  left: 50%;
  z-index: 4;
  width: 66px;
  height: 66px;
  margin: -35px 0 0 -33px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f7e7bd 0%, #d5b36c 46%, #a8843f 100%);
  color: var(--red-800);
  box-shadow: 0 6px 14px rgba(20, 0, 2, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.22), inset 0 0 0 5px rgba(122, 16, 25, 0.16);
  cursor: pointer;
}
.env__seal svg {
  width: 34px;
  height: 34px;
}
.env__seal::after {
  /* vòng nhấp nháy mời chạm */
  content: '';
  position: absolute;
  top: -7px;
  right: -7px;
  bottom: -7px;
  left: -7px;
  border-radius: 50%;
  border: 1px solid rgba(240, 223, 184, 0.7);
  animation: seal-pulse 2.2s ease-out infinite;
}
@keyframes seal-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.92);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}
.env__plate {
  position: relative;
  z-index: 5;
  width: 88%;
  margin: -13% auto 0;
  padding: 15px 16px 17px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(20, 0, 2, 0.4);
}
.env__plate::before {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  left: 5px;
  border: 1px solid var(--gold-500);
  border-radius: 2px;
  pointer-events: none;
}
.env__to {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.env__guest {
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.25;
  color: var(--red-700);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.guest-long .env__guest {
  font-size: 22px;
}
.guest-xlong .env__guest {
  font-size: 19px;
  line-height: 1.3;
}
.gate__open {
  margin-top: 26px;
  min-width: 190px;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gate__hint {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(251, 245, 234, 0.78);
}

/* hiệu ứng mở thiệp (1,75 giây) */
.gate-opening .env__seal {
  animation: seal-off 0.45s ease forwards;
}
.gate-opening .env__seal::after {
  animation: none;
  opacity: 0;
}
.gate-opening .env__flap {
  animation: flap-open 0.7s 0.25s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}
.gate-opening .env__letter {
  animation: letter-up 0.75s 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.gate-opening .env__plate,
.gate-opening .gate__open,
.gate-opening .gate__hint {
  animation: fade-down 0.4s ease forwards;
}
.gate-opening .gate {
  animation: gate-out 0.55s 1.2s ease forwards;
}
@keyframes seal-off {
  40% {
    opacity: 1;
    transform: scale(1.16);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}
@keyframes flap-open {
  0% {
    z-index: 3;
    transform: rotateX(0deg);
  }
  50% {
    z-index: 3;
  }
  51% {
    z-index: 0;
  }
  100% {
    z-index: 0;
    transform: rotateX(180deg);
  }
}
@keyframes letter-up {
  to {
    transform: translateY(-58%);
  }
}
@keyframes fade-down {
  to {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes gate-out {
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}
@media (max-height: 640px) {
  .gate__names {
    font-size: 34px;
    font-size: min(9.6vw, 36px);
    margin-top: 4px;
  }
  .env {
    max-width: 270px;
    margin-top: 14px;
  }
  .env__seal {
    width: 56px;
    height: 56px;
    margin: -30px 0 0 -28px;
  }
  .env__seal svg {
    width: 28px;
    height: 28px;
  }
  .env__guest {
    font-size: 23px;
  }
  .guest-long .env__guest {
    font-size: 19px;
  }
  .guest-xlong .env__guest {
    font-size: 17px;
  }
  .gate__open {
    margin-top: 16px;
  }
  .gate__hint {
    margin-top: 8px;
  }
}

/* ═════════ NÚT NỔI ═════════ */
.fixed {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 60;
  width: 100%;
  max-width: var(--col);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  pointer-events: none;
}
.gate-on .fixed {
  visibility: hidden;
}
.music {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(227, 200, 143, 0.65);
  border-radius: 50%;
  background: rgba(79, 7, 12, 0.78);
  color: var(--gold-200);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.music svg {
  width: 22px;
  height: 22px;
}
.music::after {
  /* gạch chéo khi nhạc đang tắt */
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 1.5px;
  margin: -1px 0 0 -14px;
  background: currentColor;
  border-radius: 2px;
  transform: rotate(-45deg);
  transition: opacity 0.2s ease;
}
.music.is-playing::after {
  opacity: 0;
}
.music.is-playing svg {
  animation: music-sway 2.4s ease-in-out infinite;
}
@keyframes music-sway {
  0%,
  100% {
    transform: rotate(-9deg) scale(1);
  }
  50% {
    transform: rotate(9deg) scale(1.08);
  }
}
.dock {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(227, 200, 143, 0.5);
  border-radius: 999px;
  background: rgba(79, 7, 12, 0.94);
  box-shadow: 0 10px 28px rgba(20, 0, 2, 0.4);
  pointer-events: auto;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translate(-50%, 16px);
  transform: translate(-50%, 16px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}
.dock.is-on {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}
.dock__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ivory);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.dock__item svg {
  width: 18px;
  height: 18px;
  color: var(--gold-300);
}
.dock__item:active {
  background: rgba(255, 255, 255, 0.1);
}
.dock__heart svg {
  color: #f08a98;
  transition: transform 0.2s ease;
}
.dock__heart.is-liked svg {
  color: #ff6f85;
}
.dock__heart:active svg {
  transform: scale(1.3);
}

/* ═════════ 1. MỞ ĐẦU ═════════ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(58px + env(safe-area-inset-top, 0px)) 0 64px;
  background-color: #63090f;
  background-image: radial-gradient(95% 55% at 50% 36%, #7c0d14 0%, #650a10 58%, #4f070c 100%);
  color: var(--ivory);
  text-align: center;
  overflow: hidden;
}
.hero__eyebrow {
  position: relative;
  z-index: 2;
}
.hero__photo {
  position: relative;
  margin-top: -4px;
}
.hero__photo img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 70%, transparent 98%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 70%, transparent 98%);
}
.hero__text {
  position: relative;
  z-index: 2;
  margin-top: -27%;
  padding: 0 16px;
}
.hero__names {
  font-size: 40px;
  font-size: min(10.9vw, 52px);
  white-space: nowrap;
  line-height: 1.35;
  color: var(--gold-200);
  text-shadow: 0 2px 20px rgba(50, 0, 4, 0.75), 0 0 2px rgba(50, 0, 4, 0.5);
}
.hero__event {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding-left: 0.3em;
}
.hero__date {
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--gold-300);
}
.hero__next {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  animation: nudge 2s ease-in-out infinite;
}
.hero__next svg {
  width: 26px;
  height: 26px;
}
@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}
/* chữ mở đầu hiện dần sau khi mở thiệp */
.js .hero__eyebrow,
.js .hero__text > * {
  opacity: 0;
  transform: translateY(16px);
}
.gate-open .hero__eyebrow,
.gate-open .hero__text > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gate-open .hero__text > :nth-child(1) {
  transition-delay: 0.25s;
}
.gate-open .hero__text > :nth-child(2) {
  transition-delay: 0.45s;
}
.gate-open .hero__text > :nth-child(3) {
  transition-delay: 0.6s;
}

/* ═════════ 2. LỜI MỜI ═════════ */
.invite {
  text-align: center;
  background-image: radial-gradient(80% 40% at 50% 0%, rgba(243, 220, 214, 0.75) 0%, rgba(255, 250, 241, 0) 100%);
}
.invite__to {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.invite__guest {
  margin-top: 8px;
  padding-bottom: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 31px;
  line-height: 1.25;
  color: var(--red-700);
  overflow-wrap: anywhere;
  word-break: break-word;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent) center bottom / 150px 1px no-repeat;
}
.guest-long .invite__guest {
  font-size: 25px;
}
.guest-xlong .invite__guest {
  font-size: 21px;
  line-height: 1.3;
}
.invite__body {
  margin-top: 20px;
  text-align: center;
  color: var(--ink);
}
.invite__call {
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 21px;
  line-height: 1.45;
  color: var(--red-700);
}

/* ═════════ 3. HAI BÊN GIA ĐÌNH ═════════ */
.family {
  padding-top: 0;
  text-align: center;
}
.family__band {
  margin: 0 calc(var(--pad) * -1);
}
.family__band img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 100%);
}
.family__inner {
  position: relative;
  margin-top: -52px;
}
.family__hy {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  padding: 11px;
  border-radius: 50%;
  border: 1px solid var(--gold-500);
  background: var(--red-800);
  color: var(--gold-300);
  box-shadow: 0 0 0 5px rgba(99, 9, 15, 0.9), 0 0 0 6px rgba(201, 164, 92, 0.45);
}
.family__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
  padding: 26px 0;
  border-top: 1px solid rgba(227, 200, 143, 0.4);
  border-bottom: 1px solid rgba(227, 200, 143, 0.4);
}
.family__side {
  padding: 0 8px;
}
.family__side + .family__side {
  border-left: 1px solid rgba(227, 200, 143, 0.4);
}
.family__side h3 {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 25px;
  line-height: 1.3;
  color: var(--gold-200);
}
.family__side p {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18.5px;
  line-height: 1.6;
  white-space: nowrap;
}
.family__place {
  margin-top: 10px;
  font-family: var(--sans) !important;
  font-size: 11.5px !important;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.family__names {
  margin-top: 34px;
}
.family__names .script {
  font-size: 44px;
  line-height: 1.3;
  color: var(--ivory);
}
.family__names .amp {
  font-size: 26px;
  line-height: 1.1;
  color: var(--gold-300);
}

/* ═════════ 4. THỜI GIAN & ĐỊA ĐIỂM ═════════ */
.event {
  text-align: center;
}
.event__time {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.event__time b {
  font-weight: 600;
  color: var(--red-700);
}
.date {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}
.date__side {
  flex: 1 1 0;
  max-width: 132px;
  padding: 9px 0;
  border-top: 1px solid var(--gold-500);
  border-bottom: 1px solid var(--gold-500);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-700);
}
.date__day {
  flex: none;
  padding: 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 92px;
  line-height: 1;
  color: var(--red-700);
}
.event__lunar {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18.5px;
  color: var(--ink-soft);
}
.event__photo {
  width: 78%;
  margin: 34px auto 0;
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--gold-500), 0 24px 40px -18px rgba(90, 20, 25, 0.45);
}
.place {
  margin-top: 40px;
}
.place__name {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.25;
  color: var(--red-700);
}
.place__addr {
  max-width: 30ch;
  margin: 8px auto 0;
  color: var(--ink);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.actions .btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 200px;
  padding: 0 12px;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.map {
  margin-top: 24px;
  border: 1px solid var(--gold-500);
  padding: 5px;
  background: #fff;
}
.map iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
}
.program {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.program__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.25;
  color: var(--red-700);
}
.steps {
  position: relative;
  width: -webkit-fit-content;
  width: fit-content;
  max-width: 100%;
  margin: 24px auto 0;
  text-align: left;
}
.steps::before {
  content: '';
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 88px;
  width: 1px;
  background: var(--gold-500);
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 58px 44px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.step + .step {
  margin-top: 20px;
}
.step__time {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  line-height: 1;
  color: var(--red-700);
  text-align: right;
}
.step__icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-500);
  border-radius: 50%;
  background: var(--paper);
  color: var(--red-700);
}
.step__icon svg {
  width: 22px;
  height: 22px;
}
.step__name {
  padding-left: 4px;
  font-size: 16px;
  font-weight: 500;
}

/* ═════════ 5. ĐẾM NGƯỢC + LỊCH ═════════ */
.count {
  padding-top: 0;
  text-align: center;
}
.count__photo {
  margin: 0 calc(var(--pad) * -1);
}
.count__photo img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 58%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 58%, transparent 96%);
}
.count__body {
  position: relative;
  margin-top: -30%;
}
.cd__tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.cd__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 0 11px;
  border: 1px solid rgba(227, 200, 143, 0.6);
  border-radius: 12px;
  background: rgba(61, 6, 9, 0.5);
  box-shadow: inset 0 0 0 3px rgba(61, 6, 9, 0.35), inset 0 0 0 4px rgba(227, 200, 143, 0.16);
}
.cd__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  color: var(--gold-200);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum', 'lnum';
}
.cd__lbl {
  margin-top: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory);
}
.cd__msg {
  padding: 18px 16px;
  border: 1px solid rgba(227, 200, 143, 0.6);
  border-radius: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--gold-200);
}
.calbox {
  position: relative;
  margin-top: 30px;
  padding: 24px 16px 18px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  box-shadow: 0 18px 36px rgba(20, 0, 2, 0.35);
}
.calbox::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  border: 1px solid var(--gold-500);
  pointer-events: none;
}
.calbox__month {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--red-700);
}
.cal {
  position: relative;
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  table-layout: fixed;
}
.cal th {
  padding: 8px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.cal th.is-sun,
.cal td.is-sun {
  color: var(--red-600);
}
.cal td {
  height: 42px;
  padding: 0;
  text-align: center;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.cal__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
}
.cal td.is-day .cal__n {
  padding-bottom: 3px;
  font-weight: 600;
  color: #fff;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 38'%3E%3Cpath d='M20 36.200l-2.400-2.200C8.400 25.700 2.500 20.300 2.500 13.500 2.500 8 6.800 3.800 12.200 3.800c3 0 6 1.400 7.800 3.700 1.800-2.300 4.800-3.700 7.800-3.700 5.400 0 9.700 4.200 9.700 9.700 0 6.800-5.900 12.200-15.100 20.500L20 36.200z' fill='%237a1019'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: day-beat 1.8s ease-in-out infinite;
}
@keyframes day-beat {
  0%,
  100% {
    transform: scale(1);
  }
  18% {
    transform: scale(1.12);
  }
  36% {
    transform: scale(1);
  }
}

/* ═════════ 6. CÔ DÂU & CHÚ RỂ ═════════ */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.person {
  text-align: center;
}
.person .arch {
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--gold-500), 0 22px 32px -18px rgba(90, 20, 25, 0.5);
  margin: 6px;
}
.person figcaption {
  margin-top: 20px;
}
.person .eyebrow {
  display: block;
}
.person__name {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.35;
  color: var(--red-700);
  white-space: nowrap;
}

/* ═════════ 7. ALBUM ═════════ */
.album {
  padding-left: 14px;
  padding-right: 14px;
}
.album__hint {
  margin: -16px 0 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shot {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: #eadfd3;
}
.shot--wide {
  grid-column: 1 / -1;
}
.shot img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (hover: hover) {
  .shot:hover img {
    transform: scale(1.04);
  }
}
.shot:focus-visible {
  outline-offset: 2px;
}

/* ═════════ 8 + 9. BIỂU MẪU ═════════ */
.rsvp__photo {
  margin: -22px 0 36px;
  border-radius: 150px 150px 6px 6px;
  overflow: hidden;
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--gold-500), 0 22px 32px -18px rgba(90, 20, 25, 0.5);
}
.rsvp__photo img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.form,
.done {
  padding: 26px 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 40px -26px rgba(90, 20, 25, 0.45);
}
.field {
  display: block;
}
.field + .field,
.opts,
.stepper {
  margin-top: 20px;
}
.field__label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #d9c7b8;
  border-radius: 12px;
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder {
  color: #a8958f;
}
.input:focus {
  outline: none;
  border-color: var(--red-700);
  box-shadow: 0 0 0 3px rgba(122, 16, 25, 0.14);
}
.input--area {
  resize: vertical;
  min-height: 112px;
}
.is-invalid .input,
.input.is-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  cursor: pointer;
}
.opt + .opt {
  margin-top: 10px;
}
.opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.opt__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 1px solid #d9c7b8;
  border-radius: 14px;
  background: var(--paper);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.opt__mark {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid #b9a394;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.2s ease;
}
.opt__mark::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 50%;
  background: var(--red-700);
  transform: scale(0);
  transition: transform 0.2s ease;
}
.opt__text {
  position: relative;
  font-size: 16px;
  font-weight: 500;
}
.opt input:checked ~ .opt__bg {
  border-color: var(--red-700);
  background: #fdf1ee;
  box-shadow: 0 0 0 1px var(--red-700);
}
.opt input:checked ~ .opt__mark {
  border-color: var(--red-700);
}
.opt input:checked ~ .opt__mark::after {
  transform: scale(1);
}
.opt input:focus-visible ~ .opt__bg {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}
.opts.is-invalid .opt__bg,
.is-invalid ~ .opt__bg {
  border-color: #c0392b;
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: #f8efe6;
}
.stepper .field__label {
  margin: 0;
}
.stepper__ctl {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper__btn {
  width: 44px;
  height: 44px;
  padding: 0 0 2px;
  border: 1px solid #d9c7b8;
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: var(--red-700);
  cursor: pointer;
}
.stepper__btn[disabled] {
  opacity: 0.4;
  cursor: default;
}
.stepper__num {
  min-width: 34px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: var(--red-700);
}
.form.is-declined .stepper {
  opacity: 0.55;
}
.form__error {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdecea;
  color: #9c2b20;
  font-size: 14.5px;
  line-height: 1.5;
}
.form .btn--block {
  margin-top: 22px;
}
.form.is-sending .btn--block {
  position: relative;
  color: transparent;
}
.form.is-sending .btn--block::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(251, 245, 234, 0.4);
  border-top-color: var(--ivory);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.done {
  text-align: center;
}
.done__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-700);
  color: var(--gold-200);
}
.done__icon svg {
  width: 28px;
  height: 28px;
}
.done__summary {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.3;
  color: var(--red-700);
}
.done__text {
  margin-top: 8px;
  color: var(--ink);
}
.done .link {
  margin-top: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid #e3d0c3;
  border-radius: 999px;
  background: #fbf3ec;
  font-size: 14px;
  line-height: 1.35;
  color: var(--red-700);
  text-align: left;
  cursor: pointer;
}
.chip:active {
  background: #f6e1d9;
}
.wishes__count {
  margin: 30px 0 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.wishlist {
  display: grid;
  gap: 12px;
}
.wish {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.wish.is-new {
  animation: wish-in 0.6s ease;
  border-color: var(--gold-500);
}
@keyframes wish-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
.wish__avatar {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-700);
  color: var(--gold-200);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
}
.wish__main {
  min-width: 0;
}
.wish__text {
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
}
.wish__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.wish__meta strong {
  font-weight: 600;
  color: var(--red-700);
  overflow-wrap: anywhere;
}
.wishes__empty {
  padding: 22px 18px;
  border: 1px dashed #d9c7b8;
  border-radius: 16px;
  text-align: center;
  color: var(--ink-soft);
}
.wishes__more {
  margin-top: 16px;
}

/* ═════════ 10. LỜI CẢM ƠN ═════════ */
.thanks {
  padding-top: 58px;
  padding-bottom: 46px;
  text-align: center;
}
.thanks__title {
  position: relative;
  z-index: 2;
  font-size: 62px;
  line-height: 1.2;
  color: var(--gold-200);
}
.thanks__photo {
  margin: -34px calc(var(--pad) * -1) 0;
}
.thanks__photo img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 91%, transparent 100%);
}
.thanks__text {
  position: relative;
  margin-top: 10px;
}
.thanks__text > p[data-tone] {
  max-width: 34ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ivory);
}
.thanks__names {
  margin-top: 26px;
  font-size: 36px;
  font-size: min(10.2vw, 46px);
  white-space: nowrap;
  line-height: 1.4;
  color: var(--gold-200);
}
.thanks__date {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.22em;
  color: var(--ivory);
}
.foot {
  padding: 26px var(--pad) calc(36px + env(safe-area-inset-bottom, 0px));
  background: var(--red-950);
  color: rgba(251, 245, 234, 0.8);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
}
.foot__hy {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  color: var(--gold-500);
}

/* ═════════ hiệu ứng hiện dần khi cuộn ═════════ */
html.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.reveal-on [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ═════════ màn hình hẹp / rộng ═════════ */
@media (max-width: 374px) {
  :root {
    --pad: 20px;
  }
  .title {
    font-size: 29px;
  }
  .family__names .script {
    font-size: 39px;
  }
  .family__side p {
    font-size: 17px;
  }
  .date__day {
    font-size: 82px;
    padding: 0 14px;
  }
  .date__side {
    font-size: 12.5px;
    letter-spacing: 0.16em;
  }
  .person__name {
    font-size: 19.5px;
  }
  .cd__num {
    font-size: 35px;
  }
  .dock__item {
    padding: 0 11px;
    font-size: 13px;
  }
  .thanks__title {
    font-size: 54px;
  }
}
@media (min-width: 481px) {
  .page {
    margin-top: 0;
  }
}

/* ═════════ tôn trọng cài đặt "giảm chuyển động" ═════════ */
@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;
  }
  .env__seal::after,
  .hero__next {
    animation: none;
  }
}
