/* Thiệp nhà gái — Vân Ly & Tuấn Anh — tông đỏ rượu vang */
:root {
  --wine: #890000;
  --wine-dark: #5c0a0f;
  --ivory: #f4efe6;
  --ink: #1f1414;
  --muted: #7a6a66;
  --f-script: "Great Vibes", cursive;
  --f-serif: "Cormorant Upright", "Times New Roman", serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --card-w: 480px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #e8e1d6; color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; height: 100vh; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
p { margin: 0; }

.card { max-width: var(--card-w); margin: 0 auto; background: #fff; overflow: hidden; box-shadow: 0 0 50px rgba(60, 20, 10, .18); min-height: 100vh; }
section { position: relative; text-align: center; padding: 56px 24px; }

/* Hoa SVG */
.fl { position: absolute; pointer-events: none; overflow: visible; filter: drop-shadow(0 4px 6px rgba(40, 0, 0, .25)); }

/* Hiệu ứng xuất hiện */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============ PHONG BÌ ============ */
.envelope-screen {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f3eee6 70%, #e9e1d4 100%);
  cursor: pointer; transition: opacity .9s ease .35s, visibility .9s ease .35s; outline: none;
}
.env-wrap { position: relative; width: min(88vw, 420px); transition: transform 1s cubic-bezier(.6, -.2, .3, 1); }
.env { width: 100%; height: auto; display: block; overflow: visible; }
.env-name { font-family: var(--f-script); font-size: 30px; fill: #fff; }
.fl-env-l { width: 46%; height: 34%; left: -9%; bottom: -12%; }
.fl-env-r { width: 50%; height: 36%; right: -10%; bottom: -10%; transform: scaleX(-1); }
.tap-hint { margin-top: 48px; font-family: var(--f-serif); font-size: 18px; letter-spacing: 2px; color: var(--wine); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.envelope-screen.open .env-wrap { transform: translateY(-14vh) scale(1.12); }
.envelope-screen.open { opacity: 0; visibility: hidden; }
.envelope-screen.open .tap-hint { opacity: 0; }

/* ============ HERO ============ */
.hero { padding: 54px 20px 40px; background: #fff; }
.kicker { font-family: var(--f-serif); font-size: 20px; font-weight: 600; letter-spacing: 5px; text-transform: uppercase; color: var(--wine); }
.kicker::before, .kicker::after { content: ""; display: inline-block; width: 34px; height: 1px; background: var(--wine); vertical-align: middle; margin: 0 12px; opacity: .6; }
.names { margin: 18px 0 8px; font-weight: 400; line-height: 1.05; }
.names span { display: block; font-family: var(--f-script); font-size: 60px; color: var(--wine); }
.names .and { font-size: 34px; color: var(--wine); margin: 6px 0; }
.duo { position: relative; height: 380px; margin-top: 26px; }
.frame { position: absolute; margin: 0; width: 54%; background: #fff; padding: 6px; border: 6px solid #7a0c12; border-radius: 6px; box-shadow: 0 12px 26px rgba(60, 10, 10, .25); }
.frame img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; background: #f1e9e2; }
.f1 { left: 4%; top: 0; transform: rotate(-6deg); }
.f2 { right: 3%; top: 64px; transform: rotate(5deg); }
.fl-hero-l { width: 44%; height: 32%; left: -8%; bottom: -26px; z-index: 2; }
.fl-hero-r { width: 22%; height: 22%; right: -6%; bottom: 0; z-index: 2; }

/* ============ GIA ĐÌNH ============ */
.family { padding: 30px 24px 50px; }
.fam-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.fam-grid h3 { margin: 0 0 6px; font-family: var(--f-serif); font-size: 21px; font-weight: 600; color: var(--ink); }
.fam-grid p { font-family: var(--f-serif); font-size: 16px; white-space: nowrap; font-weight: 500; color: var(--wine); line-height: 1.7; }
.couple { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; }
.couple > div { flex: 1; }
.couple .role { display: block; font-family: var(--f-serif); font-size: 16px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); }
.couple .full { display: block; font-family: var(--f-script); font-size: 29px; color: var(--wine); line-height: 1.2; }
.couple .heart { color: var(--wine); font-size: 18px; }

/* ============ NỀN NHUNG ĐỎ ============ */
.velvet {
  color: #fff; padding: 58px 22px 46px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 15%, #9a1520 0%, #7c0d16 45%, #55070d 100%);
}
.invite { font-family: var(--f-serif); font-size: 22px; line-height: 1.35; }
#guestName { font-weight: 600; }
.party { margin: 22px 0 18px; font-family: var(--f-serif); font-weight: 500; font-size: 32px; letter-spacing: 1px; text-transform: uppercase; }
.time { font-family: var(--f-serif); font-size: 23px; font-weight: 500; }
.date { font-family: var(--f-serif); font-size: 36px; font-weight: 600; letter-spacing: 4px; margin-top: 4px; }
.lunar { font-family: var(--f-body); font-size: 14px; font-weight: 300; opacity: .8; margin-top: 6px; }
.venue { margin-top: 28px; font-family: var(--f-serif); font-size: 21px; font-weight: 600; text-transform: uppercase; line-height: 1.35; }
.addr { margin-top: 10px; font-family: var(--f-body); font-size: 14px; font-weight: 300; opacity: .95; }
.map { margin-top: 26px; background: #fff; padding: 6px; border-radius: 4px; }
.map iframe { display: block; width: 100%; height: 300px; border: 0; }
.btn-map { display: inline-block; margin-top: 18px; padding: 10px 22px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; color: #fff; text-decoration: none; font-family: var(--f-body); font-size: 13px; letter-spacing: .5px; }
.btn-map:hover { background: rgba(255, 255, 255, .12); }

/* ============ LỊCH ============ */
.cal-sec { padding: 46px 30px 56px; }
.calendar { position: relative; z-index: 1; border: 1.5px solid #1f1414; border-radius: 6px; padding: 18px 22px 10px; background: #fff; }
.cal-title { font-family: var(--f-script); font-size: 34px; padding-bottom: 8px; border-bottom: 1.5px solid #1f1414; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); font-family: var(--f-body); font-size: 14px; color: var(--ink); }
.cal-grid .wd { font-weight: 700; padding: 12px 0; border-bottom: 1.5px solid #1f1414; margin-bottom: 6px; }
.cal-grid span { height: 44px; display: flex; align-items: center; justify-content: center; position: relative; }
.cal-grid .sun { font-weight: 700; }
.cal-grid .hl { font-weight: 700; color: var(--wine); }
.cal-grid .hl::before {
  content: ""; position: absolute; width: 40px; height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.6-4.5-9.6-9.2C.9 7.8 3 4 6.6 4c2.2 0 3.7 1.3 5.4 3.3C13.7 5.3 15.2 4 17.4 4 21 4 23.1 7.8 21.6 11.3 19.6 16 12 20.5 12 20.5z' fill='none' stroke='%23890000' stroke-width='1.1'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: beat 1.6s ease-in-out infinite;
}
.cal-grid .end { border-top: 2px solid #1f1414; grid-column: 1 / -1; height: 8px; margin-top: 4px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.fl-cal { width: 44%; height: 30%; right: -8%; bottom: 0; transform: scaleX(-1); z-index: 2; }

/* ============ LỄ THÀNH HÔN ============ */
.ceremony { padding: 34px 24px 60px; }
.c-lead { font-family: var(--f-serif); font-size: 25px; color: var(--ink); }
.c-place { font-family: var(--f-serif); font-size: 23px; color: var(--wine); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.c-label { font-family: var(--f-serif); font-size: 21px; color: var(--ink); margin-top: 22px; }
.c-day { font-family: var(--f-serif); font-size: 23px; color: var(--wine); font-weight: 500; margin-top: 10px; }
.c-date { font-family: var(--f-serif); font-size: 32px; font-weight: 600; color: var(--wine); letter-spacing: 2px; }
.c-lunar { font-family: var(--f-body); font-size: 14px; font-weight: 300; color: var(--wine); margin-top: 4px; }
.c-addr { font-family: var(--f-body); font-size: 15px; color: var(--ink); margin-top: 26px; }

/* ============ ALBUM ============ */
.album { padding: 46px 16px 52px; background: var(--ivory); }
.script-title { font-family: var(--f-script); font-size: 44px; color: var(--wine); margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid button { padding: 0; border: 0; background: #e9ddd3; border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; box-shadow: 0 6px 16px rgba(60, 10, 10, .12); }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.grid button:hover img { transform: scale(1.04); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(15, 5, 5, .95); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.lightbox button { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .75); font-size: 13px; letter-spacing: 2px; }

/* ============ CẢM ƠN ============ */
.thanks { padding: 0; }
.thanks img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%; background: #e9ddd3; }
.thanks::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(30, 0, 0, .72)); pointer-events: none; }
.thanks-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 26px 34px; color: #fff; }
.thanks-text .ty { font-family: var(--f-script); font-size: 64px; line-height: 1.1; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.thanks-text p:not(.ty) { font-family: var(--f-serif); font-size: 18px; font-weight: 500; line-height: 1.6; margin-top: 6px; }
.foot { text-align: center; padding: 22px; font-family: var(--f-serif); font-size: 17px; font-weight: 500; color: var(--wine); background: #fff; }

#petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

@media (max-width: 360px) {
  .names span { font-size: 50px; }
  .duo { height: 330px; }
  .party { font-size: 27px; }
}
