/* Thiệp cưới Viết Trí & Hồ Xoan */

/* ---------- Font chữ (tự host, chỉ các bộ ký tự Việt + Latin) ---------- */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/be-vietnam-pro-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/be-vietnam-pro-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/be-vietnam-pro-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/be-vietnam-pro-500-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/be-vietnam-pro-500-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/be-vietnam-pro-500-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/be-vietnam-pro-600-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/be-vietnam-pro-600-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/be-vietnam-pro-600-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400 600; font-display: swap; src: url("../fonts/cormorant-garamond-400-italic-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400 600; font-display: swap; src: url("../fonts/cormorant-garamond-400-italic-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400 600; font-display: swap; src: url("../fonts/cormorant-garamond-400-italic-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/cormorant-garamond-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/cormorant-garamond-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/cormorant-garamond-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/dancing-script-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/dancing-script-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/dancing-script-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/pinyon-script-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/pinyon-script-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/pinyon-script-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/playfair-display-500-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/playfair-display-500-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/playfair-display-500-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/great-vibes-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/great-vibes-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/great-vibes-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: 'Ms Madi'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ms-madi-400-normal-vietnamese.woff2") format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: 'Ms Madi'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ms-madi-400-normal-latin-ext.woff2") format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: 'Ms Madi'; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ms-madi-400-normal-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */

/* ---------- Biến dùng chung ---------- */
:root {
  --ink: #26303c;
  --ink-2: #45556a;
  --label: #5f7896;
  --accent: #6f8aa8;
  --accent-strong: #4f6784;
  --accent-mid: #6a86a6;
  --accent-soft: #8197b2;
  --line: #d3deea;
  --line-2: #c3d1e0;
  --paper: #fbfcfe;
  --mist: #eef3f8;
  --page: #e6edf5;
  --page-bg: radial-gradient(ellipse at 15% 10%, #eef3f8 0%, transparent 55%), radial-gradient(ellipse at 85% 90%, #d6e0ec 0%, transparent 55%), #e6edf5;
  --card-shadow: 0 20px 60px rgba(80, 105, 140, .22);
  /* 0 trên điện thoại, có lề + bo góc khi màn hình rộng hơn 540px */
  --desk-gap: clamp(0px, (100vw - 540px) * 999, 28px);
  --desk-radius: clamp(0px, (100vw - 540px) * 999, 20px);

  --f-serif: 'Cormorant Garamond', Georgia, serif;
  --f-sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --f-hand: 'Great Vibes', 'Dancing Script', cursive; /* thư pháp copperplate cho tiêu đề (có dấu tiếng Việt) */
  --f-script: 'Pinyon Script', cursive;
  --f-sign: 'Ms Madi', 'Dancing Script', cursive; /* chữ ký tay nét mảnh, có dấu tiếng Việt */
  --f-display: 'Playfair Display', serif;
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Không đặt nền cho <html>: nền cố định của body được đẩy lên canvas gốc, Chrome ghép sẵn trên compositor
   (không vẽ lại cả trang mỗi khung hình, cuộn không phải chờ main thread) */
html, body { margin: 0; padding: 0; }
body {
  background: var(--page-bg);
  background-attachment: fixed;
  font-family: var(--f-serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
input, textarea, button, select { font-family: var(--f-sans); }
img { max-width: 100%; }

@keyframes petalFall { 0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0 } 10% { opacity: .9 } 100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: 0 } }
/* Lắc ngang bằng `translate` (chạy trên compositor), không dùng margin-left để khỏi tính lại bố cục mỗi khung hình */
@keyframes sway { 0%, 100% { translate: 0 0 } 50% { translate: var(--sw) 0 } }
@keyframes bounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(6px) } }
@keyframes riseOut { 0% { transform: translateY(150px) rotate(var(--r, 0deg)); opacity: 0 } 18% { opacity: 1 } 100% { transform: translateY(0) rotate(var(--r, 0deg)); opacity: 1 } }
@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }
@keyframes swayT { 0%, 100% { rotate: 0deg } 50% { rotate: 3deg } }
@keyframes kenburns { from { transform: scale(1) } to { transform: scale(1.14) } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }
@keyframes heroParallax { from { transform: translateY(0) } to { transform: translateY(200px) } }

/* Hiện dần khi cuộn tới (chỉ khi có JS) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.js [data-reveal="in"] { opacity: 1; transform: none; }

/* ---------- Khung thiệp ---------- */
.page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: var(--desk-gap) 0; }
.card {
  width: 100%; max-width: 480px; position: relative; overflow: hidden;
  background: var(--paper); box-shadow: var(--card-shadow); border-radius: var(--desk-radius);
}

/* ---------- Màn mở thiệp ---------- */
.cover {
  --s: .8;
  position: fixed; inset: 0; z-index: 50;
  display: flex; justify-content: center; align-items: flex-start;
  padding: var(--desk-gap) 0;
  background: var(--page-bg);
  transition: opacity .9s ease;
}
.no-js .cover { display: none; }
.cover__card {
  width: 100%; max-width: 480px; height: 100%; /* .cover đã có padding = lề, không trừ thêm lần nữa */
  position: relative; overflow: hidden;
  border-radius: var(--desk-radius); box-shadow: var(--card-shadow); background: #f4f7fb;
  transition: transform 1.1s cubic-bezier(.7, 0, .3, 1), opacity .9s ease;
}
.is-open .cover { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .9s ease, visibility 0s linear 1.1s; }
.is-open .cover__card { transform: translateY(-100%); opacity: 0; }
.cover__body {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 12px;
}
.cover__title {
  font-family: var(--f-script); font-size: min(42px, 10vw); line-height: 1; color: #6680a0;
  transform: rotate(-5deg); white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 3px 10px rgba(80, 105, 140, .2);
}
.cover__rule { width: min(360px, 80%); border-top: 2px dotted #c9d6e4; }
.cover__stage { position: relative; flex-shrink: 0; width: calc(430px * var(--s)); height: calc(420px * var(--s)); }
.cover__hint { text-align: center; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #5c7593; font-weight: 600; }

.scene { position: absolute; left: 0; top: 0; width: 430px; height: 420px; cursor: pointer; transform: scale(var(--s)); transform-origin: 0 0; -webkit-tap-highlight-color: transparent; }
.scene:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
.scene__inner { position: absolute; left: 0; right: 0; top: -50px; height: 490px; }

.env-back {
  position: absolute; left: 55px; top: 111px; width: 320px; height: 340px; z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .12) 22%, transparent 48%),
    url("../img/linen.png"),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 2px),
    linear-gradient(170deg, #9fb3cb, #8ea4bf 45%, #6a86a6);
  background-size: auto, 96px 96px, auto, auto, auto;
  background-blend-mode: normal, soft-light, normal, normal, normal;
  clip-path: path('M0 122 C 14 92, 104 22, 160 0 C 216 22, 306 92, 320 122 L320 340 L0 340 Z');
  box-shadow: 0 8px 20px rgba(35, 50, 75, .3);
}
.env-lining {
  position: absolute; left: 63px; top: 137px; width: 304px; height: 200px; z-index: 1;
  background:
    linear-gradient(180deg, #f3f0e6, #e8e2d2 70%, #dcd4bf),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .012) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .012) 0 1px, transparent 1px 2px);
  clip-path: path('M0 84 C 12 62, 98 22, 152 8 C 206 22, 292 62, 304 84 L304 200 L0 200 Z');
  box-shadow: inset 0 10px 16px rgba(35, 50, 75, .35);
}
.daisies { position: absolute; left: 6px; top: 126px; width: 100px; height: 134px; z-index: 3; transform: rotate(-16deg); opacity: .95; filter: drop-shadow(0 3px 4px rgba(35, 50, 75, .2)); }
.polaroid {
  position: absolute; width: 142px; height: 213px; margin: 0; padding: 6px 6px 16px;
  background: linear-gradient(165deg, #fbfaf7, #f1eee7);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 4px 8px rgba(0, 0, 0, .14), 0 14px 28px rgba(0, 0, 0, .22);
  transform: rotate(var(--r));
  animation: riseOut 1.1s cubic-bezier(.22, .9, .3, 1) var(--delay) both;
}
.polaroid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid--a { left: 80px; top: 82px; --r: -6deg; --delay: .35s; z-index: 4; }
.polaroid--b { left: 212px; top: 64px; --r: 8deg; --delay: .2s; z-index: 2; }
.ticket {
  position: absolute; left: 108px; top: 198px; width: 252px; height: 150px; z-index: 5;
  --r: -5deg; transform: rotate(-5deg);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .1)) drop-shadow(0 8px 14px rgba(40, 50, 70, .22));
  animation: riseOut 1s cubic-bezier(.22, .9, .3, 1) .6s both;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 0 0 38px; text-align: center; color: #28313b;
}
.ticket::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, #fbf9f2, #f4efe3),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .012) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .012) 0 1px, transparent 1px 2px);
  clip-path: path('M0 0 H30 A6 6 0 0 0 42 0 H252 V150 H42 A6 6 0 0 0 30 150 H0 Z');
}
.ticket__stub {
  position: absolute; left: 0; top: 0; bottom: 0; width: 36px;
  border-right: 2px dashed #cdc5b1; background: linear-gradient(90deg, rgba(0, 0, 0, .035), transparent);
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: #55657a; font-weight: 600;
}
.ticket__script { font-family: var(--f-script); font-size: 19px; line-height: 1.2; color: #2e3a48; }
.ticket__rule { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.ticket__rule i { width: 46px; height: 1px; background: linear-gradient(90deg, transparent, #28313b 30%, #28313b 70%, transparent); }
.ticket__headline { font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: #2e3a48; }
.ticket__sub { font-family: var(--f-display); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #45556a; }
.env-front { position: absolute; left: 55px; top: 268px; width: 320px; height: 183px; z-index: 6; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)) drop-shadow(0 14px 20px rgba(35, 50, 75, .38)); }
.seal { position: absolute; left: 181px; top: 301px; width: 68px; height: 68px; z-index: 7; filter: drop-shadow(0 2px 2px rgba(35, 50, 75, .3)) drop-shadow(0 6px 10px rgba(35, 50, 75, .35)); animation: bounce 2s ease-in-out infinite; }
.seal svg { display: block; width: 100%; height: 100%; }
.tulip { position: absolute; left: 318px; top: 338px; width: 104px; height: 136px; object-fit: contain; z-index: 8; transform-origin: 50% 100%; animation: swayT 6s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(35, 50, 75, .25)); }

/* Cánh hoa rơi sau khi mở thiệp */
.petals { position: fixed; inset: 0; z-index: 45; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: 0; border-radius: 100% 0 100% 0; opacity: 0;
  animation: petalFall var(--dur) linear var(--delay) infinite, sway calc(var(--dur) / 3) ease-in-out infinite;
}

/* Nút nhạc */
.music {
  position: fixed; z-index: 40;
  right: max(16px, calc(50% - 240px + 16px)); top: calc(18px + var(--desk-gap));
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(80, 105, 140, .2);
  color: var(--accent); font-size: 20px; cursor: pointer;
}
.music svg { display: block; width: 22px; height: 22px; }
/* Đang phát: hiện sóng âm (nhấp nháy nhẹ), ẩn gạch chéo. Đã tắt: ngược lại */
.music__waves { display: none; }
.music.is-playing .music__waves { display: inline; }
.music.is-playing .music__slash { display: none; }
.music.is-playing .music__w1 { animation: musicWave 1.2s ease-in-out infinite; }
.music.is-playing .music__w2 { animation: musicWave 1.2s ease-in-out .3s infinite; }
@keyframes musicWave { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* Tên bài đang phát, hiện vài giây cạnh nút nhạc */
.now-playing {
  position: fixed; z-index: 40;
  right: calc(max(16px, calc(50% - 240px + 16px)) + 56px); top: calc(25px + var(--desk-gap));
  max-width: min(260px, calc(100vw - 100px)); padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(80, 105, 140, .16);
  font-family: var(--f-sans); font-size: 12.5px; line-height: 1.3; color: var(--accent-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateX(8px); transition: opacity .4s ease, transform .4s ease; pointer-events: none;
}
.now-playing.is-shown { opacity: 1; transform: none; }

/* ---------- Thành phần dùng lại ---------- */
.sec { padding: 64px 24px; text-align: center; }
.sec--paper { background: var(--paper); }
.sec--mist { background: var(--mist); }
.eyebrow { font-size: 14px; letter-spacing: .35em; text-transform: uppercase; color: var(--label); }
.title { font-family: var(--f-hand); font-size: 42px; color: var(--ink); margin-top: 8px; line-height: 1.1; text-wrap: balance; }
/* Chữ hoa của Great Vibes có đuôi dài, nới khoảng cách từ cho khỏi dính ("Lễ Thành Hôn");
   tiêu đề chủ yếu chữ thường thì nới ít hơn */
.intro__title, .event__name { word-spacing: .3em; }
.person__name { word-spacing: .2em; }
.title, .map-card__name, .print__caption { word-spacing: .14em; }
.lead { font-size: 17px; line-height: 1.7; margin: 14px auto 0; max-width: 340px; color: var(--ink-2); text-wrap: pretty; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
  border: 1px solid var(--accent); border-radius: 999px; padding: 10px 20px;
  font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
}

/* ---------- Hero ---------- */
/* --hero-h: JS đo innerHeight một lần lúc mở trang (chỉ đo lại khi đổi chiều rộng),
   để hero không co giãn theo thanh công cụ của trình duyệt trong Zalo/Messenger. Không có JS thì dùng 100svh / 100vh. */
.hero { position: relative; height: 100vh; height: 100svh; height: var(--hero-h, 100svh); min-height: 620px; overflow: hidden; }
.hero__bg { position: absolute; inset: -12% 0; width: 100%; height: 124%; max-width: none; object-fit: cover; object-position: 50% 40%; will-change: transform; }
/* Ảnh trôi chậm khi cuộn: cuộn 800px thì ảnh xuống 200px (= scrollY × 0.25, tối đa 200px), chạy trên compositor.
   Trình duyệt chưa hỗ trợ thì app.js làm thay. */
@supports (animation-timeline: scroll()) {
  .hero__bg {
    animation: heroParallax linear both; /* shorthand đặt trước: nó reset timeline/range */
    animation-timeline: scroll(root block);
    animation-range: 0 800px;
  }
}
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 28, 40, .55) 0%, rgba(20, 28, 40, .1) 26%, rgba(20, 28, 40, 0) 42%, rgba(20, 28, 40, .32) 58%, rgba(20, 28, 40, .78) 100%); }
.hero__content {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: clamp(16px, calc(var(--hero-h, 100vh) * .03), 36px) 24px clamp(36px, calc(var(--hero-h, 100vh) * .07), 60px);
  text-align: center; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}
/* Cụm chữ trên phải kết thúc trước ~19% chiều cao hero: mặt chú rể bắt đầu ở ~20% (ảnh 2841).
   Câu trích hẹp lại 64px mỗi bên để không chui dưới nút nhạc; "Welcome…" giữ 1 dòng. */
.hero__quote { margin: 0; max-width: min(300px, calc(100vw - 128px)); font-size: 13px; line-height: 1.5; text-wrap: balance; opacity: .95; }
.hero__welcome { font-family: var(--f-display); font-size: clamp(21px, 6.4vw, 30px); font-weight: 500; line-height: 1.15; margin-top: 6px; white-space: nowrap; }
@media (max-width: 340px) { .hero__quote { font-size: 12px; } }
.hero__story-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: clamp(28px, calc(var(--hero-h, 100vh) * .08), 72px); }
.hero__story { font-family: var(--f-script); font-size: clamp(48px, 14vw, 64px); line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 18px rgba(0, 0, 0, .4); }
.hero__couple { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px; gap: 12px; }
.hero__couple > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero__name { font-family: var(--f-script); font-size: clamp(32px, 9vw, 40px); line-height: 1; color: #f0e6d0; text-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 14px rgba(0, 0, 0, .4); }
.hero__role { font-size: 12px; letter-spacing: .3em; font-weight: 600; }
/* Số in đứng đều nét (Playfair) — cùng kiểu với ngày ở phần đếm ngược */
.hero__date {
  font-family: var(--f-display); font-weight: 500; font-size: 24px; letter-spacing: .1em; font-variant-numeric: lining-nums;
  margin-top: clamp(24px, calc(var(--hero-h, 100vh) * .05), 40px);
}
.hero__date i { font-style: normal; margin: 0 .25em; opacity: .7; }
.hero__save { font-size: 12px; letter-spacing: .45em; font-weight: 500; margin-top: 22px; }

/* ---------- Lời ngỏ ---------- */
.intro { padding: 64px 28px 56px; text-align: center; background: var(--paper); }
.monogram { display: flex; flex-direction: column; align-items: center; font-size: 34px; letter-spacing: .15em; line-height: 1; font-weight: 500; color: var(--ink); }
.monogram__dot { font-size: 10px; margin: 4px 0; }
.intro__tag { font-family: var(--f-script); font-size: 24px; color: var(--label); margin-top: 8px; }
.intro__title { font-family: var(--f-hand); font-weight: 400; font-size: clamp(36px, 11.5vw, 44px); color: var(--ink); margin: 28px 0 20px; line-height: 1.1; }
.intro__text { font-size: 18px; line-height: 1.75; margin: 0 auto; max-width: 360px; text-wrap: pretty; }
.intro__text strong { font-weight: 600; }
/* Ảnh in kẹp 4 góc album, nghiêng nhẹ; dấu bưu điện đóng chéo góc trên, tulip ở góc dưới */
.print { margin: 76px auto 0; width: 252px; }
.print__inner { position: relative; transform: rotate(-2deg); }
.print__photo {
  position: relative; background: #fff; padding: 8px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05), 0 8px 18px rgba(80, 105, 140, .16), 0 22px 40px rgba(80, 105, 140, .14);
}
.print__photo img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 50%; } /* ảnh ghép HNVS: giữ trọn khung 2:3 */
.print__corner {
  position: absolute; width: 30px; height: 30px;
  background: linear-gradient(135deg, #9fb3cb, #6a86a6);
  filter: drop-shadow(0 1px 1px rgba(35, 50, 75, .25));
}
.print__corner--tl { top: -5px; left: -5px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.print__corner--tr { top: -5px; right: -5px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.print__corner--bl { bottom: -5px; left: -5px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.print__corner--br { bottom: -5px; right: -5px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.print__caption { font-family: var(--f-hand); font-size: 27px; color: var(--accent); margin-top: 16px; line-height: 1.1; white-space: nowrap; }
.postmark { position: absolute; top: -74px; right: -12px; width: 118px; color: var(--accent-mid); opacity: .85; transform: rotate(-8deg); pointer-events: none; }
.print__tulip {
  position: absolute; left: -42px; bottom: 28px; width: 86px; z-index: 2;
  transform-origin: 50% 100%; animation: swayT 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(35, 50, 75, .25));
}

/* ---------- Chú rể & cô dâu ---------- */
.people-sec { padding: 56px 24px 64px; }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.person { display: flex; flex-direction: column; align-items: center; }
/* Ảnh polaroid nghiêng nhẹ, dán băng dính — cùng kiểu với polaroid ở màn mở thiệp */
.person__photo {
  position: relative; width: 100%; padding: 7px 7px 26px; background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05), 0 6px 14px rgba(80, 105, 140, .16), 0 18px 32px rgba(80, 105, 140, .14);
  transform: rotate(var(--tilt));
}
.person:nth-child(1) .person__photo { --tilt: -3deg; --tape: 4deg; }
.person:nth-child(2) .person__photo { --tilt: 2.5deg; --tape: -5deg; }
.person__photo::before {
  content: ''; position: absolute; top: -10px; left: 50%; width: 62px; height: 20px; z-index: 1;
  transform: translateX(-50%) rotate(var(--tape));
  background: rgba(243, 214, 220, .85); box-shadow: 0 1px 2px rgba(80, 105, 140, .12);
  clip-path: polygon(0 0, 100% 0, 96% 25%, 100% 50%, 96% 75%, 100% 100%, 0 100%, 4% 75%, 0 50%, 4% 25%);
}
.person__photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.person__role { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; color: var(--label); margin-top: 22px; }
.person__name { font-family: var(--f-hand); font-size: 30px; color: var(--accent); line-height: 1.15; margin-top: 6px; }
.person__family { font-size: 16px; line-height: 1.7; margin-top: 12px; color: var(--ink); }
.person__side { color: var(--label); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- Sự kiện ---------- */
/* Vé mời: cuống màu phong bì (thứ / ngày / giờ) + thân trắng, ngăn bằng đường răng cưa có 2 khuyết tròn.
   Bóng đổ đặt ở .event (mask sẽ cắt mất box-shadow nếu để chung với .event__ticket). */
.events { display: flex; flex-direction: column; gap: 18px; margin-top: 32px; }
.event { filter: drop-shadow(0 10px 20px rgba(80, 105, 140, .14)); }
.event__ticket {
  --cut: 96px; --notch: 9px;
  display: grid; grid-template-columns: var(--cut) 1fr; text-align: left;
  background: #fff; border-radius: 18px; overflow: hidden;
  -webkit-mask:
    radial-gradient(circle var(--notch) at var(--cut) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at var(--cut) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at var(--cut) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.event__stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 6px; color: #fff; text-align: center;
  background: url("../img/linen.png"), linear-gradient(165deg, #9fb3cb, #8ea4bf 45%, #6a86a6);
  background-size: 96px 96px, auto; background-blend-mode: soft-light, normal;
}
.event__weekday { font-family: var(--f-sans); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; opacity: .92; }
.event__day { font-family: var(--f-display); font-size: 46px; line-height: 1; margin-top: 6px; font-variant-numeric: lining-nums; }
.event__month { font-family: var(--f-display); font-size: 13px; letter-spacing: .1em; margin-top: 5px; font-variant-numeric: lining-nums; }
.event__time {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .5); min-width: 56px;
  font-family: var(--f-display); font-size: 18px; letter-spacing: .05em; font-variant-numeric: lining-nums;
}
.event__body {
  padding: 18px 16px 18px 20px;
  background: linear-gradient(var(--line-2) 55%, transparent 0) 0 0 / 1.5px 9px repeat-y; /* đường răng cưa */
}
.event__name { margin: 0; font-family: var(--f-hand); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--ink); }
.event__where { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: baseline; margin: 10px 0 0; }
.event__where dt { font-family: var(--f-sans); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--label); white-space: nowrap; }
.event__where dd { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); text-wrap: balance; }
.event__addr { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.event__lunar { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); font-variant-numeric: lining-nums; }
.event__tag {
  display: inline-block; margin-right: 7px; padding: 2px 8px; border-radius: 999px; vertical-align: 1px;
  font-family: var(--f-sans); font-size: 9.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-strong); background: var(--mist);
}
.event__lunar-date { white-space: nowrap; }
.event__map {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding-bottom: 1px; border-bottom: 1px solid currentColor;
  font-family: var(--f-sans); font-size: 12.5px; font-weight: 500; color: var(--accent-strong);
}
.event__map svg { width: 13px; height: 13px; }
@media (max-width: 360px) {
  .event__ticket { --cut: 82px; }
  .event__day { font-size: 40px; }
  .event__name { font-size: 24px; word-spacing: .2em; white-space: nowrap; }
  .event__where { grid-template-columns: 1fr; gap: 0; }
  .event__where dd + dt { margin-top: 6px; }
}

/* ---------- Lịch ---------- */
.cal-sec { padding: 0 24px 64px; background: var(--paper); }
.cal-card { background: #fff; border-radius: 22px; padding: 12px; box-shadow: 0 14px 40px rgba(80, 105, 140, .14); }
.cal {
  display: grid; grid-template-columns: .85fr 1.35fr; gap: 16px; align-items: center;
  background: linear-gradient(160deg, #9fb3cb, #8ea4bf 50%, #6a86a6); border-radius: 16px; padding: 22px 18px; color: #fff;
}
.cal__photo { background: #f2f6fa; padding: 8px 8px 10px; color: var(--accent-mid); }
.cal__photo img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 40%; }
.cal__caption { font-family: var(--f-script); font-size: 28px; text-align: center; line-height: 1; margin-top: 10px; }
.cal__month { font-size: 20px; letter-spacing: .02em; text-align: right; margin-bottom: 10px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; font-size: 14px; text-align: center; }
.cal__dow { font-weight: 600; font-size: 12px; letter-spacing: .05em; }
.cal__day { position: relative; display: flex; align-items: center; justify-content: center; height: 28px; color: #fff; }
.cal__day > span { position: relative; }
.cal__day.is-mark { color: #e6eef7; font-weight: 700; }
.cal__heart { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -52%); }

/* ---------- Bản đồ ---------- */
.map-sec { padding: 0 24px 64px; background: var(--paper); text-align: center; }
.map-sec__eyebrow { margin-bottom: 18px; }
.map-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.chip { border: 1px solid var(--accent); border-radius: 999px; padding: 9px 24px; white-space: nowrap; font-size: 15px; cursor: pointer; background: #fff; color: var(--accent); }
.chip.is-active { background: var(--accent); color: #fff; }
/* Khung bản đồ: thẻ trắng bo tròn, bản đồ bên trong, tên + địa chỉ + nút chỉ đường bên dưới */
.map-card { max-width: 330px; margin: 0 auto; background: #fff; border-radius: 22px; padding: 7px; box-shadow: 0 14px 34px rgba(80, 105, 140, .14); }
.map { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--mist); }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
.map-card__info { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 8px 7px; text-align: left; }
.map-card__name { font-family: var(--f-hand); font-size: 22px; line-height: 1.15; color: var(--ink); }
.map-card__addr { font-size: 14px; line-height: 1.4; color: var(--ink-2); margin-top: 2px; }
.map-card__go {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-family: var(--f-sans); font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 14px rgba(80, 105, 140, .25);
}
.map-card__go:hover { background: var(--accent-strong); color: #fff; }
.map-card__go svg { width: 14px; height: 14px; }

/* ---------- Album ---------- */
.album-switch { display: inline-flex; align-items: center; gap: 14px; margin-top: 18px; }
.album-switch__sep { width: 1px; height: 12px; background: var(--line-2); }
.switch {
  border: 0; border-bottom: 1px solid transparent; background: none; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent-soft);
  transition: all .3s ease;
}
.switch.is-active { color: var(--ink); border-bottom-color: var(--accent-mid); }

.marquee { margin: 24px -24px 0; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.mq-row { overflow: hidden; }
/* Chỉ dừng khi rê chuột thật; trên điện thoại :hover bị "dính" sau khi chạm làm hàng ảnh đứng luôn */
@media (hover: hover) { .mq-row:hover { --mq-play: paused; } }
.mq-title { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--label); margin-bottom: 8px; }
.mq-track { display: flex; gap: 12px; width: max-content; animation: marquee var(--dur) linear infinite var(--dir); animation-play-state: var(--mq-play, running); }
/* Đã cuộn khỏi màn hình thì tạm dừng hiệu ứng chạy mãi (app.js gắn .is-offscreen) */
.marquee.is-offscreen .mq-track,
.countdown.is-offscreen .countdown__bg { animation-play-state: paused; }
.mq-item { flex: 0 0 auto; height: 176px; border-radius: 4px; overflow: hidden; cursor: zoom-in; background: #dbe5f0; }
.mq-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.album-tabs { display: flex; gap: 8px; margin-top: 26px; }
.tab {
  flex: 1; border: 1px solid #a8bbd0; border-radius: 999px; padding: 10px 6px; cursor: pointer;
  font-size: 14px; letter-spacing: .04em; background: transparent; color: var(--accent-mid); transition: all .3s ease;
}
.tab.is-active { background: var(--accent-mid); color: #fff; }
.album-pane { animation: fadeSlide .55s ease both; }
.album-note { margin: 22px auto 0; max-width: 340px; font-style: italic; font-size: 17px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.strip-wrap { position: relative; margin: 20px -24px 0; }
.strip {
  position: relative; display: flex; gap: 14px; overflow-x: auto; padding: 8px 24px 18px;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.strip__card {
  flex: 0 0 78%; max-width: 340px; aspect-ratio: 3 / 4; scroll-snap-align: center; overflow: hidden;
  background: #fff; padding: 6px; border-radius: 14px; box-shadow: 0 10px 28px rgba(80, 105, 140, .14); cursor: zoom-in;
}
.strip__card img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 9px; user-select: none; -webkit-user-select: none; }
.strip__nav {
  position: absolute; top: 50%; transform: translateY(-60%); width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .9); color: var(--accent-strong); font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(80, 105, 140, .2);
}
.strip__nav--prev { left: 8px; }
.strip__nav--next { right: 8px; }
.strip__dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.dot { width: 6px; height: 6px; border-radius: 3px; background: var(--line-2); transition: all .3s ease; cursor: pointer; }
.dot.is-active { width: 20px; background: var(--accent-mid); }

/* Xem ảnh lớn */
.lightbox {
  position: fixed; inset: 0; z-index: 60; padding: 20px; cursor: zoom-out;
  display: flex; align-items: center; justify-content: center; background: rgba(30, 42, 62, .92);
}
.lightbox__img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 60px rgba(0, 0, 0, .5)); }
.lightbox__nav {
  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__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}

/* ---------- Đếm ngược ---------- */
.countdown {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 20px 44px; text-align: center; color: #fff;
}
.countdown__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transform-origin: 50% 35%; animation: kenburns 16s ease-in-out infinite alternate; }
.countdown__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(45, 65, 95, 0) 28%, rgba(45, 65, 95, .45) 52%, rgba(30, 42, 62, .86) 100%); }
.countdown__content { position: relative; }
/* Tiêu đề viết tay (Ms Madi, như mục Thank you); số in đứng đều nét (Playfair) cho ngày và đồng hồ */
.countdown__eyebrow { font-family: var(--f-sign); font-size: 40px; line-height: 1.15; letter-spacing: .03em; text-shadow: 0 1px 2px rgba(20, 28, 40, .55), 0 2px 16px rgba(20, 28, 40, .6); }
.countdown__date {
  font-family: var(--f-display); font-weight: 500; font-size: 36px; line-height: 1.1; letter-spacing: .08em;
  font-variant-numeric: lining-nums; margin-top: 12px;
}
.countdown__date i { font-style: normal; margin: 0 .3em; opacity: .65; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 28px; }
.cd__box { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3); border-radius: 14px; padding: 16px 6px 14px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cd__num { font-family: var(--f-display); font-weight: 500; font-size: 34px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.cd__label { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; margin-top: 10px; opacity: .88; }

/* ---------- Xác nhận tham dự ---------- */
.rsvp-done { margin-top: 28px; background: var(--mist); border-radius: 18px; padding: 28px 20px; font-size: 18px; line-height: 1.6; }
.rsvp { margin: 34px auto 0; max-width: 340px; display: flex; flex-direction: column; gap: 26px; align-items: stretch; }
.field-line {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 12px 0;
  font-size: 17px; background: transparent; outline: none; color: var(--ink); text-align: center; transition: border-color .25s;
}
.field-line:focus { border-color: var(--accent); }
.rsvp__choices { display: flex; justify-content: center; gap: 28px; }
.choice {
  background: none; border: 0; border-bottom: 1.5px solid transparent; padding: 6px 2px; cursor: pointer;
  font: inherit; font-size: 16px; letter-spacing: .06em; color: var(--accent-soft); transition: all .25s;
}
.choice.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.rsvp__guests { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 15px; color: var(--label); letter-spacing: .06em; }
.stepper { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; color: var(--accent-strong); font-size: 18px; line-height: 1; cursor: pointer; }
.rsvp__count { min-width: 22px; text-align: center; font-family: var(--f-display); font-size: 22px; color: var(--ink); }
.btn-solid {
  align-self: center; margin-top: 4px; border: 0; border-radius: 999px; padding: 14px 38px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; letter-spacing: .22em; text-transform: uppercase;
}
.btn-solid:hover { background: var(--label); }

/* ---------- Mừng cưới ---------- */
.gifts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.gift { background: #fff; border-radius: 18px; padding: 18px 14px; box-shadow: 0 10px 30px rgba(80, 105, 140, .08); }
.gift__who { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: var(--label); }
/* Mã QR in trên con tem thư xưa: giấy ngà, mép răng cưa đục lỗ, khung in mảnh, dán hơi nghiêng.
   Không phủ gì lên mã → vẫn quét bình thường. */
.gift__qr {
  --r: 4.5px; /* bán kính lỗ đục */
  --paper: #fbf7ee;
  margin-top: 14px; padding: calc(1.5 * var(--r) + 9px);
  background:
    radial-gradient(var(--r), #0000 98%, var(--paper)) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
    linear-gradient(var(--paper) 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
  filter: drop-shadow(0 1px 1.5px rgba(35, 50, 75, .28)) drop-shadow(0 6px 10px rgba(80, 105, 140, .14));
  transform: rotate(var(--tilt, 0deg));
}
.gift:nth-child(1) .gift__qr { --tilt: -2deg; }
.gift:nth-child(2) .gift__qr { --tilt: 1.5deg; }
.gift__qr img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff;
  outline: 1px solid rgba(106, 134, 166, .55); outline-offset: 5px;
}
.gift__name { font-size: 16px; font-weight: 600; margin-top: 16px; white-space: nowrap; }
.gift__bank { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
/* Số tài khoản: số đứng, mỗi chữ số rộng bằng nhau cho thẳng hàng */
.gift__acc {
  margin-top: 2px; font-family: var(--f-sans); font-size: 15px; font-weight: 600; letter-spacing: .03em;
  font-variant-numeric: lining-nums tabular-nums; color: var(--accent-strong);
}
@media (max-width: 360px) {
  .gifts { grid-template-columns: 1fr; max-width: 250px; margin-left: auto; margin-right: auto; }
}
.btn-copy {
  margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--accent-mid); border-radius: 999px; background: #fff; color: var(--accent-strong);
  font: inherit; font-size: 14px; cursor: pointer;
}
.btn-copy:hover { background: var(--mist); }

/* ---------- Sổ lưu bút ---------- */
/* Cây lưu bút: cây tim vẽ SVG, mỗi lời chúc treo thành thẻ tên trên cành (vị trí do app.js đặt) */
.tree { position: relative; max-width: 340px; margin: 18px auto 0; container-type: inline-size; }
.tree__art { display: block; width: 100%; height: auto; }
.tree__tags { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; transform: translateX(-50%); transform-origin: 50% 0; animation: tagSway 5s ease-in-out var(--d, 0s) infinite; }
.tag::before { content: ''; display: block; width: 1px; height: calc(var(--s, 14) * 1px); margin: 0 auto; background: #a48c79; }
@supports (width: 1cqw) { .tag::before { height: calc(var(--s, 14) / 320 * 100cqw); } }
.tag span {
  display: block; max-width: 84px; padding: 3px 9px 4px; border-radius: 6px; background: #fffdf8;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05), 0 4px 10px rgba(80, 105, 140, .2);
  font-family: var(--f-sign); font-size: 17px; line-height: 1.2; color: var(--accent-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag.is-new { animation: tagDrop .8s cubic-bezier(.3, 1.4, .5, 1) both, tagSway 5s ease-in-out .8s infinite; }
@keyframes tagSway { 0%, 100% { transform: translateX(-50%) rotate(-4deg); } 50% { transform: translateX(-50%) rotate(4deg); } }
@keyframes tagDrop { from { opacity: 0; transform: translateX(-50%) translateY(-28px); } to { opacity: 1; transform: translateX(-50%); } }
@supports (width: 1cqw) { .tag span { max-width: 26cqw; font-size: clamp(13px, 5cqw, 17px); } }
.tree__note { margin: 4px auto 0; max-width: 300px; font-style: italic; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* Ô viết lời chúc: thẻ trắng bo tròn, ô chữ nền xanh nhạt */
.wish-form {
  display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 22px auto 0; padding: 16px; text-align: left;
  background: #fff; border-radius: 20px; box-shadow: 0 12px 28px rgba(80, 105, 140, .12);
}
.wish-form__msg {
  width: 100%; min-height: 96px; padding: 12px 14px; border: 0; border-radius: 14px; outline: none; resize: vertical;
  background: var(--mist); font-family: var(--f-serif); font-style: italic; font-size: 18px; line-height: 1.55; color: var(--ink);
}
.wish-form__msg:focus { box-shadow: 0 0 0 2px rgba(111, 138, 168, .35); }
.wish-form__row { display: flex; align-items: center; gap: 10px; }
.wish-form__name {
  flex: 1; min-width: 0; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; outline: none;
  background: transparent; font-family: var(--f-serif); font-size: 18px; color: var(--ink);
}
.wish-form__name:focus { border-bottom-color: var(--accent); }
.wish-form__msg::placeholder, .wish-form__name::placeholder { color: var(--accent-soft); }
.wish-form__send {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 500; letter-spacing: .03em; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(80, 105, 140, .28);
}
.wish-form__send:hover { background: var(--accent-strong); }
.wish-form__send svg { width: 15px; height: 15px; }
@media (max-width: 340px) {
  .wish-form__row { flex-wrap: wrap; }
  .wish-form__send { width: 100%; justify-content: center; }
}

/* Lời chúc đã gửi: thẻ trắng có trái tim nhỏ đổi màu như lá trên cây */
.wishes { display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 22px auto 0; text-align: left; }
.wish {
  position: relative; padding: 16px 18px 12px 42px; border-radius: 16px; background: #fff;
  box-shadow: 0 6px 16px rgba(80, 105, 140, .1);
}
.wish::before {
  content: ''; position: absolute; left: 16px; top: 20px; width: 15px; height: 13px; background: var(--leaf, #e9b7c0);
  clip-path: path('M7.5 13S0 8.6 0 4.1C0 1.7 1.9 0 3.9 0 5.4 0 6.7.9 7.5 2.1 8.3.9 9.6 0 11.1 0 13.1 0 15 1.7 15 4.1 15 8.6 7.5 13 7.5 13z');
}
.wish:nth-child(4n + 2) { --leaf: #c9d6e4; }
.wish:nth-child(4n + 3) { --leaf: #b9cfbf; }
.wish:nth-child(4n + 4) { --leaf: #f3d6dc; }
.wish.is-new { animation: fadeSlide .6s ease both; }
.wish__msg { font-size: 18px; line-height: 1.55; font-style: italic; color: var(--ink); overflow-wrap: anywhere; }
.wish__name { margin-top: 4px; text-align: right; font-family: var(--f-sign); font-size: 24px; color: var(--accent-strong); overflow-wrap: anywhere; }

/* ---------- Lời cảm ơn ---------- */
/* Ảnh 3542: mặt chú rể ở ~40–44% chiều cao ảnh. Khung cao tối thiểu 760px (ảnh co theo chiều cao),
   "Thank you" ở trên, lời cảm ơn dồn xuống dưới → khoảng giữa để trống cho hai bạn. */
.thanks {
  position: relative; min-height: 760px; padding: 52px 28px 60px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; text-align: center; color: #fff;
}
.thanks__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.thanks__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(45, 65, 95, .5) 0%, rgba(45, 65, 95, .12) 28%, rgba(45, 65, 95, .1) 46%, rgba(30, 42, 62, .55) 64%, rgba(30, 42, 62, .85) 100%); }
.thanks__content { position: relative; text-shadow: 0 1px 8px rgba(20, 28, 40, .45); }
/* Chữ viết tay kiểu chữ ký (Ms Madi): cỡ to, giãn chữ cho thoáng */
.thanks__title { font-family: var(--f-sign); font-size: 64px; line-height: 1.1; letter-spacing: .03em; }
.thanks__text { font-family: var(--f-sign); font-size: 28px; line-height: 1.9; letter-spacing: .05em; word-spacing: .08em; margin: 14px auto 0; max-width: 350px; text-wrap: pretty; }
.thanks__names { font-family: var(--f-sign); font-size: 38px; letter-spacing: .04em; margin-top: 26px; color: #dce6f1; }
.thanks__date { font-family: var(--f-display); font-size: 15px; letter-spacing: .3em; margin-top: 8px; }
/* Màn hẹp: chữ nhỏ lại để cụm dưới không cao lên tới mặt chú rể */
@media (max-width: 360px) {
  .thanks__text { font-size: 24px; line-height: 1.8; }
  .thanks__names { font-size: 32px; }
}

/* ---------- Màn nhỏ / thấp (theo báo cáo QA) ---------- */
/* Màn thấp: đẩy ảnh hero xuống để "Welcome to our wedding" nằm trên đầu chú rể, không chạm tóc */
@media (max-height: 700px) { .hero__bg { top: -3%; bottom: auto; } }
@media (max-width: 380px) { .gift__name { font-size: 15px; } }
@media (max-width: 360px) {
  .cal__heart { width: 28px; height: 28px; }
  .cal__dow { font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 340px) { .person__role { white-space: normal; letter-spacing: .12em; } }
/* Màn ngang thấp: bỏ lề quanh màn mở thiệp */
@media (max-height: 500px) { .cover { padding: 0; } .cover__card { border-radius: 0; } }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transition: none; }
  .countdown__bg, .seal, .tulip, .print__tulip, .petals, .tag, .music__w1, .music__w2 { animation: none !important; }
  .petals { display: none; }
  .hero__bg { animation: none; transform: none; }
}
