/* =========================================================
   Tấn Lộc & Tuyết Nhung — Online wedding invitation
   Concept: photobooth · burgundy · calla lily
   ========================================================= */

:root {
  --wine: #3a0307;
  --wine-2: #52080f;
  --wine-3: #6d1520;
  --cream: #f7f0e6;
  --paper: #fbf7f1;
  --ink: #4a0b12;
  --muted: #8a6a66;
  --gold: #d2b07a;
  --line: rgba(74, 11, 18, .14);

  --f-script: "Great Vibes", "Snell Roundhand", cursive;
  --f-serif: "Cormorant Garamond", "Times New Roman", serif;
  --f-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --w: 480px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--cream);
  background: #1b0104;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; }

.script { font-family: var(--f-script); font-weight: 400; font-style: normal; }

/* Desktop backdrop — blurred photo behind the phone-width page */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: url("../assets/photos/sm/p35.jpg") center/cover no-repeat;
  filter: blur(28px) brightness(.45) saturate(1.1);
  transform: scale(1.15);
}

.page {
  position: relative;
  max-width: var(--w);
  margin: 0 auto;
  background: var(--wine);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, .55);
}

/* ---------- Lilies ---------- */
.lily { position: absolute; pointer-events: none; overflow: visible; }
.lily use { transform-origin: 50% 100%; }
.lily--hero {
  width: 150px; height: 240px;
  left: -48px; bottom: 60px;
  animation: sway 7s ease-in-out infinite;
  transform-origin: 30% 100%;
}
.lily--album {
  width: 130px; height: 210px;
  right: -40px; top: 10px;
  transform: scaleX(-1) rotate(-6deg);
  opacity: .9;
}
@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(3deg); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px;
  border: 1px solid var(--wine); border-radius: 999px;
  background: var(--wine); color: var(--cream);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none;
  transition: transform .25s var(--ease), background .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn--light { background: var(--cream); color: var(--wine); border-color: var(--cream); }
.btn--ghost { background: transparent; color: var(--wine); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 11px; letter-spacing: .1em; }
.btn:focus-visible, .ic:focus-visible, .chip input:focus-visible + span, .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 64px 24px 72px;
  text-align: center;
  background: radial-gradient(90% 45% at 50% 0%, rgba(109, 21, 32, .55), transparent 70%), var(--wine);
}
.hero__std {
  margin: 0;
  font-size: clamp(48px, 15vw, 64px); line-height: 1.1;
  color: var(--cream);
}
.hero__names {
  display: grid; gap: 0;
  width: min(100%, 330px); margin: 18px auto 34px;
  font-family: var(--f-serif); font-weight: 500;
  font-size: clamp(24px, 7.4vw, 31px); letter-spacing: .06em; text-transform: uppercase;
  line-height: 1.2;
}
.hero__n1 { justify-self: start; }
.hero__n2 { justify-self: end; margin-top: -6px; }
.hero__and { position: relative; justify-self: start; display: flex; align-items: center; margin-top: -4px; }
.hero__and i { display: block; width: 58px; height: 1px; background: linear-gradient(90deg, transparent, var(--cream)); }
.hero__and em { font-size: 34px; text-transform: none; letter-spacing: 0; margin-left: -4px; color: var(--cream); }

/* Photobooth printer */
.booth { position: relative; width: 220px; margin: 0 auto; }
.booth__slot {
  position: relative; z-index: 3;
  height: 42px; margin: 0 -26px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 -2px 0 rgba(0, 0, 0, .06);
  display: grid; place-items: center;
}
.booth__slot span {
  width: 85%; height: 7px; border-radius: 6px;
  background: #1a0204;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .8);
}
.booth__mask { position: relative; z-index: 2; margin-top: -20px; overflow: hidden; padding: 0 0 20px; }
.strip {
  background: var(--paper);
  color: var(--ink);
  padding: 30px 12px 16px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .35);
  transform: translateY(-100%);
  transition: transform 3.2s cubic-bezier(.45, .05, .2, 1);
}
.is-printed .strip { transform: translateY(0); }
.strip__title { margin: 0; font-size: 36px; line-height: .95; color: var(--ink); }
.strip__song { margin: 10px 0 0; font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.strip__artist { margin: 0; font-size: 11px; color: var(--muted); }

.player { margin-top: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.player__bar { position: relative; height: 14px; cursor: pointer; display: flex; align-items: center; }
.player__bar::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(74, 11, 18, .15); border-radius: 2px; }
.player__fill { position: relative; height: 2px; width: 0; background: var(--ink); border-radius: 2px; }
.player__fill span { position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--ink); }
.player__time { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.player__ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 0 2px; }
.ic {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  opacity: .55; transition: opacity .2s, transform .2s;
}
.ic svg { width: 17px; height: 17px; }
.ic.is-on, .ic:hover { opacity: 1; }
.ic--main { width: 40px; height: 40px; opacity: 1; background: var(--ink); color: var(--cream); box-shadow: 0 6px 14px rgba(58, 3, 7, .35); }
.ic--main svg { width: 18px; height: 18px; }
.ic:active { transform: scale(.92); }

.strip__photos { display: grid; gap: 10px; margin-top: 14px; }
.strip__photos img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; cursor: zoom-in; }
.strip__foot { margin: 14px 0 0; font-family: var(--f-serif); font-size: 12px; letter-spacing: .18em; font-weight: 600; line-height: 1.5; }
.strip__foot span { color: var(--wine-3); }
.strip__foot small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .3em; }

/* ---------- Generic sections ---------- */
.sec { position: relative; padding: 72px 24px; text-align: center; }
.sec--paper { background: var(--paper); color: var(--ink); }
.title-script { margin: 0; font-size: clamp(42px, 12vw, 52px); line-height: 1.1; }
.sub { margin: 6px auto 0; max-width: 340px; font-size: 13px; color: rgba(247, 240, 230, .72); }
.sec--paper .sub, .modal .sub { color: var(--muted); }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--wine-3); }

/* Invitation */
.invite__lead {
  margin: 18px auto 0; max-width: 360px;
  font-family: var(--f-serif); font-style: italic; font-size: 19px; line-height: 1.5; color: var(--ink);
}
.couple { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 40px; }
.couple__item { margin: 0; flex: 1 1 0; max-width: 170px; }
.couple__amp { font-size: 46px; color: var(--wine-3); margin-top: -40px; }
.arch { aspect-ratio: 3 / 4.3; border-radius: 999px 999px 8px 8px; overflow: hidden; border: 1px solid var(--line); padding: 5px; background: #fff; }
.arch img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 5px 5px; }
.couple figcaption { margin-top: 12px; }
.couple figcaption small { display: block; font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.couple figcaption strong { display: block; font-family: var(--f-serif); font-size: 22px; font-weight: 600; }

/* Countdown */
.countdown { background: radial-gradient(90% 60% at 50% 100%, rgba(109, 21, 32, .6), transparent 70%), var(--wine); }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 340px; margin: 28px auto 0; }
.cd div { padding: 14px 0 10px; border: 1px solid rgba(210, 176, 122, .4); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.cd b { display: block; font-family: var(--f-serif); font-size: 32px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.cd span { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

.cal { max-width: 320px; margin: 36px auto 0; padding: 20px 18px; background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: 0 16px 30px rgba(0, 0, 0, .3); }
.cal__head { margin: 0 0 12px; font-family: var(--f-serif); font-size: 20px; font-weight: 600; letter-spacing: .08em; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; font-size: 12px; }
.cal__grid .dow { font-size: 10px; font-weight: 600; letter-spacing: .05em; color: var(--muted); padding-bottom: 4px; }
.cal__grid span { position: relative; display: grid; place-items: center; height: 32px; }
.cal__grid .mark { color: var(--cream); font-weight: 600; z-index: 0; }
.cal__grid .mark svg { position: absolute; z-index: -1; width: 32px; height: 32px; color: var(--wine-3); animation: beat 1.6s ease-in-out infinite; }
.cal__grid .mark.main svg { color: var(--wine); }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }

/* Events — ticket cards */
.ticket {
  position: relative; margin: 34px auto 0; max-width: 380px;
  background: #fff; border-radius: 16px; overflow: hidden; text-align: center;
  box-shadow: 0 18px 40px rgba(74, 11, 18, .12);
}
.ticket__photo { aspect-ratio: 16 / 10; overflow: hidden; }
.ticket__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ticket__body { position: relative; padding: 26px 20px 24px; border-top: 2px dashed var(--line); }
.ticket__body::before, .ticket__body::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper);
}
.ticket__body::before { left: -12px; }
.ticket__body::after { right: -12px; }
.ticket__kicker { margin: 0; font-family: var(--f-serif); font-size: 28px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wine); }
.ticket__date { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.ticket__date i { width: 1px; height: 14px; background: var(--line); }
.ticket__venue { margin: 0; font-family: var(--f-serif); font-size: 19px; font-weight: 600; }
.ticket__addr { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ticket__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Album — photobooth strips */
.album { padding-bottom: 60px; }
.album__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin-top: 34px; align-items: start; }
.pstrip {
  background: var(--paper); padding: 8px 8px 0; box-shadow: 0 14px 26px rgba(0, 0, 0, .35);
  transform: rotate(var(--r, 0deg));
  transition: transform .4s var(--ease);
}
.pstrip:nth-child(even) { margin-top: 36px; }
.pstrip:hover { transform: rotate(0deg) scale(1.02); }
.pstrip img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 7px; cursor: zoom-in; background: #e9e0d6; }
.pstrip p { margin: 0; padding: 4px 0 8px; font-family: var(--f-script); font-size: 18px; color: var(--ink); line-height: 1.2; }
.album__more { margin-top: 36px; }

/* RSVP form */
.form { max-width: 380px; margin: 30px auto 0; text-align: left; }
.field { display: block; margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field > span, .field > legend { display: block; margin-bottom: 8px; padding: 0; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: 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='%234a0b12' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 40px;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--wine-3); box-shadow: 0 0 0 3px rgba(109, 21, 32, .12); }
.field.is-error input { border-color: #b3261e; }
.chips { display: grid; gap: 8px; }
.chips--3 { grid-template-columns: repeat(3, 1fr); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; cursor: pointer; transition: all .2s;
}
.chip input:checked + span { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.form__msg { min-height: 1.4em; margin: 0 0 10px; font-size: 13px; text-align: center; color: var(--wine-3); }
.form__msg.is-ok { font-family: var(--f-serif); font-size: 17px; font-style: italic; }
.form__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* Thanks */
.thanks { position: relative; background: var(--wine); }
.thanks img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
.thanks__over {
  position: relative; margin-top: -40px;
  padding: 0 24px calc(64px + env(safe-area-inset-bottom));
  text-align: center;
}
.thanks h2 { margin: 0; font-size: 64px; line-height: 1; }
.thanks p { margin: 8px 0 0; font-size: 13px; letter-spacing: .12em; }
.thanks__names { font-family: var(--f-serif); font-size: 18px !important; letter-spacing: .24em !important; text-transform: uppercase; color: var(--gold); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 20px;
  background: rgba(20, 1, 3, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease;
}
.modal__card {
  position: relative; width: 100%; max-width: 380px; max-height: calc(100vh - 40px); overflow: auto;
  padding: 30px 20px 22px; border-radius: 20px;
  background: var(--paper); color: var(--ink); text-align: center;
  animation: rise .4s var(--ease);
}
.modal__card h3 { margin: 0; font-size: 44px; line-height: 1.1; }
.modal__x, .lb__x {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent;
}
.modal__x svg, .lb__x svg { width: 22px; height: 22px; }
.tabs { display: inline-flex; margin: 16px 0 14px; padding: 4px; border-radius: 999px; background: rgba(74, 11, 18, .07); }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.tab.is-on { background: var(--wine); color: var(--cream); }
.qr img { width: 100%; max-height: 56vh; object-fit: contain; border-radius: 14px; }
.qr__hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: rgba(15, 1, 2, .94);
  animation: fade .3s ease;
  touch-action: pan-y;
}
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb__x { color: var(--cream); top: calc(10px + env(safe-area-inset-top)); }
.lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--cream);
}
.lb__nav svg { width: 22px; height: 22px; }
.lb__prev { left: 10px; }
.lb__next { right: 10px; }
.lb__count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; letter-spacing: .2em; color: rgba(247, 240, 230, .7); }

/* ---------- Floating buttons ---------- */
.fab {
  position: fixed; z-index: 40;
  right: max(14px, calc(50vw - var(--w) / 2 + 14px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 10px;
}
.fab__btn {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid rgba(210, 176, 122, .5); border-radius: 50%;
  background: rgba(58, 3, 7, .82); color: var(--cream);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
.fab__btn svg { width: 20px; height: 20px; }
.fab__music.is-playing svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* YouTube player kept alive but invisible */
.yt-hidden { position: fixed; width: 200px; height: 200px; left: 0; bottom: 0; z-index: -2; opacity: .01; pointer-events: none; }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

.pstrip.is-in { transform: rotate(var(--r, 0deg)); }
.pstrip.is-in:hover { transform: rotate(0deg) scale(1.02); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.98); } }

@media (min-width: 520px) {
  .page { margin-block: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
