/* Thiệp cưới Khánh Dũ & Lê Khanh — mẫu "Hoa Rum Trắng"
   Layout: one paper column (max 480px) like a long folded card; watercolor calla lilies bleed off its edges;
   on wide screens the column floats on a sage-to-olive wash. Single light theme by design (paper invitation). */
/* Chữ "D" của The Nautigal có gạch ngang, đọc nhầm thành "Đ": mượn riêng chữ D từ Alex Brush */
@font-face { font-family: "Script D"; src: url("https://fonts.gstatic.com/s/alexbrush/v23/SZc83FzrJKuqFbwMKk6EhUXz7RlNiCY.woff2") format("woff2"); unicode-range: U+0044; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f6f5f2;
  --paper-hi: #fdfcf8;
  --olive: #565a36;
  --olive-deep: #44482a;
  --gold: #a5865a;
  --gold-soft: #b89c74;
  --muted: #8b7f66;
  --line: #ddd5c4;
  --sage: #9aa58a;
  --wash-a: #f4f3ec;
  --wash-b: #c5c7b3;
  --wash-c: #74785a;
  --on-olive: #f7f5ef;
  --shadow: 46, 44, 30;

  --f-script: "Script D", "The Nautigal", "Great Vibes", cursive;
  --f-display: "Cormorant Garamond", "EB Garamond", "Times New Roman", serif;
  --f-head: "EB Garamond", "Cormorant Garamond", "Times New Roman", serif;
  --f-sans: "Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif;

  --gutter-l: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));
  --col: 480px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--olive);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

@media (min-width: 560px) {
  body { background: #fff; }
}

/* ---------- paper column ---------- */
.card {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  background-color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background: url("https://cdn.wedding-invitation.io.vn/assets/art/paper.webp") repeat;
  background-size: 441px 588px;
  opacity: .25;
}
@media (min-width: 768px) { .card::before { background-size: 600px 800px; } }
/* desktop: scale the whole phone-width column up instead of re-flowing it */
:root { --z: 1; }
@media (min-width: 768px) { :root { --z: 1.12; --col: 620px; } }
@media (min-width: 1000px) { :root { --z: 1.2; --col: 750px; } }
.card, .cover__card, .modal__panel { zoom: var(--z); }
@media (min-width: 560px) {
  .card { box-shadow: 0 0 0 1px rgba(var(--shadow), .14), 0 10px 40px -20px rgba(var(--shadow), .18); }
}

.section {
  position: relative;
  padding-block: 56px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.section > *:not(.deco) { position: relative; z-index: 1; }
.section__title {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--olive);
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* decorations */
.deco { position: absolute; z-index: 0; pointer-events: none; user-select: none; max-width: none; }
.deco--side-l { left: -6%; width: 30%; opacity: .8; }
.deco--side-r { right: -6%; width: 30%; opacity: .8; }
.deco--families { bottom: 40px; }
.deco--ceremony { top: -150px; }
.deco--party { top: 26%; }
.deco--gb { bottom: 0; opacity: .6; }
@media (min-width: 480px) { .deco--side-l, .deco--side-r { width: 144px; } }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: 64%; padding-bottom: 8px; }
.hero__lily {
  position: absolute;
  top: 0;
  margin-top: -16%;
  right: -14%;
  width: 75%;
  max-width: none;
  pointer-events: none;
  animation: sway 9s ease-in-out infinite alternate;
  transform-origin: 100% 0;
}
.hero__inner {
  position: relative;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hero__names {
  width: 100%;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(52px, 15.5vw, 72px);
  line-height: 1.05;
  color: var(--olive);
  display: grid;
  gap: 2px;
}
.hero__first { justify-self: start; padding-left: 4%; }
.hero__amp { justify-self: center; font-size: .62em; color: var(--olive); }
.hero__second { justify-self: end; padding-right: 17%; }
@media (min-width: 768px) {
  .hero__names { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero__first { grid-column: 1; justify-self: end; white-space: nowrap; padding-left: 0; margin-right: -.3em; }
  .hero__amp { grid-column: 1 / -1; }
  .hero__second { grid-column: 2; justify-self: start; white-space: nowrap; padding-right: 0; margin-left: .3em; }
}
@media (min-width: 768px) { .hero__names { font-size: 58px; } }
.hero__date {
  font-family: var(--f-head);
  font-size: 17px;
  letter-spacing: .32em;
  color: var(--gold);
  font-variant-numeric: lining-nums;
}

/* ---------- families ---------- */
.families { padding-top: 64px; gap: 22px; }
.families__grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: start;
}
.families__rule { width: 1px; align-self: stretch; background: var(--olive); opacity: .55; margin-block: 30px 18px; }
.family { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.family__side {
  font-family: var(--f-head);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.family__title { font-family: var(--f-head); font-style: italic; font-size: 17px; color: var(--gold); margin-bottom: 2px; }
.family__name { font-family: var(--f-head); font-weight: 500; font-size: clamp(12px, 3.4vw, 16.5px); line-height: 1.45; color: var(--olive); white-space: nowrap; }
.family__addr { margin-top: 6px; font-family: var(--f-head); font-size: clamp(12px, 3.5vw, 15px); line-height: 1.45; color: var(--gold); white-space: nowrap; }

.announce {
  margin-top: 10px;
  font-family: var(--f-head);
  font-size: clamp(15px, 4.2vw, 19px);
  line-height: 1.5;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--olive);
  text-wrap: balance;
}
.couple { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.couple__person { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.couple__name {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(50px, 15vw, 72px);
  line-height: 1.2;
  padding-inline: .15em;
  color: var(--olive);
  text-wrap: balance;
}
.couple__order {
  font-family: var(--f-head);
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.couple__and { font-family: var(--f-script); font-size: 58px; line-height: .9; color: var(--gold); padding-block: 2px 6px; }

/* ---------- event blocks ---------- */
.event { gap: 10px; }
.event__icon { width: 120px; height: auto; margin-bottom: 4px; position: relative; z-index: 1; }
.event__icon--cake { width: 104px; }
.event__lead {
  font-family: var(--f-head);
  font-size: 17px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--olive);
  line-height: 1.45;
  text-wrap: balance;
}
.event__venue {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--olive);
  line-height: 1.2;
}
.event__addr { font-family: var(--f-head); font-size: 16px; color: var(--gold); font-weight: 400; }
/* Tiệc ở nhà hàng: loại nơi tổ chức trên tên, sảnh dưới tên */
.event__kind { font-family: var(--f-head); font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.event__venue--long { font-size: clamp(26px, 8.6vw, 34px); }
.event__hall { font-family: var(--f-head); font-size: 16.5px; font-weight: 600; letter-spacing: .04em; color: var(--olive); }
.map {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 380px;
  padding: 14px 18px 14px 14px;
  border: 1px solid rgba(165, 134, 90, .35);
  border-radius: 14px;
  background: rgba(253, 252, 248, .7);
  text-align: left;
}
.map__qr { flex: none; width: 104px; padding: 7px; border-radius: 8px; background: #fff; box-shadow: 0 6px 16px -10px rgba(var(--shadow), .5); }
.map__qr svg { display: block; width: 100%; height: auto; }
.map__text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.map__title { font-family: var(--f-head); font-size: 17px; font-weight: 600; color: var(--olive); }
.map__hint { font-size: 12.5px; line-height: 1.45; color: var(--gold); }
.map__btn { margin-top: 4px; padding: 8px 18px; font-size: 12.5px; text-decoration: none; }
.when { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; }
.when__meta {
  display: flex;
  gap: 18px;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}
.when__date { display: flex; align-items: center; gap: 16px; }
.when__day {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 72px;
  line-height: .9;
  color: var(--olive);
  font-variant-numeric: lining-nums;
  padding-right: 16px;
  border-right: 1px solid var(--olive);
}
.when__rest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-family: var(--f-head);
  font-size: 19px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--olive);
  line-height: 1.1;
}
.when__lunar {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  text-wrap: balance;
}

.event--party { gap: 12px; }
.guest {
  font-family: var(--f-script);
  font-size: clamp(38px, 11vw, 50px);
  line-height: 1.25;
  color: var(--olive);
  padding: 2px 18px 10px;
  border-bottom: 1px dashed var(--gold-soft);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.event--party .event__lead { margin-top: 10px; }

/* countdown */
.countdown { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.countdown__title {
  font-family: var(--f-head);
  font-size: 21px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
}
.countdown__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 64px)); gap: 10px; }
.countdown__grid div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.countdown__grid span { font-family: var(--f-head); font-weight: 600; font-size: 28px; line-height: 1; color: var(--olive); font-variant-numeric: tabular-nums lining-nums; }
.countdown__grid small { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.countdown__done { font-family: var(--f-head); font-size: 20px; color: var(--olive); }

.times { display: flex; gap: 44px; margin-top: 18px; }
.times div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.times small { font-family: var(--f-head); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.times strong { font-family: var(--f-head); font-weight: 600; font-size: 24px; color: var(--olive); font-variant-numeric: lining-nums; }

/* calendar */
.calendar {
  margin-top: 26px;
  width: min(100%, 290px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(253, 252, 248, .55);
  padding: 14px 10px 12px;
}
.calendar__head { font-family: var(--f-head); font-weight: 700; font-size: 19px; color: var(--olive); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.calendar__dow, .calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar__dow { padding: 8px 0 6px; border-bottom: 2px solid var(--olive); font-family: var(--f-head); font-size: 11.5px; color: var(--muted); }
.calendar__grid { padding-top: 8px; row-gap: 4px; }
.calendar__grid span {
  position: relative;
  display: grid;
  place-items: center;
  height: 32px;
  font-family: var(--f-head);
  font-size: 14px;
  color: var(--olive);
  font-variant-numeric: tabular-nums lining-nums;
}
.calendar__grid .is-day { color: var(--on-olive); font-weight: 700; }
.calendar__grid .is-day::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 30px;
  background: var(--olive);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5C12 20.5 3 15 3 9.2 3 6.3 5.2 4 8 4c1.8 0 3.2 1 4 2.4C12.8 5 14.2 4 16 4c2.8 0 5 2.3 5 5.2 0 5.8-9 11.3-9 11.3z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5C12 20.5 3 15 3 9.2 3 6.3 5.2 4 8 4c1.8 0 3.2 1 4 2.4C12.8 5 14.2 4 16 4c2.8 0 5 2.3 5 5.2 0 5.8-9 11.3-9 11.3z'/%3E%3C/svg%3E") center / contain no-repeat;
  z-index: -1;
  animation: beat 1.8s ease-in-out infinite;
}
.calendar__grid .is-day { z-index: 0; }

.actions { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.addcal { position: relative; }
.link-btn {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-family: var(--f-head);
  font-size: 16px;
  color: var(--olive);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--gold-soft);
  cursor: pointer;
}
.addcal__menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px -16px rgba(var(--shadow), .35);
  overflow: hidden;
}
.addcal__menu a { padding: 12px 16px; font-size: 14px; color: var(--olive); text-decoration: none; }
.addcal__menu a + a { border-top: 1px solid var(--line); }
.addcal__menu a:hover { background: var(--paper); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 30px;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn--solid { background: var(--olive); color: var(--on-olive); box-shadow: 0 10px 24px -12px rgba(var(--shadow), .6); }
.btn--solid:hover { background: var(--olive-deep); transform: translateY(-1px); }
.btn--solid:active { transform: translateY(1px); }
.btn--sm { padding: 10px 22px; font-size: 13.5px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- album ---------- */
.album { padding-inline: 0; gap: 22px; }
.album .section__title { padding-inline: var(--gutter-l) var(--gutter-r); }
.album__stage { width: 100%; overflow: hidden; padding-block: 18px 40px; margin-bottom: -14px; --sw: .5; }
@media (min-width: 560px) { .album__stage { --sw: .38; } }
.album__view { position: relative; width: min(100%, 680px); margin-inline: auto; perspective: 1100px; }
.album__track {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / calc(var(--sw) * 1.5);
  transform-style: preserve-3d;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 6px;
}
.album__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: rgba(40, 42, 30, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background-color .3s ease, transform .3s ease;
}
.album__nav svg { width: 18px; height: 18px; }
.album__nav:hover { background: rgba(40, 42, 30, .72); transform: scale(1.06); }
.album__nav--prev { left: calc(50% - var(--sw) * 50% - 17px); }
.album__nav--next { right: calc(50% - var(--sw) * 50% - 17px); }
.album__track.is-drag { cursor: grabbing; }
.album__slide {
  position: absolute;
  top: 0;
  left: calc(50% - var(--sw) * 50%);
  width: calc(var(--sw) * 100%);
  height: 100%;
  border: 0;
  padding: 0;
  background: var(--paper-hi);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 26px 34px -24px rgba(var(--shadow), .55), 0 2px 6px rgba(var(--shadow), .08);
  transition: transform .9s cubic-bezier(.22,.9,.24,1), opacity .9s cubic-bezier(.22,.9,.24,1), filter .9s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.album__track.is-drag .album__slide { transition: none; }
.album__slide img { pointer-events: none; -webkit-user-drag: none; }
.album__slide img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.22,.9,.24,1); }
.album__slide.is-active img { transform: scale(1.04); }
.album__dots { display: flex; gap: 6px; justify-content: center; }
.album__dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); cursor: pointer; transition: width .6s cubic-bezier(.22,.9,.24,1), background-color .6s ease; }
.album__dots i.on { width: 22px; background: var(--olive); opacity: .8; }

/* ---------- guestbook ---------- */
.guestbook { gap: 20px; }
.gb-form { width: 100%; max-width: 420px; margin-inline: auto; display: flex; flex-direction: column; gap: 10px; }
.gb-form__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.field {
  width: 100%;
  border: 1px solid rgba(86, 90, 54, .55);
  border-radius: 8px;
  background: rgba(253, 252, 248, .75);
  padding: 8px 12px;
  font: 400 14px/1.5 var(--f-sans);
  color: var(--olive-deep);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: #a39b88; }
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(165, 134, 90, .18); }
textarea.field { resize: vertical; min-height: 84px; }
.gb-form .btn--sm { padding: 8px 18px; font-size: 12.5px; }
.gb-form .chip { padding: 6px 10px; font-size: 12.5px; }
.gb-form .chip svg { width: 15px; height: 15px; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--olive) 50%), linear-gradient(135deg, var(--olive) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(86, 90, 54, .08);
  color: var(--olive);
  font-size: 13px;
  cursor: pointer;
}
.chip:hover { background: rgba(86, 90, 54, .14); }
.form-msg { min-height: 1.2em; font-size: 13.5px; color: var(--gold); text-align: left; }
.form-msg.is-error { color: #9a4a3a; }

.wishes {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  max-height: 470px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 10px 24px 2px;
  text-align: left;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(165, 134, 90, .45) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}
.wishes::-webkit-scrollbar { width: 4px; }
.wishes::-webkit-scrollbar-track { background: transparent; margin-block: 6px; }
.wishes::-webkit-scrollbar-thumb { background: rgba(165, 134, 90, .45); border-radius: 99px; }
.wishes::-webkit-scrollbar-thumb:hover { background: rgba(165, 134, 90, .7); }
.wish { background: rgba(253, 252, 248, .82); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.wish__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wish__name { font-family: var(--f-head); font-weight: 600; font-size: 16px; color: var(--olive); min-width: 0; overflow-wrap: anywhere; }
.wish__time { flex: none; font-family: var(--f-head); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wish__msg { font-family: var(--f-head); font-size: 16px; line-height: 1.5; color: var(--olive-deep); overflow-wrap: anywhere; white-space: pre-line; }
.wish--new { animation: rise .6s ease both; }
.wishes__empty { text-align: center; font-family: var(--f-head); font-style: italic; font-size: 15px; color: var(--muted); padding: 12px; }

/* ---------- gift ---------- */
.gift { gap: 14px; padding-bottom: 40px; }
.gift__box {
  position: relative;
  width: 260px;
  max-width: 100%;
  height: 230px;
  border: 0;
  background: none;
  cursor: pointer;
  margin-top: 6px;
}
.gift__env { position: absolute; max-width: none; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gift__env--back { left: 14px; top: -6px; width: 112px; transform: rotate(-4deg); }
.gift__env--front { right: 4px; top: 40px; width: 140px; transform: rotate(6deg); }
.gift__box:hover .gift__env--back { transform: rotate(-8deg) translateY(-6px); }
.gift__box:hover .gift__env--front { transform: rotate(10deg) translateY(-8px); }
.gift__spark { position: absolute; color: var(--gold); font-size: 15px; animation: twinkle 2.4s ease-in-out infinite; }
.gift__spark--1 { left: 34px; top: 0; }
.gift__spark--2 { right: 12px; top: 30px; animation-delay: .8s; font-size: 12px; }
.gift__spark--3 { left: 4px; bottom: 30px; animation-delay: 1.5s; font-size: 11px; }
.gift__hint { font-size: 14px; font-weight: 500; color: var(--muted); }

.gift__tabs { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.gift__tabs button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--f-head);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--olive);
  cursor: pointer;
}
.gift__tabs button[aria-selected="true"] { background: var(--olive); border-color: var(--olive); color: var(--on-olive); }
.gift__panel { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; text-align: center; }
.qr {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.qr svg { width: 100%; height: 100%; display: block; }
.qr--empty { display: grid; place-items: center; padding: 22px; background: rgba(253, 252, 248, .9); font-family: var(--f-head); font-style: italic; font-size: 16px; line-height: 1.4; color: var(--muted); }
.acct { display: flex; flex-direction: column; gap: 2px; }
.acct__bank { font-family: var(--f-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.acct__num { font-family: var(--f-head); font-weight: 600; font-size: 22px; letter-spacing: .06em; color: var(--olive); font-variant-numeric: tabular-nums lining-nums; user-select: all; }
.acct__name { font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--olive); }

/* ---------- thanks ---------- */
.thanks { padding-top: 30px; padding-bottom: 72px; gap: 22px; }
.thanks__frame { position: relative; width: min(74%, 290px); padding: 10px; }
.thanks__arch {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: 999px 999px 14px 14px;
  overflow: hidden;
  box-shadow: 0 22px 40px -22px rgba(var(--shadow), .6);
}
.thanks__arch img { width: 100%; height: 100%; object-fit: cover; }
.thanks__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold-soft);
  border-radius: 999px 999px 20px 20px;
  opacity: .8;
}
.thanks__lily { position: absolute; width: 66%; max-width: none; bottom: -40px; z-index: 2; pointer-events: none; }
.thanks__lily--l { left: -38%; transform: scaleX(-1); }
.thanks__lily--r { right: -38%; }
.thanks__text {
  margin-top: 14px;
  font-family: var(--f-head);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--olive);
  text-wrap: balance;
}
.thanks__sign { font-family: var(--f-script); font-size: 46px; line-height: 1.3; color: var(--olive); }

/* ---------- ornament ---------- */
.ornament { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.ornament span { width: 64px; height: 1px; background: currentColor; opacity: .6; }

/* ---------- cover ---------- */
.cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(160deg, var(--wash-a) 0%, var(--wash-b) 46%, var(--wash-c) 100%);
  overflow: hidden;
  transition: opacity .9s ease .25s, visibility 0s linear 1.2s;
}
.cover__petals { position: absolute; inset: 0; pointer-events: none; }
.petal {
  position: absolute;
  top: -40px;
  width: 16px;
  height: 16px;
  opacity: .85;
  animation: fall linear infinite;
}
.petal svg { width: 100%; height: 100%; display: block; animation: spin 6s linear infinite; }
.cover__card {
  position: relative;
  width: min(100%, 340px);
  padding: 36px 26px 40px;
  border-radius: 12px;
  background-color: var(--paper-hi);
  background-image: url("https://cdn.wedding-invitation.io.vn/assets/art/paper.webp");
  background-size: 300px;
  box-shadow: 0 40px 80px -30px rgba(var(--shadow), .65), 0 0 0 1px rgba(255, 255, 255, .6) inset;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 1s cubic-bezier(.6,0,.3,1), opacity .8s ease;
  animation: card-in 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.cover__card > *:not(.cover__lily) { position: relative; z-index: 1; }
.cover__lily { position: absolute; z-index: 0; pointer-events: none; max-width: none; opacity: .55; }
.cover__lily--tl { width: 26%; left: -4%; top: -4%; transform: scaleX(-1); }
.cover__lily--br { width: 58%; right: -8%; bottom: -6%; opacity: .6; }
.cover__seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--on-olive);
  background: radial-gradient(circle at 35% 30%, #6d7146, var(--olive-deep) 70%);
  box-shadow: 0 12px 22px -8px rgba(var(--shadow), .55), inset 0 0 0 3px rgba(255, 255, 255, .08);
  margin-bottom: 6px;
}
.cover__seal svg { animation: beat 1.8s ease-in-out infinite; }
.cover__names { font-family: var(--f-script); font-weight: 400; font-size: clamp(46px, 14vw, 58px); line-height: 1.08; color: var(--olive); display: flex; flex-direction: column; }
.cover__amp { font-family: var(--f-head); font-size: 24px; line-height: 1.3; }
.cover__date { font-family: var(--f-head); font-size: 22px; color: var(--gold); font-variant-numeric: lining-nums; }
.cover__invite { margin-top: 4px; font-family: var(--f-head); font-size: 20px; color: var(--gold); }
.cover__guest { margin-top: -8px; font-family: var(--f-display); font-weight: 600; font-size: 26px; line-height: 1.2; color: var(--olive); max-width: 100%; overflow-wrap: anywhere; }
.cover__open { margin-top: 10px; padding: 13px 38px; font-size: 16px; text-transform: none; letter-spacing: .04em; }
.cover.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
/* mở thiệp: lấp lánh + mở vòng tròn */
.cover.is-opening { pointer-events: none; }
.cover.is-opening .cover__card { animation: card-glow 1.9s cubic-bezier(.3,.6,.3,1) both; }
.cover__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 220, .0) 40%, rgba(255, 248, 228, .9) 50%, rgba(255, 246, 220, 0) 60%, transparent 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
  opacity: 0;
}
.cover.is-opening .cover__card::after { animation: shine .9s cubic-bezier(.4,0,.2,1) .05s both; }
.cover.is-opening .cover__seal { animation: seal-pop .9s cubic-bezier(.3,1.4,.5,1) both; }
.cover.is-opening .cover__seal svg { animation: none; }
.starfall {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, calc(var(--col) * var(--z)));
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  animation: fade 2s ease both;
}
@media (max-width: 559px) { .starfall { width: 100%; } }
.starfall__f { position: absolute; top: -20px; animation: star-fall linear infinite; }
.starfall__s { position: relative; display: block; filter: drop-shadow(0 0 3px rgba(255, 236, 190, .9)); animation: twinkle ease-in-out infinite, spin linear infinite; }
.starfall__s svg { width: 100%; height: 100%; display: block; }
.open-fx { position: fixed; inset: 0; z-index: 101; pointer-events: none; overflow: hidden; }
.open-fx > i { position: absolute; display: block; }
.open-fx svg { width: 100%; height: 100%; display: block; }
.open-fx__flash { border-radius: 50%; background: radial-gradient(circle, rgba(255, 253, 244, 1) 0%, rgba(255, 240, 200, .7) 30%, rgba(255, 236, 190, 0) 70%); }
.open-fx__ring { border-radius: 50%; border: 1.5px solid rgba(233, 207, 143, .9); box-shadow: 0 0 18px rgba(255, 236, 190, .8), inset 0 0 14px rgba(255, 236, 190, .6); }
.open-fx__star::before { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 210, .85), rgba(255, 244, 210, 0) 65%); }
.open-fx__star svg { position: relative; }
body.is-entering .card { animation: page-in 2s cubic-bezier(.2,.7,.2,1) .45s both; }
body.is-entering .hero__lily { animation: lily-in 2.2s cubic-bezier(.2,.7,.2,1) .9s both, sway 9s ease-in-out 3.1s infinite alternate; }
@media (min-width: 768px) {
  .cover__card { width: 500px; min-height: 350px; padding: 26px 40px 30px; gap: 10px; justify-content: center; }
  .cover__names { font-size: 40px; }
  .cover__amp { font-size: 18px; }
  .cover__date { font-size: 17px; }
  .cover__invite { font-size: 17px; }
  .cover__guest { font-size: 22px; margin-top: -6px; }
  .cover__open { padding: 11px 32px; font-size: 15px; }
  .cover__lily { opacity: .4; }
  .cover__lily--tl { width: 20%; left: -3%; top: auto; bottom: -6%; }
  .cover__lily--br { width: 34%; right: -6%; bottom: -12%; opacity: .45; }
}
.cover.is-open .cover__card { transform: translateY(-40px) scale(.94); opacity: 0; }

/* ---------- music ---------- */
.music {
  position: fixed;
  z-index: 50;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #707449, var(--olive-deep) 72%);
  color: var(--on-olive);
  box-shadow: 0 12px 26px -10px rgba(var(--shadow), .7), 0 0 0 4px rgba(247, 245, 239, .5);
  cursor: pointer;
}
@media (min-width: 560px) { .music { right: calc(50% - var(--col) * var(--z) / 2 + 16px); } }
.music__bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.music__bars i { width: 3px; height: 30%; border-radius: 2px; background: currentColor; transition: height .3s ease; }
.music__bars i:nth-child(2) { height: 70%; }
.music__bars i:nth-child(3) { height: 50%; }
.music__bars i:nth-child(4) { height: 85%; }
.music[aria-pressed="true"] .music__bars i { animation: eq .9s ease-in-out infinite alternate; }
.music[aria-pressed="true"] .music__bars i:nth-child(2) { animation-delay: -.3s; }
.music[aria-pressed="true"] .music__bars i:nth-child(3) { animation-delay: -.6s; }
.music[aria-pressed="true"] .music__bars i:nth-child(4) { animation-delay: -.15s; }
.music[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; opacity: .85; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(24, 25, 16, .93);
  padding: max(40px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(48px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: fade .3s ease both;
}
.lightbox img { max-height: 84vh; max-width: 100%; width: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); touch-action: pan-y; }
.lightbox__close, .lightbox__nav {
  position: absolute;
  border: 0;
  background: rgba(247, 245, 239, .12);
  color: #f7f5ef;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox__close { top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 34px; }
.lightbox__nav--prev { left: calc(10px + env(safe-area-inset-left, 0px)); }
.lightbox__nav--next { right: calc(10px + env(safe-area-inset-right, 0px)); }
.lightbox__count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; color: rgba(247, 245, 239, .75); font-family: var(--f-head); font-size: 14px; letter-spacing: .14em; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); }
.modal__backdrop { position: absolute; inset: 0; background: rgba(44, 46, 30, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s ease both; }
.modal__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: calc((100vh - 40px) / var(--z));
  overflow-y: auto;
  background-color: var(--paper-hi);
  background-image: url("https://cdn.wedding-invitation.io.vn/assets/art/paper.webp");
  background-size: 300px;
  border-radius: 18px;
  padding: 30px 22px 24px;
  box-shadow: 0 40px 80px -30px rgba(var(--shadow), .7);
  animation: pop .35s cubic-bezier(.2,.8,.3,1.1) both;
  text-align: center;
}
.modal__close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(86, 90, 54, .08); font-size: 24px; line-height: 1; color: var(--olive); cursor: pointer; }
.modal__title { font-family: var(--f-head); font-weight: 700; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; color: var(--olive); }
.modal__sub { margin-top: 4px; font-size: 13.5px; color: var(--gold); }
.rsvp-form { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.rsvp-form .field { padding: 10px 12px; }
.rsvp-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rsvp-form__row > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rsvp-form .btn { margin-top: 10px; }
.lbl { font-family: var(--f-head); font-size: 15px; color: var(--olive); margin-top: 6px; }
.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.choice legend { padding: 0; margin-bottom: 4px; }
.choice label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; cursor: pointer; background: rgba(253, 252, 248, .6); }
.choice input { accent-color: var(--olive); width: 18px; height: 18px; margin: 0; }
.choice label:has(input:checked) { border-color: var(--olive); background: rgba(86, 90, 54, .06); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 130;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--olive-deep);
  color: var(--on-olive);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 16px 30px -14px rgba(var(--shadow), .7);
  animation: toast-in .3s ease both;
}

/* ---------- motion ---------- */
.reveal.in { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes card-glow {
  0% { transform: scale(1); box-shadow: 0 40px 80px -30px rgba(var(--shadow), .65); }
  25% { transform: scale(1.035); box-shadow: 0 0 60px 6px rgba(255, 238, 196, .75), 0 40px 80px -30px rgba(var(--shadow), .4); }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1.14); opacity: 0; box-shadow: 0 0 90px 20px rgba(255, 238, 196, 0); }
}
@keyframes shine { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 1; background-position: -30% 0; } }
@keyframes seal-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.3); box-shadow: 0 0 0 8px rgba(233, 207, 143, .35), 0 0 40px 12px rgba(255, 236, 190, .9); }
  100% { transform: scale(1.1); box-shadow: 0 0 0 16px rgba(233, 207, 143, 0), 0 0 70px 26px rgba(255, 236, 190, 0); }
}
@keyframes glow { 0% { opacity: 0; scale: .2; } 35% { opacity: 1; scale: 1.4; } 100% { opacity: 0; scale: 3.2; } }
@keyframes page-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes lily-in { from { opacity: 0; transform: translate(40px, -30px) rotate(5deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes sway { from { transform: rotate(0deg); } to { transform: rotate(-1deg); } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes star-fall { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(var(--sx), 55vh, 0); } 100% { transform: translate3d(0, calc(100vh + 40px), 0); } }
@keyframes fall {
  0% { transform: translate3d(0, -5vh, 0); }
  50% { transform: translate3d(28px, 55vh, 0); }
  100% { transform: translate3d(-12px, 115vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .petal { display: none; }
}

@media (max-width: 360px) {
  .family__name { font-size: 12px; white-space: normal; text-wrap: balance; }
  .family__addr { white-space: normal; text-wrap: balance; }
  .family__addr { font-size: 11.5px; }
  .when__day { font-size: 60px; }
  .countdown__grid { gap: 6px; }
}
