/* =============================================================
   Thiệp cưới — phong cách ZenLove (tông kem + hồng nhạt, mobile-first)
   Dựng theo DESIGN-PATTERN.md: token màu/spacing/radius/shadow
   của hệ thống ZenLove, kiến trúc 5 khe font, hiệu ứng lặp.
   Toàn bộ tĩnh, không phụ thuộc backend.
   ============================================================= */

:root {
  /* ---- Màu (mục 2) ---------------------------------------- */
  /* Tông KEM SÁNG + HỒNG NHẠT + điểm VÀNG KIM — tươi tắn, hợp hỷ sự,
     đúng màu thiệp thực tế (hồng nhạt). Nền kem ngà, section hồng phấn,
     dải sự kiện/nút dùng hồng rose đủ đậm để chữ trắng ngà đọc rõ. */
  --primary:      #c05d74;   /* hồng rose — nhãn nhỏ, link, chữ nhấn (đọc rõ trên kem) */
  --grad-1:       #f7c7cf;   /* hồng phấn nhạt */
  --grad-2:       #ec9fae;   /* hồng rose nhạt — dải/nút mềm mại hơn */
  --on-grad:      #8a2f49;   /* CHỮ trên khối hồng nhạt (rose đậm, đọc rõ) */
  --accent-hover: #f9e3e6;   /* hồng phấn rất nhạt — hover, viền focus */
  --gold:         #c39a5b;   /* vàng kim ấm — dấu &, chi tiết trang trí */
  --surface-dark: #b3546c;   /* nền nút phụ (rose đậm) */
  --bg:           #fff9f5;   /* kem/ngà sáng ấm */
  --text:         #4a3b37;   /* nâu than ấm, không đen thuần */
  --text-muted:   #8a746d;
  --border:       #f0e0da;
  --soft:         #fdf5f2;    /* blush cực nhạt cho section xen kẽ */
  --soft-2:       #fdeeee;    /* hồng phấn rất nhạt */

  --grad: linear-gradient(135deg, var(--grad-1), var(--grad-2));

  /* ---- 5 khe font (mục 3) --------------------------------- */
  --font-brand:     "Cormorant Garamond", "Playfair Display", serif;
  --font-heading:   "Playfair Display", "Times New Roman", serif;
  --font-display:   "Dancing Script", "Great Vibes", cursive;  /* tiêu đề tiếng Anh — chữ viết tay bay bổng */
  --font-body:      "Be Vietnam Pro", system-ui, sans-serif;
  --font-signature: "Great Vibes", "Dancing Script", cursive;
  --font-inter:     "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Spacing hệ 8px (mục 4) ----------------------------- */
  --s-2: 2px;  --s-3: 3px;  --s-4: 4px;  --s-6: 6px;
  --s-8: 8px;  --s-10: 10px; --s-16: 16px; --s-24: 24px;
  --s-section: 54px;         /* khoảng nghỉ giữa section */

  /* ---- Bo góc (mục 4) ------------------------------------- */
  --r-sm: 4px; --r-md: 5px; --r-lg: 10px; --r-xl: 12px; --r-full: 9999px;

  /* ---- Đổ bóng — ba mức nhẹ (mục 4) ----------------------- */
  --sh-1: 0 2px 0 rgba(0,0,0,.02);
  --sh-2: 0 0 10px rgba(0,0,0,.1);
  --sh-3: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);

  --wrap: 520px;             /* mobile-first: khung hẹp như điện thoại */
}

* , *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100vh; }

img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* Khung nội dung: canvas hẹp, căn giữa, viền mảnh như một tấm thiệp */
.stage {
  max-width: var(--wrap);
  margin-inline: auto;
  background: var(--bg);
  position: relative;
  box-shadow: var(--sh-2);
  overflow: hidden;
}

.section { padding: var(--s-section) 22px; position: relative; }
.section--soft  { background: var(--soft); }
.section--soft2 { background: var(--soft-2); }

/* ---- Tiêu đề section ------------------------------------- */
.eyebrow {
  font-family: var(--font-inter);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--primary);
  text-align: center;
  margin: 0 0 var(--s-8);
  font-weight: 600;
}
.title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 var(--s-24);
  color: var(--text);
}
.title .flourish { display: block; font-size: 20px; color: var(--primary); margin-top: var(--s-4); }

/* ---- Header song ngữ kiểu ZenLove ----------------------------
   Tiếng Anh cỡ lớn (font Didone) ở trên, phụ đề tiếng Việt ở dưới. */
.sec-head { text-align: center; margin-bottom: clamp(1.75rem, 6vw, 2.75rem); }
.sec-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 11vw, 52px);   /* chữ viết tay đọc nhỏ hơn nên tăng cỡ */
  line-height: 1.1;
  letter-spacing: 0;                     /* script không giãn chữ */
  text-transform: none;                  /* giữ chữ thường/hoa như gõ, không ép in hoa */
  color: var(--primary);                 /* hồng rose cho chữ viết tay nổi bật */
  margin: 0;
}
.sec-sub {
  font-family: var(--font-body);
  font-size: 14px; color: var(--text-muted);
  margin: var(--s-8) 0 0; letter-spacing: .01em;
}
/* Phụ đề dạng nhãn nhỏ chữ hoa (vd TIME / THỜI GIAN) */
.sec-title--sm { font-size: clamp(22px, 6.5vw, 30px); }

/* ---- Khối trích dẫn có dấu ngoặc kép cỡ lớn ------------------ */
.pullquote {
  position: relative;
  max-width: 36ch; margin: var(--s-24) auto;
  padding: 6px clamp(20px, 7vw, 34px);
  text-align: center;
  font-family: var(--font-body);
  color: var(--text-muted); font-size: 15px; line-height: 1.75;
}
.pullquote p { margin: 0; }
.pullquote::before, .pullquote::after {
  position: absolute;
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600;
  font-size: 52px; line-height: 1; color: var(--gold); opacity: .55;
}
.pullquote::before { content: "\201C"; top: -10px;  left: -2px; }
.pullquote::after  { content: "\201D"; bottom: -30px; right: 0; }

/* ---- Câu thơ giữa hai vạch kẻ -------------------------------- */
.verse-block { text-align: center; }
.verse {
  font-family: var(--font-body); color: var(--text-muted);
  font-size: 15px; line-height: 1.85; max-width: 42ch; margin: var(--s-16) auto;
}
.verse-rule {
  border: 0; height: 1px; width: min(72%, 320px);
  margin: var(--s-8) auto; background: var(--border);
}

/* ---- Vạch dọc mảnh ngăn cách --------------------------------- */
.thread-line {
  width: 1px; height: 52px; margin: var(--s-24) auto;
  background: linear-gradient(var(--accent-hover), transparent);
}

/* ---- Khối kể chuyện: chữ + ảnh xen kẽ ------------------------
   Mỗi beat là một đoạn chữ kèm một ảnh. Beat lẻ: chữ trên - ảnh
   dưới; beat chẵn (--reverse): ảnh trên - chữ dưới. Cuộn xuống sẽ
   thấy chữ và hình luân phiên như một mạch truyện. */
.story-beat { display: flex; flex-direction: column; gap: var(--s-24); align-items: center; }
.story-beat--reverse { flex-direction: column-reverse; }
.beat-text { text-align: center; }
.beat-photo {
  width: 100%; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-2); background: var(--soft-2);
}
.beat-photo img { width: 100%; display: block; transition: transform .6s ease; }
.story-beat:hover .beat-photo img { transform: scale(1.03); }
.story-beat .verse { margin: 0 auto; }
.story-beat .pullquote { margin: var(--s-16) auto 0; }

/* Dải hoa văn ngăn cách */
.divider-mark {
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-10); color: var(--primary); margin: var(--s-16) 0;
}
.divider-mark::before, .divider-mark::after {
  content: ""; height: 1px; width: 46px;
  background: linear-gradient(90deg, transparent, var(--primary));
}
.divider-mark::after { background: linear-gradient(90deg, var(--primary), transparent); }

/* =============================================================
   Nút (mục 6)
   ============================================================= */
.btn {
  font-family: var(--font-inter);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-8);
  cursor: pointer; border: 0; text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
/* CTA chính — nâu đậm */
.btn--cta {
  background: var(--surface-dark); color: #fff;
  padding: 10px 20px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  box-shadow: var(--sh-3);
}
.btn--cta:hover { transform: translateY(-2px); }
.btn--cta:active { transform: translateY(0); }
/* Nút gradient hồng — dùng cho hành động nổi bật */
.btn--grad {
  background: var(--grad); color: var(--on-grad);
  padding: 12px 24px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 700; box-shadow: var(--sh-3);
}
.btn--grad:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -6px rgba(200,95,120,.45); }
/* Nút phụ viền */
.btn--ghost {
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
}
.btn--ghost:hover { background: var(--accent-hover); color: var(--surface-dark); border-color: var(--accent-hover); }
/* Nút nổi trên ảnh (mục 6) */
.btn--float {
  background: rgba(255,255,255,.72); color: rgba(0,0,0,.88);
  padding: 6px 12px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 500; backdrop-filter: blur(4px);
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* =============================================================
   Màn hình mở đầu — nền ảnh cưới, bố cục: SAVE THE DATE ở trên,
   tên ở khoảng giữa-trên, nút MỞ THIỆP dính đáy.
   ============================================================= */
.envelope {
  position: fixed; inset: 0; z-index: 200;
  overflow-y: auto;
  color: #fff; text-align: center;
  background:
    linear-gradient(rgba(20,20,20,.12), rgba(20,20,20,.5)),
    url("../img/hero.jpg") calc(50% - 15px) center / cover no-repeat;
  transition: opacity .8s ease, visibility .8s;
}
.envelope.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.env-inner {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(2.4rem, 9vh, 5rem) 22px clamp(2.5rem, 8vh, 5rem);
  animation: env-rise 1s .05s both cubic-bezier(.22,1,.36,1);
}
.env-eyebrow {
  font-family: var(--font-inter); font-size: 12px; letter-spacing: .42em;
  text-transform: uppercase; margin: 0 0 var(--s-16);
  color: rgba(255,255,255,.9);
}
.env-names {
  font-family: var(--font-signature);
  font-size: clamp(52px, 18vw, 86px); line-height: .9; margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,.4);
}
.env-names .amp { display: block; font-size: .42em; margin: 4px 0; opacity: .95; color: var(--gold); }
.env-date {
  font-family: var(--font-inter); font-size: 14px; letter-spacing: .3em;
  margin: var(--s-16) 0 0; color: rgba(255,255,255,.92);
}
.env-open-btn {
  margin-top: auto; flex: none;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.85);
  padding: 13px 36px; border-radius: var(--r-full);
  font-family: var(--font-inter); font-weight: 600; font-size: 13px;
  letter-spacing: .16em; cursor: pointer; backdrop-filter: blur(2px);
  transition: background .25s, color .25s, transform .18s;
  animation: heart-pulse 2.6s ease-out infinite;
}
.env-open-btn:hover { background: #fff; color: var(--primary); transform: translateY(-2px); }

/* Màn hình thấp (điện thoại xoay ngang): xếp gọn căn giữa, KHÔNG
   đẩy nút xuống đáy — tránh nút tràn khỏi khung khi thiếu chiều cao. */
@media (max-height: 600px) {
  .env-inner { justify-content: center; padding: 1.4rem 22px; }
  .env-names { font-size: clamp(34px, 10vh, 52px); }
  .env-eyebrow { margin-bottom: var(--s-8); }
  .env-date { margin-top: var(--s-8); }
  .env-open-btn { margin-top: 1.6rem; }
}

/* =============================================================
   Bìa (cover)
   ============================================================= */
/* Bố cục KHỚP màn hình phong bì: chữ dồn lên giữa-trên, mũi tên
   cuộn thay chỗ nút MỞ THIỆP ở đáy. */
.cover {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; color: #fff;
  padding: clamp(2.4rem, 9vh, 5rem) 22px clamp(1.6rem, 4vh, 2.6rem);
  background:
    linear-gradient(rgba(20,20,20,.12), rgba(20,20,20,.5)),
    url("../img/hero.jpg") calc(50% - 15px) center / cover no-repeat;
}
.cover__eyebrow {
  font-family: var(--font-inter); font-size: 12px; letter-spacing: .42em;
  text-transform: uppercase; margin: 0 0 var(--s-16);
  color: rgba(255,255,255,.9);
}
.cover__names {
  font-family: var(--font-signature);
  font-size: clamp(52px, 18vw, 86px);
  line-height: .9; margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,.4);
}
.cover__names .amp { display: block; font-size: .42em; margin: 4px 0; opacity: .95; color: var(--gold); }
.cover__date {
  font-family: var(--font-inter); font-size: 14px; letter-spacing: .3em;
  margin: var(--s-16) 0 0; color: rgba(255,255,255,.92);
}
.cover__scroll {
  margin-top: auto;   /* đẩy mũi tên cuộn xuống đáy */
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-inter); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(255,255,255,.85);
  padding-top: 26px;
}
.cover__scroll i {
  width: 1px; height: 34px;
  background: linear-gradient(rgba(255,255,255,0), #fff);
  animation: scroll-line 1.9s ease-in-out infinite;
}

/* =============================================================
   Câu mở đầu / lời ngỏ
   ============================================================= */
.intro { text-align: center; }
.intro__line {
  font-family: var(--font-body); color: var(--text-muted);
  font-size: 15px; margin: 0 auto var(--s-16); max-width: 34ch;
}
.intro__verse {
  font-family: var(--font-signature); font-size: 28px; color: var(--primary);
  line-height: 1.3; margin: var(--s-24) 0;
}

/* =============================================================
   Gia đình
   ============================================================= */
/* Bố cục: câu thơ → NHÀ TRAI/NHÀ GÁI (bố mẹ) → trái tim → CHÚ RỂ/CÔ DÂU */
.family-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-16) var(--s-16);
  text-align: center; max-width: 460px; margin: 0 auto;
}
.family__role {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 15px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text); margin: 0 0 var(--s-8);
}
.family__parent {
  font-family: var(--font-heading); font-size: 14px; letter-spacing: .01em;
  text-transform: uppercase; color: var(--text-muted); margin: 3px 0;
}
.family__parent strong { font-weight: 600; color: var(--text); }
.family__city { font-family: var(--font-inter); font-size: 12.5px; color: var(--text-muted); margin: var(--s-8) 0 0; }
.family__name {
  font-family: var(--font-signature); font-size: clamp(30px, 9vw, 42px);
  color: var(--primary); margin: var(--s-4) 0 0; line-height: 1.1;
}
.family-heart { display: flex; justify-content: center; color: var(--primary); margin: var(--s-24) auto; }
.family-heart svg { width: 76px; height: auto; }

/* =============================================================
   Đếm ngược
   ============================================================= */
.countdown { display: flex; justify-content: center; gap: var(--s-10); }
.cd-cell {
  min-width: 66px; padding: 12px 6px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); text-align: center;
}
.cd-cell b {
  display: block; font-family: var(--font-heading); font-size: 28px;
  color: var(--primary); line-height: 1;
}
.cd-cell span {
  font-family: var(--font-inter); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted); margin-top: 6px; display: block;
}

/* =============================================================
   Lịch tháng — ngày cưới khoanh tròn
   ============================================================= */
.calendar {
  max-width: 340px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-2); padding: 16px; overflow: hidden;
}
.calendar__head {
  text-align: center; font-family: var(--font-heading); font-size: 18px;
  color: var(--text); margin-bottom: var(--s-10);
}
.calendar__grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.calendar__dow {
  font-family: var(--font-inter); font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-align: center; padding: 6px 0;
}
.calendar__day {
  font-family: var(--font-inter); font-size: 13px; text-align: center;
  padding: 7px 0; color: var(--text); border-radius: var(--r-md);
}
.calendar__day.is-empty { visibility: hidden; }
.calendar__day.is-wed {
  background: var(--grad); color: var(--on-grad); font-weight: 700;
  position: relative; box-shadow: var(--sh-2);
}
.calendar__day.is-wed::after {
  content: "♥"; position: absolute; top: -3px; right: 3px; font-size: 9px;
}

/* =============================================================
   Timeline — chuyện tình
   ============================================================= */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--grad-1), var(--grad-2));
}
.tl-item { position: relative; margin-bottom: var(--s-24); }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary);
  box-shadow: 0 0 0 3px var(--soft-2);
}
.tl-when {
  font-family: var(--font-inter); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; color: var(--primary); text-transform: uppercase;
}
.tl-title { font-family: var(--font-heading); font-size: 17px; margin: 3px 0 4px; color: var(--text); }
.tl-text { font-size: 13.5px; color: var(--text-muted); margin: 0 0 var(--s-10); line-height: 1.55; }
.tl-photo { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); }
.tl-photo img { width: 100%; }

/* Dải ảnh dưới trích dẫn OUR STORY */
.story-photos { display: grid; gap: var(--s-10); margin-top: var(--s-24); }

/* =============================================================
   Sự kiện
   ============================================================= */
.events { display: grid; gap: var(--s-24); }
.event {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-2); text-align: center; padding: 26px 18px 22px;
}
.event__title {
  font-family: var(--font-heading); font-weight: 600; font-size: 22px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text); margin: 0;
}
.event__when {
  font-family: var(--font-inter); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin: var(--s-8) 0 var(--s-16);
}
/* Hàng ngày cỡ lớn: THÁNG | ngày | NĂM, có vạch dọc ngăn cách */
.event__bigdate {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: var(--s-16); max-width: 300px; margin: var(--s-8) auto var(--s-16);
}
.event__dp {
  font-family: var(--font-heading); font-size: 15px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text);
}
.event__dp:first-child { text-align: right; }
.event__dp:last-child  { text-align: left; }
.event__day {
  font-family: var(--font-heading); font-size: 52px; font-weight: 600; line-height: 1;
  color: var(--primary); padding: 4px var(--s-16);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.event__lunar { font-size: 13px; color: var(--text-muted); font-style: italic; margin: 0 0 var(--s-16); }
.event__venue { font-family: var(--font-heading); font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: var(--text); margin: var(--s-8) 0 3px; }
.event__addr { font-size: 13px; color: var(--text-muted); margin: 0 0 var(--s-16); }
.event__actions { display: flex; flex-direction: column; align-items: center; gap: var(--s-10); }
.btn--map { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; padding: 10px 28px; }
.btn--ics {
  background: none; border: 0; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-inter); font-size: 12px; text-decoration: underline;
  text-underline-offset: 3px; padding: 2px;
}
.btn--ics:hover { color: var(--primary); }

/* =============================================================
   Album
   ============================================================= */
.album { columns: 2; column-gap: var(--s-8); }
.album__item {
  break-inside: avoid; margin-bottom: var(--s-8);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1);
  cursor: pointer; background: var(--soft-2);
}
.album__item img { width: 100%; transition: transform .4s ease; }
.album__item:hover img { transform: scale(1.05); }
.album__more { text-align: center; margin-top: var(--s-24); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 180; display: none;
  background: rgba(0,0,0,.9); place-items: center; padding: 20px;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: var(--r-md); }
.lightbox__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.15); color: #fff; font-size: 22px; cursor: pointer;
}
.lightbox__btn:hover { background: rgba(255,255,255,.28); }
.lightbox__prev { left: 12px; } .lightbox__next { right: 12px; }
.lightbox__close { top: 16px; right: 16px; transform: none; }

/* =============================================================
   RSVP
   ============================================================= */
.rsvp { max-width: 400px; margin: 0 auto; }
.field { margin-bottom: var(--s-16); }
.field label {
  display: block; font-family: var(--font-inter); font-size: 12px;
  font-weight: 600; color: var(--text-muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; background: #fff; color: var(--text-muted);
  border: 1px solid #e0e0e0; border-radius: var(--r-sm);
  padding: 10px 12px; font-family: var(--font-body); font-size: 14px;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-hover);
}
.rsvp__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-10); }
.rsvp__status {
  text-align: center; font-family: var(--font-inter); font-size: 13px;
  margin-top: var(--s-16); min-height: 20px; color: var(--primary);
}
.rsvp__deadline { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: var(--s-8); }
.rsvp__embed { width: 100%; border: 0; border-radius: var(--r-md); min-height: 640px; }

/* =============================================================
   Mừng cưới / gift
   ============================================================= */
.gift__note { text-align: center; color: var(--text-muted); font-size: 13.5px; max-width: 36ch; margin: 0 auto var(--s-24); }

.giftbox { text-align: center; }

/* ---- Nút hộp quà (đóng) — biến mất khi đã mở ---- */
.giftbox__trigger {
  display: inline-flex; flex-direction: column; align-items: center; gap: 14px;
  background: none; border: 0; cursor: pointer; padding: 8px 8px 0;
  max-height: 240px; overflow: visible;
  transition: opacity .7s ease, transform .7s ease, max-height .8s ease;
}
.giftbox__trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: var(--r-lg); }
.giftbox.is-open .giftbox__trigger {
  opacity: 0; transform: scale(.6); max-height: 0; margin: 0;
  overflow: hidden; pointer-events: none;
}

/* ---- Hình hộp quà vẽ bằng CSS ---- */
.giftbox__art { position: relative; width: 128px; height: 116px; display: block; animation: gift-bob 2.6s ease-in-out infinite; }
.giftbox.is-opening .giftbox__art, .giftbox.is-open .giftbox__art { animation: none; }
.giftbox__base {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 104px; height: 76px; border-radius: 6px 6px 8px 8px;
  background: linear-gradient(160deg, var(--grad-1), var(--grad-2)); box-shadow: var(--sh-3);
}
.giftbox__ribbon {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 20px; height: 76px; background: var(--gold); z-index: 1;
}
.giftbox__lid {
  position: absolute; left: 50%; top: 24px; transform: translateX(-50%);
  width: 120px; height: 30px; border-radius: 6px;
  background: linear-gradient(160deg, var(--grad-2), var(--primary)); box-shadow: var(--sh-2); z-index: 2;
  transition: transform .95s cubic-bezier(.34,1.35,.5,1), opacity .95s ease;   /* nắp bay chậm hơn */
}
.giftbox__bow { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--gold); }
.giftbox__bow::before, .giftbox__bow::after {
  content: ""; position: absolute; top: -4px; width: 22px; height: 17px; border-radius: 50%; background: var(--gold);
}
.giftbox__bow::before { left: -18px; transform: rotate(20deg); }
.giftbox__bow::after  { right: -18px; transform: rotate(-20deg); }
/* nắp bật lên & bay đi khi mở */
.giftbox.is-opening .giftbox__lid, .giftbox.is-open .giftbox__lid {
  transform: translateX(-50%) translateY(-72px) rotate(-16deg); opacity: 0;
}
.giftbox__hint { font-family: var(--font-inter); font-size: 12px; letter-spacing: .04em; color: var(--primary); font-weight: 600; }

/* ---- Khu thẻ QR: 2 thẻ NẰM NGANG nhau (không xuống dòng) ---- */
.giftbox__cards {
  display: flex; justify-content: center; flex-wrap: nowrap; align-items: stretch;
  gap: var(--s-10);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 1s ease, opacity .8s ease;   /* chậm hơn */
}
.giftbox.is-open .giftbox__cards { max-height: 2000px; opacity: 1; }

.giftcard {
  flex: 1 1 0; min-width: 0; max-width: 220px;         /* chia đôi hàng ngang */
  text-align: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); padding: 14px 10px 16px;
}
.giftbox.is-open .giftcard { animation: giftcard-in .95s ease both var(--d, 0s); }  /* chậm hơn */
.giftcard__side { font-family: var(--font-inter); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin: 0 0 var(--s-8); }
.giftcard__qr { width: 100%; max-width: 148px; height: auto; aspect-ratio: 1 / 1; margin: 0 auto var(--s-8); border-radius: var(--r-md); background: var(--soft-2); }
.giftcard__owner { font-family: var(--font-heading); font-size: 14px; line-height: 1.25; margin: 0; color: var(--text); }
.giftcard__bank { font-size: 12px; color: var(--text-muted); margin: 2px 0; }
.giftcard__num { font-family: var(--font-inter); font-size: 14px; font-weight: 700; color: var(--primary); margin: var(--s-6) 0 var(--s-8); word-break: break-all; }
.giftcard__copy { font-size: 11px; padding: .5rem .75rem; }

@keyframes gift-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes giftcard-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* =============================================================
   Lời chào cuối — ảnh cưới tràn viền + hẹn gặp
   ============================================================= */
.farewell { text-align: center; }
.farewell__photo {
  margin: 0 -22px var(--s-24);       /* tràn hết chiều ngang khung thiệp */
  overflow: hidden; box-shadow: var(--sh-1); background: var(--soft-2);
}
.farewell__photo img { width: 100%; display: block; }
.farewell__vn {
  font-family: var(--font-heading); font-size: 21px; color: var(--text); margin: 0;
}
.farewell__en {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0;
  text-transform: none; color: var(--primary); margin: var(--s-4) 0 0;
}

/* =============================================================
   Footer
   ============================================================= */
.footer {
  text-align: center; color: var(--on-grad); padding: 56px 22px;
  background: var(--grad);
}
.footer__thanks { font-family: var(--font-signature); font-size: 40px; margin: 0 0 var(--s-8); }
.footer__names { font-family: var(--font-heading); font-size: 18px; letter-spacing: .1em; margin: 0; }
.footer__date { font-family: var(--font-inter); font-size: 12px; letter-spacing: .24em; margin: var(--s-16) 0 0; opacity: .9; }

/* =============================================================
   Thanh hành động cố định đáy (mục 6)
   ============================================================= */
/* Gọn về góc PHẢI dưới: cột 3 nút tròn nhỏ, cân với đĩa nhạc góc trái */
.actionbar {
  position: fixed; right: 14px; bottom: 14px; left: auto; transform: none;
  z-index: 70; display: flex; flex-direction: column; gap: var(--s-8);
  background: none; box-shadow: none; border: 0; padding: 0;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.actionbar.is-on { opacity: 1; visibility: visible; }
.actionbar button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  color: var(--primary); box-shadow: var(--sh-3);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .18s ease;
}
.actionbar button:hover { transform: translateY(-2px); }
.actionbar button svg { width: 18px; height: 18px; }
.actionbar .is-primary { background: var(--grad); color: var(--on-grad); border-color: transparent; }
.actionbar .is-primary svg { width: 19px; height: 19px; }

/* =============================================================
   Nút nhạc — đĩa xoay, góc trái dưới
   ============================================================= */
.music {
  position: fixed; left: 14px; bottom: 14px; z-index: 75;
  width: 50px; height: 50px; padding: 0; border: 0; background: none;
  cursor: pointer; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
}
.music[hidden] { display: none; }
/* Đĩa than: ảnh vinyl PNG (đã có sẵn rãnh, nhãn, lỗ tâm). Dùng <img>
   cho chắc chắn hiển thị (background-image không paint ở môi trường này). */
.music__disc {
  position: relative;
  width: 100%; height: 100%;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
/* Xoay THẲNG trên <img> (ảnh vinyl vốn đã tròn). Nhạc bật thì quay,
   nhạc tắt thì dừng TẠI CHỖ (bật lại quay tiếp từ đúng góc). */
.music__disc img {
  width: 100%; height: 100%; display: block;
  border-radius: 50%; object-fit: cover;
  animation: mrotate 5s linear infinite;
  animation-play-state: paused;        /* mặc định dừng khi chưa/không phát nhạc */
  will-change: transform;
}
.music.is-playing .music__disc img { animation-play-state: running; }
.music__state {
  position: absolute; inset: auto -2px -2px auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; color: var(--primary);
  display: grid; place-items: center; box-shadow: var(--sh-2);
}
.music__state svg { width: 11px; height: 11px; }
.music.is-playing .music__state { display: none; }   /* nhạc bật (loa mở) thì ẩn badge tắt tiếng */

/* =============================================================
   Hiệu ứng rơi nền
   ============================================================= */
.falls { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fall {
  position: absolute; top: -6%;
  will-change: transform;
  animation: fall-down linear infinite;
}

/* =============================================================
   Vào-màn-hình khi cuộn tới (animate.css rút gọn)
   ============================================================= */
/* Transform CHỈ áp khi chưa reveal (:not(.in)); khi đã .in thì các
   selector này không khớp nữa → transform về none. Không phụ thuộc
   thứ tự cascade nên đúng trên mọi engine. */
.reveal { opacity: 0; transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; }
.reveal:not(.in)[data-in="up"]    { transform: translateY(40px); }
.reveal:not(.in)[data-in="left"]  { transform: translateX(-40px); }
.reveal:not(.in)[data-in="right"] { transform: translateX(40px); }
.reveal:not(.in)[data-in="zoom"]  { transform: scale(.94); }

/* =============================================================
   Bảy preset lặp vô hạn (mục 5)
   ============================================================= */
.animation-float  { animation: zl-float 3s ease-in-out infinite; }
.animation-bounce { animation: zl-bounce 1.6s ease infinite; }
.animation-pulse  { animation: zl-pulse 2.2s ease-in-out infinite; }
.animation-rotate { animation: zl-rotate 8s linear infinite; }
.animation-shake  { animation: zl-shake 3s ease-in-out infinite; }
.animation-wiggle { animation: zl-wiggle 2.4s ease-in-out infinite; }
.animation-wobble { animation: zl-wobble 3s ease-in-out infinite; }

/* =============================================================
   Keyframes
   ============================================================= */
@keyframes env-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes soft-blink { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes heart-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.5); }
  70% { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
@keyframes scroll-line { 0%,100% { opacity: .3; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes mrotate { to { transform: rotate(360deg); } }
@keyframes fall-down {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(108vh) translateX(var(--drift, 20px)) rotate(var(--spin, 360deg)); opacity: 0; }
}
@keyframes zl-float  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes zl-bounce { 0%,20%,50%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }
@keyframes zl-pulse  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes zl-rotate { to { transform: rotate(360deg); } }
@keyframes zl-shake  { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes zl-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes zl-wobble { 0%,100% { transform: rotate(0); } 30% { transform: rotate(4deg) translateX(2px); } 60% { transform: rotate(-4deg) translateX(-2px); } }

/* =============================================================
   Tôn trọng thiết lập tắt hiệu ứng
   ============================================================= */
html:not(.motion-on) .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html:not(.motion-on) .fall,
html:not(.motion-on) .cover__scroll i,
html:not(.motion-on) [class*="animation-"],
html:not(.motion-on) .music__disc img { animation: none !important; }

/* =============================================================
   Trên màn hình rộng: giữ dáng điện thoại, thêm nền be hai bên
   ============================================================= */
@media (min-width: 560px) {
  body { background: linear-gradient(160deg, #ece0dc, #fff); }
  .stage { margin-block: 24px; border-radius: var(--r-xl); }
}
