:root {
  --bg: #d6dbbf;
  --card: #c1c8af;
  --ink: #062424;
  --cream: #faf6f1;
  --page: #b7bf9f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

.card { max-width: 480px; margin: 0 auto; background: var(--bg); overflow: hidden; box-shadow: 0 0 40px rgba(6, 36, 36, .18); }
.caps { text-transform: uppercase; letter-spacing: .04em; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.script { font-family: 'Pinyon Script', cursive; font-weight: 400; line-height: 1.25; }
.names { font-size: clamp(28px, 8.4vw, 40px); text-wrap: balance; }
.title { font-size: 38px; margin: 40px 0 16px; }

/* Ảnh bìa */
.hero { position: relative; aspect-ratio: 2 / 3; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .5)); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 8%; z-index: 1; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.hero-text .names { margin: 2px 0 4px; }
.hero-date { font-size: 18px; letter-spacing: .14em; }

/* Đếm ngược */
.countdown { padding: 30px 16px 34px; }
.clock { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 320px; margin: 18px auto 0; }
.clock b { display: block; font-size: 26px; font-weight: 500; line-height: 1.2; }
.clock span { font-size: 14px; }

/* Lời mời */
.invite { padding: 6px 16px 30px; }
.portrait { width: 64%; aspect-ratio: 2 / 3; object-fit: cover; margin: 0 auto 30px; box-shadow: 0 12px 30px rgba(6, 36, 36, .2); }
.invite .names { margin-top: 8px; }

/* Hai bên gia đình */
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 14px; }
.family img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: 10px; }
.family h3 { font-size: 15px; font-weight: 600; text-transform: uppercase; }
.family p { font-size: 14.5px; }
.family b { font-weight: 600; }
.addr { font-style: italic; margin-top: 2px; }
.divider { width: 170px; margin: 26px auto 30px; opacity: .7; }

/* Lịch cưới */
.event { background: var(--card); border-radius: 10px; padding: 26px 16px 28px; margin: 0 16px 22px; }
.event h3 { font-size: 17px; font-weight: 600; text-transform: uppercase; }
.event-date { display: inline-block; font-size: 22px; font-weight: 600; letter-spacing: .06em; border-top: 1px solid; border-bottom: 1px solid; padding: 2px 12px; margin: 12px 0 6px; }
.pin { width: 28px; height: 28px; margin: 16px auto 2px; }
.place { font-size: 30px; }
.btn-outline { display: inline-block; margin-top: 16px; padding: 6px 52px; border: 1.5px solid; border-radius: 999px; text-decoration: none; text-transform: uppercase; font-size: 13px; letter-spacing: .04em; }

/* Album */
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 10px; }
.album img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; cursor: zoom-in; }
.album img.wide { grid-column: span 2; aspect-ratio: 3 / 2; }
.album img.top { object-position: center 25%; }

/* Lời chúc & xác nhận */
.rsvp { padding: 0 24px 10px; }
.rsvp form { display: grid; gap: 12px; margin-top: 18px; }
.rsvp input, .rsvp textarea, .rsvp select { width: 100%; padding: 10px 18px; border: 1.2px solid var(--ink); border-radius: 22px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.rsvp textarea { border-radius: 16px; resize: vertical; }
.rsvp select { appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23062424' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center / 16px; }
.rsvp ::placeholder { color: rgba(6, 36, 36, .6); }
.btn { padding: 12px; border: 0; border-radius: 22px; background: var(--ink); color: var(--cream); font: inherit; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.btn:disabled { opacity: .6; }
.form-msg { min-height: 1.6em; font-style: italic; }
.wishes { margin-top: 18px; }
.wishes h3 { font-size: 30px; margin-bottom: 10px; }
.wish-list { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; padding-right: 4px; text-align: left; }
.wish { background: rgba(250, 246, 241, .45); border-radius: 12px; padding: 10px 14px; }
.wish-name { font-size: 14px; font-weight: 600; }
.wish-name span { font-weight: 400; font-style: italic; opacity: .75; }

/* Mừng cưới */
.gift-card { display: flex; align-items: center; gap: 14px; margin: 0 22px; padding: 12px; border: 1.2px solid var(--ink); border-radius: 10px; text-align: left; }
.qr { width: 46%; flex-shrink: 0; background: #fff; border-radius: 4px; }
.gift-info { font-size: 14px; }
.acc-name { font-weight: 600; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid; }
.acc-no { font-weight: 600; letter-spacing: .04em; }
.btn-copy { margin: 6px 0 10px; padding: 3px 12px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }

/* Lời cảm ơn */
.thanks { position: relative; margin-top: 44px; }
.thanks img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.thanks-text { position: absolute; left: 0; right: 0; top: 40%; padding: 18px 18px 22px; background: rgba(250, 246, 241, .55); }
.thanks-text h2 { font-size: 40px; }
.thanks-text p { font-size: 15px; font-style: italic; }

.footer { padding: 28px 16px 90px; }
.footer .script { font-size: 30px; }

/* Nút nhạc */
.music { position: fixed; bottom: 18px; right: max(14px, calc(50% - 226px)); z-index: 10; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--ink); color: var(--cream); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; opacity: .75; }
.music svg { width: 22px; height: 22px; }
.music.playing { opacity: 1; }
.music.playing svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Xem ảnh phóng to */
.lightbox { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; padding: 12px; border: 0; background: none; color: #fff; font-size: 42px; line-height: 1; cursor: pointer; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 6px; right: 10px; }

/* Hiện dần khi cuộn tới */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .music.playing svg { animation: none; }
}
