/*
 * Giao diện "Xanh ngọc" — thiệp cưới nhà trai · Lễ Thành Hôn Tuấn Ngọc & Cẩm Tú
 *
 * Màu lấy theo thiệp giấy: nền xanh ngọc, thiệp trắng, chữ và hoa văn vàng nâu.
 * Hoạ tiết: hoa văn góc thiệp, trái tim, nơ, chấm bi, viền vỏ sò.
 *
 * MUỐN ĐỔI MÀU: chỉ cần sửa các biến ngay bên dưới.
 *   --teal-50 … --teal-300   : các nền xanh ngọc nhạt
 *   --teal-500               : đúng màu xanh ngọc của thiệp giấy (nền ngoài cùng, nền màn hình mở thiệp)
 *   --brown-600, --brown-700 : màu nút bấm và chữ tiêu đề (vàng nâu của chữ in trên thiệp giấy)
 *   --gold-600 … --gold-300  : dấu "&", đường kẻ, hoa văn trang trí
 */
:root {
  color-scheme: only light;

  --teal-50: #f3fafa;
  --teal-100: #e4f3f4;
  --teal-200: #cbe7ea;
  --teal-300: #a5d4d9;
  --teal-400: #77bec5;
  --teal-500: #48a5ad;
  --brown-600: #8f651f;
  --brown-700: #7b5619;
  --brown-800: #5f4212;
  --gold-600: #a8822f;
  --gold-500: #c2a05a;
  --gold-300: #e7d8b3;
  --paper: #fffefb;
  --blush: #f4fafa;
  --ink: #4a3b1e;
  --ink-soft: #7a6c50;
  --line: #e2ecec;
  --field: #cfe0e2;
  --shadow: 38, 112, 120; /* màu bóng đổ (r, g, b) */

  --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;

  /* màu cho phần lõi (core.css) */
  --lb-bg: rgba(16, 40, 43, 0.96);
  --toast-bg: rgba(31, 88, 95, 0.96);
  --heart-color: #e8587a;

  /* chấm bi trắng: dùng 2 lớp đặt so le nhau */
  --dots: radial-gradient(circle, rgba(255, 255, 255, 0.9) 1.5px, rgba(255, 255, 255, 0) 2.2px);
}

*,
*::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(--teal-200);
  background-image: var(--dots), var(--dots);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  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(--teal-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-600);
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brown-600);
}

.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.25;
  color: var(--brown-700);
}

/* đường trang trí dưới tiêu đề: hai nét mảnh và một trái tim nhỏ */
.orn {
  display: block;
  width: 168px;
  height: 17px;
  margin: 10px auto 0;
  color: var(--gold-500);
  --orn-heart: var(--teal-400);
}

.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(--brown-600);
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(143, 101, 31, 0.5);
}

.btn--solid:hover {
  background: var(--brown-700);
}

.btn--line {
  background: #fff;
  border-color: var(--teal-400);
  color: var(--brown-700);
}

.btn--line:hover {
  background: var(--teal-50);
}

.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(--brown-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 80px rgba(var(--shadow), 0.4);
}

.sec {
  position: relative;
  padding: 68px var(--pad);
}

.sec--paper {
  background: var(--paper);
}

.sec--blush {
  background: linear-gradient(180deg, var(--blush) 0%, var(--paper) 100%);
}

/* nền hồng phấn chấm bi */
.sec--rose {
  background-color: var(--teal-100);
  background-image: var(--dots), var(--dots);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.sec--rose .eyebrow,
.gate .eyebrow,
.hero__eyebrow {
  color: var(--brown-700);
}

/* viền vỏ sò (như viền ren) nối phần nền hồng với phần nền trắng */
.scallop-top::before,
.scallop-bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 11px;
  background-repeat: repeat-x;
  background-size: 22px 11px;
  background-position: 50% 0;
  pointer-events: none;
}

.scallop-top::before {
  bottom: 100%;
  background-image: radial-gradient(circle at 11px 11px, var(--teal-100) 10.6px, rgba(228, 243, 244, 0) 11px);
}

.scallop-bottom::after {
  top: 100%;
  z-index: 2;
  background-image: radial-gradient(circle at 11px 0, var(--teal-100) 10.6px, rgba(228, 243, 244, 0) 11px);
}

/* thẻ giấy bo tròn, viền chỉ may */
.frame {
  position: relative;
  padding: 44px 24px 34px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--teal-200), 0 26px 44px -30px rgba(var(--shadow), 0.9);
}

.frame::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  border: 1.5px dashed var(--teal-300);
  border-radius: 21px;
  pointer-events: none;
}

.frame__badge {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--teal-500);
  box-shadow: 0 0 0 1px var(--teal-200), 0 6px 12px -6px rgba(var(--shadow), 0.9);
}

.frame__badge svg {
  width: 20px;
  height: 20px;
}

/* khung ảnh hình cổng vòm */
.arch {
  position: relative;
  overflow: hidden;
  border-radius: 999px 999px 14px 14px;
  background: var(--teal-100);
}

.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(--teal-100);
  background-image: var(--dots), var(--dots), radial-gradient(92% 62% at 50% 42%, #fff 0%, var(--teal-100) 54%, var(--teal-200) 100%);
  background-size: 24px 24px, 24px 24px, auto;
  background-position: 0 0, 12px 12px, 0 0;
  color: var(--ink);
  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: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.gate__names {
  margin-top: 10px;
  font-size: 38px;
  font-size: min(10.6vw, 42px);
  white-space: nowrap;
  line-height: 1.4;
  color: var(--brown-600);
}

.gate__date {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.env {
  position: relative;
  width: 100%;
  max-width: 318px;
  margin: 26px auto 0;
}

.env__body {
  position: relative;
  height: 0;
  padding-bottom: 66%;
  border-radius: 12px;
  background: linear-gradient(180deg, #6fbac1 0%, #48a5ad 100%);
  box-shadow: 0 24px 44px -12px rgba(var(--shadow), 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  -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: 8px;
  background: #fff;
  color: var(--brown-600);
  box-shadow: 0 2px 10px rgba(var(--shadow), 0.35);
}

.env__letter-hy {
  width: 44px;
  height: 44px;
  color: var(--teal-500);
}

.env__letter .script {
  margin-top: 4px;
  font-size: 24px;
  white-space: nowrap;
}

.env__letter .amp {
  color: var(--gold-600);
}

.env__pocket {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #e9f5f6 0%, #cbe7ea 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(119, 190, 197, 0.6) 50%, transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(119, 190, 197, 0.6) 50%, transparent calc(50% + 1px));
  opacity: 0.8;
}

.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 7px rgba(27, 84, 91, 0.3));
  filter: drop-shadow(0 5px 7px rgba(27, 84, 91, 0.3));
}

.env__flap-shape {
  width: 100%;
  height: 100%;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #c3e3e6 0%, #9fd1d6 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%, #dcc07c 0%, #b48a36 50%, #8f651f 100%);
  color: #fff;
  box-shadow: 0 8px 16px -4px rgba(95, 66, 18, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.26), inset 0 0 0 5px rgba(95, 66, 18, 0.16);
  cursor: pointer;
}

.env__seal svg {
  width: 30px;
  height: 30px;
}

.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: 1.5px solid rgba(168, 130, 47, 0.8);
  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: 16px 16px 18px;
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--teal-200), 0 18px 30px -14px rgba(var(--shadow), 0.75);
}

.env__plate::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  border: 1.5px dashed var(--teal-300);
  border-radius: 13px;
  pointer-events: none;
}

.env__to {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--brown-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(--brown-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: var(--ink-soft);
}

/* hiệu ứng mở thiệp, tổng cộng 3,2 giây: con dấu bật ra → nắp phong bì mở → thiệp trượt lên → chuyển vào trang.
   Mỗi dòng ghi "thời lượng" rồi "thời điểm bắt đầu" (giây). Muốn nhanh / chậm hơn: sửa các số này, rồi sửa
   tổng thời gian ở data-gate-duration="3200" (mili giây) trong index.html cho khớp với lúc hiệu ứng cuối kết thúc. */
.gate-opening .env__seal {
  animation: seal-off 0.65s ease forwards;
}

.gate-opening .env__seal::after {
  animation: none;
  opacity: 0;
}

.gate-opening .env__flap {
  animation: flap-open 1.2s 0.45s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.gate-opening .env__letter {
  animation: letter-up 1.3s 1.1s 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.6s ease forwards;
}

.gate-opening .gate {
  animation: gate-out 0.8s 2.4s 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: 26px;
    height: 26px;
  }
  .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 var(--teal-200);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brown-600);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 14px -4px rgba(var(--shadow), 0.7);
}

.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 var(--teal-200);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px -10px rgba(var(--shadow), 0.85);
  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 {
  max-width: calc(100% - 16px);
}

.dock__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.dock__item svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--teal-500);
}

.dock__item:active {
  background: var(--teal-100);
}

.dock__heart svg {
  color: var(--teal-400);
  transition: transform 0.2s ease;
}

.dock__heart.is-liked svg {
  color: #e8587a;
}

.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(62px + env(safe-area-inset-top, 0px)) 0 68px;
  background-color: var(--blush);
  background-image: radial-gradient(64% 36% at 50% 40%, #fff 0%, rgba(255, 255, 255, 0) 100%), radial-gradient(80% 38% at 0% 0%, var(--teal-200) 0%, rgba(203, 231, 234, 0) 100%),
    radial-gradient(74% 26% at 100% 66%, var(--teal-200) 0%, rgba(203, 231, 234, 0) 100%), linear-gradient(180deg, var(--teal-100) 0%, var(--blush) 62%, var(--paper) 100%);
  color: var(--ink);
  text-align: center;
  overflow: hidden;
}

.hero__eyebrow {
  position: relative;
  z-index: 2;
}

/* ảnh trong khung cổng vòm, thắt nơ phía dưới */
.hero__photo {
  position: relative;
  width: 74%;
  max-width: 330px;
  margin: 20px auto 0;
}

.hero__photo::before {
  /* nét viền mảnh chạy quanh khung */
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
  border: 1px solid var(--teal-300);
  border-radius: 999px 999px 26px 26px;
  pointer-events: none;
}

.hero__arch {
  position: relative;
  height: 0;
  padding-bottom: 133.33%;
  overflow: hidden;
  border-radius: 999px 999px 18px 18px;
  background: var(--teal-100);
  box-shadow: 0 0 0 6px #fff, 0 28px 44px -22px rgba(var(--shadow), 0.95);
}

.hero__arch img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
}

.hero__bow {
  position: absolute;
  left: 50%;
  bottom: -27px;
  z-index: 2;
  width: 78px;
  height: 46px;
  margin-left: -39px;
  color: var(--teal-300);
  -webkit-filter: drop-shadow(0 4px 5px rgba(var(--shadow), 0.45));
  filter: drop-shadow(0 4px 5px rgba(var(--shadow), 0.45));
}

.hero__spark {
  position: absolute;
  z-index: 2;
  color: var(--teal-400);
  animation: twinkle 3.2s ease-in-out infinite;
}

.hero__spark--a {
  top: 9%;
  left: -15%;
  width: 22px;
  height: 22px;
}

.hero__spark--b {
  top: 30%;
  right: -15%;
  width: 15px;
  height: 15px;
  color: var(--gold-500);
  animation-delay: 1.1s;
}

.hero__spark--c {
  bottom: 12%;
  left: -13%;
  width: 13px;
  height: 13px;
  color: var(--gold-500);
  animation-delay: 2s;
}

.hero__spark--d {
  bottom: 30%;
  right: -14%;
  width: 20px;
  height: 20px;
  animation-delay: 0.6s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.hero__text {
  position: relative;
  z-index: 2;
  margin-top: 40px;
  padding: 0 16px;
}

.hero__names {
  font-size: 40px;
  font-size: min(10.9vw, 52px);
  white-space: nowrap;
  line-height: 1.35;
  color: var(--brown-600);
}

.hero__event {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding-left: 0.3em;
  color: var(--ink);
}

.hero__date {
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--brown-700);
}

.hero__next {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-500);
  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;
  }
}

/* màn hình thấp: thu nhỏ khung ảnh để tên hai bạn vẫn nằm trong màn hình đầu */
@media (max-height: 720px) {
  .hero__photo {
    width: 62%;
  }
  .hero__text {
    margin-top: 36px;
  }
}

@media (max-height: 600px) {
  .hero__photo {
    width: 52%;
  }
}

/* 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;
}

.invite__to {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brown-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(--brown-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: 600;
  font-size: 21px;
  line-height: 1.45;
  color: var(--brown-700);
}

/* lời mời riêng viết cho từng khách (thay cho lời mời chung) */
.invite__custom {
  margin-top: 20px;
  color: var(--ink);
  white-space: pre-line; /* giữ đúng chỗ xuống dòng người viết đã gõ */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invite__custom.is-short {
  /* vài câu ngắn thì viết kiểu chữ nghiêng lớn như một dòng nhắn tay */
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.5;
  color: var(--brown-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 44%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 44%, transparent 100%);
}

.family__inner {
  position: relative;
  margin-top: -52px;
}

.family__hy {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  padding: 12px;
  border-radius: 50%;
  background: #fff;
  color: var(--brown-600);
  box-shadow: 0 0 0 1px var(--teal-300), 0 0 0 6px rgba(255, 255, 255, 0.7), 0 10px 18px -6px rgba(var(--shadow), 0.8);
}

.family__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
  padding: 26px 0;
  border-top: 1px solid rgba(194, 160, 90, 0.6);
  border-bottom: 1px solid rgba(194, 160, 90, 0.6);
}

.family__side {
  padding: 0 8px;
}

.family__side + .family__side {
  border-left: 1px solid rgba(194, 160, 90, 0.6);
}

.family__side h3 {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.3;
  color: var(--brown-700);
}

.family__side p {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18.5px;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--ink);
}

.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(--brown-700) !important;
}

.family__names {
  margin-top: 34px;
}

.family__names .script {
  font-size: 44px;
  line-height: 1.3;
  color: var(--brown-600);
}

.family__names .amp {
  font-size: 26px;
  line-height: 1.1;
  color: var(--gold-600);
}

/* ═════════ 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(--brown-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(--brown-700);
}

.date__day {
  flex: none;
  padding: 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 92px;
  line-height: 1;
  color: var(--brown-600);
}

.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: 36px auto 0;
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--teal-300), 0 28px 40px -20px rgba(var(--shadow), 0.9);
}

.place {
  margin-top: 42px;
}

.place__name {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.25;
  color: var(--brown-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;
  padding: 5px;
  border: 1px solid var(--teal-200);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.map iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: 15px;
}

.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(--brown-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(--teal-300);
}

.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(--brown-700);
  text-align: right;
}

.step__icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal-300);
  border-radius: 50%;
  background: var(--teal-50);
  color: var(--brown-600);
}

.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 9%, #000 50%, transparent 86%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 50%, transparent 86%);
}

.count__body {
  position: relative;
  margin-top: -34%;
}

.cd__tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.cd__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--teal-200), 0 16px 24px -18px rgba(var(--shadow), 0.95);
}

.cd__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  color: var(--brown-600);
  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(--ink-soft);
}

.cd__msg {
  padding: 18px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--teal-200);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.45;
  color: var(--brown-700);
}

.calbox {
  position: relative;
  margin-top: 30px;
  padding: 24px 16px 18px;
  background: #fff;
  color: var(--ink);
  border-radius: 26px;
  box-shadow: 0 0 0 1px var(--teal-200), 0 26px 40px -28px rgba(var(--shadow), 0.95);
}

.calbox__month {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--brown-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(--brown-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;
}

/* ngày cưới: trái tim vàng nâu đập nhẹ (màu trong chuỗi fill='%23…' là --brown-600) */
.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.2l-2.4-2.2C8.4 25.7 2.5 20.3 2.5 13.5 2.5 8 6.8 3.8 12.2 3.8c3 0 6 1.4 7.8 3.7 1.8-2.3 4.8-3.7 7.8-3.7 5.4 0 9.7 4.2 9.7 9.7 0 6.8-5.9 12.2-15.1 20.5L20 36.2z' fill='%238f651f'/%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 {
  margin: 6px;
  box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--teal-300), 0 24px 32px -20px rgba(var(--shadow), 0.95);
}

.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(--brown-700);
  white-space: nowrap;
}

/* nút mở album, nằm dưới hai ảnh chân dung */
.couple__more {
  margin-top: 34px;
  text-align: center;
}

/* ═════════ 7. ALBUM (không nằm trong thân thiệp: chỉ mở ra khi khách bấm "Album") ═════════ */

.sheet {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 200;
  width: 100%;
  max-width: var(--col);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(var(--shadow), 0.45);
  opacity: 0;
  -webkit-transform: translate(-50%, 36px);
  transform: translate(-50%, 36px);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sheet.is-on {
  opacity: 1;
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
}

.sheet__bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) 64px 9px;
  background: rgba(255, 254, 251, 0.95);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.sheet__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--brown-700);
}

.sheet__hint {
  margin-top: 1px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.sheet__close {
  position: absolute;
  top: calc(11px + 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 var(--teal-200);
  border-radius: 50%;
  background: #fff;
  color: var(--brown-700);
  cursor: pointer;
}

.sheet__close svg {
  width: 20px;
  height: 20px;
}

.sheet__close:active {
  background: var(--teal-100);
}

.sheet__body {
  padding: 12px 12px calc(26px + env(safe-area-inset-bottom, 0px));
}

.sheet__back {
  margin-top: 20px;
}

/* trình duyệt tắt JavaScript: album nằm luôn ở cuối trang */
html.no-js .sheet[hidden] {
  display: block !important;
  position: static;
  margin: 0 auto;
  overflow: visible;
  opacity: 1;
  -webkit-transform: none;
  transform: none;
  box-shadow: none;
}

html.no-js .sheet__bar {
  position: static;
}

html.no-js [data-album-open],
html.no-js [data-album-close] {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shot {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: var(--teal-100);
}

.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 16px 16px;
  overflow: hidden;
  background: var(--teal-100);
  box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--teal-300), 0 24px 32px -20px rgba(var(--shadow), 0.95);
}

.rsvp__photo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.form,
.done {
  padding: 26px 20px 22px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 40px -28px rgba(var(--shadow), 0.9);
}

.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 var(--field);
  border-radius: 14px;
  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: #9c9482;
}

.input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(72, 165, 173, 0.28);
}

.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 var(--field);
  border-radius: 16px;
  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 #b9cdd0;
  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(--brown-600);
  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(--teal-500);
  background: var(--teal-50);
  box-shadow: 0 0 0 1px var(--teal-500);
}

.opt input:checked ~ .opt__mark {
  border-color: var(--brown-600);
}

.opt input:checked ~ .opt__mark::after {
  transform: scale(1);
}

.opt input:focus-visible ~ .opt__bg {
  outline: 2px solid var(--teal-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: 16px;
  background: var(--blush);
}

.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 var(--field);
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  color: var(--brown-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(--brown-700);
}

.form.is-declined .stepper {
  opacity: 0.55;
}

.form__error {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  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(255, 255, 255, 0.45);
  border-top-color: #fff;
  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(--teal-100);
  color: var(--brown-600);
  box-shadow: 0 0 0 1px var(--teal-300);
}

.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(--brown-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 var(--teal-200);
  border-radius: 999px;
  background: var(--teal-50);
  font-size: 14px;
  line-height: 1.35;
  color: var(--brown-700);
  text-align: left;
  cursor: pointer;
}

.chip:active {
  background: var(--teal-100);
}

.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: 20px;
  background: #fff;
}

.wish.is-new {
  animation: wish-in 0.6s ease;
  border-color: var(--teal-400);
}

@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(--teal-100);
  color: var(--brown-700);
  box-shadow: inset 0 0 0 1px var(--teal-300);
  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(--brown-700);
  overflow-wrap: anywhere;
}

.wishes__empty {
  padding: 22px 18px;
  border: 1.5px dashed var(--teal-300);
  border-radius: 20px;
  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(--brown-600);
}

.thanks__photo {
  margin: -22px calc(var(--pad) * -1) 0;
}

.thanks__photo img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 80%, transparent 100%);
}

.thanks__text {
  position: relative;
  margin-top: 6px;
}

.thanks__text > p[data-tone] {
  max-width: 34ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}

.thanks__names {
  margin-top: 26px;
  font-size: 36px;
  font-size: min(10.2vw, 46px);
  white-space: nowrap;
  line-height: 1.4;
  color: var(--brown-600);
}

.thanks__date {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.foot {
  padding: 26px var(--pad) calc(36px + env(safe-area-inset-bottom, 0px));
  background: var(--teal-200);
  color: var(--brown-800);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.foot__hy {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto 10px;
  color: var(--brown-600);
}

/* ═════════ HÌNH CHIBI cô dâu – chú rể (ảnh: assets/img/chibi/, điều khiển: assets/js/chibi.js) ═════════ */

/* Một hình dán ở góc phải dưới, đổi hình theo chỗ khách đang xem (xem đầu file chibi.js).
   Cỡ hình: sửa --chibi-h (chiều cao hình, tính bằng px).
   --chibi-ratio và --chibi-ratio-bow là tỉ lệ khung (cao / rộng) của hình mở đầu và hình cúi chào, dùng để chừa chỗ
   cho hình ở màn hình phong bì, trang đầu và chân trang; đổi ảnh thì điền lại theo số mà lệnh `npm run chibi` in ra.
   (Lúc hiện hình nào, chibi.js tự đo tỉ lệ của hình đó và đặt lại --chibi-ratio ngay trên hình.)
   Nếu ở màn hình phong bì hay trang đầu hình vướng chữ hoặc nút bấm, chibi.js sẽ tự thu nhỏ dần (--chibi-scale);
   thu nhỏ hết mức vẫn vướng thì tạm ẩn ở màn hình đó (is-away). */
:root {
  --chibi-h: 180px;
  --chibi-ratio: 1.3691; /* hình mở đầu */
  --chibi-ratio-bow: 1.193; /* hình cúi chào */
}

@media (min-width: 481px) {
  :root {
    --chibi-h: 198px;
  }
}

@media (max-height: 700px) {
  :root {
    --chibi-h: 148px;
  }
}

.chibi {
  position: fixed;
  right: 2px;
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  width: calc(var(--chibi-h) / var(--chibi-ratio) * var(--chibi-scale, 1));
  pointer-events: none;
  opacity: 0;
  -webkit-transform: translateY(14px) scale(0.94);
  transform: translateY(14px) scale(0.94);
  -webkit-transform-origin: 70% 100%;
  transform-origin: 70% 100%;
  /* thời gian mờ đi (0.22s) khớp với T_SWAP trong chibi.js */
  transition: opacity 0.22s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  -webkit-filter: drop-shadow(0 3px 4px rgba(var(--shadow), 0.45));
  filter: drop-shadow(0 3px 4px rgba(var(--shadow), 0.45));
}

.chibi.is-on {
  opacity: 1;
  -webkit-transform: none;
  transform: none;
}

.chibi.is-away {
  opacity: 0;
  visibility: hidden;
}

/* phần giữa thiệp: hình đứng ngay trên thanh lối tắt (và nằm dưới ngăn album, ảnh xem lớn) */
.chibi.is-up {
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  z-index: 61;
}

@media (min-width: 481px) {
  .chibi {
    right: calc(50% - 238px);
  }
}

/* các khung hình nằm trên một hàng ngang của ảnh nền, mỗi lúc chỉ lộ một khung
   (background-size do chibi.js đặt lại theo số khung của từng hình) */
.chibi__pic {
  height: 0;
  padding-bottom: calc(100% * var(--chibi-ratio));
  background-repeat: no-repeat;
  background-size: 800% 100%;
  background-position: 0 0;
}

/* Chừa chỗ cho hình (mặc định là có hình; chỉ khi hình không dùng được, chibi.js mới gắn class no-chibi để bỏ phần chừa này):
   chữ ở chân trang lùi sang trái; phong bì và ảnh trang đầu tự co theo chiều cao màn hình để hình không phải thu nhỏ. */
.js:not(.no-chibi) .foot {
  padding-right: calc(var(--chibi-h) / var(--chibi-ratio-bow) + 6px);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.js:not(.no-chibi) .gate {
  padding-bottom: calc(var(--chibi-h) * 0.86 + env(safe-area-inset-bottom, 0px));
}

.js:not(.no-chibi) .hero {
  padding-bottom: calc(var(--chibi-h) + 12px);
}

.js:not(.no-chibi) .hero__photo {
  width: min(74%, 330px, max(46%, calc((100vh - 286px - var(--chibi-h)) * 0.75)));
  width: min(74%, 330px, max(46%, calc((100svh - 286px - var(--chibi-h)) * 0.75)));
}

@media (max-height: 760px) {
  .js:not(.no-chibi) .gate__names {
    font-size: 34px;
    font-size: min(9.6vw, 36px);
    margin-top: 4px;
  }
  .js:not(.no-chibi) .env {
    max-width: 270px;
    margin-top: 14px;
  }
  .js:not(.no-chibi) .env__seal {
    width: 56px;
    height: 56px;
    margin: -30px 0 0 -28px;
  }
  .js:not(.no-chibi) .env__seal svg {
    width: 26px;
    height: 26px;
  }
  .js:not(.no-chibi) .env__guest {
    font-size: 23px;
  }
  .js.guest-long:not(.no-chibi) .env__guest {
    font-size: 19px;
  }
  .js.guest-xlong:not(.no-chibi) .env__guest {
    font-size: 17px;
  }
  .js:not(.no-chibi) .gate__open {
    margin-top: 16px;
  }
  .js:not(.no-chibi) .gate__hint {
    margin-top: 8px;
  }
}

/* ═════════ hiệu ứng hiện dần khi cuộn ═════════ */

/* Kiểu mặc định: mờ dần và trượt lên. Phần tử có data-reveal được core.js gắn class is-in khi khách cuộn tới. */
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;
}

/* ═════════ CHUYỂN ĐỘNG: mỗi phần hiện ra một kiểu · trang đầu · chi tiết nhỏ · lúc khách tương tác ═════════

   Quy ước đọc các luật bên dưới:
   - "html.reveal-on … :not(.is-in)" là dáng vẻ của phần tử TRƯỚC khi hiện (mờ, lệch, thu nhỏ…). Khi khách cuộn tới,
     core.js gắn is-in, luật đó hết hiệu lực và phần tử trượt về kiểu dáng bình thường của nó.
   - reveal-on chỉ có khi mã chạy được và máy không bật "giảm chuyển động"; motion-on do motion.js gắn (cùng điều kiện).
     Không có hai class này thì mọi thứ hiện sẵn, đứng yên.
   Muốn bỏ chuyển động của một phần: xoá cụm luật của phần đó (mỗi cụm có một dòng chú thích mở đầu). */

:root {
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1); /* trượt nhanh rồi chậm dần */
  --ease-pop: cubic-bezier(0.3, 1.45, 0.45, 1); /* nảy quá đà một chút rồi về chỗ */
  --ease-write: cubic-bezier(0.45, 0, 0.25, 1); /* đều tay, dùng cho chữ "viết" dần từ trái sang */
}

/* ── Tiêu đề mỗi phần: dòng chữ nhỏ hiện trước, tiêu đề trồi lên, rồi nét trang trí vẽ từ giữa ra hai bên ── */
html.reveal-on .head[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .head[data-reveal] > * {
  transition: opacity 0.7s ease, transform 0.85s var(--ease-out);
}

html.reveal-on .head[data-reveal] > .title {
  transition-delay: 0.12s;
}

html.reveal-on .head[data-reveal] > .orn {
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s ease 0.4s, -webkit-clip-path 0.9s ease 0.4s;
}

html.reveal-on .head[data-reveal]:not(.is-in) > .eyebrow {
  opacity: 0;
  transform: translateY(10px);
}

html.reveal-on .head[data-reveal]:not(.is-in) > .title {
  opacity: 0;
  transform: translateY(26px) scale(0.94);
}

html.reveal-on .head[data-reveal]:not(.is-in) > .orn {
  -webkit-clip-path: inset(0 50% 0 50%);
  clip-path: inset(0 50% 0 50%);
}

/* ── Ảnh: khung hiện dần, ảnh bên trong thu từ hơi to về đúng cỡ ── */
.family__band,
.count__photo,
.thanks__photo {
  overflow: hidden;
}

html.reveal-on figure[data-reveal] img {
  transition: transform 1.7s var(--ease-out);
}

html.reveal-on figure[data-reveal]:not(.is-in) img {
  transform: scale(1.14);
}

/* ảnh tràn hết bề ngang: chỉ mờ dần, không trượt (để không hở nền phía trên) */
html.reveal-on .family__band[data-reveal],
html.reveal-on .count__photo[data-reveal],
html.reveal-on .thanks__photo[data-reveal] {
  transform: none;
  transition: opacity 1.1s ease;
}

/* ảnh trong khung vòm: trồi lên và nở ra */
html.reveal-on .event__photo[data-reveal],
html.reveal-on .rsvp__photo[data-reveal] {
  transition-duration: 0.9s, 1.1s;
}

html.reveal-on .event__photo[data-reveal]:not(.is-in),
html.reveal-on .rsvp__photo[data-reveal]:not(.is-in) {
  transform: translateY(34px) scale(0.94);
}

/* ── Lời mời: thẻ giấy nở ra, trái tim nảy lên, tên khách hiện dần như đang viết, rồi tới lời mời ── */
html.reveal-on .invite__card[data-reveal] {
  transition-duration: 0.8s, 1s;
}

html.reveal-on .invite__card[data-reveal]:not(.is-in) {
  transform: translateY(30px) scale(0.95);
}

html.reveal-on .invite__card[data-reveal] > .frame__badge {
  transition: transform 0.75s var(--ease-pop) 0.4s;
}

html.reveal-on .invite__card[data-reveal]:not(.is-in) > .frame__badge {
  transform: scale(0);
}

html.reveal-on .invite__card[data-reveal] p {
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out);
}

html.reveal-on .invite__card[data-reveal]:not(.is-in) p {
  opacity: 0;
  transform: translateY(14px);
}

html.reveal-on .invite__card[data-reveal] .invite__to {
  transition-delay: 0.35s;
}

html.reveal-on .invite__card[data-reveal] .invite__guest {
  -webkit-clip-path: inset(-25% -6% -30% -6%);
  clip-path: inset(-25% -6% -30% -6%);
  transition: clip-path 1.2s var(--ease-write) 0.55s, -webkit-clip-path 1.2s var(--ease-write) 0.55s;
}

html.reveal-on .invite__card[data-reveal]:not(.is-in) .invite__guest {
  opacity: 1;
  transform: none;
  -webkit-clip-path: inset(-25% 100% -30% -6%);
  clip-path: inset(-25% 100% -30% -6%);
}

html.reveal-on .invite__card[data-reveal] .invite__body,
html.reveal-on .invite__card[data-reveal] .invite__custom {
  transition-delay: 0.95s;
}

html.reveal-on .invite__card[data-reveal] .invite__call {
  transition-delay: 1.15s;
}

/* ── Hai bên gia đình: chữ song hỷ xoay vào, nhà gái trượt từ trái, nhà trai trượt từ phải; tên hai bạn cũng vậy ── */
html.reveal-on .family__hy[data-reveal] {
  transition: opacity 0.5s ease, transform 0.9s var(--ease-pop);
}

html.reveal-on .family__hy[data-reveal]:not(.is-in) {
  transform: scale(0.3) rotate(-40deg);
}

html.reveal-on .family__grid[data-reveal] {
  transform: none;
}

html.reveal-on .family__grid[data-reveal] > .family__side {
  transition: opacity 0.8s ease 0.15s, transform 0.9s var(--ease-out) 0.15s;
}

html.reveal-on .family__grid[data-reveal]:not(.is-in) > .family__side {
  opacity: 0;
}

html.reveal-on .family__grid[data-reveal]:not(.is-in) > .family__side:first-child {
  transform: translateX(-34px);
}

html.reveal-on .family__grid[data-reveal]:not(.is-in) > .family__side:last-child {
  transform: translateX(34px);
}

html.reveal-on .family__names[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .family__names[data-reveal] > * {
  transition: opacity 0.9s ease, transform 1s var(--ease-out);
}

html.reveal-on .family__names[data-reveal] > .amp {
  transition: opacity 0.5s ease 0.35s, transform 0.8s var(--ease-pop) 0.35s;
}

html.reveal-on .family__names[data-reveal] > .script:last-child {
  transition-delay: 0.5s;
}

html.reveal-on .family__names[data-reveal]:not(.is-in) > * {
  opacity: 0;
}

html.reveal-on .family__names[data-reveal]:not(.is-in) > .script:first-child {
  transform: translateX(-40px);
}

html.reveal-on .family__names[data-reveal]:not(.is-in) > .amp {
  transform: scale(0.2);
}

html.reveal-on .family__names[data-reveal]:not(.is-in) > .script:last-child {
  transform: translateX(40px);
}

/* ── Thời gian: giờ hiện trước, "Tháng 11" và "Năm 2026" trượt vào từ hai bên, số 29 nảy lên ── */
html.reveal-on .event__when[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .event__when[data-reveal] > p,
html.reveal-on .event__when[data-reveal] .date__side {
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
}

html.reveal-on .event__when[data-reveal] .date__side {
  transition-delay: 0.2s;
}

html.reveal-on .event__when[data-reveal] > .event__lunar {
  transition-delay: 0.8s;
}

html.reveal-on .event__when[data-reveal]:not(.is-in) > p {
  opacity: 0;
  transform: translateY(12px);
}

html.reveal-on .event__when[data-reveal]:not(.is-in) .date__side {
  opacity: 0;
}

html.reveal-on .event__when[data-reveal]:not(.is-in) .date__side:first-child {
  transform: translateX(-32px);
}

html.reveal-on .event__when[data-reveal]:not(.is-in) .date__side:last-child {
  transform: translateX(32px);
}

html.reveal-on .event__when[data-reveal]:not(.is-in) .date__day {
  opacity: 0;
}

html.reveal-on .event__when[data-reveal].is-in .date__day {
  animation: day-pop 0.9s ease-out 0.4s backwards;
}

@keyframes day-pop {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  55% {
    opacity: 1;
    transform: scale(1.18);
  }
  78% {
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Địa điểm: các dòng hiện lần lượt ── */
html.reveal-on .place[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .place[data-reveal] > :not(.map) {
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out);
}

html.reveal-on .place[data-reveal] > :nth-child(2) {
  transition-delay: 0.1s;
}

html.reveal-on .place[data-reveal] > :nth-child(3) {
  transition-delay: 0.2s;
}

html.reveal-on .place[data-reveal] > :nth-child(4) {
  transition-delay: 0.34s;
}

html.reveal-on .place[data-reveal]:not(.is-in) > :not(.map) {
  opacity: 0;
  transform: translateY(16px);
}

/* ── Lịch trình: từng mốc trượt vào từ trái, biểu tượng nảy lên ── */
html.reveal-on .step[data-reveal]:not(.is-in) {
  transform: translateX(-28px);
}

html.reveal-on .step[data-reveal] .step__icon {
  transition: transform 0.7s var(--ease-pop) 0.3s;
}

html.reveal-on .step[data-reveal]:not(.is-in) .step__icon {
  transform: scale(0.3);
}

/* ── Đếm ngược: bốn ô lần lượt nảy lên; tờ lịch nở ra ── */
html.reveal-on .cd[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .cd[data-reveal] .cd__tile,
html.reveal-on .cd[data-reveal] .cd__msg {
  transition: opacity 0.6s ease, transform 0.8s var(--ease-pop);
}

html.reveal-on .cd[data-reveal] .cd__tile:nth-child(2) {
  transition-delay: 0.09s;
}

html.reveal-on .cd[data-reveal] .cd__tile:nth-child(3) {
  transition-delay: 0.18s;
}

html.reveal-on .cd[data-reveal] .cd__tile:nth-child(4) {
  transition-delay: 0.27s;
}

html.reveal-on .cd[data-reveal]:not(.is-in) .cd__tile,
html.reveal-on .cd[data-reveal]:not(.is-in) .cd__msg {
  opacity: 0;
  transform: translateY(26px) scale(0.86);
}

html.reveal-on .calbox[data-reveal]:not(.is-in) {
  transform: translateY(28px) scale(0.95);
}

/* ── Cô dâu & chú rể: hai ảnh trượt vào từ hai bên, hơi nghiêng rồi đứng thẳng lại; tên hiện sau ── */
html.reveal-on .person[data-reveal] {
  transition-duration: 0.9s, 1.1s;
}

html.reveal-on .duo > .person[data-reveal]:not(.is-in):first-child {
  transform: translateX(-38px) rotate(-5deg);
}

html.reveal-on .duo > .person[data-reveal]:not(.is-in):last-child {
  transform: translateX(38px) rotate(5deg);
}

html.reveal-on .person[data-reveal] figcaption {
  transition: opacity 0.7s ease 0.5s, transform 0.8s var(--ease-out) 0.5s;
}

html.reveal-on .person[data-reveal]:not(.is-in) figcaption {
  opacity: 0;
  transform: translateY(12px);
}

/* ── Biểu mẫu xác nhận / lời chúc: khung nở ra, các ô hiện lần lượt (nút gửi hiện cùng khung) ── */
html.reveal-on .form[data-reveal]:not(.is-in) {
  transform: translateY(30px) scale(0.97);
}

html.reveal-on .form[data-reveal] > :not(.btn) {
  transition: opacity 0.7s ease 0.15s, transform 0.8s var(--ease-out) 0.15s;
}

html.reveal-on .form[data-reveal] > :not(.btn):nth-child(2) {
  transition-delay: 0.23s;
}

html.reveal-on .form[data-reveal] > :not(.btn):nth-child(3) {
  transition-delay: 0.31s;
}

html.reveal-on .form[data-reveal] > :not(.btn):nth-child(n + 4) {
  transition-delay: 0.39s;
}

html.reveal-on .form[data-reveal]:not(.is-in) > :not(.btn) {
  opacity: 0;
  transform: translateY(16px);
}

/* ── Lời cảm ơn: "Thank you" và tên hai bạn hiện dần từ trái sang như đang viết ── */
html.reveal-on .thanks__title[data-reveal] {
  opacity: 1;
  transform: none;
}

/* (che chữ ở thẻ span bên trong, không che chính thẻ tiêu đề: thẻ bị che kín thì trình duyệt không báo là đã cuộn tới) */
html.reveal-on .thanks__title[data-reveal] > span {
  display: inline-block;
  -webkit-clip-path: inset(-25% -8% -35% -8%);
  clip-path: inset(-25% -8% -35% -8%);
  transition: clip-path 1.5s var(--ease-write), -webkit-clip-path 1.5s var(--ease-write);
}

html.reveal-on .thanks__title[data-reveal]:not(.is-in) > span {
  -webkit-clip-path: inset(-25% 100% -35% -8%);
  clip-path: inset(-25% 100% -35% -8%);
}

html.reveal-on .thanks__text[data-reveal] {
  opacity: 1;
  transform: none;
}

html.reveal-on .thanks__text[data-reveal] > p {
  transition: opacity 0.9s ease, transform 0.9s var(--ease-out);
}

html.reveal-on .thanks__text[data-reveal]:not(.is-in) > p {
  opacity: 0;
  transform: translateY(16px);
}

html.reveal-on .thanks__text[data-reveal] > .thanks__names {
  -webkit-clip-path: inset(-25% -8% -35% -8%);
  clip-path: inset(-25% -8% -35% -8%);
  transition: clip-path 1.6s var(--ease-write) 0.5s, -webkit-clip-path 1.6s var(--ease-write) 0.5s;
}

html.reveal-on .thanks__text[data-reveal]:not(.is-in) > .thanks__names {
  opacity: 1;
  transform: none;
  -webkit-clip-path: inset(-25% 100% -35% -8%);
  clip-path: inset(-25% 100% -35% -8%);
}

html.reveal-on .thanks__text[data-reveal] > .thanks__date {
  transition-delay: 1.6s;
}

/* ── TRANG ĐẦU (chạy sau khi mở thiệp): ảnh trồi lên, nơ nảy ra, tên hai bạn hiện dần như đang viết ── */
.js .hero__photo {
  opacity: 0;
}

.gate-open .hero__photo {
  opacity: 1;
  animation: hero-photo-in 1.2s var(--ease-out) backwards;
}

@keyframes hero-photo-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92);
  }
}

.js .hero__bow {
  transform: scale(0);
}

.gate-open .hero__bow {
  transform: none;
  transition: transform 0.8s var(--ease-pop) 1s;
}

.js .hero__text > .hero__names {
  opacity: 1;
  transform: none;
  -webkit-clip-path: inset(-25% 100% -35% -6%);
  clip-path: inset(-25% 100% -35% -6%);
}

.gate-open .hero__text > .hero__names {
  -webkit-clip-path: inset(-25% -6% -35% -6%);
  clip-path: inset(-25% -6% -35% -6%);
  transition: clip-path 1.6s var(--ease-write) 0.45s, -webkit-clip-path 1.6s var(--ease-write) 0.45s;
}

.gate-open .hero__text > :nth-child(2) {
  transition-delay: 1.15s;
}

.gate-open .hero__text > :nth-child(3) {
  transition-delay: 1.3s;
}

/* ảnh trang đầu phóng to rất chậm rồi thu lại; khi khách cuộn, ảnh trôi nhẹ trong khung (motion.js đổi --hero-drift) */
.hero__arch picture {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  -webkit-transform-origin: 50% 40%;
  transform-origin: 50% 40%;
}

.motion-on.gate-open .hero__arch picture {
  animation: hero-zoom 18s ease-in-out 0.6s infinite alternate backwards;
}

.motion-on.gate-open .hero__arch img {
  transform: translate3d(0, var(--hero-drift, -3%), 0);
}

@keyframes hero-zoom {
  from {
    transform: scale(1.1);
  }
  to {
    transform: scale(1.18);
  }
}

/* ── CHI TIẾT NHỎ ── */

/* vệt sáng lướt qua các nút chính (Mở thiệp, Chỉ đường, Gửi xác nhận, Gửi lời chúc) */
.btn--solid {
  position: relative;
  overflow: hidden;
}

.btn--solid::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-190%) skewX(-18deg);
  pointer-events: none;
}

.motion-on .btn--solid::after {
  animation: btn-shine 4.6s ease-in-out infinite;
}

@keyframes btn-shine {
  0%,
  58% {
    transform: translateX(-190%) skewX(-18deg);
  }
  100% {
    transform: translateX(340%) skewX(-18deg);
  }
}

/* trái tim trên nút "Mở thiệp" đập nhẹ; ghim bản đồ trên nút "Chỉ đường" thỉnh thoảng nhún một cái */
.motion-on .gate__open svg {
  animation: day-beat 1.8s ease-in-out infinite;
}

.motion-on .btn[data-action='map'] svg {
  -webkit-transform-origin: 50% 100%;
  transform-origin: 50% 100%;
  animation: pin-hop 3.8s ease-in-out infinite;
}

@keyframes pin-hop {
  0%,
  72%,
  100% {
    transform: none;
  }
  80% {
    transform: translateY(-5px);
  }
  88% {
    transform: translateY(0) scale(1.1, 0.88);
  }
  94% {
    transform: translateY(-2px);
  }
}

/* (con số đếm ngược "lăn" xuống mỗi khi đổi: do motion.js làm) */

/* ── LÚC KHÁCH TƯƠNG TÁC ── */

/* gửi xác nhận xong: khung cảm ơn nở ra, dấu tích nảy lên */
.motion-on .done:not([hidden]) {
  animation: done-in 0.7s var(--ease-out);
}

.motion-on .done:not([hidden]) .done__icon {
  animation: pop-in 0.8s var(--ease-pop) 0.2s backwards;
}

@keyframes done-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}

/* tim và hoa giấy bung ra khi gửi xong xác nhận / lời chúc (motion.js tạo từng mảnh) */
.burst {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1045;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.burst > span {
  position: absolute;
  display: block;
  line-height: 1;
  will-change: transform, opacity;
}

/* mở album: ảnh hiện lần lượt (lúc đóng, ảnh chờ ngăn album mờ hẳn rồi mới trở lại trạng thái ẩn) */
.js .sheet .shot {
  opacity: 0;
  transform: translateY(22px) scale(0.96);
  transition: opacity 0s linear 0.32s, transform 0s linear 0.32s;
}

.js .sheet.is-on .shot {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease 0.6s, transform 0.65s var(--ease-out) 0.6s;
}

.js .sheet.is-on .shot:nth-child(1) {
  transition-delay: 0.12s;
}

.js .sheet.is-on .shot:nth-child(2) {
  transition-delay: 0.18s;
}

.js .sheet.is-on .shot:nth-child(3) {
  transition-delay: 0.24s;
}

.js .sheet.is-on .shot:nth-child(4) {
  transition-delay: 0.3s;
}

.js .sheet.is-on .shot:nth-child(5) {
  transition-delay: 0.36s;
}

.js .sheet.is-on .shot:nth-child(6) {
  transition-delay: 0.42s;
}

.js .sheet.is-on .shot:nth-child(7) {
  transition-delay: 0.48s;
}

.js .sheet.is-on .shot:nth-child(8) {
  transition-delay: 0.54s;
}

/* ═════════ 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 {
    gap: 2px;
    padding: 4px;
  }
  .dock__item {
    gap: 4px;
    padding: 0 8px;
    font-size: 12.5px;
  }
  .dock__item svg {
    width: 17px;
    height: 17px;
  }
  .thanks__title {
    font-size: 54px;
  }
}

/* máy rất hẹp: thanh lối tắt chỉ còn biểu tượng (chữ vẫn đọc được bằng trình đọc màn hình) */
@media (max-width: 339px) {
  .dock__item {
    padding: 0 12px;
  }
  .dock__item span:not([data-heart-count]) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (min-width: 481px) {
  .page {
    margin-top: 0;
  }
}

/* ═════════ QUÀ TẶNG (gift.js) ═════════
   Nút hộp quà ở thanh lối tắt, hộp chọn quà trượt lên từ dưới, và món quà bay lên khi khách vừa tặng.
   Danh sách quà nằm trong assets/js/config.js (mục gifts). */

/* mục của thanh lối tắt đang ẩn (hidden) thì không chiếm chỗ */
.dock__item[hidden] {
  display: none;
}

.dock__gift {
  justify-content: center;
  min-width: 40px;
  padding: 0 10px;
}

.dock__gift svg {
  width: 20px;
  height: 20px;
  -webkit-transform-origin: 50% 100%;
  transform-origin: 50% 100%;
}

/* Thanh lối tắt có thêm nút quà (5 mục) thì chật trên điện thoại, nên thu gọn dần theo bề ngang màn hình.
   Chỉ áp dụng khi nút quà đang hiện (gift.js gắn lớp has-gift); không có nút quà thì thanh giữ nguyên như cũ. */
@media (max-width: 449px) {
  .has-gift .dock {
    gap: 2px;
    padding: 4px;
  }
  .has-gift .dock__item {
    gap: 4px;
    padding: 0 8px;
    font-size: 12.5px;
  }
  .has-gift .dock__item svg {
    width: 17px;
    height: 17px;
  }
  .has-gift .dock__gift svg {
    width: 19px;
    height: 19px;
  }
}

/* hẹp hơn nữa: mục Album chỉ còn biểu tượng (chữ vẫn đọc được bằng trình đọc màn hình) */
@media (max-width: 409px) {
  .has-gift .dock__item[data-album-open] {
    justify-content: center;
    min-width: 40px;
    padding: 0 10px;
  }
  .has-gift .dock__item[data-album-open] span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 379px) {
  .has-gift .dock__item {
    gap: 3px;
    padding: 0 7px;
    font-size: 12px;
  }
  .has-gift .dock__item svg {
    width: 16px;
    height: 16px;
  }
  .has-gift .dock__item[data-album-open],
  .has-gift .dock__gift {
    padding: 0 9px;
  }
  .has-gift .dock__gift svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 359px) {
  .has-gift .dock__item[data-album-open],
  .has-gift .dock__gift {
    min-width: 36px;
  }
}

/* máy rất hẹp: cả thanh chỉ còn biểu tượng (xem quy tắc 339px ở trên), giữ chỗ bấm đủ rộng */
@media (max-width: 339px) {
  .has-gift .dock__item,
  .has-gift .dock__item[data-album-open],
  .has-gift .dock__gift {
    padding: 0 11px;
  }
}

/* hộp quà nhún nhẹ vài giây một lần để khách để ý */
.motion-on .dock.is-on .dock__gift svg {
  animation: gift-hop 4.2s ease-in-out 1.4s infinite;
}

@keyframes gift-hop {
  0%,
  82%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  86% {
    transform: translateY(-4px) rotate(-9deg);
  }
  90% {
    transform: translateY(0) rotate(7deg);
  }
  94% {
    transform: translateY(-2px) rotate(-4deg);
  }
}

/* con số tim nảy lên khi vừa được cộng thêm tim của món quà */
.dock__heart.is-bumped {
  animation: heart-bump 0.7s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes heart-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}

html.gift-open,
html.gift-open body {
  overflow: hidden;
}

.gift {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 300;
}

.gift__shade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(20, 52, 56, 0.5);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.gift.is-on .gift__shade {
  opacity: 1;
}

.gift__box {
  position: absolute;
  left: 50%;
  bottom: var(--kb, 0px); /* --kb = chiều cao bàn phím điện thoại đang che (gift.js đặt) */
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--col);
  max-height: calc(100% - var(--kb, 0px) - 64px);
  border-radius: 22px 22px 0 0;
  background: var(--paper);
  box-shadow: 0 -18px 50px -18px rgba(var(--shadow), 0.95);
  outline: none;
  -webkit-transform: translate(-50%, 104%);
  transform: translate(-50%, 104%);
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gift.is-on .gift__box {
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
}

.gift__head {
  position: relative;
  flex: none;
  padding: 18px 60px 6px;
  text-align: center;
}

.gift__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
  color: var(--brown-700);
}

.gift__close {
  position: absolute;
  top: 9px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brown-700);
  cursor: pointer;
}

.gift__close svg {
  width: 20px;
  height: 20px;
}

.gift__close:active {
  background: var(--teal-100);
}

.gift__grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: -webkit-min-content;
  grid-auto-rows: min-content;
  gap: 4px;
  padding: 6px 10px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.gift__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 112px;
  padding: 9px 3px 8px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gift__item:active {
  background: var(--teal-50);
}

.gift__item[aria-pressed='true'] {
  border-color: var(--teal-400);
  background: var(--teal-100);
}

.gift__icon {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 36px;
  line-height: 1.25;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.gift__item[aria-pressed='true'] .gift__icon {
  transform: scale(1.18) rotate(-6deg);
}

.gift__name {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.gift__hearts {
  margin-top: auto;
  padding-top: 3px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
}

.gift__hearts i {
  font-style: normal;
  color: #e8587a;
}

/* chữ chỉ dành cho trình đọc màn hình */
.gift__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gift__foot {
  flex: none;
  padding: 9px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #fff;
}

.gift__note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}

.gift__err {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.4;
  color: #b3261e;
  text-align: center;
}

.gift__row {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.gift__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--field);
  border-radius: 999px;
  background: var(--paper);
  font-size: 16px; /* dưới 16px thì iPhone tự phóng to trang khi gõ */
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.gift__input::placeholder {
  color: #9c9482;
}

.gift__input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(72, 165, 173, 0.28);
}

.gift__send {
  flex: none;
  min-height: 48px;
  padding: 0 18px;
  white-space: nowrap;
}

@media (max-width: 359px) {
  .gift__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gift__send {
    padding: 0 14px;
  }
}

/* món quà vừa tặng: hiện lớn giữa màn hình rồi bay lên */
.gift-fx {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 1040;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 128px;
  line-height: 1;
  pointer-events: none;
  -webkit-filter: drop-shadow(0 16px 22px rgba(var(--shadow), 0.6));
  filter: drop-shadow(0 16px 22px rgba(var(--shadow), 0.6));
  animation: gift-fly 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes gift-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, 40%) scale(0.2) rotate(-18deg);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18) rotate(8deg);
  }
  26% {
    transform: translate(-50%, -50%) scale(0.96) rotate(-4deg);
  }
  36% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  74% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1.04) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -190%) scale(0.86) rotate(6deg);
  }
}

/* ═════════ 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,
  .hero__spark {
    animation: none;
  }
}

/* ═════════ RIÊNG CHO THIỆP NHÀ TRAI: nền xanh ngọc, thiệp trắng có hoa văn bốn góc như thiệp giấy ═════════
   Mọi luật trong mục này chỉ có ở bản nhà trai (phần phía trên giống bản nhà gái, chỉ khác màu).
   Bỏ cả mục này thì thiệp trở về bố cục của bản nhà gái với tông xanh ngọc. */

:root {
  /* Hoa văn góc thiệp (vẽ riêng cho thiệp này): cùng một hình, lật cho bốn góc.
     Muốn đổi màu hoa văn: thay cả 8 chỗ %23a8822f (mã màu, # viết thành %23) trong bốn dòng dưới. */
  --corner-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23a8822f' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 61V15C3 8.4 8.4 3 15 3h46'/%3E%3Cpath d='M9 38V25c0-8.8 7.2-16 16-16h13'/%3E%3Cpath d='M25 9c-4 4-4 10 0 13 3.2 2.4 7.6.800 8-2.6.300-2.8-2.6-4.6-4.6-3-1.3 1-1 3 .600 3.3'/%3E%3Cpath d='M9 25c4-4 10-4 13 0 2.4 3.2.800 7.6-2.6 8-2.8.300-4.6-2.6-3-4.6 1-1.3 3-1 3.3.600'/%3E%3Cpath d='M38 9c3 3.6 7.4 4.4 11.5 2.300M9 38c3.6 3 4.4 7.4 2.3 11.5'/%3E%3C/g%3E%3Cg fill='%23a8822f'%3E%3Cpath d='M40.5 9c2.3-3.3 6-4.3 9.5-2.8-2.3 3.3-6 4.3-9.5 2.800zM9 40.500c-3.3 2.3-4.3 6-2.8 9.5 3.3-2.3 4.3-6 2.8-9.500z'/%3E%3Ccircle cx='14.5' cy='14.5' r='2'/%3E%3Ccircle cx='55' cy='9' r='1.3'/%3E%3Ccircle cx='9' cy='55' r='1.3'/%3E%3Ccircle cx='61' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='61' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  --corner-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg transform='matrix(-1 0 0 1 64 0)'%3E%3Cg fill='none' stroke='%23a8822f' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 61V15C3 8.4 8.4 3 15 3h46'/%3E%3Cpath d='M9 38V25c0-8.8 7.2-16 16-16h13'/%3E%3Cpath d='M25 9c-4 4-4 10 0 13 3.2 2.4 7.6.800 8-2.6.300-2.8-2.6-4.6-4.6-3-1.3 1-1 3 .600 3.3'/%3E%3Cpath d='M9 25c4-4 10-4 13 0 2.4 3.2.800 7.6-2.6 8-2.8.300-4.6-2.6-3-4.6 1-1.3 3-1 3.3.600'/%3E%3Cpath d='M38 9c3 3.6 7.4 4.4 11.5 2.300M9 38c3.6 3 4.4 7.4 2.3 11.5'/%3E%3C/g%3E%3Cg fill='%23a8822f'%3E%3Cpath d='M40.5 9c2.3-3.3 6-4.3 9.5-2.8-2.3 3.3-6 4.3-9.5 2.800zM9 40.500c-3.3 2.3-4.3 6-2.8 9.5 3.3-2.3 4.3-6 2.8-9.500z'/%3E%3Ccircle cx='14.5' cy='14.5' r='2'/%3E%3Ccircle cx='55' cy='9' r='1.3'/%3E%3Ccircle cx='9' cy='55' r='1.3'/%3E%3Ccircle cx='61' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='61' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --corner-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg transform='matrix(1 0 0 -1 0 64)'%3E%3Cg fill='none' stroke='%23a8822f' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 61V15C3 8.4 8.4 3 15 3h46'/%3E%3Cpath d='M9 38V25c0-8.8 7.2-16 16-16h13'/%3E%3Cpath d='M25 9c-4 4-4 10 0 13 3.2 2.4 7.6.800 8-2.6.300-2.8-2.6-4.6-4.6-3-1.3 1-1 3 .600 3.3'/%3E%3Cpath d='M9 25c4-4 10-4 13 0 2.4 3.2.800 7.6-2.6 8-2.8.300-4.6-2.6-3-4.6 1-1.3 3-1 3.3.600'/%3E%3Cpath d='M38 9c3 3.6 7.4 4.4 11.5 2.300M9 38c3.6 3 4.4 7.4 2.3 11.5'/%3E%3C/g%3E%3Cg fill='%23a8822f'%3E%3Cpath d='M40.5 9c2.3-3.3 6-4.3 9.5-2.8-2.3 3.3-6 4.3-9.5 2.800zM9 40.500c-3.3 2.3-4.3 6-2.8 9.5 3.3-2.3 4.3-6 2.8-9.500z'/%3E%3Ccircle cx='14.5' cy='14.5' r='2'/%3E%3Ccircle cx='55' cy='9' r='1.3'/%3E%3Ccircle cx='9' cy='55' r='1.3'/%3E%3Ccircle cx='61' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='61' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --corner-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg transform='matrix(-1 0 0 -1 64 64)'%3E%3Cg fill='none' stroke='%23a8822f' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 61V15C3 8.4 8.4 3 15 3h46'/%3E%3Cpath d='M9 38V25c0-8.8 7.2-16 16-16h13'/%3E%3Cpath d='M25 9c-4 4-4 10 0 13 3.2 2.4 7.6.800 8-2.6.300-2.8-2.6-4.6-4.6-3-1.3 1-1 3 .600 3.3'/%3E%3Cpath d='M9 25c4-4 10-4 13 0 2.4 3.2.800 7.6-2.6 8-2.8.300-4.6-2.6-3-4.6 1-1.3 3-1 3.3.600'/%3E%3Cpath d='M38 9c3 3.6 7.4 4.4 11.5 2.300M9 38c3.6 3 4.4 7.4 2.3 11.5'/%3E%3C/g%3E%3Cg fill='%23a8822f'%3E%3Cpath d='M40.5 9c2.3-3.3 6-4.3 9.5-2.8-2.3 3.3-6 4.3-9.5 2.800zM9 40.500c-3.3 2.3-4.3 6-2.8 9.5 3.3-2.3 4.3-6 2.8-9.500z'/%3E%3Ccircle cx='14.5' cy='14.5' r='2'/%3E%3Ccircle cx='55' cy='9' r='1.3'/%3E%3Ccircle cx='9' cy='55' r='1.3'/%3E%3Ccircle cx='61' cy='3' r='1.5'/%3E%3Ccircle cx='3' cy='61' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --corner-size: 46px;
  --corners: var(--corner-tl) left top / var(--corner-size) var(--corner-size) no-repeat, var(--corner-tr) right top / var(--corner-size) var(--corner-size) no-repeat,
    var(--corner-bl) left bottom / var(--corner-size) var(--corner-size) no-repeat, var(--corner-br) right bottom / var(--corner-size) var(--corner-size) no-repeat;
}

/* nền ngoài cùng (hai bên thiệp khi xem trên máy tính): đúng màu xanh ngọc của thiệp giấy */
body {
  background-color: var(--teal-500);
  background-image: none;
}

/* ── màn hình mở thiệp: một tấm thiệp trắng đặt trên nền xanh ngọc ── */
.gate {
  background-color: var(--teal-500);
  background-image: radial-gradient(96% 64% at 50% 38%, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 72%);
  background-size: auto;
  background-position: 0 0;
}

.gate__inner {
  position: relative;
  max-width: 368px;
  padding: 38px 22px 28px;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 34px 60px -26px rgba(12, 58, 64, 0.7), 0 2px 8px rgba(12, 58, 64, 0.16);
}

.gate__inner::before {
  content: '';
  position: absolute;
  top: 9px;
  right: 9px;
  bottom: 9px;
  left: 9px;
  background: var(--corners);
  pointer-events: none;
}

.gate__names {
  font-size: 32px;
  font-size: min(8.6vw, 40px);
}

/* dòng nhắc cuối thiệp nằm gọn giữa hai hoa văn góc dưới */
.gate__hint {
  max-width: 190px;
  margin-right: auto;
  margin-left: auto;
  line-height: 1.5;
}

.env__plate {
  box-shadow: 0 0 0 1px var(--teal-200), 0 18px 30px -16px rgba(var(--shadow), 0.6);
}

@media (max-height: 700px) {
  .gate__inner {
    padding: 26px 20px 20px;
  }
  .gate__inner::before {
    --corner-size: 38px;
  }
  .gate__hint {
    max-width: 176px;
  }
}

@media (max-height: 600px) {
  .gate__inner {
    padding: 20px 18px 16px;
  }
  .gate__title {
    font-size: 18px;
  }
  .env {
    margin-top: 10px;
  }
}

/* ── thẻ lời mời: bốn góc hoa văn thay cho viền chỉ may ── */
.frame {
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--teal-200), 0 26px 44px -30px rgba(var(--shadow), 0.9);
}

.frame::before {
  top: 9px;
  right: 9px;
  bottom: 9px;
  left: 9px;
  border: 0;
  border-radius: 0;
  background: var(--corners);
}

/* ── hai bên gia đình: dòng "Trưởng nam & Út nữ" giữa tên hai bạn, như trên thiệp giấy ── */
.family__names .family__ranks {
  margin: 4px 0;
  white-space: nowrap;
}

.family__rank {
  display: inline-block;
  min-width: 108px;
  padding: 0 10px;
  font-size: 19.5px;
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
  vertical-align: middle;
}

.family__rank:first-child {
  text-align: right;
}

.family__rank:last-child {
  text-align: left;
}

/* ── thời gian & địa điểm ── */
.event__note {
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18.5px;
  color: var(--ink-soft);
}

/* tên nơi tổ chức: "Tầng 6" một dòng nhỏ phía trên, tên khách sạn nằm gọn trên một dòng */
.place__name {
  font-size: 30px;
  font-size: min(7.6vw, 30px);
  white-space: nowrap;
}

.place__floor {
  display: block;
  margin-bottom: 2px;
  font-size: 21px;
  font-style: italic;
  color: var(--gold-600);
}

.place__welcome {
  margin-top: 26px;
  font-size: 30px;
  color: var(--brown-600);
}
