@font-face {
  font-family: Aghita;
  src: url(assets/FzAghita.woff2) format("woff2");
  font-display: swap;
}

:root {
  --wine: #660708;
  --red: #8b1019;
  --rouge: #a51c1c;
  --gold: #d4af63;
  --gold-deep: #b6893e;
  --pale: #f3e5ab;
  --ivory: #fdfbf7;
  --paper: #f8f1e5;
  --ink: #3e2927;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Be Vietnam Pro", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wine);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body.sealed {
  overflow: hidden;
}

h1, h2, h3, p, figure, ol {
  margin: 0;
}

h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
}

h2 {
  font-size: clamp(36px, 5.4vw, 62px);
  font-weight: 600;
  color: var(--wine);
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  color: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #c49139;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  width: 100%;
}

#three-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

main[inert] {
  visibility: hidden;
}

/* CỔNG MỞ THIỆP (GATE) */
.gate {
  position: fixed;
  z-index: 9;
  inset: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--pale);
  background: radial-gradient(ellipse at 50% 38%, #881c22 0%, #5e0f14 48%, #34060b 100%);
  isolation: isolate;
}

.gate::before,
.gate::after,
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  width: clamp(190px, 36vw, 600px);
  aspect-ratio: 400 / 330;
  background: url(assets/lotus.svg) left bottom / contain no-repeat;
  z-index: -1;
  opacity: 0.42;
}

.gate::before,
.hero::before {
  bottom: 0;
  left: 0;
}

.gate::after,
.hero::after {
  top: 0;
  right: 0;
  transform: rotate(180deg);
}

.gate-frame,
.hero-frame {
  position: absolute;
  inset: clamp(10px, 1.8vw, 24px);
  pointer-events: none;
  border: 1px solid rgba(212, 175, 99, 0.34);
  z-index: -1;
}

.gate-frame::before,
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212, 175, 99, 0.18);
}

.gate-content {
  width: min(92vw, 840px);
  padding: 36px 0;
  position: relative;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.27em;
  font-size: clamp(11px, 1.1vw, 13.5px);
  font-weight: 500;
}

.names {
  font: 600 clamp(44px, 6.2vw, 84px) / 1.14 var(--serif);
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.names i {
  font: italic 500 0.68em var(--serif);
  color: var(--gold);
  margin: 0 0.12em;
}

.gate-eyebrow {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  color: #e6c690;
}

.gate-eyebrow::before,
.gate-eyebrow::after {
  content: "";
  width: 44px;
  height: 1px;
  background: rgba(212, 175, 99, 0.5);
}

.gate h1 {
  margin: 14px 0 24px;
  color: #ffecd0;
  text-shadow: 0 2px 18px rgba(32, 3, 7, 0.45);
}

.guest-badge {
  display: inline-block;
  margin: -6px auto 20px;
  padding: 5px 18px;
  border: 1px solid rgba(212, 175, 99, 0.45);
  border-radius: 999px;
  background: rgba(68, 8, 14, 0.55);
  color: #fce8c3;
  font: 500 14px / 1.4 var(--sans);
  letter-spacing: 0.03em;
}

.hero-guest {
  margin: 8px auto 4px;
}

.guest-personal-note {
  max-width: 480px;
  margin: -10px auto 18px;
  font: italic 18px / 1.38 var(--serif);
  color: #f6ddb4;
}

.hero-guest-note {
  margin: 4px auto 6px;
}

.envelope {
  position: relative;
  display: block;
  width: min(78vw, 470px);
  aspect-ratio: 1.72;
  margin: auto;
  border: 0;
  background: transparent;
  perspective: 1200px;
  filter: drop-shadow(0 18px 20px rgba(36, 3, 6, 0.62));
}

.door {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  backface-visibility: hidden;
  transition: transform 1.08s cubic-bezier(0.42, 0.03, 0.2, 1), filter 0.85s;
  overflow: hidden;
  border: 1px solid rgba(227, 184, 121, 0.48);
  background-color: #90202b;
  background-image:
    repeating-linear-gradient(48deg, transparent 0 3px, rgba(255, 220, 164, 0.03) 4px, transparent 5px),
    linear-gradient(110deg, #8d1e26, #aa3137 43%, #74121c);
  box-shadow: inset 0 0 28px rgba(57, 2, 18, 0.28);
}

.left-door {
  transform-origin: left;
  border-radius: 4px 0 0 4px;
}

.right-door {
  left: 50%;
  transform-origin: right;
  border-radius: 0 4px 4px 0;
  background-color: #a12b32;
  background-image:
    repeating-linear-gradient(-48deg, transparent 0 3px, rgba(255, 220, 164, 0.035) 4px, transparent 5px),
    linear-gradient(120deg, #79141d, #ad3036 40%, #881e26);
}

.door-border {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 175, 99, 0.48);
  outline: 1px solid rgba(212, 175, 99, 0.3);
  outline-offset: -4px;
}

.door::after {
  position: absolute;
  content: "";
  inset: 0;
  background: url(assets/lotus.svg) 0 100% / 130% auto no-repeat;
  opacity: 0.56;
}

.right-door::after {
  transform: rotate(180deg);
}

.silk-band {
  position: absolute;
  left: 0;
  right: 0;
  height: 19%;
  top: 40.5%;
  border-block: 1px solid rgba(214, 162, 92, 0.62);
  background: linear-gradient(rgba(130, 27, 36, 0.92), rgba(108, 16, 26, 0.95), rgba(141, 29, 37, 0.92));
  box-shadow: 0 2px 6px rgba(41, 8, 10, 0.45);
}

.wax {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  translate: -50% -50%;
  width: clamp(64px, 9vw, 92px);
  aspect-ratio: 1;
  border-radius: 48% 52% 46% 54% / 49% 46% 54% 51%;
  background: radial-gradient(ellipse at 32% 22%, #f7e3b0 0, #dab676 26%, #aa793a 60%, #e4c282 76%, #885a2b 93%);
  border: 2px solid #deb978;
  box-shadow: inset 1px 2px 4px rgba(255, 244, 198, 0.7), 0 6px 14px rgba(38, 5, 9, 0.65);
  transition: transform 0.45s ease, opacity 0.45s ease, box-shadow 0.45s ease;
}

.wax b {
  display: grid;
  place-items: center;
  width: 78%;
  height: 78%;
  border: 2px double #a17739;
  border-radius: 50%;
  font: normal clamp(34px, 4.4vw, 52px) / 1 Georgia, serif;
  color: #76421c;
  text-shadow: 0 1px 1px #f9db98;
}

.envelope:hover .wax {
  transform: rotate(-5deg) scale(1.045);
  box-shadow: inset 1px 2px 5px rgba(255, 248, 214, 0.82), 0 8px 20px rgba(255, 206, 120, 0.25);
}

.open-hint {
  display: block;
  background: transparent;
  color: #f4dcb2;
  border: 0;
  padding: 14px 20px;
  margin: 10px auto 0;
  font: italic 22px var(--serif);
}

.gate-date {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: #dfb980;
  font-size: 12px;
  letter-spacing: 0.22em;
}

.gate-date span {
  width: 28px;
  height: 1px;
  background: rgba(212, 175, 99, 0.48);
}

.gate.opening {
  pointer-events: none;
  animation: unveil 1.18s cubic-bezier(0.32, 0, 0.2, 1) forwards;
}

.opening .left-door {
  transform: rotateY(-114deg);
}

.opening .right-door {
  transform: rotateY(114deg);
}

.opening .wax {
  transform: rotate(24deg) scale(1.16);
  opacity: 0;
}

.opening .silk-band {
  opacity: 0;
  transition: opacity 0.2s;
}

@keyframes unveil {
  0% {
    opacity: 1;
  }
  38% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
  }
}

/* PHẦN THIỆP CHÍNH (HERO + THREE.JS) */
.hero {
  position: relative;
  color: #f6e7d0;
  text-align: center;
  overflow: hidden;
  padding: clamp(38px, 5vw, 56px) 18px clamp(46px, 5.5vw, 64px);
}

.hero::before,
.hero::after {
  opacity: 0.22;
}

.three-ready .hero::before,
.three-ready .hero::after {
  opacity: 0.12;
}

.three-ready .hero-frame {
  border-color: rgba(212, 175, 99, 0.22);
}

.three-ready .hero-frame::before {
  border-color: rgba(212, 175, 99, 0.10);
}

.hero:focus {
  outline: 0;
}

.hero-center {
  position: relative;
  z-index: 1;
  margin: auto;
  max-width: 980px;
}

#emblem-anchor {
  width: clamp(114px, 12.5vw, 152px);
  height: clamp(110px, 11.5vw, 140px);
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}

.stage-anchor {
  width: clamp(112px, 12vw, 138px);
  height: clamp(106px, 11vw, 128px);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}

.events-anchor {
  width: clamp(124px, 13.5vw, 154px);
  height: clamp(120px, 13vw, 148px);
  margin-bottom: 12px;
}

.gift-anchor {
  width: clamp(120px, 13vw, 146px);
  height: clamp(118px, 12.5vw, 142px);
  margin-bottom: 14px;
}

.wish-anchor {
  width: clamp(134px, 15vw, 168px);
  height: clamp(112px, 12vw, 134px);
  margin-bottom: 10px;
}

.fallback-symbol {
  width: 86%;
  height: 100%;
  padding: 16%;
  border: 2px double #dcb97b;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #b7353b, #620e1a 72%);
  box-shadow: inset 0 0 0 3px #891a25, 0 4px 12px rgba(53, 6, 11, 0.4);
}

.three-ready .fallback-symbol {
  visibility: hidden;
}

.hero .kicker {
  color: #ebd0a3;
}

.hero .names {
  color: #ffeed2;
  margin: 10px 0 12px;
  text-shadow: 0 2px 16px rgba(32, 3, 8, 0.5);
}

.hero-date {
  font: 500 clamp(21px, 2.2vw, 25px) var(--serif);
  color: #fff2dc;
}

#lunar {
  font: italic 18px var(--serif);
  color: #e9cda6;
  margin-top: 2px;
}

.arch {
  width: min(74vw, 304px);
  margin: 34px auto 6px;
  padding: 7px;
  border: 1px solid rgba(212, 175, 99, 0.82);
  border-radius: 152px 152px 4px 4px;
  background: linear-gradient(180deg, rgba(255, 236, 194, 0.14), rgba(92, 12, 20, 0.32));
  box-shadow: 0 18px 42px rgba(24, 2, 5, 0.52);
}

.three-ready .arch {
  border-color: rgba(212, 175, 99, 0.36);
}

.arch img {
  aspect-ratio: 3 / 4.05;
  object-fit: cover;
  object-position: 50% 34%;
  border-radius: 146px 146px 2px 2px;
}

/* CÁC PHẦN NỘI DUNG GIẤY DÓ KEM */
.paper {
  position: relative;
  background: rgba(253, 250, 243, 0.988);
  box-shadow: 0 0 40px rgba(36, 4, 8, 0.22);
  border-block: 1px solid rgba(212, 175, 99, 0.35);
}

.section {
  max-width: 1060px;
  margin: auto;
  padding: clamp(52px, 6vw, 86px) clamp(18px, 4vw, 42px);
  text-align: center;
}

.section + .section {
  padding-top: 0;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #b07d3a;
  font: 24px / 1 var(--serif);
  margin: 0 0 14px;
}

.divider::before,
.divider::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ccac7d, transparent);
}

.ornament-icon {
  display: block;
}

.lede {
  max-width: 620px;
  margin: 14px auto 0;
  color: #675147;
}

/* GIA ĐÌNH HAI BÊN */
.families {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 36px auto 0;
  max-width: 840px;
  gap: 0;
}

.families article {
  padding: 10px clamp(12px, 2.6vw, 32px);
}

.families article + article {
  border-left: 1px solid #d5b88c;
}

.family-title {
  color: #975a35;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.families h3 {
  font-size: clamp(27px, 3vw, 38px);
  color: var(--red);
  margin: 6px 0 14px;
}

.families p {
  font-size: 15px;
  color: #4b3532;
}

.families address {
  font-style: normal;
  font-size: 13.5px;
  color: #736154;
  margin-top: 12px;
}

/* CHUYỆN CHÚNG MÌNH */
.story {
  list-style: none;
  padding: 0;
  margin: 36px auto 0;
  max-width: 700px;
  text-align: left;
}

.story li {
  display: grid;
  grid-template-columns: 78px 28px 1fr;
  column-gap: 14px;
  position: relative;
  padding: 0 0 30px;
}

.story li:last-child {
  padding-bottom: 0;
}

.story time {
  font: 600 23px / 1.35 var(--serif);
  color: #9b5d37;
  text-align: right;
  padding-top: 2px;
}

.story-marker {
  position: relative;
  display: flex;
  justify-content: center;
}

.story-marker::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: -34px;
  width: 1px;
  background: #cfb38c;
}

.story li:last-child .story-marker::before {
  display: none;
}

.story-marker::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px #f8edd9, 0 0 0 4px #cfb38c;
}

.story h3 {
  font-size: clamp(25px, 2.8vw, 30px);
  color: var(--wine);
}

.story p {
  font-size: 15px;
  color: #533e3a;
  margin-top: 6px;
}

/* HẸN NGÀY CHUNG ĐÔI */
.events-section {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(64, 6, 13, 0.68), rgba(96, 12, 22, 0.56), rgba(58, 5, 12, 0.72));
  position: relative;
  overflow: hidden;
}

.events-section h2,
.ceremony-stage h2,
.wish-stage h2 {
  color: #ffecd0;
  text-shadow: 0 2px 14px rgba(28, 2, 6, 0.45);
}

.events-section .divider {
  color: #ecc97b;
}

.clock {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px auto 34px;
}

.clock > div {
  position: relative;
  padding: 14px 10px 12px;
  background: linear-gradient(160deg, rgba(126, 18, 30, 0.86), rgba(76, 8, 16, 0.92));
  border: 1px solid rgba(226, 190, 120, 0.68);
  outline: 1px solid rgba(226, 190, 120, 0.25);
  outline-offset: -4px;
  min-width: clamp(68px, 9.2vw, 96px);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(24, 2, 6, 0.35);
  backdrop-filter: blur(5px);
}

.clock strong {
  font: 600 clamp(34px, 4vw, 42px) / 1 var(--serif);
  color: #fff3d4;
  display: block;
  font-variant-numeric: tabular-nums;
}

.clock small {
  color: #edd4ab;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
  display: block;
}

#clock-status:not(:empty) {
  margin-top: -12px;
  margin-bottom: 18px;
  color: #ffe9c2;
}

.events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.event {
  position: relative;
  border: 1px solid #d7b67a;
  outline: 1px solid rgba(182, 137, 62, 0.34);
  outline-offset: -7px;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf3e4 100%);
  color: var(--ink);
  padding: clamp(28px, 3.6vw, 42px) 24px;
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(24, 2, 6, 0.34);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.event:hover {
  transform: translateY(-4px);
  border-color: #f0cc84;
  box-shadow: 0 24px 52px rgba(20, 2, 5, 0.46);
}

.event-badge {
  display: inline-block;
  padding: 3px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #f5e7ce;
  border: 1px solid rgba(195, 146, 68, 0.42);
  color: #8b4e24;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.event h3 {
  color: var(--red);
  font-size: clamp(31px, 3.3vw, 38px);
}

.event time {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(139, 16, 25, 0.07);
  color: var(--wine);
  margin: 13px 0;
  font-weight: 600;
  font-size: 15px;
}

.event strong {
  display: block;
  font-size: 16.5px;
  color: #341f1d;
}

.event address {
  font-size: 14px;
  font-style: normal;
  color: #634d47;
  margin-top: 5px;
}

.event-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  font-size: 13.5px;
}

.event-links a {
  color: var(--wine);
  padding: 8px 18px;
  border: 1px solid rgba(139, 16, 25, 0.36);
  border-radius: 999px;
  background: #fffcf7;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.event-links a:hover {
  background: var(--wine);
  border-color: var(--gold);
  color: #fff5e2;
  transform: translateY(-1px);
}

/* ALBUM ẢNH CƯỚI 7 ẢNH */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.gallery button {
  width: 100%;
  padding: 5px;
  border: 1px solid #dfccb0;
  border-radius: 3px;
  display: block;
  overflow: hidden;
  background: #fffdf9;
  box-shadow: 0 4px 16px rgba(84, 38, 22, 0.07);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.gallery button:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(102, 7, 8, 0.14);
  transform: translateY(-2px);
}

.gallery button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  border-radius: 2px;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gallery button:hover img {
  transform: scale(1.035);
}

.gallery button:nth-child(1),
.gallery button:nth-child(2),
.gallery button:nth-child(6),
.gallery button:nth-child(7) {
  grid-column: span 3;
  aspect-ratio: 3 / 3.85;
}

.gallery button:nth-child(3),
.gallery button:nth-child(4),
.gallery button:nth-child(5) {
  grid-column: span 2;
  aspect-ratio: 2 / 2.85;
}

.gallery button.is-collage {
  background: #fffdf9;
  display: grid;
  place-items: center;
  padding: 10px;
}

.gallery button.is-collage img {
  object-fit: contain;
  object-position: center;
  background: #fffdf9;
}

/* =========================================================================
   SÂN KHẤU 3D CUỐI THIỆP: THIỆP HỒI ĐÁP (RSVP), HỒNG BAO & ĐÀI HOA ĐĂNG
   ========================================================================= */
/* Khi WebGL đã sẵn sàng, bỏ lớp phủ mờ để nền lụa gấm và tượng 3D sáng rực 100% như phần Hero */
.three-ready .events-section,
.three-ready .ceremony-stage,
.three-ready .wish-stage,
.three-ready footer {
  background: transparent;
}

.ceremony-stage {
  position: relative;
  background: linear-gradient(180deg, #4b060e, #6d0d18, #46050c);
  color: #f7e6cb;
}

.stage-kicker {
  color: #ebd09e;
  margin-bottom: 6px;
}

.stage-lede {
  max-width: 580px;
  margin: 12px auto 0;
  color: #efd9b8;
  font-size: 15.5px;
}

/* KHUNG THẺ HOÀNG GIA (ROYAL CARD) CÓ GÓC ĐỒNG MẠ VÀNG */
.royal-card {
  position: relative;
  max-width: 670px;
  margin: 30px auto 0;
  text-align: left;
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4.4vw, 40px);
  background: linear-gradient(180deg, #fffdf9 0%, #fbf3e4 100%);
  color: var(--ink);
  border: 1px solid #d7b67a;
  outline: 1px solid rgba(182, 137, 62, 0.34);
  outline-offset: -7px;
  border-radius: 6px;
  box-shadow: 0 20px 48px rgba(24, 2, 6, 0.36);
  overflow: hidden;
}

.card-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #c39244;
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}

.card-corner.tl {
  top: 11px;
  left: 11px;
  border-width: 2px 0 0 2px;
}
.card-corner.tr {
  top: 11px;
  right: 11px;
  border-width: 2px 2px 0 0;
}
.card-corner.bl {
  bottom: 11px;
  left: 11px;
  border-width: 0 0 2px 2px;
}
.card-corner.br {
  bottom: 11px;
  right: 11px;
  border-width: 0 2px 2px 0;
}

.card-seal-watermark {
  position: absolute;
  right: 22px;
  top: 18px;
  font: normal 68px / 1 Georgia, serif;
  color: rgba(152, 23, 38, 0.065);
  pointer-events: none;
  user-select: none;
}

/* BỘ CHỌN NHANH BUỔI TIỆC (PARTY TILES) */
.party-picker {
  display: grid;
  gap: 8px;
}

.picker-label {
  font-size: 14px;
  font-weight: 500;
  color: #462f2c;
}

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

.party-tile {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  text-align: center;
  background: #fffcf7;
  border: 1px solid #d8c6ab;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.party-tile b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--wine);
}

.party-tile small {
  font-size: 11.5px;
  color: #776156;
  line-height: 1.25;
}

.party-tile:hover {
  border-color: #c29347;
  background: #fdf6e9;
  transform: translateY(-1px);
}

.party-tile.is-active {
  background: linear-gradient(145deg, #84121d, #640811);
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(102, 7, 8, 0.22);
}

.party-tile.is-active b {
  color: #fff1d1;
}

.party-tile.is-active small {
  color: #edd2a4;
}

/* DÒNG SỐ NGƯỜI ĐI CÙNG GỌN CÂN ĐỐI & TỰ ẨN KHI CHỌN VẮNG MẶT */
.companions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #faf3e6;
  border: 1px solid #e4d3b8;
  border-radius: 5px;
}

.companions-info {
  display: grid;
  gap: 2px;
}

.companions-info small {
  font-size: 12.5px;
  color: #776156;
}

.companions-row .stepper-wrap {
  width: 168px;
  flex-shrink: 0;
}

.party-tiles.needs-choice {
  outline: 2px solid var(--red);
  outline-offset: 4px;
  border-radius: 6px;
}

.wish-field-group {
  display: grid;
  gap: 8px;
}

.wish-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* STEPPER SỐ NGƯỜI ĐI CÙNG */
.stepper-wrap {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  border: 1px solid #cbbba5;
  border-radius: 4px;
  background: #fffcf8;
  overflow: hidden;
}

.stepper-wrap:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(139, 16, 25, 0.1);
}

.stepper-wrap input {
  border: 0;
  text-align: center;
  font-weight: 600;
  padding-inline: 6px;
  background: transparent;
  box-shadow: none !important;
  appearance: textfield;
}

.stepper-wrap input::-webkit-outer-spin-button,
.stepper-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.step-btn {
  display: grid;
  place-items: center;
  background: #f6ecdc;
  color: var(--wine);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s, color 0.18s;
}

.step-btn:hover {
  background: #ead7b9;
}

.stepper-wrap.is-disabled {
  opacity: 0.52;
  pointer-events: none;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #462f2c;
}

input,
textarea,
select {
  min-width: 0;
  width: 100%;
  padding: 11px 13px;
  background: #fffcf8;
  border: 1px solid #cbbba5;
  border-radius: 4px;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(139, 16, 25, 0.1);
}

select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23660708' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

textarea {
  resize: vertical;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 400;
}

.check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--red);
}

.primary,
.copy {
  border: 1px solid var(--gold);
  padding: 13px 24px;
  background: linear-gradient(135deg, #86121d, #5f070f);
  color: #fff5e1;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(92, 8, 16, 0.24);
  transition: filter 0.2s, transform 0.15s;
}

.primary:hover:not(:disabled),
.copy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.6;
}

.status:not(:empty),
#wall-status:not(:empty),
#copy-status:not(:empty) {
  font-size: 14px;
  font-weight: 500;
  color: var(--red);
}

.status:empty {
  display: none;
}

/* KHÔNG GIAN HỒNG BAO MỪNG CƯỚI 3D */
.gift-section {
  padding-top: 12px;
}

.gift-card-shell {
  position: relative;
  max-width: 670px;
  margin: 28px auto 0;
  padding: clamp(24px, 4vw, 36px) clamp(18px, 4vw, 38px);
  background: linear-gradient(165deg, rgba(108, 13, 23, 0.72), rgba(58, 6, 12, 0.82));
  border: 1px solid rgba(218, 181, 112, 0.55);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(20, 2, 5, 0.42);
  backdrop-filter: blur(5px);
}

.gift-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
  margin: 0 auto 24px;
}

.gift-mini-card {
  padding: 14px 16px;
  border-radius: 5px;
  border: 1px solid rgba(226, 190, 122, 0.42);
  background: rgba(52, 5, 11, 0.52);
  color: #fcebd0;
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.2s;
}

.gift-mini-card:hover {
  border-color: var(--gold);
  background: rgba(134, 18, 30, 0.62);
  transform: translateY(-2px);
}

.gift-mini-card span {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #e5c185;
}

.gift-mini-card strong {
  display: block;
  font: 600 24px / 1.2 var(--serif);
  color: #fff2d6;
  margin: 4px 0 2px;
}

.gift-mini-card small {
  font-size: 13px;
  color: #e4cca8;
}

.gift-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #f8e4b4 0%, #dfb469 52%, #f4da9c 100%);
  color: #5b0810;
  border: 1px solid #fff0c8;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(18, 2, 5, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.75);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.gift-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 14px 34px rgba(246, 200, 112, 0.28);
}

.gift-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #7c101b;
  color: #fbe4b2;
  font: 18px / 1 Georgia, serif;
}

/* SỔ LƯU BÚT: ĐÀI HOA ĐĂNG 3D & THẺ CHÚC PHÚC */
.wish-stage {
  position: relative;
  background: linear-gradient(180deg, rgba(48, 5, 11, 0.68), rgba(84, 11, 20, 0.54), rgba(56, 6, 13, 0.74));
  border-top: 1px solid rgba(212, 175, 99, 0.28);
}

.wish-stage-inner {
  padding-bottom: clamp(42px, 5vw, 62px);
}

.wall-paper {
  border-top: 2px solid rgba(212, 175, 99, 0.55);
}

.wall-body {
  padding-top: clamp(42px, 5vw, 68px);
}

.wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  text-align: left;
  margin: 0 0 16px;
}

.wall article {
  position: relative;
  border: 1px solid #cfb07c;
  background: linear-gradient(160deg, #fffdf8 0%, #f6ebd6 100%);
  padding: 24px 24px 20px;
  border-radius: 5px;
  box-shadow: 0 6px 20px rgba(90, 42, 22, 0.07);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.wall article::before {
  content: "“";
  position: absolute;
  top: 6px;
  left: 14px;
  font: 600 54px / 1 var(--serif);
  color: rgba(180, 132, 62, 0.24);
  pointer-events: none;
}

.wall article::after {
  content: "囍";
  position: absolute;
  right: 14px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(156, 28, 38, 0.24);
  border-radius: 3px;
  font: normal 15px / 1 Georgia, serif;
  color: rgba(156, 28, 38, 0.28);
  pointer-events: none;
}

.wall article:nth-child(4n + 1),
.wall article:nth-child(4n) {
  background: linear-gradient(155deg, #861521 0%, #630b14 100%);
  color: #ffedd4;
  border-color: #c79d5b;
}

.wall article:nth-child(4n + 1)::before,
.wall article:nth-child(4n)::before {
  color: rgba(243, 212, 148, 0.22);
}

.wall article:nth-child(4n + 1)::after,
.wall article:nth-child(4n)::after {
  border-color: rgba(243, 212, 148, 0.3);
  color: rgba(243, 212, 148, 0.36);
}

.wall p {
  position: relative;
  white-space: pre-wrap;
  font: italic 22px / 1.44 var(--serif);
  padding-top: 8px;
}

.wall strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.wall strong::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.wall-actions {
  margin-top: 30px;
  text-align: center;
}

.wish-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid #c59b59;
  background: linear-gradient(180deg, #fffdf9, #f6ead4);
  color: var(--wine);
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(102, 7, 8, 0.1);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.wish-open-btn:hover {
  transform: translateY(-2px);
  border-color: var(--red);
  box-shadow: 0 12px 28px rgba(102, 7, 8, 0.16);
}

#wish-modal {
  width: min(560px, calc(100vw - 24px));
  text-align: center;
  padding: 0 24px 26px;
  background: linear-gradient(180deg, #fffdf9 0%, #f8efe0 100%);
  border: 2px solid #d4af63;
}

#wish-modal h2 {
  font-size: clamp(30px, 4.6vw, 38px);
  color: #fff1d6;
  margin-top: 4px;
}

.wish-modal-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.wish-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--wine);
  color: #fbe3b0;
  border: 1px solid var(--gold);
  font: 16px / 1 Georgia, serif;
  flex-shrink: 0;
}

.quick-wishes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wish-chip {
  display: inline-block;
  padding: 6px 13px;
  font-size: 12.5px;
  border-radius: 999px;
  background: #f7ecda;
  color: #6b1a20;
  border: 1px solid #d7bc91;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.wish-chip:hover {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff4df;
}

/* CHÂN TRANG (FOOTER) */
footer {
  position: relative;
  padding: 54px 16px;
  text-align: center;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(58, 6, 12, 0.72), rgba(38, 4, 8, 0.88));
}

footer .names {
  font-size: clamp(34px, 4.2vw, 56px);
  color: #ffecd0;
  margin-bottom: 10px;
}

footer p:last-child {
  font-size: 14px;
  color: #e6c99a;
}

/* NÚT ĐIỀU KHIỂN NỔI */
.controls {
  position: fixed;
  z-index: 5;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: 16px;
  display: flex;
  gap: 8px;
}

.controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d5b77e;
  background: rgba(104, 16, 25, 0.92);
  color: #f4d89d;
  border-radius: 50%;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(38, 4, 8, 0.55);
  backdrop-filter: blur(4px);
}

.controls button[aria-pressed="true"] {
  background: #f1deb5;
  color: var(--wine);
}

/* LIGHTBOX & HỘP MỪNG CƯỚI PHONG BAO ĐỎ - VÀNG */
dialog {
  max-width: calc(100vw - 24px);
  max-height: 94dvh;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--ivory);
  color: var(--ink);
  padding: 28px;
}

dialog::backdrop {
  background: rgba(28, 6, 10, 0.9);
  backdrop-filter: blur(4px);
}

.close,
.photo-nav {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: rgba(64, 8, 12, 0.88);
  color: #fff;
  border: 1px solid rgba(227, 193, 141, 0.55);
  border-radius: 50%;
  font: 26px / 1 Georgia, serif;
}

.close {
  position: absolute;
  z-index: 2;
  right: 12px;
  top: 12px;
}

#lightbox {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 20px 56px;
  background: rgba(26, 6, 10, 0.96);
  color: #f8e6c6;
}

#lightbox[open] {
  display: grid;
  place-items: center;
}

#lightbox figure {
  width: 100%;
  max-width: 960px;
  text-align: center;
}

#light-photo {
  width: auto;
  max-width: 100%;
  max-height: 80dvh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 3px;
}

#photo-count {
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: #e6caa0;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

#prev {
  left: 10px;
}

#next {
  right: 10px;
}

#gift-modal {
  width: min(650px, calc(100vw - 24px));
  text-align: center;
  padding: 0 24px 26px;
  background: linear-gradient(180deg, #fffdf9 0%, #f8efe0 100%);
  border: 2px solid #d4af63;
}

.gift-modal-head {
  margin: 0 -24px 22px;
  padding: 24px 44px 20px;
  background: radial-gradient(ellipse at 50% 20%, #9b1a26, #610912 85%);
  color: #ffedd2;
  border-bottom: 2px solid #d4af63;
}

.gift-modal-seal {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fae5b2, #be8c42 82%);
  color: #6b1019;
  border: 2px solid #fff1cc;
  font: 22px / 1 Georgia, serif;
  box-shadow: 0 4px 12px rgba(28, 3, 7, 0.45);
}

.gift-modal-head .kicker {
  color: #edd09d;
  font-size: 11px;
}

#gift-modal h2 {
  font-size: clamp(32px, 4.8vw, 40px);
  color: #fff1d6;
  margin-top: 4px;
}

.accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.accounts article {
  position: relative;
  padding: 18px 14px;
  background: #fffdf9;
  border: 1px solid #d7b77e;
  outline: 1px solid rgba(212, 175, 99, 0.32);
  outline-offset: -5px;
  border-radius: 5px;
  box-shadow: 0 8px 22px rgba(96, 24, 18, 0.08);
}

.accounts article.is-highlighted {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(139, 16, 25, 0.22), 0 10px 26px rgba(139, 16, 25, 0.15);
}

.accounts img {
  width: min(100%, 158px);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 12px auto;
  padding: 8px;
  background: #fff;
  border: 1px solid #dfc89e;
  border-radius: 4px;
}

.accounts strong,
.accounts small {
  display: block;
}

.accounts small {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f6ead6;
  color: #78482a;
  font-weight: 500;
}

.accounts p {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 8px;
  color: var(--wine);
}

.accounts h3 {
  font-size: 28px;
  color: var(--red);
}

.copy {
  font-size: 13px;
  padding: 9px 18px;
  margin-top: 12px;
}

#gift-note {
  font-size: 12.5px;
  color: #6d584f;
  margin-top: 16px;
}

/* ĐÁP ỨNG GIAO DIỆN DI ĐỘNG & MÁY TÍNH BẢNG */
@media (max-width: 767px) {
  .gate-content {
    padding: 28px 0;
  }

  .gate::before,
  .gate::after {
    width: 62vw;
  }

  .gate-frame,
  .hero-frame {
    inset: 10px;
  }

  .envelope {
    width: min(82vw, 390px);
  }

  #emblem-anchor {
    width: 108px;
    height: 104px;
    margin-bottom: 16px;
  }

  .hero {
    padding: 32px 16px 42px;
  }

  .hero-date {
    font-size: 21px;
  }

  .arch {
    width: min(72vw, 276px);
    margin-top: 26px;
  }

  .section {
    padding-inline: 17px;
  }

  .events {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .party-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gallery button:nth-child(1) {
    grid-column: span 2;
    aspect-ratio: 4 / 4.5;
  }

  .gallery button:nth-child(n + 2) {
    grid-column: span 1;
    aspect-ratio: 3 / 4.1;
  }

  #lightbox {
    padding: 18px 14px;
  }

  .photo-nav {
    top: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: none;
  }

  #prev {
    left: 24%;
  }

  #next {
    right: 24%;
  }

  #photo-count {
    margin-bottom: 52px;
  }
}

@media (max-width: 620px) {
  .names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: clamp(38px, 10vw, 56px);
    line-height: 1.08;
  }

  .names i {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.56em;
    line-height: 1;
    margin: 2px 0;
  }

  .names i::before,
  .names i::after {
    content: "";
    width: 22px;
    height: 1px;
    background: rgba(212, 175, 99, 0.45);
  }

  footer .names {
    font-size: clamp(32px, 8.5vw, 44px);
  }

  .families {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 28px;
  }

  .families article {
    padding: 4px 10px;
  }

  .families article + article {
    border-left: 0;
    border-top: 1px solid #dcc29b;
    padding-top: 22px;
  }

  .story li {
    grid-template-columns: 58px 22px 1fr;
    column-gap: 10px;
    padding-bottom: 24px;
  }

  .story time {
    font-size: 20px;
  }

  .fields,
  .wall,
  .accounts,
  .gift-preview {
    grid-template-columns: 1fr;
  }

  .gift-button {
    padding: 13px 20px;
    font-size: 14.5px;
    width: 100%;
  }

  .wall {
    gap: 13px;
  }

  .wall article {
    padding: 20px 18px 18px;
  }

  .wall p {
    font-size: 20px;
  }

  .companions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .companions-row .stepper-wrap {
    width: 100%;
  }

  #gift-modal,
  #wish-modal {
    padding: 0 14px 20px;
  }

  .gift-modal-head {
    margin-inline: -14px;
    padding: 20px 36px 16px;
  }
}

@media (max-height: 510px) and (orientation: landscape) {
  .gate-content {
    padding: 12px;
  }
  .gate .names {
    flex-direction: row;
    justify-content: center;
    font-size: 32px;
    margin: 4px 0;
  }
  .envelope {
    width: 230px;
  }
  .open-hint {
    margin: 0;
    padding: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
