/* TRANG GIỚI THIỆU ivt.onl (T140) — server/landing.js dựng HTML. Màu theo theme app (src/theme.ts) + logo
   (thiep-xinh-mark.svg). Chuyển động dùng đúng "từ vựng" hiệu ứng của thiệp: viết tay (mép mực mềm quét
   theo chiều đọc, tuyến tính — writeSoft), vẽ nét (dash trên pathLength=1), quét hiện (mép mềm, inOut
   cubic — wipeSoft), đánh máy, hạt bay, lơ lửng, đóng dấu sáp, mở phong bì như màn mở thiệp. */

:root {
  --cream: #F6F2EC;
  --paper: #FBF8F1;
  --surface: #EFE8E0;
  --line: #E2D7CA;
  --ink: #26202A;
  --dim: #655C70;
  --rose: #E8A0A6;
  --rose-2: #F6E1E3;
  --crimson: #B0355A;
  --gold: #D4AF37;
  --plum: #1E1B22;
  --plum-2: #141216;
  --leaf: #2D6A4F;
  --leaf-2: #95C4A8;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --inout: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 17px/1.65 var(--sans); overflow-x: hidden; }
/* Lớp trang trí tràn mép (vầng sáng 440px sau ảnh tính năng .feat-vis::before) không được nới bề ngang trang: trên điện thoại
   overflow-x:hidden của body không chặn vuốt ngang ⇒ trang trượt ngang khi cuộn. `clip` không tạo khung cuộn — nav sticky vẫn chạy. */
main { overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; } /* height:auto — ảnh mang width/height (giữ chỗ) mà CSS chỉ đặt bề ngang thì không bị kéo dãn */
a { color: var(--crimson); }
button { font: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
.center { text-align: center; }
h2 { font: 600 clamp(34px, 4.4vw, 56px)/1.08 var(--serif); letter-spacing: -.01em; margin: .25em 0 .35em; }
.eyebrow { font: 600 12.5px/1.3 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--crimson); margin: 0; }
.lead { font-size: clamp(16px, 1.3vw, 19px); color: var(--dim); max-width: 640px; margin: 0 0 1em; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- icon nét (vẽ nét khi cuộn tới) */
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.draw * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .ic.draw *, .in.ic.draw * { animation: drawLine 1.8s var(--inout) .25s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- gợi ý ngôn ngữ */
.suggest { position: relative; z-index: 60; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 48px; background: var(--plum); color: #F5F1EA; font-size: 14px; text-align: center; }
.suggest[hidden] { display: none; }
.suggest a { color: var(--rose); font-weight: 600; text-decoration: none; }
.suggest-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; background: none; border: 0; color: #B9AEB6; font-size: 22px; cursor: pointer; }

/* ---------------------------------------------------------------- thanh điều hướng */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px; padding: 12px max(20px, calc((100vw - 1180px) / 2 + 20px)); background: rgba(246, 242, 236, .8); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.nav.scrolled { border-color: var(--line); box-shadow: 0 8px 26px -20px rgba(43, 21, 24, .45); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 19px/1 var(--sans); color: var(--ink); text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: block; flex: none; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; opacity: .78; transition: opacity .2s, color .2s; }
.nav-links a:hover { opacity: 1; color: var(--crimson); }
.lang { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .6); }
.lang:hover { border-color: var(--rose); color: var(--crimson); }

/* ---------------------------------------------------------------- nút */
.btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 13px 24px; font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 0; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.btn:hover { transform: translateY(-2px); }
.btn .ic { width: 20px; height: 20px; }
.btn-store { background: var(--plum); color: #fff; padding: 10px 22px 10px 14px; box-shadow: 0 12px 26px -12px rgba(30, 27, 34, .7); }
.btn-store .store-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.btn-store .store-tx { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.btn-store small { font-weight: 500; font-size: 11px; opacity: .7; letter-spacing: .04em; }
.btn-store.is-soon { cursor: default; }
.btn-store.is-soon:hover { transform: none; }
/* Huy hiệu App Store CHÍNH THỨC (T217, site/badges/ — App Store Marketing Tools): nguyên bản Apple, không bo / đổ bóng / hiệu ứng
   khi rê chuột; cao ≥ 40px (Apple) — 54px như nút cũ; khoảng trống ¼ chiều cao (~14px) = gap 14px của .cta. */
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { display: block; height: 54px; width: auto; }
.store-badge:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; border-radius: 10px; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 24px -18px rgba(43, 21, 24, .5); }
.btn-ghost .ic { color: var(--crimson); fill: var(--rose-2); }
.btn-light { background: #fff; color: var(--plum); }
.btn-light .store-ic { background: var(--rose-2); }
.btn-sm { padding: 6px 14px 6px 6px; font-size: 13px; box-shadow: none; }
.btn-sm .store-ic { width: 28px; height: 28px; }
.btn-sm small { display: none; }
.replay { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; color: var(--crimson); font-weight: 600; font-size: 14px; cursor: pointer; }
.replay .ic { width: 16px; height: 16px; }
.replay.light { color: var(--rose); margin-top: 18px; }

/* ---------------------------------------------------------------- khung điện thoại */
.phone { position: relative; width: 300px; aspect-ratio: 1320 / 2868; border-radius: 50px; padding: 11px; background: linear-gradient(150deg, #2c2732, #121015 60%); box-shadow: inset 0 0 0 1.5px #3c3542, 0 44px 80px -34px rgba(43, 21, 24, .6), 0 18px 38px -20px rgba(43, 21, 24, .35); flex: none; }
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 39px; overflow: hidden; background: var(--paper); }
.phone iframe, .phone .shot { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.island { position: absolute; top: 21px; left: 50%; width: 29%; height: 23px; transform: translateX(-50%); background: #050505; border-radius: 20px; pointer-events: none; }
.phone.sm { width: 262px; border-radius: 44px; padding: 10px; }
.phone.sm .screen { border-radius: 34px; }
.phone.xs { width: 168px; border-radius: 30px; padding: 7px; }
.phone.xs .screen { border-radius: 23px; }

/* ---------------------------------------------------------------- HERO */
.hero { position: relative; overflow: hidden; padding: 48px 0 96px; isolation: isolate; }
.sky { position: absolute; inset: -10% -10% 0; z-index: -3; background:
  radial-gradient(38% 46% at 78% 34%, rgba(232, 160, 166, .42), transparent 72%),
  radial-gradient(30% 36% at 8% 86%, rgba(212, 175, 55, .16), transparent 72%),
  radial-gradient(40% 40% at 50% 0%, rgba(255, 255, 255, .7), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 36px; align-items: center; }
.hero h1 { margin: .3em 0 .4em; font-weight: 600; }
.h1a { display: block; font: 600 clamp(40px, 4.5vw, 66px)/1.04 var(--serif); letter-spacing: -.015em; }
.h1b { display: block; font: 400 clamp(34px, 4.6vw, 68px)/1.2 var(--script); color: var(--crimson); padding: .02em .12em .1em 0; margin-left: -.03em; }
.hero .lead { max-width: 560px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 28px; }
.cta.center { justify-content: center; }

/* VIẾT TAY (như hiệu ứng "write" của thiệp): mask cao bằng chữ, dài 2 lần + mép mềm .9em; dời mask từ
   phải sang trái ⇒ mép mực chạy theo chiều đọc với tốc độ đều. */
.write { -webkit-mask-image: linear-gradient(90deg, #000 calc(50% - .45em), transparent calc(50% + .45em)); mask-image: linear-gradient(90deg, #000 calc(50% - .45em), transparent calc(50% + .45em));
  -webkit-mask-size: calc(200% + .9em) 100%; mask-size: calc(200% + .9em) 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.ready .write { animation: write 2.4s linear .5s forwards; }
@keyframes write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* ĐÁNH MÁY: landing.js tách ký tự thành <span>, mỗi ký tự hiện sau ký tự trước --tw ms. */
[data-type] .ch { opacity: 0; }
/* Không dùng steps(1): sai số dấu phẩy động ở mốc cuối làm vài ký tự kẹt ở 0. */
.ready [data-type] .ch { animation: typeIn .08s linear forwards; animation-delay: calc(var(--n) * 38ms + .1s); }
[data-type]::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -.15em; background: var(--crimson); opacity: 0; }
.ready [data-type]::after { animation: caret .9s steps(1) 3 .1s; }
@keyframes typeIn { to { opacity: 1; } }
@keyframes caret { 0% { opacity: 1; } 50% { opacity: 0; } }

.hero-tx .h1a, .hero-tx .lead, .hero-tx .cta, .hero-tx .stats { opacity: 0; transform: translateY(22px); }
.ready .hero-tx .h1a { animation: slideUp .9s var(--ease) .15s forwards; }
.ready .hero-tx .lead { animation: slideUp .9s var(--ease) 1.1s forwards; }
.ready .hero-tx .cta { animation: slideUp .9s var(--ease) 1.3s forwards; }
.ready .hero-tx .stats { animation: slideUp .9s var(--ease) 1.5s forwards; }
@keyframes slideUp { to { opacity: 1; transform: none; } }

.stats { display: flex; flex-wrap: wrap; gap: 14px 34px; list-style: none; padding: 0; margin: 36px 0 0; }
.stats li { display: flex; flex-direction: column; }
.stats b { font: 600 38px/1 var(--serif); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.stats b i { font-size: 30px; font-style: normal; color: var(--crimson); margin-left: 2px; }
.stats li > span { font-size: 13.5px; color: var(--dim); margin-top: 4px; }

/* Nhánh lá: thân VẼ NÉT, lá mọc dần (zoomIn) — gợi đúng mẫu "Hoa lá nét mảnh" của thiệp demo. */
.branch { position: absolute; z-index: -1; width: 300px; pointer-events: none; }
.branch.b1 { top: 10px; left: -40px; }
.branch.b2 { right: -36px; bottom: -6px; transform: rotate(180deg); }
.branch .stem { fill: none; stroke: var(--leaf); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.branch .leaves ellipse { fill: var(--leaf); opacity: 0; transform-box: fill-box; transform-origin: center; }
.branch .leaves ellipse:nth-child(even) { fill: var(--leaf-2); }
.ready .branch .stem { animation: drawLine 2.6s var(--inout) .2s forwards; }
.ready .branch .leaves ellipse { animation: leafIn .9s var(--ease) forwards; }
.ready .branch .leaves ellipse:nth-child(1) { animation-delay: .7s; }
.ready .branch .leaves ellipse:nth-child(2) { animation-delay: 1s; }
.ready .branch .leaves ellipse:nth-child(3) { animation-delay: 1.3s; }
.ready .branch .leaves ellipse:nth-child(4) { animation-delay: 1.6s; }
.ready .branch .leaves ellipse:nth-child(5) { animation-delay: 1.9s; }
.ready .branch .leaves ellipse:nth-child(6) { animation-delay: 2.2s; }
@keyframes leafIn { from { opacity: 0; scale: .2; } to { opacity: .9; scale: 1; } }

/* HẠT BAY: cánh hoa, tim, lấp lánh (landing.js rải). */
.particles { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.pt { position: absolute; top: -40px; left: var(--x); width: var(--s); height: var(--s); opacity: 0; background: center / contain no-repeat; animation: fall var(--d) linear var(--delay) infinite; }
.pt.petal { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1C16 5 16 13 10 19 4 13 4 5 10 1Z' fill='%23EDB1B6'/%3E%3Cpath d='M10 4v12' stroke='%23F6D3D6' stroke-width='1'/%3E%3C/svg%3E"); }
.pt.heart { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 17S2.5 12.4 2.5 7.4A3.9 3.9 0 0 1 10 5.2a3.9 3.9 0 0 1 7.5 2.2C17.5 12.4 10 17 10 17Z' fill='%23D9798A'/%3E%3C/svg%3E"); }
.pt.spark { top: var(--y); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0C10.8 5.6 14.4 9.2 20 10 14.4 10.8 10.8 14.4 10 20 9.2 14.4 5.6 10.8 0 10 5.6 9.2 9.2 5.6 10 0Z' fill='%23D4AF37'/%3E%3C/svg%3E"); animation: twinkle var(--d) ease-in-out var(--delay) infinite; }
@keyframes fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  8% { opacity: .85; }
  92% { opacity: .85; }
  100% { opacity: 0; transform: translate3d(var(--sway), var(--fall, 900px), 0) rotate(var(--rot)); }
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 50% { opacity: .95; transform: scale(1) rotate(45deg); } }

.hero-vis { position: relative; display: flex; justify-content: center; align-items: center; min-height: 700px; }
.hero-phone { width: 318px; z-index: 2; opacity: 0; transform: translateY(40px) scale(.96); }
.ready .hero-phone { animation: rise 1.1s var(--ease) .3s forwards, float 7s ease-in-out 1.4s infinite; }
@keyframes rise { to { opacity: 1; transform: none; } }
/* LƠ LỬNG (hiệu ứng lặp "float" của thiệp). */
/* transform (không phải `translate`): các khung lệch vị trí bằng `translate`/`rotate` vẫn giữ chỗ khi lơ lửng. */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero-vis .phone.back.tilt { position: absolute; width: 236px; z-index: 1; left: 50%; top: 50%; translate: -112% -44%; rotate: -9deg; opacity: 0; }
.ready .hero-vis .phone.back.tilt { animation: fadeIn 1s ease .9s forwards; }
@keyframes fadeIn { to { opacity: .97; } }
.chip { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 15px 10px 10px; border-radius: 18px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 20px 40px -22px rgba(43, 21, 24, .55), 0 0 0 1px rgba(226, 215, 202, .7); font-size: 14px; line-height: 1.3; color: var(--ink); white-space: nowrap; opacity: 0; }
.chip b { font-weight: 700; }
.chip .ic { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--rose-2); color: var(--crimson); }
.chip .av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2D6A4F, #52866D); color: #fff; font-weight: 700; font-size: 12.5px; }
.chip .qr { width: 34px; height: 34px; border-radius: 6px; background:
  conic-gradient(from 90deg at 3px 3px, #26202A 90deg, transparent 0) 0 0 / 11px 11px,
  linear-gradient(#fff, #fff); box-shadow: inset 0 0 0 3px #fff; outline: 1px solid var(--line); }
.c-rsvp { top: 12%; right: -3%; }
.c-open { bottom: 25%; right: -8%; }
.c-qr { bottom: 11%; left: -2%; }
.ready .c-rsvp { animation: dropIn .9s var(--ease) 2.2s forwards, float 6s ease-in-out 3.2s infinite; }
.ready .c-open { animation: zoomIn .8s var(--ease) 2.7s forwards, float 7s ease-in-out 3.6s infinite; }
.ready .c-qr { animation: slideUpChip .9s var(--ease) 3.1s forwards, float 6.5s ease-in-out 4.1s infinite; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-40px); } 70% { opacity: 1; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes slideUpChip { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.hero-note { position: absolute; bottom: -54px; left: 0; right: 0; margin: 0; text-align: center; font-size: 13.5px; color: var(--dim); }

/* ---------------------------------------------------------------- hiện dần khi cuộn tới */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform 1s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- dải mẫu + các dịp */
.occ { padding: 96px 0 90px; background: linear-gradient(180deg, var(--cream), #fff 30%, #fff 70%, var(--cream)); }
.marquee { display: grid; gap: 20px; margin: 44px 0 40px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.mq-row { overflow: hidden; }
.mq-track { display: flex; gap: 20px; padding-right: 20px; width: max-content; animation: marquee 90s linear infinite; }
.mq-row.rev .mq-track { animation-direction: reverse; animation-duration: 100s; }
.marquee:hover .mq-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tpl { margin: 0; width: 162px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 16px 30px -20px rgba(43, 21, 24, .55), 0 0 0 1px rgba(226, 215, 202, .6); transition: transform .35s var(--ease); flex: none; }
.tpl:hover { transform: translateY(-8px) rotate(-1.5deg); }
.tpl img { width: 100%; height: 100%; object-fit: cover; }
.occasions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; padding: 0 20px; margin: 0 auto; max-width: 980px; }
.occasions li { padding: 7px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink); opacity: 0; transform: scale(.7); }
.occasions.in li { animation: pop .5s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms); }
.occasions.in { transform: none; }
@keyframes pop { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- tính năng */
.features { padding: 100px 0 80px; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 50px 0; }
.feat.flip .feat-tx { order: 2; }
.feat-tx { max-width: 500px; }
.feat.flip .feat-tx { justify-self: end; }
.feat-no { font: italic 500 24px/1 var(--serif); color: var(--crimson); }
.feat h3 { font: 600 clamp(30px, 3.2vw, 44px)/1.1 var(--serif); font-variant-numeric: lining-nums; margin: .2em 0 .45em; }
.feat p { color: var(--dim); margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.tags li { font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px; background: var(--rose-2); color: #8E2443; }
.feat-vis { position: relative; display: flex; justify-content: center; align-items: center; min-height: 600px; isolation: isolate; }
.feat-vis::before { content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, rgba(232, 160, 166, .32), transparent 68%); }
.feat:nth-of-type(even) .feat-vis::before { background: radial-gradient(circle, rgba(149, 196, 168, .32), transparent 68%); }
.feat-vis .phone.sm { width: 286px; }
.feat-vis.duo .phone { translate: -26% 0; z-index: 1; }
.feat-vis.duo .phone.back { position: absolute; translate: 32% 6%; rotate: 7deg; z-index: 0; }
.in .feat-vis .phone { animation: float 8s ease-in-out 1.6s infinite; }
.in .feat-vis .phone.back { animation-delay: 2.4s; }
/* QUÉT HIỆN (wipe "down" của thiệp): màn hình lộ dần từ trên xuống, mép mềm, inOut cubic. */
.phone[data-wipe] .screen { -webkit-mask-image: linear-gradient(180deg, #000 calc(50% - 70px), transparent calc(50% + 70px)); mask-image: linear-gradient(180deg, #000 calc(50% - 70px), transparent calc(50% + 70px));
  -webkit-mask-size: 100% calc(200% + 140px); mask-size: 100% calc(200% + 140px); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 0 100%; mask-position: 0 100%; }
.in .phone[data-wipe] .screen { animation: wipeDown 1.5s var(--inout) .25s forwards; }
.in .phone[data-wipe].back .screen { animation-delay: .7s; }
@keyframes wipeDown { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 18px; list-style: none; padding: 0; margin: 70px 0 0; }
.cell { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 28px 26px; }
.cell .ic { width: 44px; height: 44px; color: var(--crimson); stroke-width: 1.3; }
.cell h4 { font: 600 24px/1.2 var(--serif); font-variant-numeric: lining-nums; margin: 14px 0 6px; }
.cell p { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.6; }
.cell.wide { grid-column: 2 / span 2; grid-row: 2 / span 2; min-height: 330px; background: linear-gradient(160deg, #fff, var(--rose-2)); }
.cell.wide p { max-width: min(330px, 40%); } /* chừa chỗ cho ảnh iPad bên phải (ô 2 cột ở máy tính bảng hẹp) */
.cell .ipad { position: absolute; right: -50px; bottom: -80px; width: 58%; border-radius: 26px; border: 10px solid #1d1a21; box-shadow: 0 30px 60px -30px rgba(43, 21, 24, .6); rotate: -6deg; transition: rotate .6s var(--ease), translate .6s var(--ease); }
.cell.wide:hover .ipad { rotate: -3deg; translate: -10px -10px; }

/* ---------------------------------------------------------------- hiệu ứng (nền tối như icon app) */
.fx { position: relative; overflow: hidden; padding: 110px 0; color: #F5F1EA; background: linear-gradient(160deg, var(--plum) 0%, var(--plum-2) 100%); isolation: isolate; }
.fx-glow { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(40% 50% at 78% 45%, rgba(232, 160, 166, .2), transparent 70%),
  radial-gradient(30% 40% at 12% 90%, rgba(212, 175, 55, .12), transparent 70%); }
.fx .eyebrow { color: var(--rose); }
.fx .lead { color: #BDB2BA; }
.fx-grid { display: grid; grid-template-columns: 1fr auto; gap: 70px; align-items: center; }
.fx-tabs { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 10px; max-width: 520px; }
.fx-tab { position: relative; overflow: hidden; width: 100%; display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px 18px 15px 16px; border-radius: 18px; cursor: pointer; color: inherit; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .08); transition: background .3s, border-color .3s, transform .3s var(--ease); }
.fx-tab:hover { background: rgba(255, 255, 255, .07); }
.fx-tab .ic { width: 30px; height: 30px; color: var(--rose); margin-top: 1px; }
.fx-tab b { display: block; font: 600 21px/1.2 var(--serif); }
.fx-tab small { display: block; color: #BDB2BA; font-size: 14px; margin-top: 3px; }
.fx-tab.on { background: rgba(232, 160, 166, .12); border-color: rgba(232, 160, 166, .5); transform: translateX(6px); }
.fx-tab .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold)); }
.fx-tab.on .bar { animation: bar var(--dwell, 8s) linear forwards; }
.fx.paused .fx-tab .bar { animation-play-state: paused; }
.fx.manual .fx-tab .bar { animation: none; width: 0; }
@keyframes bar { to { width: 100%; } }
.fx-vis { display: flex; flex-direction: column; align-items: center; }
.fx-phone { width: 330px; box-shadow: inset 0 0 0 1.5px #3c3542, 0 50px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .05); }
.fx-phone .screen { background: #FBF8F1; transition: opacity .35s ease; }
.fx-phone.loading .screen { opacity: 0; }

/* ---------------------------------------------------------------- cách dùng */
.how { padding: 110px 0 90px; }
.steps-wrap { position: relative; margin-top: 50px; }
.steps-line { position: absolute; left: 8%; right: 8%; top: 8px; width: 84%; height: 40px; z-index: 0; overflow: visible; }
.steps-line path { fill: none; stroke: var(--rose); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.steps-wrap.in .steps-line path { animation: drawLine 2.2s var(--inout) .3s forwards; }
.steps { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; list-style: none; padding: 0; margin: 0; }
.step { text-align: center; }
.step h3 { font: 600 28px/1.15 var(--serif); margin: 24px 0 8px; }
.step p { color: var(--dim); margin: 0 auto; max-width: 300px; font-size: 15.5px; }
.step .phone { margin: 0 auto; }
/* ĐÓNG DẤU SÁP: con dấu đỏ viền vàng (như logo) đập xuống. */
.step-seal { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 26px; border-radius: 50%; color: #fff; font: 600 26px/1 var(--serif); font-variant-numeric: lining-nums; background: radial-gradient(circle at 34% 30%, #CF5577, #8E2443 72%); box-shadow: 0 0 0 3px var(--gold), 0 12px 22px -8px rgba(142, 36, 67, .65); opacity: 0; }
.step.in .step-seal { animation: stamp .75s cubic-bezier(.2, 1.5, .4, 1) forwards; animation-delay: calc(var(--i) * .3s + .3s); }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.9) rotate(-24deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- ảnh chụp */
.gallery { padding: 90px 0 100px; background: linear-gradient(180deg, var(--cream), #fff); }
.gal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.gal-nav { display: flex; gap: 10px; }
.gal-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.gal-btn:hover { border-color: var(--rose); color: var(--crimson); transform: scale(1.06); }
.gal-track { display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; list-style: none; margin: 0; padding: 34px max(20px, calc((100vw - 1180px) / 2 + 20px)) 40px; scrollbar-width: none; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-track li { flex: none; scroll-snap-align: center; text-align: center; }
.gal-track .phone.sm { width: 236px; box-shadow: inset 0 0 0 1.5px #3c3542, 0 30px 50px -30px rgba(43, 21, 24, .55); }
.gal-track p { margin: 18px 0 0; font-weight: 600; font-size: 15px; }

/* ---------------------------------------------------------------- hỏi đáp */
.faq { padding: 100px 0 90px; background: #fff; }
.faq-list { margin-top: 34px; }
.faq-list details { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 0 24px; margin: 12px 0; transition: box-shadow .3s, border-color .3s; }
.faq-list details[open] { border-color: var(--rose); box-shadow: 0 18px 40px -30px rgba(176, 53, 90, .5); }
.faq-list summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; font: 400 30px/1 var(--serif); color: var(--crimson); transition: transform .35s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { margin: 0 0 22px; color: var(--dim); }
.more { margin-top: 26px; font-weight: 600; }
.more a { text-decoration: none; }

/* ---------------------------------------------------------------- kết: phong bì mở như màn mở thiệp */
.end { position: relative; overflow: hidden; isolation: isolate; padding: 200px 0 120px; color: #F5F1EA; background: radial-gradient(50% 60% at 50% 30%, rgba(232, 160, 166, .2), transparent 70%), linear-gradient(170deg, #241d27, var(--plum-2)); }
.end .lead { color: #BDB2BA; }
.end h2 { color: #fff; }
/* Phong bì = MÀN MỞ THIỆP THẬT của app (T200, src/services/webExport/introEnvelope.ts — scripts/landing-envelope.cjs sinh
   envelope.css / envelope.js / HTML). #intro trên thiệp là màn phủ toàn màn hình ⇒ ở đây thành khối trong dòng chảy, cảnh nền
   (mặt bàn dưới đèn, bụi sáng) phủ cả section. Mở khi cuộn tới, chạm để xem lại: landing.js (envOpen — nhịp như openEnvelope).
   Đệm trên 200px: chỗ cho thư nhô ~62 % như trên app (tiêu đề phía trên mờ đi lúc mở). */
.end #intro { position: static; display: block; overflow: visible; background: none; }
.end .ixScene { z-index: -1; }
.end .ixStage { margin: 0 auto 38px; padding: 0; gap: 22px; }
.end .env { width: min(330px, 82vw); }
.end .letter img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- chân trang */
.foot { background: var(--plum-2); color: #BDB2BA; padding: 34px 0 40px; font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; }
.foot .brand { color: #F5F1EA; font-size: 17px; }
.foot .logo { width: 30px; height: 30px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 22px; }
.foot nav a { color: #BDB2BA; text-decoration: none; }
.foot nav a:hover { color: var(--rose); }
.foot .copy { margin-left: auto; }

/* ---------------------------------------------------------------- màn nhỏ */
@media (max-width: 1080px) {
  .c-open { right: -2%; }
  .hero-vis .phone.back.tilt { translate: -98% -44%; }
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .lang { margin-left: auto; }
  .hero { padding-top: 26px; }
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-tx { text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .cta, .stats { justify-content: center; }
  .stats li { align-items: center; text-align: center; }
  .hero-vis { min-height: 640px; margin-top: 30px; }
  .feat, .feat.flip { grid-template-columns: 1fr; gap: 26px; padding: 40px 0; }
  .feat.flip .feat-tx { order: 0; justify-self: start; }
  .feat-vis { min-height: 520px; }
  .fx-grid { grid-template-columns: 1fr; gap: 40px; }
  .fx-tabs { max-width: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell.wide { grid-column: 1 / span 2; grid-row: auto; min-height: 330px; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 54px; }
  .steps-line { display: none; }
  .branch { width: 200px; }
  .branch.b1 { top: -46px; left: -96px; opacity: .75; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .nav .btn-store { display: none; }
  .hero-vis { min-height: 590px; }
  .hero-phone { width: 268px; }
  .hero-vis .phone.back.tilt { width: 190px; translate: -96% -46%; }
  .chip { font-size: 12.5px; padding: 8px 12px 8px 8px; }
  .chip .ic, .chip .av, .chip .qr { width: 28px; height: 28px; }
  .c-rsvp { right: 0; top: 6%; }
  .c-open { display: none; }
  .c-qr { left: 0; bottom: 8%; }
  .hero-note { bottom: -58px; padding: 0 10px; }
  .phone.sm, .feat-vis .phone.sm { width: 220px; }
  .feat-vis { min-height: 480px; }
  .feat-vis.duo .phone { translate: -16% 0; }
  .feat-vis.duo .phone.back { translate: 22% 7%; }
  .bento { grid-template-columns: 1fr; }
  .cell.wide { grid-column: auto; min-height: 0; padding-bottom: 0; }
  .cell.wide p { max-width: none; }
  /* Ô hẹp: ảnh iPad nằm DƯỚI chữ (đặt tuyệt đối thì đè lên chữ), ló khỏi mép dưới ô. */
  .cell .ipad { position: relative; right: auto; bottom: auto; width: 92%; margin: 32px -34px -140px auto; }
  .fx-phone { width: 290px; }
  .fx-tab small { display: none; }
  .fx-tab b { font-size: 19px; }
  .gal-track .phone.sm { width: 210px; }
  .foot .copy { margin-left: 0; }
}

/* ---------------------------------------------------------------- ít chuyển động */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .mq-track { animation: none !important; }
  .particles { display: none; }
  .write { -webkit-mask-image: none; mask-image: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
