/* ==========================================================================
   Thiệp mời cưới — "Pink pop"
   Màu: hồng cánh sen + đỏ rượu, chữ đen tím. Thẻ viền dày + bóng đổ cứng.
   ========================================================================== */

:root {
  --hot: #FF4D8D;       /* nền hero / album */
  --deep: #D10A3A;      /* điểm nhấn, nền khối mừng cưới */
  --ink: #2A0A18;       /* chữ, viền */
  --blush: #FFF3F0;     /* nền trang */
  --pink-l: #FFD1E0;    /* nền nhạt, sticker */
  --pink-xl: #FFE3EC;
  --peach: #FFB89A;
  --muted: #6B2A3C;     /* chữ phụ */
  --white: #FFFFFF;

  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-script: 'Pacifico', 'Brush Script MT', cursive;

  --container: 1080px;
  --radius: 24px;
  --border: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--blush);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.script { font-family: var(--font-script); font-weight: 400; }
.center { text-align: center; }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 12px 20px; background: var(--ink); color: var(--white);
  border-radius: 999px; text-decoration: none; font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: 880px; }
.container--form { max-width: 680px; }

/* ---------- Icon / heart helpers ---------- */
.icon {
  width: 26px; height: 26px;
  fill: none; stroke: var(--ink); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--white { stroke: var(--white); }

.heart {
  position: absolute;
  width: var(--s, 32px); height: var(--s, 32px);
  left: var(--x, auto); right: var(--r, auto);
  top: var(--y, auto); bottom: var(--b, auto);
  fill: currentColor;
  pointer-events: none;
}

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-26px) rotate(10deg); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(42, 10, 24, .5); }
  70% { box-shadow: 0 0 0 18px rgba(42, 10, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 10, 24, 0); }
}
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.14); } }

.rise { animation: rise .8s var(--ease) both; }
.d1 { animation-delay: .1s; }
.d2 { animation-delay: .25s; }
.d3 { animation-delay: .4s; }
.d4 { animation-delay: .55s; }
.float-a { animation: floaty 7s ease-in-out infinite; }
.float-b { animation: floaty 9s ease-in-out infinite; animation-delay: -3s; }
.float-c { animation: floaty 11s ease-in-out infinite; animation-delay: -6s; }
.spin { animation: spin 18s linear infinite; }
.pulse { animation: pulse 2.2s ease-out infinite; }
.beat { animation: beat 1.8s ease-in-out infinite; transform-origin: center; }

/* Hiện dần khi cuộn tới (chỉ bật khi JS chạy; xem main.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s ease, transform .7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Buttons / stickers ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 32px;
  border: var(--border); border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.03); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--white { background: var(--white); color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 14px; margin-top: 8px; }
.btn--lg { width: 100%; font-size: 17px; }
.btn[hidden] { display: none; }

.sticker, .kicker {
  display: inline-block;
  border: var(--border); border-radius: 999px;
  font-weight: 700; text-transform: uppercase;
}
.sticker {
  padding: 8px 18px; background: var(--white);
  font-size: 13px; letter-spacing: .14em; transform: rotate(-3deg);
}
.kicker { padding: 6px 16px; font-size: 12px; letter-spacing: .14em; }
.kicker--pink { background: var(--pink-l); }
.kicker--white { background: var(--white); }
.tilt-l-s { transform: rotate(-2deg); }
.tilt-r-s { transform: rotate(2deg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hot); color: var(--ink); }
.hero__hearts { position: absolute; inset: 0; pointer-events: none; }
.hero__inner { position: relative; }

.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; padding: 20px 0; }
.nav__logo {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-script); font-size: 28px; text-decoration: none;
}
.nav__links { display: flex; flex-wrap: wrap; gap: 4px; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .2s ease;
}
.nav__links a:hover { background: var(--white); }

.hero__grid { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding: 40px 0 112px; }
.hero__text { flex: 1 1 440px; min-width: 0; }
.hero__names {
  margin-top: 24px;
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(44px, 7.5vw, 88px); line-height: 1.2;
}
.hero__names span { display: block; overflow-wrap: anywhere; }
.hero__amp { color: var(--white); font-size: .7em; }
.hero__date { margin-top: 28px; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.01em; }
.hero__venue { margin-top: 4px; font-size: 17px; font-weight: 600; }
.hero__address { margin-top: 2px; font-size: 16px; font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero__photo { position: relative; flex: 1 1 300px; max-width: 420px; width: 100%; }
.arch {
  width: 100%; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 999px 999px 28px 28px;
  background: var(--pink-xl); border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 32px;
  font-size: 14px; font-weight: 600;
  transform: rotate(3deg);
}
.arch img, .polaroid__img img, .qr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arch:has(img) { padding: 0; }

.badge { position: absolute; left: -36px; bottom: -28px; width: 132px; height: 132px; }
.badge__ring { position: absolute; inset: 0; width: 100%; height: 100%; font-family: var(--font-body); }
.badge__heart { position: absolute; left: 49px; top: 49px; width: 34px; height: 34px; fill: var(--hot); }

/* ---------- Marquee ---------- */
.marquee { background: var(--ink); color: var(--pink-l); overflow: hidden; padding: 14px 0; white-space: nowrap; }
.marquee:empty, .marquee__track:empty { display: none; }
.marquee__track {
  display: flex; width: max-content;
  font-size: 16px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  animation: marquee 34s linear infinite;
}
.marquee__group { display: flex; flex-shrink: 0; align-items: center; gap: 28px; padding-right: 28px; }
.marquee__heart { width: 18px; height: 18px; fill: var(--pink-l); }

/* ---------- Sections ---------- */
.section { position: relative; padding: 96px 0; }
.section--intro { background: var(--blush); }
.section--info { background: var(--pink-l); }
.section--album { background: var(--hot); padding-bottom: 112px; }
.section--rsvp { background: var(--blush); }
.section--gift { background: var(--deep); color: var(--white); overflow: hidden; }

.h2 {
  margin-top: 20px;
  font-weight: 800; font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15; letter-spacing: -.02em;
}
.accent { color: var(--deep); }
.accent--white { color: var(--white); }
.accent--pink { color: var(--pink-l); }
.lead { margin: 20px auto 0; max-width: 560px; font-size: 18px; color: var(--muted); }
.lead--sm { font-size: 16px; margin-top: 16px; }
.lead--light { margin-left: 0; max-width: 440px; color: var(--pink-xl); }

/* ---------- Countdown ---------- */
.countdown { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 56px; }
.countdown__tile {
  flex: 1 1 120px; max-width: 180px; padding: 20px 8px;
  background: var(--white); border: var(--border); border-radius: 22px; box-shadow: var(--shadow);
}
.countdown__num {
  font-size: clamp(36px, 6vw, 60px); font-weight: 800; line-height: 1;
  color: var(--deep); font-variant-numeric: tabular-nums;
}
.countdown__label { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.countdown__note { margin-top: 24px; font-family: var(--font-script); font-size: 26px; color: var(--deep); }

.families { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 72px; margin-top: 64px; }
.families__role { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.families__name { margin-top: 2px; font-size: 22px; font-weight: 800; }
.families__addr { font-size: 15px; color: var(--muted); }

/* ---------- Info cards ---------- */
.cards { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; margin-top: 56px; }
.card {
  flex: 1 1 280px; padding: 32px;
  background: var(--white); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card__icon {
  width: 56px; height: 56px; border-radius: 50%; border: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.card__icon--hot { background: var(--hot); }
.card__icon--deep { background: var(--deep); }
.card__title { margin-top: 20px; font-size: 26px; font-weight: 800; }
.card__text { margin-top: 8px; color: var(--muted); }

/* QR chỉ đường trong thẻ "Ở đâu?" (đủ lớn để điện thoại quét được) */
.addr-qr { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }
.addr-qr__box {
  width: 140px; height: 140px; overflow: hidden;
  background: var(--white); border: var(--border); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 12px; font-weight: 600; color: var(--ink);
}
.addr-qr__box:has(.ph-label) { background: var(--pink-l); padding: 8px; }
.addr-qr__box svg, .addr-qr__box img { display: block; width: 100%; height: 100%; max-width: none; }
.addr-qr__text { flex: 1 1 140px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.addr-qr + .btn { margin-top: 16px; }

.tilt-l { transform: rotate(-2deg); }
.tilt-r { transform: rotate(2deg); }
.lift { transition: transform .3s var(--ease); }
.lift:hover, .lift.tilt-l:hover, .lift.tilt-r:hover { transform: translateY(-8px) rotate(0deg) scale(1.02); }

/* ---------- Gallery ---------- */
.gallery { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 36px 28px; margin-top: 56px; }
.polaroid {
  flex: 1 1 220px; max-width: 250px; padding: 14px 14px 20px; margin: 0;
  background: var(--white); border: var(--border); border-radius: 6px; box-shadow: var(--shadow);
  transition: transform .35s var(--ease);
}
.polaroid:nth-child(2n) { margin-top: 32px; }
.polaroid:nth-child(4n+1) { transform: rotate(-4deg); }
.polaroid:nth-child(4n+2) { transform: rotate(3deg); }
.polaroid:nth-child(4n+3) { transform: rotate(-2deg); }
.polaroid:nth-child(4n+4) { transform: rotate(4deg); }
.polaroid:hover { transform: rotate(0deg) scale(1.06); }
.polaroid__img {
  aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--pink-l); border: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.polaroid__cap { margin-top: 14px; text-align: center; font-family: var(--font-script); font-size: 18px; }

.polaroid--zoom { cursor: zoom-in; -webkit-user-select: none; user-select: none; }
.polaroid__cap:empty { display: none; }
.polaroid:has(.polaroid__cap:empty) { padding-bottom: 36px; }
.gallery__hint { margin-top: 12px; font-size: 15px; font-weight: 600; }

/* ---------- Xem ảnh lớn (lightbox) ---------- */
html.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: transparent; color: var(--white);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(42, 10, 24, .94); }
.lightbox__figure {
  margin: 0; min-width: 0; max-width: 100%;
  padding: 64px clamp(16px, 9vw, 110px) 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lightbox__img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px);
  background: var(--white); border: 4px solid var(--white); border-radius: 10px;
}
.lightbox__img.is-in { animation: lbIn .3s var(--ease) both; }
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lightbox__cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; text-align: center; }
.lightbox__text { font-family: var(--font-script); font-size: 24px; line-height: 1.3; }
.lightbox__text:empty { display: none; }
.lightbox__count {
  padding: 2px 14px; background: var(--white); color: var(--ink);
  border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: .08em;
}
.lightbox__btn {
  position: absolute; width: 52px; height: 52px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--ink);
  border: var(--border); border-radius: 50%;
  cursor: pointer; transition: background .2s ease, transform .2s ease;
}
.lightbox__btn:hover { background: var(--pink-l); }
.lightbox__btn:focus-visible { outline-color: var(--white); }
.lightbox__btn .icon { width: 24px; height: 24px; stroke-width: 2.5; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav { top: 50%; margin-top: -26px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__nav:hover { transform: scale(1.08); }

/* ---------- RSVP form ---------- */
.rsvp {
  margin-top: 40px; padding: 32px;
  display: flex; flex-direction: column; gap: 24px;
  background: var(--white); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; font-size: 15px; padding: 0; }
.field legend { margin-bottom: 10px; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: var(--border); border-radius: 14px;
  font: inherit; color: var(--ink); background: var(--white);
}
.field textarea { resize: vertical; }
.field input[aria-invalid="true"] { border-color: var(--deep); box-shadow: 0 0 0 3px var(--pink-l); }
.field[hidden] { display: none; }

.choices { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 20px 0 16px;
  border: var(--border); border-radius: 999px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .2s ease;
}
.chip input { width: 20px; height: 20px; margin: 0; accent-color: var(--deep); }
.chip:has(input:checked) { background: var(--pink-l); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__status { min-height: 1.5em; font-weight: 600; color: var(--deep); }
.form__status:empty { min-height: 0; }

.thanks {
  margin-top: 40px; padding: 48px 32px; text-align: center;
  background: var(--hot); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.thanks[hidden] { display: none; }
.thanks__heart { width: 64px; height: 64px; fill: var(--white); stroke: var(--ink); stroke-width: 1.2; }
.thanks__title { margin-top: 16px; font-family: var(--font-script); font-size: 36px; line-height: 1.3; }
.thanks__title:focus { outline: none; }
.thanks__text { margin: 12px 0 24px; font-size: 17px; font-weight: 500; }

/* ---------- Gift / QR ---------- */
.gift { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 56px; max-width: 1000px; }
.gift__text { flex: 1 1 340px; min-width: 0; }
.gift__card-wrap { flex: 0 1 340px; width: 100%; }
.gift__card {
  padding: 32px; text-align: center;
  background: var(--white); color: var(--ink);
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.gift__label { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.qr {
  width: 190px; height: 190px; margin: 20px auto 0; overflow: hidden;
  background: var(--pink-l); border: var(--border); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.gift__name { margin-top: 20px; font-size: 18px; font-weight: 800; }
.gift__bank { font-size: 15px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--white); padding: 72px 0; }
.footer__heart { width: 40px; height: 40px; fill: var(--hot); }
.footer__thanks { margin-top: 12px; font-family: var(--font-script); font-size: clamp(40px, 7vw, 72px); line-height: 1.2; color: var(--pink-l); }
.footer__text { margin-top: 12px; color: var(--pink-xl); }
.footer__tag {
  display: inline-block; margin-top: 28px; padding: 10px 22px;
  border: 2px solid var(--pink-l); border-radius: 999px;
  font-size: 14px; font-weight: 700; letter-spacing: .1em; color: var(--pink-l);
}
.footer__mono { margin-top: 28px; font-family: var(--font-script); font-size: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 72px 0; }
  .hero__grid { gap: 48px; padding-bottom: 88px; }
  .badge { left: -12px; }
  .rsvp { padding: 24px 20px; }
  .polaroid:nth-child(2n) { margin-top: 0; }
  .lightbox__figure { padding: 72px 12px 20px; }
  .lightbox__btn { width: 44px; height: 44px; }
  .lightbox__nav { margin-top: -22px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 12px; right: 12px; }
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}