/* =========================================================
   THIỆP CƯỚI ONLINE – giao diện tối giản (clean / editorial)
   Theme: .theme-white · .theme-ivory · .theme-noir · .theme-burgundy (đỏ đô)
   ========================================================= */

:root {
  /* Font hỗ trợ đầy đủ tiếng Việt (Google Fonts, subset vietnamese) */
  --ff-display: 'Playfair Display', 'Times New Roman', serif;   /* tiêu đề, tên, số */
  --ff-serif: 'Literata', Georgia, serif;                        /* đoạn văn, chữ nghiêng */
  --ff-script: 'Great Vibes', cursive;                           /* chỉ dấu & */
  --ff-sans: 'Be Vietnam Pro', 'Helvetica Neue', Arial, sans-serif; /* nhãn, nút */
  --maxw: 480px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- THEME: IVORY ---------- */
.theme-ivory {
  --page: #e9e4db;
  --bg: #f8f5f0;
  --bg-2: #f1ece4;
  --ink: #2e2924;
  --ink-soft: #675e55;
  --muted: #a1978b;
  --accent: #a8895a;
  --line: rgba(46, 41, 36, .13);
  --line-accent: rgba(168, 137, 90, .6);
  --btn-bg: #2e2924;
  --btn-ink: #f8f5f0;
  --intro-bg: #f3eee6;
  --env-back: #e7dfd1;
  --env-front: #efe8dc;
  --env-flap: #eae1d3;
  --seal-a: #cfae8a;
  --seal-b: #a98260;
  --seal-c: #7d5a3c;
}

/* ---------- THEME: NOIR ---------- */
.theme-noir {
  --page: #080807;
  --bg: #121110;
  --bg-2: #191715;
  --ink: #efe9df;
  --ink-soft: #bcb3a6;
  --muted: #857c71;
  --accent: #c6a570;
  --line: rgba(239, 233, 223, .12);
  --line-accent: rgba(198, 165, 112, .55);
  --btn-bg: #c6a570;
  --btn-ink: #121110;
  --intro-bg: #121110;
  --env-back: #1c1916;
  --env-front: #24201c;
  --env-flap: #2a2520;
  --seal-a: #e0c48e;
  --seal-b: #b38d52;
  --seal-c: #7a5c30;
}

/* ---------- THEME: BURGUNDY (đỏ đô – vàng) ---------- */
.theme-burgundy {
  --page: #22060b;
  --bg: #4a0e18;
  --bg-2: #3d0b13;
  --ink: #f7ede2;
  --ink-soft: #e4d1c3;
  --muted: #c29e94;
  --accent: #d8b47a;
  --line: rgba(247, 237, 226, .16);
  --line-accent: rgba(216, 180, 122, .6);
  --btn-bg: #d8b47a;
  --btn-ink: #3d0b13;
  --intro-bg: #4a0e18;
  --env-back: #5c1320;
  --env-front: #6b1727;
  --env-flap: #641524;
  --card-bg: #fbf6ee;
  --card-logo: #7a1424;
  --seal-a: #ecd29c;
  --seal-b: #c29a58;
  --seal-c: #7d5a26;
}

/* ---------- THEME: WHITE (trắng tinh – đen than) ---------- */
.theme-white {
  --page: #ecebe8;
  --bg: #ffffff;
  --bg-2: #f6f5f2;
  --ink: #1d1d1d;
  --ink-soft: #55534f;
  --muted: #9b9893;
  --accent: #1d1d1d;
  --line: rgba(29, 29, 29, .12);
  --line-accent: rgba(29, 29, 29, .5);
  --btn-bg: #1d1d1d;
  --btn-ink: #ffffff;
  --intro-bg: #ffffff;
  --env-back: #ecebe7;
  --env-front: #f6f5f2;
  --env-flap: #f1f0ec;
  --card-bg: #ffffff;
  --card-logo: #1d1d1d;
  --seal-a: #5c5c5c;
  --seal-b: #2a2a2a;
  --seal-c: #101010;
  --seal-mark: rgba(255, 255, 255, .88);
  --seal-hi: rgba(0, 0, 0, .6);
}
.theme-white .map iframe { filter: grayscale(1) contrast(1.05); }

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--ff-serif); font-size: 15.5px; line-height: 1.65;
  color: var(--ink); background: var(--page);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  /* số đứng thẳng ở mọi nơi (Playfair mặc định dùng số kiểu cổ: 0 giống chữ o) */
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
}
body.locked { overflow: hidden; height: 100vh; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.page { position: relative; max-width: var(--maxw); margin: 0 auto; background: var(--bg); overflow: hidden; }
@media (min-width: 520px) {
  .page { box-shadow: 0 0 0 1px var(--line), 0 40px 90px -40px rgba(0, 0, 0, .35); }
}
section, footer { position: relative; }

/* ---------- TYPO ---------- */
.eyebrow {
  font-family: var(--ff-sans); font-size: 10px; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase; color: var(--muted); padding-left: .3em;
}
.title { font-family: var(--ff-display); font-weight: 400; font-size: clamp(26px, 7.4vw, 32px); line-height: 1.25; margin-top: 10px; text-wrap: balance; }
.title em { font-style: italic; color: var(--accent); }
.rule { display: block; width: 36px; height: 1px; border: 0; background: var(--line-accent); margin: 30px auto; }
.amp { font-family: var(--ff-script); font-weight: 400; color: var(--accent); }
.lead { margin-top: 14px; font-size: 15px; font-style: italic; line-height: 1.6; color: var(--ink-soft); }
.sec { padding: 96px 32px; text-align: center; }
.sec.alt { background: var(--bg-2); }
.full { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.full.wide { aspect-ratio: 3 / 2; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 146px; padding: 14px 22px; border: 1px solid var(--btn-bg); border-radius: 2px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-ink);
  font-family: var(--ff-sans); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: opacity .25s, transform .2s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-accent); }
.btn svg { width: 14px; height: 14px; }

/* =========================================================
   INTRO – PHONG BÌ
   ========================================================= */
.intro {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: var(--intro-bg); color: var(--ink);
  transition: opacity 1s var(--ease), visibility 1s;
}
.intro.hide { opacity: 0; visibility: hidden; }
.intro-inner { width: min(90vw, 400px); text-align: center; }
.intro-names { position: relative; z-index: 2; margin-top: 14px; font-family: var(--ff-display); font-style: italic; font-size: 27px; line-height: 1.3; }
.intro-names span { white-space: nowrap; }
.intro-names .amp { font-style: normal; font-size: 32px; margin: 0 2px; }

.env { position: relative; z-index: 1; width: 280px; height: 188px; margin: 40px auto; perspective: 1400px; cursor: pointer; }
.env-back, .env-front, .env-flap { position: absolute; left: 0; right: 0; }
.env-back { top: 0; bottom: 0; background: var(--env-back); box-shadow: 0 30px 50px -30px rgba(0, 0, 0, .5); }
.env-card {
  position: absolute; left: 14px; right: 14px; top: 10px; height: 166px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--card-bg, #fbf8f2); color: #2e2924;
  transition: transform 1.3s .55s var(--ease);
}
.env-card .eyebrow { font-size: 7.5px; color: #9b8f80; }
.env-card .names { font-family: var(--ff-display); font-style: italic; font-size: 17px; line-height: 1.2; color: var(--card-logo, #2e2924); }
.env-front { top: 0; bottom: 0; z-index: 3; background: var(--env-front); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env-flap {
  top: 0; height: 62%; z-index: 4; background: var(--env-flap);
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center;
  transition: transform .9s var(--ease), z-index 0s .45s;
}
.seal {
  position: absolute; left: 50%; top: 60%; z-index: 5; width: 72px; height: 72px;
  transform: translate(-50%, -50%); transition: opacity .45s, transform .45s var(--ease);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .22));
}
.seal svg { display: block; width: 100%; height: 100%; }
.seal .logo { position: absolute; inset: 25%; width: auto; margin: 0; }
.seal .seal-mark { background: var(--seal-mark, var(--seal-c)); }
.seal .seal-hi { background: var(--seal-hi, rgba(255, 240, 210, .45)); transform: translate(.6px, .9px); }
.intro.opening .seal { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.intro.opening .env-flap { transform: rotateX(180deg); z-index: 1; }
.intro.opening .env-card { transform: translateY(-58%); }
/* khi mở: chữ phía trên & dưới phong bì mờ đi để tấm thiệp trượt lên không bị đè lên tên */
.intro-inner > .eyebrow, .intro-names, .intro-guest, .intro .btn { transition: opacity .45s ease; }
.intro.opening .intro-inner > .eyebrow, .intro.opening .intro-names,
.intro.opening .intro-guest, .intro.opening .btn { opacity: 0; pointer-events: none; }
.intro-guest { font-size: 14px; font-style: italic; color: var(--ink-soft); }
.intro-guest b { display: block; margin-top: 4px; font-family: var(--ff-display); font-style: normal; font-weight: 500; font-size: 20px; color: var(--ink); }
.intro .btn { margin-top: 28px; }

/* ---------- LOGO (tô màu bằng mask) ---------- */
.logo {
  display: block; width: 72px; aspect-ratio: 781 / 800; margin: 0 auto;
  background: var(--accent);
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
}
.logo.lg { width: 96px; margin-bottom: 36px; }
.logo.on-photo { width: 58px; background: #fff; opacity: .92; }
.logo.card { width: 50px; background: var(--card-logo, #a8895a); margin-bottom: 2px; }
footer .logo { width: 60px; margin-bottom: 16px; }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 600px; max-height: 900px; overflow: hidden; color: #fff; text-align: center; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 8s var(--ease); }
body.opened .hero > img { transform: none; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .6)); }
.hero-top { position: absolute; top: 36px; left: 0; right: 0; z-index: 2; }
.hero-top .eyebrow { color: rgba(255, 255, 255, .85); }
.hero-content { position: absolute; left: 0; right: 0; bottom: 60px; z-index: 2; padding: 0 28px; }
.hero-names { font-family: var(--ff-display); font-weight: 400; font-size: clamp(25px, 7.4vw, 33px); line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }
.hero-names .amp { display: block; font-size: 38px; line-height: 1.15; letter-spacing: 0; text-transform: none; color: #fff; opacity: .9; }
.hero-date { margin-top: 20px; font-family: var(--ff-sans); font-size: 11px; letter-spacing: .45em; padding-left: .45em; color: rgba(255, 255, 255, .9); }

/* =========================================================
   STORY
   ========================================================= */
.story .guest { margin-top: 10px; font-family: var(--ff-display); font-style: italic; font-size: 26px; line-height: 1.25; word-break: break-word; }
.quote { max-width: 300px; margin: 0 auto; font-style: italic; font-size: 16px; line-height: 1.75; color: var(--ink-soft); text-wrap: balance; }
.arch { width: 76%; aspect-ratio: 3 / 4.3; margin: 44px auto 0; border-radius: 999px 999px 0 0; overflow: hidden; }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.story .save { margin-top: 40px; }
.big-date { margin-top: 8px; font-family: var(--ff-display); font-size: 22px; letter-spacing: .18em; padding-left: .18em; }

/* =========================================================
   COUPLE
   ========================================================= */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 44px; text-align: left; }
.person .ph { aspect-ratio: 3 / 4.3; overflow: hidden; }
.person .ph img { width: 100%; height: 100%; object-fit: cover; }
.person:nth-child(2) { margin-top: 56px; }
.person figcaption { margin-top: 14px; }
.person .eyebrow { padding-left: 0; }
.person b { display: block; margin-top: 4px; font-family: var(--ff-display); font-weight: 400; font-size: clamp(15px, 4.3vw, 18px); line-height: 1.2; white-space: nowrap; }

/* =========================================================
   INVITATION
   ========================================================= */
.monogram { width: 64px; height: 64px; margin: 0 auto 36px; color: var(--accent); }
.families { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); gap: 10px; align-items: start; }
.families .vline { background: var(--line); align-self: stretch; }
.fam { min-width: 0; }
.fam .eyebrow { color: var(--accent); margin-bottom: 12px; }
.fam p { font-size: clamp(13px, 3.6vw, 14.5px); line-height: 1.55; }
.fam .who { font-weight: 500; white-space: nowrap; }   /* tên cha mẹ luôn 1 dòng; JS tự thu chữ cho vừa cột */
.nw { white-space: nowrap; }
.fam .addr { margin-top: 8px; font-size: clamp(12px, 3.3vw, 13px); font-style: italic; color: var(--ink-soft); }
.lotus { display: inline-block; width: 14px; height: 14px; margin-left: 3px; vertical-align: -1px; color: var(--accent); }

.announce { font-family: var(--ff-sans); font-size: 10.5px; font-weight: 500; letter-spacing: .22em; line-height: 2; text-transform: uppercase; color: var(--ink-soft); }
.spouses { margin-top: 24px; }
.spouse .rank { display: block; font-family: var(--ff-sans); font-size: 9.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); padding-left: .3em; }
.spouse .name { display: block; margin-top: 6px; font-family: var(--ff-display); font-weight: 400; font-size: clamp(19px, 5.6vw, 25px); line-height: 1.3; letter-spacing: .05em; text-transform: uppercase; }
.spouses .amp { display: block; margin: 10px 0; font-size: 40px; line-height: 1; }
.ceremony { margin-top: 26px; }
.ceremony.after { margin-top: 0; }
.ceremony .c-note { font-size: 14.5px; font-style: italic; color: var(--ink-soft); }
/* giờ hôn lễ: cùng kiểu với giờ đón khách / khai tiệc (.times b) */
.ceremony .c-time { display: block; margin-top: 6px; font-family: var(--ff-display); font-weight: 400; font-size: 22px; line-height: 1.3; color: var(--ink); }
.ceremony .c-date { display: block; margin-top: 2px; font-family: var(--ff-sans); font-size: 9.5px; letter-spacing: .26em; padding-left: .26em; text-transform: uppercase; color: var(--muted); }
.ceremony .c-lunar { margin-top: 6px; font-size: 13px; font-style: italic; color: var(--ink-soft); }

.invite-line { font-size: 15px; font-style: italic; line-height: 1.6; color: var(--ink-soft); }
.venue { margin-top: 16px; font-family: var(--ff-display); font-weight: 400; font-size: clamp(19px, 5.4vw, 23px); line-height: 1.35; letter-spacing: .05em; text-transform: uppercase; }
.hall { margin-top: 8px; font-family: var(--ff-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: var(--accent); }
.venue-addr { margin-top: 10px; font-size: 13.5px; font-style: italic; line-height: 1.55; color: var(--ink-soft); }

.dow-line { margin-top: 40px; font-family: var(--ff-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; color: var(--accent); }
.datebox { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; max-width: 320px; margin: 12px auto 0; }
.datebox .side { padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--ff-sans); font-size: 10px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }
.datebox .day { font-family: var(--ff-display); font-weight: 400; font-size: 56px; line-height: .9; color: var(--accent); }
.lunar { margin-top: 14px; font-size: 13.5px; font-style: italic; color: var(--ink-soft); }
.times { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 26px; }
.times small { display: block; font-family: var(--ff-sans); font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.times b { display: block; margin-top: 2px; font-family: var(--ff-display); font-weight: 400; font-size: 22px; }
.times .sep { width: 1px; height: 38px; background: var(--line); }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.map { margin-top: 28px; height: 210px; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.4) contrast(1.02); }
.theme-noir .map iframe, .theme-burgundy .map iframe { filter: grayscale(.7) invert(.88) hue-rotate(180deg) contrast(.9); }
.closing { margin-top: 34px; font-size: 15px; font-style: italic; line-height: 1.55; color: var(--ink-soft); }
.closing-2 { margin-top: 14px; font-family: var(--ff-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--accent); }

/* =========================================================
   SAVE THE DATE – lịch + đếm ngược
   ========================================================= */
.grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; max-width: 330px; margin: 34px auto 0; }
.grid .dow { padding-bottom: 12px; font-family: var(--ff-sans); font-size: 9px; font-weight: 600; letter-spacing: .1em; color: var(--muted); }
.grid .d { height: 40px; display: flex; align-items: center; justify-content: center; font-family: var(--ff-display); font-size: 15px; }
.grid .d.mark span { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--bg); font-weight: 600; }
.cal-note { margin-top: 18px; font-size: 13.5px; font-style: italic; color: var(--ink-soft); }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 330px; margin: 44px auto 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cd-box { padding: 18px 0 14px; }
.cd-box + .cd-box { border-left: 1px solid var(--line); }
.cd-box b { display: block; font-family: var(--ff-display); font-weight: 400; font-size: 28px; line-height: 1; }
.cd-box small { display: block; margin-top: 8px; font-family: var(--ff-sans); font-size: 8.5px; letter-spacing: .26em; padding-left: .26em; text-transform: uppercase; color: var(--muted); }
.cd-done { margin-top: 18px; font-family: var(--ff-display); font-style: italic; font-size: 20px; color: var(--accent); }

/* =========================================================
   PLAN – lịch trình
   ========================================================= */
.plan-body { padding: 64px 32px 96px; text-align: center; }
.plan-list { max-width: 330px; margin: 36px auto 0; text-align: left; border-top: 1px solid var(--line); }
.plan-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.plan-row .time { font-family: var(--ff-display); font-size: 22px; line-height: 1; color: var(--accent); }
.plan-row .what { font-family: var(--ff-display); font-weight: 500; font-size: 14.5px; letter-spacing: .06em; text-transform: uppercase; }
.plan-row .sub { font-size: 13px; font-style: italic; color: var(--ink-soft); }
.plan-row .when { display: block; margin-top: 4px; font-family: var(--ff-sans); font-size: 9px; letter-spacing: .2em; color: var(--muted); }

/* =========================================================
   MOMENTS
   ========================================================= */
.mgrid { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 200px 200px; gap: 8px; margin: 44px -12px 0; }
.mgrid figure { overflow: hidden; }
.mgrid figure:first-child { grid-row: span 2; }
.mgrid img { width: 100%; height: 100%; object-fit: cover; }
.moments .quote { margin-top: 44px; }

/* =========================================================
   ALBUM
   ========================================================= */
.album { padding: 96px 0 84px; text-align: center; }
.album .head { padding: 0 32px; }
.viewer { position: relative; margin-top: 40px; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; aspect-ratio: 2 / 3; padding: 0 28px; scroll-snap-align: center; }
.slide img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.nav-btn {
  position: absolute; top: 50%; z-index: 2; width: 38px; height: 38px; margin-top: -19px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .7); background: rgba(0, 0, 0, .18); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.nav-btn svg { width: 15px; height: 15px; }
.nav-btn.prev { left: 40px; }
.nav-btn.next { right: 40px; }
.counter { display: block; margin-top: 18px; font-family: var(--ff-sans); font-size: 10px; letter-spacing: .3em; color: var(--muted); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 28px 0; scrollbar-width: none; scroll-behavior: smooth; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: 0 0 52px; height: 70px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .38; transition: opacity .3s; }
.thumbs button.on { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.lightbox { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; background: rgba(10, 9, 8, .97); }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox .close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 30px; font-weight: 300; cursor: pointer; }
.lightbox .nav-btn.prev { left: 12px; }
.lightbox .nav-btn.next { right: 12px; }

/* =========================================================
   RSVP & LỜI CHÚC
   ========================================================= */
.form { display: grid; gap: 4px; max-width: 340px; margin: 36px auto 0; text-align: left; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); font-size: 16px; font-family: var(--ff-serif); outline: none;
  -webkit-appearance: none; appearance: none; transition: border-color .25s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field select {
  padding-right: 22px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select option { color: #2e2924; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.field ::placeholder { color: var(--muted); font-style: italic; }
.row2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.form .btn { justify-self: center; margin-top: 26px; }
.wishes { max-width: 340px; max-height: 380px; margin: 48px auto 0; overflow-y: auto; text-align: left; border-top: 1px solid var(--line); }
.wish { padding: 16px 0; border-bottom: 1px solid var(--line); }
.wish b { font-family: var(--ff-display); font-weight: 500; font-size: 15px; }
.wish .tag { margin-left: 8px; font-family: var(--ff-sans); font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.wish p { margin-top: 2px; font-size: 14px; font-style: italic; line-height: 1.5; color: var(--ink-soft); white-space: pre-line; }
.wish-empty { padding: 18px 0; text-align: center; font-size: 15px; font-style: italic; color: var(--muted); }

/* =========================================================
   GIFT
   ========================================================= */
.gifts { display: grid; gap: 14px; max-width: 360px; margin: 36px auto 0; }
.gift { display: flex; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); text-align: left; }
.gift img { flex: 0 0 auto; width: 96px; height: 96px; padding: 4px; background: #fff; object-fit: contain; }
.gift .who { font-family: var(--ff-sans); font-size: 9.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.gift .bank { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.gift .acc { font-family: var(--ff-display); font-size: 19px; font-weight: 500; letter-spacing: .04em; line-height: 1.3; }
.gift .holder { font-family: var(--ff-sans); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.gift .copy { margin-top: 10px; padding: 0 0 2px; border: 0; border-bottom: 1px solid var(--line-accent); background: none; cursor: pointer; font-family: var(--ff-sans); font-size: 9.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

/* =========================================================
   THANK YOU + FOOTER
   ========================================================= */
.thanks { position: relative; height: 640px; overflow: hidden; color: #fff; text-align: center; }
.thanks > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thanks::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .68)); }
.thanks-in { position: absolute; left: 0; right: 0; bottom: 56px; z-index: 2; padding: 0 36px; }
.thanks h2 { font-family: var(--ff-display); font-weight: 400; font-style: italic; font-size: 40px; line-height: 1.1; }
.thanks p { margin-top: 14px; font-size: 14.5px; font-style: italic; line-height: 1.6; opacity: .92; }
footer { padding: 64px 24px 96px; text-align: center; }
footer .monogram { margin-bottom: 14px; }
footer .names { font-family: var(--ff-display); font-style: italic; font-size: 20px; }
footer .eyebrow { margin-top: 8px; }

/* =========================================================
   MISC – music / toast / bản nháp / hạt rơi (tuỳ chọn)
   ========================================================= */
.music {
  position: fixed; z-index: 60; bottom: 18px; left: max(14px, calc(50% - var(--maxw) / 2 + 14px));
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-accent); cursor: pointer;
  background: var(--bg); color: var(--accent); display: none; align-items: center; justify-content: center;
}
.music.show { display: flex; }
.music svg { width: 18px; height: 18px; }
.music.playing svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: 80px; z-index: 400; max-width: 90vw; padding: 12px 20px; border-radius: 2px; background: #2e2924; color: #f8f5f0; font-family: var(--ff-sans); font-size: 12px; letter-spacing: .04em; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .4s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.draft-badge { position: fixed; z-index: 250; bottom: 12px; left: 50%; transform: translateX(-50%); max-width: calc(min(100vw, var(--maxw)) - 24px); padding: 6px 14px; border-radius: 2px; background: #8b2b2b; color: #fff; font-family: var(--ff-sans); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-align: center; pointer-events: none; }

.fx { position: fixed; top: 0; bottom: 0; left: 50%; z-index: 50; width: min(100%, var(--maxw)); transform: translateX(-50%); overflow: hidden; pointer-events: none; }
.fx i { position: absolute; top: -20px; display: block; border-radius: 50%; background: var(--accent); opacity: 0; animation: fall linear infinite; }
@keyframes fall {
  0% { transform: translate3d(0, -5vh, 0); opacity: 0; }
  10% { opacity: .6; }
  50% { transform: translate3d(var(--sway), 50vh, 0); }
  90% { opacity: .4; }
  100% { transform: translate3d(0, 105vh, 0); opacity: 0; }
}

/* ---------- REVEAL ---------- */
[data-r] { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
[data-r].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  [data-r] { opacity: 1; transform: none; }
  .fx { display: none; }
}
/* điện thoại: lề phần thiệp mời hẹp lại để hai cột Nhà Trai | Nhà Gái đủ chỗ */
@media (max-width: 480px) {
  .sec.invite { padding-left: 16px; padding-right: 16px; }
}
/* máy quá hẹp (chữ tên sẽ < 11px): JS thêm .stack → hai họ xếp trên – dưới */
.families.stack { grid-template-columns: minmax(0, 1fr); gap: 26px; }
.families.stack .vline { width: 36px; height: 1px; justify-self: center; align-self: auto; }
@media (max-width: 360px) {
  .sec { padding: 84px 22px; }
  .families { gap: 8px; }
  .cd-box b { font-size: 28px; }
  .plan-row { grid-template-columns: 78px 1fr; }
}
