/* ============================================================
   BẢN CINEMATIC — ảnh full màn hình · kem ấm · chữ vàng đồng
   ============================================================ */
:root {
  --cream: #f8f1ed;
  --cream-2: #f2e7e0;
  --ink: #3b3232;
  --ink-soft: #7d6f6a;
  --gold: #9c5a1a;
  --gold-2: #c09455;
  --gold-3: #e8d29b;
  --dark: #332b2b;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --display: "Playfair Display", "Cormorant Garamond", serif;
  --script: "Italianno", "Great Vibes", cursive;
  --sans: "Be Vietnam Pro", -apple-system, "Segoe UI", sans-serif;

  --col: 460px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--serif); color: var(--ink); background: #ded5d0;
  font-size: 17px; line-height: 1.6; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; border: 0; background: none; }

.page { width: 100%; max-width: var(--col); margin: 0 auto; background: var(--cream); position: relative; overflow: hidden; box-shadow: 0 0 60px rgba(0,0,0,.25); }

/* ============================================================ INTRO */
#intro {
  position: fixed; inset: 0; z-index: 100; background: var(--dark);
  overflow: hidden;
  transition: opacity 1.2s ease, visibility 1.2s;
}
#intro.done { opacity: 0; visibility: hidden; }
#intro .words { transition: opacity .5s ease; }
#intro .photo {
  position: absolute; inset: 0; background-size: cover; background-position: center 35%;
  opacity: 0; transform: scale(1.12);
  transition: opacity 1.6s ease, transform 6s cubic-bezier(.2,.5,.2,1);
}
#intro.reveal .photo { opacity: 1; transform: scale(1); }
#intro .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,32,32,.45) 0%, rgba(40,32,32,.1) 35%, rgba(40,32,32,.55) 75%, rgba(40,32,32,.8) 100%); opacity: 0; transition: opacity 1.6s ease; }
#intro.reveal .shade { opacity: 1; }

/* chữ intro dùng chung layout với chữ hero → chuyển cảnh không bị lệch */
.words { position: absolute; left: 24px; right: 24px; bottom: 128px; z-index: 2; text-align: left; }
.words .w1 { font-family: var(--script); font-size: clamp(50px, 17vw, 78px); line-height: .9; color: #fff; }
.words .w1 b { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 15vw, 68px); color: var(--gold-3); margin-left: .12em; }
.words .w2 { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 15vw, 68px); line-height: 1; color: var(--gold-3); margin-top: -2px; }

#intro .words .w1, #intro .words .w2 { opacity: 0; transform: translateY(24px); animation: wordUp 1.3s cubic-bezier(.2,.7,.2,1) forwards; }
#intro .words .w1 { animation-delay: .45s; }
#intro .words .w2 { animation-delay: 1.05s; }
#intro .words .w1, #intro .words .w1 b, #intro .words .w2 { color: rgba(232,210,155,.45); transition: color 1.6s ease, text-shadow 1.6s ease; }
#intro.reveal .words .w1 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.45); }
#intro.reveal .words .w1 b, #intro.reveal .words .w2 { color: var(--gold-3); text-shadow: 0 2px 20px rgba(0,0,0,.45); }
@keyframes wordUp { to { opacity: 1; transform: none; } }

.intro-foot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 82px; padding: 0 26px; display: flex; justify-content: space-between; font-family: var(--sans); font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: rgba(232,210,155,.7); }
.skip {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  color: #fff; border-radius: 999px; padding: 10px 20px;
  font-family: var(--sans); font-size: 12px; letter-spacing: .22em; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  animation: fadeIn 1s ease 2s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================ HERO */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 35%; animation: slowZoom 18s ease-out both; }
@keyframes slowZoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,32,32,.3) 0%, transparent 30%, rgba(40,32,32,.5) 70%, rgba(40,32,32,.82) 100%); }
.hero .meta { position: absolute; left: 24px; right: 24px; bottom: 82px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; color: rgba(255,255,255,.9); font-family: var(--display); }
.hero .meta .d { font-size: 20px; letter-spacing: .04em; }
.hero .meta .y { font-size: 20px; color: rgba(232,210,155,.85); }
.scroll-cue { position: absolute; left: 50%; bottom: 68px; transform: translateX(-50%); z-index: 3; width: 1px; height: 34px; background: linear-gradient(180deg, transparent, rgba(255,255,255,.7)); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0%,100% { opacity: .2; } 50% { opacity: 1; } }

/* ============================================================ SECTIONS */
section { padding: 62px 30px; text-align: center; position: relative; }
.eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); }
.h-sec { font-family: var(--display); font-size: 20px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 26px; }
.h-script { font-family: var(--script); font-size: clamp(38px, 12vw, 52px); color: var(--gold-2); line-height: 1.05; }
.lead { font-size: 17.5px; line-height: 2; color: var(--ink); max-width: 340px; margin: 18px auto 0; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.squiggle { width: 150px; height: 42px; margin: 26px auto 0; color: var(--ink); }
.squiggle svg { width: 100%; height: 100%; }

/* parents */
.parents { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.parents .t { font-family: var(--display); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.parents .n { font-family: var(--display); font-size: 13px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.9; }
.parents .a { font-size: 14px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }

/* hai chân dung */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.duo figure { position: relative; }
.duo img { width: 100%; aspect-ratio: 3/4.2; object-fit: cover; }
.duo figcaption { font-family: var(--script); font-size: 34px; color: var(--gold-2); margin-top: 8px; line-height: 1.1; }
.duo .role { font-family: var(--sans); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); }

/* story */
.story-photo { margin-top: 26px; }
.story-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 26px; }
.gal figure { overflow: hidden; background: var(--cream-2); cursor: zoom-in; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.gal figure:hover img { transform: scale(1.06); }
.gal .s3 { grid-column: span 3; aspect-ratio: 3/3.6; }
.gal .s2 { grid-column: span 2; aspect-ratio: 3/4; }
.gal .s6 { grid-column: span 6; aspect-ratio: 16/10; }
#lightbox { position: fixed; inset: 0; background: rgba(28,22,22,.95); z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
#lightbox.show { display: flex; }
#lightbox img { max-height: 92vh; max-width: 96vw; object-fit: contain; }

/* save the date */
.save { position: relative; height: 92svh; min-height: 520px; padding: 0; overflow: hidden; }
.save .bg { position: absolute; inset: 0; background-size: cover; background-position: center 40%; }
.save .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,32,32,.25), rgba(40,32,32,.35) 45%, rgba(40,32,32,.85)); }
.save .words { position: absolute; left: 26px; right: 26px; bottom: 54px; z-index: 2; text-align: left; color: #fff; }
.save .s1 { font-family: var(--script); font-size: clamp(46px, 15vw, 66px); line-height: .92; }
.save .s2 { font-family: var(--script); font-size: clamp(46px, 15vw, 66px); line-height: .92; color: var(--gold-3); margin-left: 1.2em; }
.save .time { font-family: var(--display); font-size: 17px; letter-spacing: .16em; text-transform: uppercase; margin-top: 18px; }
.save .date { font-family: var(--display); font-size: clamp(30px, 10vw, 42px); letter-spacing: .06em; color: var(--gold-3); margin-top: 2px; }
.save .lunar { font-family: var(--serif); font-style: italic; font-size: 14px; color: rgba(255,255,255,.8); margin-top: 4px; }

/* lịch */
.cal { margin: 24px auto 0; max-width: 330px; border: 1px solid var(--gold-3); }
.cal .cap { font-family: var(--display); font-size: 15px; letter-spacing: .1em; padding: 11px; border-bottom: 1px solid var(--gold-3); color: var(--gold); }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 6px 4px 10px; }
.cal .grid span { padding: 8px 0; font-size: 14.5px; color: var(--ink); }
.cal .grid .wd { font-family: var(--sans); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); padding-bottom: 8px; }
.cal .grid .today { position: relative; z-index: 0; color: #fff; }
.cal .grid .today::before { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; background: #c96a6a; border-radius: 50%; z-index: -1; }

/* location */
.venue-script { font-family: var(--script); font-size: 52px; color: var(--gold-2); line-height: 1.1; margin: 6px 0 4px; }
.addr { font-size: 15.5px; color: var(--ink-soft); }
.map { margin-top: 18px; aspect-ratio: 4/3; border: 1px solid var(--cream-2); }
.map iframe { width: 100%; height: 100%; border: 0; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  border: 1px solid var(--gold-2); color: var(--gold); padding: 10px 22px;
  font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none; transition: .25s;
}
.link-btn:hover { background: var(--gold-2); color: #fff; }

/* timeline */
.tl { display: grid; gap: 22px; max-width: 300px; margin: 6px auto 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 1px; background: var(--gold-3); transform: translateX(-50%); }
.tl div { display: grid; grid-template-columns: 1fr 12px 1fr; align-items: center; gap: 18px; }
.tl .t { text-align: right; font-family: var(--display); font-size: 18px; color: var(--gold); }
.tl .d { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-2); margin: 0 auto; box-shadow: 0 0 0 4px var(--cream); }
.tl .l { text-align: left; font-size: 16.5px; }

/* countdown */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 26px; }
.cd div { background: var(--cream-2); padding: 14px 4px; }
.cd b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--gold); line-height: 1.1; }
.cd span { font-family: var(--sans); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }

/* ============================================================ LỜI CHÚC BAY */
#wish-layer { position: fixed; left: 0; right: 0; bottom: 74px; z-index: 60; pointer-events: none; max-width: var(--col); margin: 0 auto; height: 220px; overflow: hidden; }
.bubble {
  position: absolute; left: 12px; max-width: 78%;
  display: flex; align-items: center; gap: 8px;
  background: rgba(225,117,117,.5); backdrop-filter: blur(4px);
  color: #fff; border-radius: 999px; padding: 7px 14px 7px 8px;
  font-family: var(--sans); font-size: 13px; line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  animation: rise 9s linear forwards;
}
.bubble .who { font-weight: 700; white-space: nowrap; }
.bubble .av { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 22px; }
.bubble .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes rise { 0% { transform: translateY(220px); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }

/* thanh gửi lời chúc */
/* thanh lời chúc + nút nhạc chỉ hiện sau khi vào thiệp */
body.intro-on #wish-bar, body.intro-on #wish-layer, body.intro-on .fab-music { opacity: 0; pointer-events: none; }
#wish-bar, #wish-layer, .fab-music { transition: opacity .6s ease; }

#wish-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  max-width: var(--col); margin: 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; align-items: center;
  background: linear-gradient(180deg, rgba(248,241,237,0), rgba(248,241,237,.92) 40%);
}
#wish-bar input {
  flex: 1; font: inherit; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: rgba(255,255,255,.9); border: 1px solid var(--cream-2); border-radius: 999px; padding: 11px 16px; outline: none;
}
#wish-bar input:focus { border-color: var(--gold-2); }
#wish-bar button { width: 42px; height: 42px; border-radius: 50%; background: #e17575; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.18); flex: 0 0 42px; }
#wish-bar button svg { width: 18px; height: 18px; fill: currentColor; }
#wish-bar .heart-btn { background: #fff; color: #e17575; }

.fab-music {
  position: fixed; top: 14px; right: 14px; z-index: 80;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.75); backdrop-filter: blur(6px); color: var(--gold);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.fab-music svg { width: 17px; height: 17px; fill: currentColor; }
.fab-music.playing svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { padding: 54px 30px calc(96px + env(safe-area-inset-bottom)); text-align: center; }
footer .th { font-family: var(--script); font-size: 62px; color: var(--gold-2); line-height: 1; }
footer p { font-style: italic; color: var(--ink-soft); font-size: 15.5px; max-width: 300px; margin: 12px auto 0; }
footer .nm { font-family: var(--display); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .bg, #intro .words { transition: opacity .5s ease; }
#intro .photo { animation: none; transform: none; }
  .bubble { animation-duration: 12s; }
}

/* hỏi tên khi link không kèm ?to= */
#name-ask { position: fixed; inset: 0; z-index: 95; background: rgba(40,32,32,.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
#name-ask[hidden] { display: none; }
.na-box { width: 100%; max-width: 420px; background: var(--cream); padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px; text-align: center; animation: naUp .3s ease both; }
@keyframes naUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.na-t { font-family: var(--display); font-size: 20px; color: var(--gold); margin-bottom: 14px; }
#name-input { width: 100%; font: inherit; font-family: var(--sans); font-size: 16px; padding: 12px 16px; border: 1px solid var(--gold-3); border-radius: 999px; background: #fff; outline: none; }
#name-input:focus { border-color: var(--gold-2); }
.na-row { display: flex; gap: 10px; margin-top: 14px; }
.na-row button { flex: 1; padding: 12px; border-radius: 999px; font-family: var(--sans); font-size: 14px; }
#name-cancel { background: var(--cream-2); color: var(--ink-soft); }
#name-ok { background: #e17575; color: #fff; font-weight: 600; }

/* tim bay khi bấm nút ❤ */
.heart-fly { position: fixed; bottom: 70px; z-index: 75; color: #e17575; font-size: 22px; pointer-events: none; animation: heartUp 1.8s ease-out forwards; }
@keyframes heartUp { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), -240px) scale(1.2); opacity: 0; } }
