/* ===== Tokens ===== */
:root {
  --cream: #F6F2E8;
  --paper: #FBF8F1;
  --ink: #2E2A25;
  --muted: #6A645B;
  --sage: #CFD7B8;
  --burg: #60091E;

  /* theo từng nhà (đổi bằng data-side trên <html>) */
  --accent: #60091E;
  --accent-ink: #FFFFFF;
  --soft: #F1E6E4;
  --line: rgba(96, 9, 30, .28);

  --font-script: "Great Vibes", "Snell Roundhand", cursive;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --gutter: max(20px, env(safe-area-inset-left));
}
html[data-side="gai"] {
  --accent: #4E5C3D;
  --soft: #E8EDDA;
  --line: rgba(78, 92, 61, .32);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  overflow-x: clip;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.8rem, 10vw, 4.2rem);
  line-height: 1.1;
  color: var(--accent);
  text-align: center;
  margin-bottom: 2.2rem;
}
.swan {
  display: block;
  width: 96px; height: 58px;
  margin: 0 auto 1.2rem;
  background: var(--accent);
  -webkit-mask: url(../assets/img/ui/swan.png) center / contain no-repeat;
  mask: url(../assets/img/ui/swan.png) center / contain no-repeat;
}
.swan--light { background: #fff; }
.section--rsvp .swan { background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .6rem 1.7rem;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 1.05rem; font-weight: 600; letter-spacing: .06em;
  text-decoration: none;
  transition: transform .25s var(--ease), background-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--accent-ink); }

/* ===== 1. Mở thiệp ===== */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; padding: 24px var(--gutter);
  background: var(--cream);
  overflow: hidden;
  transition: opacity 1s var(--ease), visibility 0s 1s;
}
.intro__glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(207, 215, 184, .75), transparent 70%),
    radial-gradient(45% 40% at 85% 90%, rgba(96, 9, 30, .16), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
.intro__eyebrow, .intro__hint { position: relative; transition: opacity .5s; }
.intro__eyebrow { font-size: .95rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--burg); }
.intro__hint { font-style: italic; color: var(--muted); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.intro.is-opening .intro__hint, .intro.is-opening .intro__eyebrow { opacity: 0; animation: none; }
.intro.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2.6rem;
}
.intro__stage.is-single { gap: 0; }
.intro__stage:not(.is-single) { padding-bottom: 1.6rem; }

/* Phong bì */
.env {
  --ew: min(72vw, 330px);
  --eh: calc(var(--ew) * .68);
  --base: #CFD7B8; --shade-l: #C3CCAB; --shade-r: #C8D1B0; --shade-b: #D8DFC4; --flap: #BEC8A4;
  --ink-env: #55604A; --seal: #60091E; --seal-swan: #F6F2E8;
  position: relative; display: block;
  width: var(--ew); height: var(--eh);
  padding: 0; border: 0; background: none;
  perspective: 1100px;
  transition: transform 1s var(--ease), opacity .7s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.env--trai {
  --base: #60091E; --shade-l: #550719; --shade-r: #5B081C; --shade-b: #6B1126; --flap: #4F0616;
  --ink-env: #F6F2E8; --seal: #CFD7B8; --seal-swan: #60091E;
}
.env:hover:not(.is-open) { transform: translateY(-4px); }
.env.is-away { opacity: 0; transform: scale(.9) translateY(24px); pointer-events: none; }
.env__label {
  position: absolute; left: 0; right: 0; top: calc(100% + .55rem); text-align: center;
  font-size: .95rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  transition: opacity .4s;
}
.env.is-open .env__label, .is-single .env__label { opacity: 0; }
.env > span, .env__body > span { display: block; position: absolute; }
.env__back { inset: 0; background: var(--base); border-radius: 4px; box-shadow: 0 22px 40px -18px rgba(46, 42, 37, .45); filter: brightness(.94); }
.env__slot { z-index: 2; left: 0; width: 100%; top: calc(var(--eh) * -1.5); bottom: 0; overflow: hidden; pointer-events: none; }
.env__card {
  position: absolute; left: 8%; right: 8%; top: calc(var(--eh) * 1.56);
  transition: transform 1.1s var(--ease) .55s;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18));
}
.env__card img { width: 100%; }
.env.is-open .env__card { transform: translateY(calc(var(--eh) * -1.15)); }
.env__pocket { inset: 0; z-index: 3; }
.env__pocket i { position: absolute; inset: 0; }
.env__pocket .l { background: var(--shade-l); clip-path: polygon(0 0, 50% 54%, 0 100%); }
.env__pocket .r { background: var(--shade-r); clip-path: polygon(100% 0, 50% 54%, 100% 100%); }
.env__pocket .b { background: var(--shade-b); clip-path: polygon(0 100%, 50% 54%, 100% 100%); border-radius: 0 0 4px 4px; }
.env__flap {
  z-index: 5; left: 0; top: 0; width: 100%; height: 58%;
  background: var(--flap);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center; backface-visibility: visible;
  transition: transform .8s var(--ease), z-index 0s, background-color .4s;
}
.env.is-open .env__flap { transform: rotateX(180deg); z-index: 1; transition: transform .8s var(--ease), z-index 0s .38s; }
.env__seal {
  z-index: 6; left: 50%; top: 56%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: var(--seal);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3), inset 0 0 0 2px rgba(255, 255, 255, .18);
  transition: opacity .35s, transform .5s var(--ease);
}
.env__seal::after {
  content: ""; position: absolute; inset: 8px 6px;
  background: var(--seal-swan);
  -webkit-mask: url(../assets/img/ui/swan.png) center / contain no-repeat;
  mask: url(../assets/img/ui/swan.png) center / contain no-repeat;
}
.env.is-open .env__seal { opacity: 0; transform: scale(.5); }
.env__names {
  z-index: 4; left: 0; right: 0; bottom: 6%; text-align: center; pointer-events: none;
  color: var(--ink-env); transition: opacity .4s;
}
.env__names b { display: block; font-family: var(--font-script); font-weight: 400; font-size: calc(var(--ew) * .1); line-height: 1.05; }
.env__names small { font-size: .85rem; letter-spacing: .18em; opacity: .85; }
.env.is-open .env__names { opacity: 0; }
.env.is-leaving { transform: translateY(40px) scale(.96); opacity: 0; transition: transform 1s var(--ease), opacity .8s; }
.env.is-leaving .env__card { transform: translateY(calc(var(--eh) * -1.15)); }

@media (min-width: 820px) {
  .intro__stage { flex-direction: row; gap: 6rem; }
  .intro__stage.is-single { gap: 0; }
  .env { --ew: 340px; }
}

/* ===== Chuyển nhà ===== */
.switch {
  position: fixed; z-index: 50; top: max(12px, env(safe-area-inset-top)); left: 50%;
  display: flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translate(-50%, -120%); opacity: 0;
  transition: transform .8s var(--ease) .6s, opacity .8s .6s;
}
body.is-entered .switch { transform: translate(-50%, 0); opacity: 1; }
.switch button {
  min-height: 40px; padding: 0 1.15rem; white-space: nowrap; border: 0; border-radius: 999px; background: transparent;
  font-size: 1rem; font-weight: 600; letter-spacing: .06em; color: var(--muted);
  transition: background-color .3s, color .3s;
}
.switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ===== Cánh hoa rơi ===== */
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.petal {
  position: absolute; top: -6%; left: var(--x);
  width: var(--s); height: calc(var(--s) * 1.35);
  background: var(--pc); border-radius: 85% 0 85% 0; opacity: 0;
  animation: fall var(--t) linear var(--dl) infinite;
}
@keyframes fall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  10% { opacity: .85; }
  100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--r)); opacity: .15; }
}

/* ===== Thanh tiến trình ===== */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: var(--accent); transform-origin: left; transform: scaleX(var(--sp, 0)); pointer-events: none; }

/* ===== 2. Hero ===== */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 1.4rem; padding: 78px var(--gutter) 0; text-align: center;
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 15% 0%, color-mix(in srgb, var(--sage) 70%, transparent), transparent 70%),
    radial-gradient(60% 40% at 100% 55%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(180deg, var(--cream) 0%, var(--soft) 100%);
  transition: background .6s;
}
.hero > * { position: relative; z-index: 2; }
.hero > .petals { position: absolute; z-index: 1; }
.hero__in { opacity: 0; transform: translateY(22px); }
body.is-entered .hero__in { animation: rise 1.1s var(--ease) forwards; animation-delay: calc(.4s + var(--i) * .16s); }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero__text { display: flex; flex-direction: column; align-items: center; }
.hero__text .swan { width: 74px; height: 45px; margin-bottom: .5rem; }
.names { font-family: var(--font-script); font-weight: 400; color: var(--accent); line-height: 1; margin-top: .5rem; display: flex; flex-direction: column; align-items: center; }
.names > span:not(.visually-hidden) { font-size: clamp(3.8rem, 18vw, 6.4rem); display: block; }
.names__amp { font-size: clamp(2rem, 9vw, 3rem) !important; margin: -.05em 0; }
.hero__date { letter-spacing: .32em; font-weight: 600; color: var(--muted); margin-top: .8rem; }
.hero__photo { position: relative; width: clamp(260px, min(78vw, calc((100svh - 360px) * .667)), 520px); margin-top: .6rem; }
.arch { border-radius: 999px 999px 0 0; overflow: hidden; aspect-ratio: 2 / 3; background: var(--sage); }
.arch img { width: 100%; height: 112%; object-fit: cover; object-position: 50% 30%; will-change: transform; }
.arch__outline { position: absolute; inset: -10px -10px 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 999px 999px 0 0; pointer-events: none; }
.scroll-cue {
  position: absolute !important; left: 50%; bottom: 14px; margin-left: -22px; z-index: 3; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; color: #fff; background: color-mix(in srgb, var(--accent) 75%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }

@media (min-width: 900px) {
  .hero {
    flex-direction: row-reverse; justify-content: center; align-items: flex-end; gap: clamp(3rem, 8vw, 8rem);
    height: 100svh; min-height: 640px; padding: 84px 5vw 0; text-align: left;
  }
  .hero__text { align-items: flex-start; align-self: center; padding-bottom: 6vh; }
  .hero__text .swan { margin-left: 0; margin-right: auto; }
  .names { align-items: flex-start; }
  .names > span:not(.visually-hidden) { font-size: clamp(5rem, 8vw, 8rem); }
  .names__amp { padding-left: .9em; margin: .1em 0 .15em !important; }
  .hero__photo { height: 100%; width: auto; max-width: 44vw; aspect-ratio: 2 / 3; margin: 0; }
  .hero__photo .arch { height: 100%; aspect-ratio: auto; }
  .scroll-cue { display: none; }
}

/* ===== Section chung ===== */
.section { position: relative; padding: clamp(4.2rem, 12vw, 7rem) var(--gutter); }
.section > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
[data-reveal], .tl__item { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.is-in { opacity: 1 !important; transform: none !important; }
.title { position: relative; }
/* viền sò (scallop) giống hình dáng thiệp: màu phần trên truyền qua --prev */
.scallop::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 15px; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 0, var(--prev) 13px, transparent 13.6px) 0 0 / 30px 15px repeat-x;
}
.section--timeline { --prev: var(--cream); }
.section--place { --prev: var(--soft); }

/* Khung 2 nét như thiệp in */
.frame-card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 2.4rem 1.4rem 2rem; }
.frame-card::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 16px; pointer-events: none; }

/* ===== Ngày cưới ===== */
.section--date { background: var(--paper); transition: background-color .6s; }
.date__grid { display: grid; gap: 2.4rem; align-items: center; max-width: 960px !important; }
.polaroid { margin: 0 auto; width: min(66vw, 300px); padding: 10px 10px 40px; background: #fff; box-shadow: 0 22px 40px -20px rgba(46, 42, 37, .5); transform: rotate(-3deg); position: relative; }
.polaroid::after { content: ""; position: absolute; left: 50%; top: -14px; width: 84px; height: 26px; margin-left: -42px; background: color-mix(in srgb, var(--sage) 80%, #fff); opacity: .85; transform: rotate(3deg); }
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.polaroid.is-in { transform: rotate(-3deg) !important; }
.paper {
  position: relative; text-align: center; padding: 2rem 1rem 1.8rem; border-radius: 22px; color: #2a2622;
  background-color: #F3EFE6;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='5' seed='7' stitchTiles='stitch' result='t'/><feDiffuseLighting in='t' lighting-color='%23ffffff' surfaceScale='.9' result='l'><feDistantLight azimuth='50' elevation='62'/></feDiffuseLighting><feComponentTransfer in='l'><feFuncR type='linear' slope='.3' intercept='.7'/><feFuncG type='linear' slope='.3' intercept='.7'/><feFuncB type='linear' slope='.3' intercept='.7'/></feComponentTransfer></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-blend-mode: multiply;
  box-shadow: 0 24px 44px -24px rgba(46, 42, 37, .55), inset 0 0 0 1px rgba(46, 42, 37, .06);
}
/* monogram kiểu thiệp: hai chữ cái lệch nhau + trái tim vẽ tay */
.mono { position: relative; height: 7.6rem; max-width: 280px; margin: 0 auto; font-family: var(--font-serif); font-weight: 500; color: #25211d; }
.mono__a, .mono__b { position: absolute; font-size: 4.6rem; line-height: 1; }
.mono__a { left: 14%; top: 0; }
.mono__b { left: 52%; top: 3.1rem; }
.mono__heart { position: absolute; left: 40%; top: .35rem; width: 40px; height: 38px; color: #5c564d; transform: rotate(-8deg); }
.tagline { font-family: var(--font-script); font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1.25; margin: .3rem 0 1.4rem; color: #25211d; }

/* lịch viết tay: tuần bắt đầu từ CN, số mờ hơi lệch, trái tim khoanh ngày cưới */
.cal { max-width: 340px; margin: 0 auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.cal__dow { font-family: "Space Mono", ui-monospace, monospace; font-weight: 700; font-size: .85rem; letter-spacing: .02em; padding-bottom: .5rem; color: #2a2622; }
.cal__day {
  position: relative; display: grid; place-items: center; height: 2.8rem;
  font-family: "Caveat", "Segoe Print", cursive; font-size: 1.75rem; line-height: 1; color: #a39d92;
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--r, 0deg));
}
.cal__day.is-main { color: #25211d; font-weight: 500; }
.cal__day svg { position: absolute; left: 50%; top: 50%; width: 3.4rem; height: 3.2rem; margin: -1.65rem 0 0 -1.75rem; pointer-events: none; overflow: visible; }
.cal__day .heart { color: #3b3631; transform: rotate(-6deg); }
.cal__day .ring { color: #5c564d; width: 2.7rem; height: 2.7rem; margin: -1.4rem 0 0 -1.35rem; }
.cal__day svg path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) .5s; }
.paper.is-in .cal__day svg path { stroke-dashoffset: 0; }
.date__caption { margin-top: 1.1rem; letter-spacing: .12em; text-transform: uppercase; font-family: "Space Mono", ui-monospace, monospace; font-weight: 700; font-size: .8rem; color: #2a2622; }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; max-width: 340px; margin: 1.3rem auto 0; }
.count div { padding: .5rem .2rem; border-top: 1px solid rgba(46, 42, 37, .22); }
.count b { display: block; font-family: "Caveat", cursive; font-size: clamp(2rem, 8vw, 2.5rem); font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums; color: #25211d; }
.count small { font-family: "Space Mono", ui-monospace, monospace; font-weight: 700; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #6a645b; }
@media (min-width: 820px) {
  .date__grid { grid-template-columns: 1fr 1.15fr; gap: 4rem; }
  .polaroid { width: min(100%, 330px); }
}

/* ===== Dải ảnh toàn màn hình ===== */
.band { position: relative; height: 80svh; min-height: 440px; overflow: hidden; background: #2a2622; }
.band--short { height: 64svh; min-height: 380px; }
.band img { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; object-fit: cover; object-position: 50% 35%; will-change: transform; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 28%, transparent 60%, rgba(0, 0, 0, .5)); pointer-events: none; }
.band__text { position: absolute; z-index: 2; left: 0; right: 0; bottom: 14%; text-align: center; color: #fff; font-family: var(--font-script); font-size: clamp(3.2rem, 13vw, 5.6rem); line-height: 1.1; text-shadow: 0 4px 24px rgba(0, 0, 0, .35); }

/* ===== Album (bố cục xen kẽ nhiều hình dáng) ===== */
.section--album { background: var(--cream); overflow: hidden; }
.section--album .title { color: var(--accent); }
.collage { display: grid; grid-template-columns: repeat(12, 1fr); max-width: 1000px !important; }
.cl { position: relative; margin: 0; }
.lb { display: block; width: 100%; padding: 0; border: 0; background: none; }
.shape { display: block; position: relative; overflow: hidden; background: var(--sage); }
.shape img { width: 100%; height: 112%; object-fit: cover; will-change: transform; transition: filter .6s; }
.lb:hover .shape img { filter: saturate(1.1) brightness(1.03); }
.shape--arch { aspect-ratio: 2 / 3; border-radius: 999px 999px 8px 8px; }
.shape--circle { aspect-ratio: 1; border-radius: 50%; }
.shape--oval { aspect-ratio: 3 / 4; border-radius: 50%; }
.shape--card {
  aspect-ratio: 760 / 1022; background: var(--accent);
  -webkit-mask: url(../assets/img/ui/card-gai.webp) center / 100% 100% no-repeat; mask: url(../assets/img/ui/card-gai.webp) center / 100% 100% no-repeat;
}
.cl--a { grid-column: 1 / span 8; }
.cl--a::after, .cl--d::after { content: ""; position: absolute; inset: 10px -10px -10px 10px; border: 1px solid var(--line); z-index: -1; }
.cl--a::after { border-radius: 999px 999px 8px 8px; }
.cl--d::after { border-radius: 50%; }
.cl--b { grid-column: 6 / span 7; margin-top: -2.4rem; z-index: 1; }
.cl--b .shape { box-shadow: 0 0 0 6px var(--cream), 0 18px 34px -16px rgba(46, 42, 37, .5); }
.cl--c { grid-column: 2 / span 8; margin-top: 2.4rem; }
.cl--d { grid-column: 5 / span 8; margin-top: -2.2rem; }
@media (min-width: 820px) {
  .collage { gap: 0 2rem; }
  .cl--a { grid-column: 1 / span 4; }
  .cl--b { grid-column: 5 / span 4; margin-top: 7rem; }
  .cl--c { grid-column: 9 / span 4; margin-top: 1rem; }
  .cl--d { grid-column: 3 / span 4; margin-top: -3rem; }
}

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; padding: 0; border: 0; background: rgba(20, 17, 15, .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(20, 17, 15, .94); }
.lightbox img { max-width: 94vw; max-height: 90dvh; object-fit: contain; border-radius: 4px; }
.lightbox__btn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; line-height: 1; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .26); }
.lightbox__close { top: 16px; right: 16px; font-size: 1.2rem; }
.lightbox__prev { left: 12px; top: 50%; margin-top: -24px; }
.lightbox__next { right: 12px; top: 50%; margin-top: -24px; }

/* ===== Timeline ===== */
.section--timeline { background: var(--soft); transition: background-color .6s; }
.tlwrap { display: grid; gap: 2.6rem; max-width: 900px !important; }
.tlphoto { position: relative; margin: 0 auto; width: min(66vw, 300px); }
.arch--sm img { height: 108%; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; --p: 0; }
.tl::before, .tl::after { content: ""; position: absolute; top: 30px; bottom: 30px; left: 29px; width: 2px; }
.tl::before { background: var(--line); }
.tl::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); }
.tl__item { position: relative; display: grid; grid-template-columns: 60px 1fr; column-gap: 1rem; padding: 0 0 1.4rem; }
.tl__item:last-child { padding-bottom: 0; }
.tl__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--paper); border: 1px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--soft); }
.tl__dot svg { width: 26px; height: 26px; }
.tl__body { padding: .9rem 1.2rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.tl__time { font-size: 2rem; font-weight: 500; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl__title { font-size: 1.3rem; font-weight: 600; margin-top: .3rem; }
.tl__note { color: var(--muted); font-style: italic; }
.tl__day { display: block; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: .35rem; }
@media (min-width: 900px) {
  .tlwrap { grid-template-columns: 340px 1fr; gap: 4.5rem; align-items: start; }
  .tlphoto { position: sticky; top: 96px; width: 100%; margin: 0; }
}

/* ===== Địa điểm ===== */
.section--place { background: var(--paper); text-align: center; transition: background-color .6s; }
.place { max-width: 620px !important; padding-top: 2.6rem; }
.place__name { font-family: var(--font-script); font-size: clamp(2.8rem, 11vw, 4.2rem); line-height: 1.15; color: var(--accent); }
.place__hall { letter-spacing: .2em; text-transform: uppercase; font-weight: 600; font-size: 1rem; margin-top: .4rem; }
.place__addr { margin-top: .6rem; max-width: 30ch; margin-inline: auto; }
.place__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.6rem; }
.map { margin-top: 2rem !important; max-width: 820px !important; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.85); }
@media (min-width: 820px) { .map { aspect-ratio: 16 / 9; } }

/* ===== RSVP ===== */
.section--rsvp { background: var(--accent); color: #fff; transition: background-color .6s; overflow: hidden; }
.section--rsvp::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 40% at 100% 0%, rgba(255, 255, 255, .12), transparent 70%), radial-gradient(45% 35% at 0% 100%, rgba(0, 0, 0, .22), transparent 70%); pointer-events: none; }
.section--rsvp .title { color: #fff; }
.rsvp-wrap { display: grid; gap: 2rem; max-width: 980px !important; position: relative; }
.rsvp-photo { position: relative; margin: 0 auto; width: min(52vw, 210px); }
.rsvp-photo .arch__outline { border-color: rgba(255, 255, 255, .4); }
.rsvp-box { max-width: 520px; margin: 0 auto; width: 100%; }
.field { margin: 0 0 1.4rem; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; padding: 0; margin-bottom: .45rem; font-size: .95rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.field label em { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .85; }
.field input[type=text], .field input[type=tel], .field textarea {
  width: 100%; min-height: 52px; padding: .7rem 1rem;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-size: 1.15rem;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.field__err { margin-top: .4rem; font-size: 1rem; color: #FFD9D4; }
.field__err:empty { display: none; }
.field.has-err input[type=text] { border-color: #FFB4AA; }
.choice { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; }
.choice label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1.1rem; font-weight: 500; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; place-items: center; min-height: 56px; padding: .5rem; text-align: center; border: 1px solid rgba(255, 255, 255, .5); border-radius: 12px; cursor: pointer; transition: background-color .25s, color .25s; }
.choice input:checked + span { background: #fff; color: var(--accent); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid rgba(255, 255, 255, .5); border-radius: 12px; overflow: hidden; }
.stepper button { width: 52px; height: 52px; border: 0; background: transparent; font-size: 1.6rem; color: #fff; }
.stepper button:hover { background: rgba(255, 255, 255, .15); }
.stepper input { width: 64px; height: 52px; border: 0; background: transparent; text-align: center; font-size: 1.4rem; color: #fff; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#guestsField[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn--solid { width: 100%; background: #fff; color: var(--accent); border-color: #fff; min-height: 56px; font-size: 1.15rem; }
.btn--solid:disabled { opacity: .6; cursor: progress; transform: none; }
.thanks { text-align: center; padding: 2rem 0; }
.thanks__big { font-family: var(--font-script); font-size: clamp(3.2rem, 14vw, 4.8rem); line-height: 1.1; margin-bottom: .4rem; }
@media (min-width: 900px) {
  .rsvp-wrap { grid-template-columns: 340px 1fr; gap: 5rem; align-items: center; }
  .rsvp-photo { width: 100%; }
  .rsvp-box { margin: 0; }
  .rsvp-box .title { text-align: left; }
}

/* ===== Footer ===== */
.footer { position: relative; min-height: 78svh; display: grid; place-items: end center; overflow: hidden; background: #2a2622; text-align: center; color: #fff; }
.footer__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.footer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, .7)); }
.footer__inner { position: relative; z-index: 2; padding: 3rem var(--gutter) calc(3rem + env(safe-area-inset-bottom)); }
.footer__names { font-family: var(--font-script); font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1.2; text-wrap: balance; }
.footer__small { font-style: italic; margin-top: .4rem; font-size: 1.1rem; max-width: 30ch; margin-inline: auto; opacity: .92; }

/* ===== Giảm chuyển động ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .hero__in, [data-reveal], .tl__item { opacity: 1; transform: none; }
  .petals { display: none; }
}
