:root {
  --red: #8a1c22;
  --red-dark: #5f1015;
  --red-mid: #a3262d;
  --gold: #c9a24b;
  --gold-light: #e8d49a;
  --cream: #fbf4e6;
  --cream-2: #f3e7cf;
  --ink: #3a2a24;
  --muted: #7a655a;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M24 4l20 20-20 20L4 24z' fill='none' stroke='%23c9a24b' stroke-opacity='.22'/%3E%3Ccircle cx='24' cy='24' r='2' fill='%23c9a24b' fill-opacity='.25'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }

.script { font-family: "Great Vibes", "Playfair Display", cursive; font-weight: 400; }
.xi { font-family: "Playfair Display", serif; color: var(--gold); font-size: 64px; line-height: 1; }
.xi.small { font-size: 40px; margin-bottom: 6px; }

.gold-text {
  color: var(--gold-light);
  background: linear-gradient(100deg, #c9a24b 0%, #f6e7ae 25%, #c9a24b 50%, #f6e7ae 75%, #c9a24b 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }

.c { position: absolute; width: 64px; height: 64px; color: var(--gold); pointer-events: none; }
.c.tl { top: 8px; left: 8px; }
.c.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.c.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.c.br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

.orn { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto; max-width: 340px; }
.orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.orn i:last-child { background: linear-gradient(270deg, transparent, var(--gold)); }
.lotus { width: 56px; height: 31px; color: var(--gold); flex: none; }
.lotus.big { width: 84px; height: 46px; margin-bottom: 12px; }

.cover {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 190, 120, .22), transparent 60%),
    var(--pattern),
    radial-gradient(ellipse at center, var(--red-mid) 0%, var(--red-dark) 100%);
  color: var(--cream);
  transition: opacity .9s ease, visibility .9s ease;
  padding: 24px;
}
.cover.gone { opacity: 0; visibility: hidden; }
.cover-card {
  position: relative;
  text-align: center;
  border: 1px solid var(--gold);
  background: rgba(60, 10, 14, .35);
  backdrop-filter: blur(2px);
  padding: 64px 32px 52px; max-width: 440px; width: 100%;
  box-shadow: 0 0 0 8px rgba(201, 162, 75, .12), 0 20px 60px rgba(0, 0, 0, .35);
}
.cover-card .c { width: 56px; height: 56px; }
.ring {
  width: 96px; height: 96px; margin: 0 auto 8px; display: grid; place-items: center;
  border: 2px solid var(--gold); border-radius: 50%; font-size: 52px;
  box-shadow: 0 0 0 6px rgba(201, 162, 75, .15), 0 0 30px rgba(232, 212, 154, .35);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(201, 162, 75, .08), 0 0 44px rgba(232, 212, 154, .55); } }
.cover-kicker, .kicker {
  text-transform: uppercase; letter-spacing: .35em; font-size: 12px; color: var(--gold-light); margin: 16px 0 0;
}
.cover-names { font-size: 56px; line-height: 1.1; margin: 10px 0 20px; }
.cover-names span, .hero-names span { display: block; font-size: .55em; }
.cover-guest { margin: 0 0 22px; font-size: 15px; color: var(--gold-light); }

.btn {
  position: relative; overflow: hidden;
  display: inline-block; cursor: pointer; text-decoration: none;
  font: 500 14px "Be Vietnam Pro", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  padding: 13px 32px; border-radius: 999px; border: 1px solid var(--gold);
  transition: transform .2s, background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.gold { background: linear-gradient(135deg, #e8d49a, #c9a24b 55%, #e8d49a); color: var(--red-dark); box-shadow: 0 6px 18px rgba(201, 162, 75, .35); }
.btn.gold::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: sweep 3.4s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn.outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn.outline:hover { background: var(--red); color: var(--cream); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

.music {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--gold); background: var(--red); color: var(--gold-light);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.music.playing svg { animation: spin 4s linear infinite; }
.music.muted::after {
  content: ""; position: absolute; width: 28px; height: 2px; background: var(--gold-light);
  transform: rotate(-45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

.petals { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -30px; border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #ffd6d6, #f08a96);
  opacity: 0; animation: fall linear infinite;
}
.petal.g { background: linear-gradient(135deg, #f6e7ae, #c9a24b); }
@keyframes fall {
  0% { transform: translate3d(0, -5vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .85; }
  50% { transform: translate3d(var(--sway), 55vh, 0) rotate(200deg); }
  100% { transform: translate3d(calc(var(--sway) * -.4), 110vh, 0) rotate(420deg); opacity: .7; }
}

.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; display: grid; place-items: center; text-align: center; color: var(--cream);
  background:
    linear-gradient(rgba(60, 10, 14, .5), rgba(60, 10, 14, .72)),
    var(--hero-photo, none),
    var(--pattern),
    radial-gradient(ellipse at 50% 30%, var(--red-mid), var(--red-dark));
  background-size: cover, cover, 48px 48px, cover; background-position: center;
  padding: 56px 20px 40px;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.hero-xi {
  position: absolute; left: 50%; top: 50%; font-family: "Playfair Display", serif;
  font-size: min(90vw, 560px); line-height: 1; color: var(--gold); opacity: .08;
  transform: translate(-50%, -50%); animation: slowspin 90s linear infinite; pointer-events: none;
}
@keyframes slowspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-inner { position: relative; z-index: 2; }
.hero-names { font-size: clamp(54px, 13vw, 112px); line-height: 1.05; margin: 12px 0 8px; }
.hero-date { font-family: "Playfair Display", serif; font-size: clamp(24px, 5vw, 36px); letter-spacing: .2em; margin: 6px 0 0; }
.hero-sub { margin: 6px 0 32px; letter-spacing: .15em; font-size: 14px; text-transform: uppercase; color: var(--gold-light); }
.scroll-hint { color: var(--gold); font-size: 34px; text-decoration: none; display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

.lantern { position: absolute; top: -6px; z-index: 1; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.lantern.l1 { left: 5%; width: 54px; height: 126px; }
.lantern.l2 { left: 14%; width: 38px; height: 88px; top: -20px; animation-delay: -1.8s; }
.lantern.l3 { right: 14%; width: 38px; height: 88px; top: -20px; animation-delay: -3s; }
.lantern.l4 { right: 5%; width: 54px; height: 126px; animation-delay: -.9s; }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

.section {
  position: relative; padding: clamp(40px, 7vh, 72px) 20px; text-align: center;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.section.cream { background: var(--cream); }
.section.pattern { background: var(--pattern), var(--cream-2); }
.section.red {
  color: var(--cream);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 190, 120, .14), transparent 60%),
    var(--pattern),
    linear-gradient(180deg, var(--red-mid), var(--red-dark));
}
.section.scallop { --sc: var(--cream); }
#rsvp.scallop { --sc: var(--cream-2); }
#rsvp.scallop::after { display: none; }
.section.scallop::before, .section.scallop::after {
  content: ""; position: absolute; left: 0; right: 0; height: 24px; pointer-events: none;
}
.section.scallop::before {
  top: -1px;
  background: radial-gradient(circle at 24px 0, var(--sc) 22px, transparent 23px) repeat-x;
  background-size: 48px 24px;
}
.section.scallop::after {
  bottom: -1px;
  background: radial-gradient(circle at 24px 24px, var(--sc) 22px, transparent 23px) repeat-x;
  background-size: 48px 24px;
}
.wrap { max-width: 980px; width: 100%; margin: 0 auto; position: relative; }
.wrap.narrow { max-width: 640px; }
.title {
  font-family: "Playfair Display", serif; font-weight: 600; font-size: 30px; color: var(--red);
  margin: 0 0 clamp(20px, 4vh, 32px); position: relative; padding-bottom: 16px;
}
.title::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 64px; height: 2px; background: var(--gold); transform: translateX(-50%); }
.section.red .title { color: var(--gold-light); }
.section .kicker { color: var(--gold); }
.guest-line { font-family: "Playfair Display", serif; font-size: clamp(28px, 6vw, 40px); color: var(--red); margin: 10px 0 4px; }
.lead { color: var(--muted); font-size: 17px; margin: 0; }
.lead.small { font-size: 15px; margin-bottom: 20px; }
.lead.light { color: var(--gold-light); }

.frame { position: relative; padding: 56px 30px; border: 1px solid var(--gold-light); background: #fffaf0; box-shadow: 0 10px 40px rgba(138, 28, 34, .08); }
.frame.paper { padding: 40px 28px 24px; border-color: var(--gold); box-shadow: 0 16px 50px rgba(0, 0, 0, .3); }

.families { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 20px; }
.family {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(232, 212, 154, .55);
  padding: 40px 24px; border-radius: 6px; backdrop-filter: blur(2px);
}
.family-tag { text-transform: uppercase; letter-spacing: .3em; font-size: 12px; color: var(--gold); margin: 0 0 16px; }
.parent { margin: 4px 0; font-size: 17px; color: var(--cream); }
.parent strong { font-family: "Playfair Display", serif; font-weight: 600; color: var(--gold-light); }
.divider { width: 40px; height: 1px; background: var(--gold); margin: 22px auto 16px; }
.child-label { margin: 0; font-size: 13px; color: var(--gold-light); opacity: .8; }
.child { font-size: 40px; margin: 0; line-height: 1.3; }
.emblem {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--gold); color: var(--gold); font-family: "Playfair Display", serif; font-size: 38px;
  background: var(--red-dark); box-shadow: 0 0 0 6px rgba(201, 162, 75, .15);
}

.date-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 14px; }
.dc-side { padding: 12px 0; }
.dc-side span {
  display: inline-block; font-family: "Playfair Display", serif; font-size: 20px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red);
  padding: 10px 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); min-width: 140px;
}
.dc-mid { padding: 0 24px; display: grid; justify-items: center; line-height: 1; }
.dc-mid small { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.dc-mid b {
  font-family: "Playfair Display", serif; font-weight: 700; font-size: clamp(76px, 13vh, 104px); line-height: 1.05; color: var(--red);
  text-shadow: 3px 3px 0 var(--gold-light);
}
.lunar { color: var(--muted); font-style: italic; margin: 0 0 24px; }

.venue { padding: 18px 16px; margin-bottom: 24px; border-top: 1px solid var(--gold-light); border-bottom: 1px solid var(--gold-light); }
.venue .lotus { margin: 0 auto 6px; display: block; }
.venue-k { text-transform: uppercase; letter-spacing: .3em; font-size: 12px; color: var(--gold); margin: 0; }
.venue-v { font-family: "Playfair Display", serif; font-size: 24px; color: var(--red); margin: 4px 0 0; }
.venue-a { font-size: 17px; margin: 2px 0 0; }

.countdown { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.countdown div {
  min-width: 76px; padding: 14px 8px; background: linear-gradient(180deg, var(--red-mid), var(--red-dark));
  color: var(--gold-light); border-radius: 8px; border: 1px solid var(--gold);
  box-shadow: 0 6px 16px rgba(95, 16, 21, .25);
}
.countdown b { display: block; font-family: "Playfair Display", serif; font-size: 30px; line-height: 1.1; }
.countdown small { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }

.map { border: 1px solid var(--gold-light); border-radius: 6px; overflow: hidden; margin-bottom: 22px; }
.map-addr { margin: -8px 0 24px; }
.map iframe { width: 100%; height: clamp(280px, 52vh, 460px); border: 0; display: block; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(120px, 21vh, 190px); gap: 12px; }
.gallery figure { margin: 0; border-radius: 6px; overflow: hidden; background: var(--cream); border: 1px solid var(--gold); padding: 5px; }
.gallery figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery figure:nth-child(4), .gallery figure:nth-child(n+5) { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; border-radius: 3px; }
.gallery figure:hover img { transform: scale(1.04); }
.ph {
  height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--gold); font-size: 12px;
  letter-spacing: .15em; text-transform: uppercase; border-radius: 3px;
  background: var(--pattern), linear-gradient(135deg, var(--cream), var(--cream-2));
}
.ph b { font-family: "Playfair Display", serif; font-size: 34px; font-weight: 400; opacity: .7; }

.form { text-align: left; display: grid; gap: 12px; }
.form label, .form legend { font-size: 14px; font-weight: 500; color: var(--red); display: grid; gap: 6px; }
.form input[type="text"], .form select, .form textarea {
  width: 100%; font: 400 16px "Be Vietnam Pro", sans-serif; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--gold-light); border-radius: 6px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.form .radio { display: flex; gap: 10px; align-items: center; font-weight: 400; color: var(--ink); cursor: pointer; }
.form .radio input { accent-color: var(--red); }
.form .btn { justify-self: center; margin-top: 6px; }
.form-note { text-align: center; margin: 0; min-height: 24px; color: var(--red); font-size: 15px; }
.form-note.err { color: #b00020; }

.footer {
  scroll-snap-align: end;
  background: var(--pattern), linear-gradient(180deg, var(--red-dark), #3d0a0e);
  color: var(--cream); text-align: center; padding: 64px 20px 80px;
}
.foot-names { font-size: 48px; margin: 0 0 6px; }
.footer p { margin: 0; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .families { grid-template-columns: 1fr; gap: 14px 0; }
  .emblem { margin: 0 auto; width: 60px; height: 60px; font-size: 32px; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: clamp(100px, 16vh, 150px); }
  .gallery figure:nth-child(1) { grid-row: auto; }
  .family { padding: 26px 18px; }
  .child { font-size: 34px; }
  .divider { margin: 14px auto 10px; }
  .families { gap: 10px 0; }
  .gallery figure:nth-child(4), .gallery figure:nth-child(5) { grid-column: auto; }
  .gallery figure:nth-child(6) { grid-column: span 2; }
  .lantern.l2, .lantern.l3 { display: none; }
}

@media (max-width: 520px) {
  .section { padding: 72px 16px; }
  .frame { padding: 52px 20px; }
  .c { width: 48px; height: 48px; }
  .cover-names { font-size: 48px; }
  .countdown { gap: 8px; }
  .countdown div { min-width: 64px; }
  .dc-side span { min-width: 0; font-size: 15px; padding: 8px 4px; }
  .dc-mid { padding: 0 12px; }
  .dc-mid b { font-size: 84px; }
  .lantern.l1, .lantern.l4 { width: 40px; height: 94px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint, .music.playing svg, .lantern, .hero-xi, .ring, .gold-text, .btn.gold::after { animation: none; }
  .petals { display: none; }
}
