:root {
  --bg: #f6f1ea;
  --bg-2: #efe7dc;
  --ink: #33302b;
  --muted: #8a8177;
  --gold: #b49058;
  --sage: #8b9a86;
  --emerald: #2f4a3c;
  --emerald-2: #4f6f5c;
  --line: rgba(51, 48, 43, .14);
  --shadow: 0 24px 60px -34px rgba(70, 55, 35, .5);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --sans: "Jost", system-ui, sans-serif;
  --col: 460px;
  --pad: clamp(22px, 6vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

img { display: block; width: 100%; height: 100%; object-fit: cover; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

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

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title { font-size: clamp(2.4rem, 9vw, 3.2rem); line-height: 1.1; margin-bottom: 26px; }

.rule {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 18px auto;
  position: relative;
}

.rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  transform: translateX(-50%) rotate(45deg);
  background: var(--bg);
}

.btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  display: inline-block;
  padding: 14px 30px;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: var(--gold);
  color: #fffdf8;
  text-decoration: none;
  cursor: pointer;
  transition: background .35s, color .35s, transform .35s;
}

.btn:hover { background: #a07f4a; transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--gold); color: #fffdf8; }
.btn.small { padding: 10px 20px; font-size: 11px; }
.btn[hidden] { display: none; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--pad);
  background:
    radial-gradient(90% 60% at 50% 30%, rgba(243, 220, 154, .16), transparent 70%),
    linear-gradient(180deg, #35533f 0%, #24392e 100%);
  color: #f7f1e8;
  overflow-y: auto;
  transition: opacity 1.1s ease, visibility 1.1s;
}

.gate.open { opacity: 0; visibility: hidden; }
.gate .eyebrow { color: rgba(247, 241, 232, .75); }
.gate-inner { max-width: var(--col); width: 100%; }
.gate h1 { font-size: clamp(3.4rem, 15vw, 5rem); line-height: 1.05; margin: 12px 0 6px; }
.gate-date { font-size: 1.05rem; letter-spacing: .04em; }

.gate-guest {
  margin: 34px auto 24px;
  padding: 18px 20px;
  border: 1px solid rgba(247, 241, 232, .3);
  max-width: 340px;
}

.gate-guest .guest { font-size: 1.45rem; margin-top: 6px; letter-spacing: .02em; }
.gate-note { font-family: var(--sans); font-size: 10.5px; letter-spacing: .08em; color: rgba(247, 241, 232, .6); margin-top: 22px; }
.gate .btn { background: #f7f1e8; border-color: #f7f1e8; color: #33302b; }
.gate .btn:hover { background: #fff; }

main {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  background: rgba(246, 241, 234, .92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel {
  padding: clamp(72px, 16vw, 110px) var(--pad);
  text-align: center;
  position: relative;
}

.cover {
  padding: clamp(64px, 14vw, 96px) 0 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(80% 50% at 50% 100%, rgba(139, 154, 134, .35), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.cover-text { position: relative; padding: 0 var(--pad); }

.cover-art {
  position: relative;
  padding: 40px var(--pad) 0;
  margin-top: 28px;
}

.arch-line {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(360px, 84%);
  height: 96%;
  transform: translateX(-50%);
  border: 1px solid var(--gold);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(255, 253, 248, .85), rgba(255, 253, 248, 0));
}

.arch-line::before {
  content: "";
  position: absolute;
  inset: 8px 8px 0;
  border: 1px solid rgba(180, 144, 88, .4);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.script.big { font-size: clamp(3.6rem, 17vw, 5.4rem); line-height: 1.02; }
.cover-date { font-size: 1.05rem; letter-spacing: .06em; }

.illo svg { display: block; width: 100%; height: auto; overflow: visible; }
.illo.pair { position: relative; display: flex; justify-content: center; align-items: flex-end; max-width: 380px; margin: 0 auto; }
.illo.pair svg { width: 54%; flex: none; }
.illo.pair svg + svg { margin-left: -8%; }
.illo.pair.small { max-width: 210px; margin-bottom: 14px; }

.fig { animation: bob 5.5s ease-in-out infinite; }
.fig.late { animation-delay: -2.4s; }
.ronce, .goyang { transform-box: fill-box; }
.ronce { transform-origin: 50% 0; animation: sway 4.2s ease-in-out infinite; }
.ronce.right { animation-delay: -1.6s; }
.goyang { transform-origin: 50% 100%; animation: wiggle 2.6s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.verse { background: var(--bg-2); }
.verse .arab { font-size: clamp(1.4rem, 5vw, 1.8rem); line-height: 2.2; direction: rtl; margin-bottom: 20px; }
.verse .quote { font-style: italic; font-size: 1.08rem; line-height: 1.75; color: #4a443c; }
.verse .source { font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-top: 16px; }

.salam { font-style: italic; font-size: 1.12rem; color: #4a443c; margin-bottom: 18px; }
.events .note { display: inline-block; margin-top: 14px; padding: 4px 14px; border: 1px solid var(--gold); color: var(--gold); font-family: var(--sans); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.deadline { font-style: italic; color: var(--gold); margin: -10px auto 26px; max-width: 340px; }
.prayer .eyebrow { margin-bottom: 18px; }
.families { list-style: none; margin-top: 18px; font-size: 1.02rem; color: #4a443c; }
.families li + li { margin-top: 2px; }
[data-text][hidden] { display: none; }
.couple .intro { max-width: 380px; margin: 14px auto 46px; font-size: 1.02rem; color: #4a443c; }
.person + .amp { margin: 30px 0; }
.amp { font-size: 3rem; color: var(--gold); }

.frame {
  width: min(280px, 72vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 22px;
  overflow: hidden;
  background: var(--bg-2);
  outline: 1px solid var(--line);
  outline-offset: 10px;
}

.frame.arch {
  border-radius: 999px 999px 6px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(70% 45% at 50% 100%, rgba(139, 154, 134, .4), transparent 70%),
    linear-gradient(180deg, #fffdf8, var(--bg-2));
}

.frame.arch .illo { width: 78%; margin-bottom: -4%; }
.frame.arch img { object-position: 50% 0; }
.closing-photo img { object-position: 50% 42%; }
.grid figure { outline: 1px solid rgba(180, 144, 88, .45); outline-offset: -6px; }
.person h3 { font-size: clamp(2.2rem, 8vw, 2.8rem); line-height: 1.15; }
.parents { font-size: .98rem; color: var(--muted); margin-top: 6px; }

.countdown-sec { background: var(--bg-2); }
.big-date { font-size: clamp(2.6rem, 11vw, 3.6rem); margin: 10px 0 26px; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 32px; }
.cd div { padding: 14px 4px; border: 1px solid var(--line); background: rgba(255, 253, 248, .6); }
.cd b { display: block; font-weight: 500; font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-done { font-style: italic; color: #4a443c; max-width: 320px; margin: 0 auto 32px; }
.cd span { font-family: var(--sans); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.events .card {
  border: 1px solid var(--line);
  padding: 32px 22px;
  margin-bottom: 18px;
  background: rgba(255, 253, 248, .7);
}

.events .time { font-size: clamp(2.2rem, 8.6vw, 3rem); line-height: 1.1; color: var(--gold); margin: 6px 0 10px; }
.events .meta { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.events .place { font-size: 1.25rem; margin-top: 12px; }
.events .address { font-size: .98rem; color: var(--muted); max-width: 300px; margin: 0 auto; }
.events .landmark { font-style: italic; font-size: .98rem; color: var(--gold); margin-top: 8px; }
.events .landmark:empty { display: none; }
.events .btn { margin-top: 18px; }

.timeline { list-style: none; text-align: left; max-width: 380px; margin: 0 auto; }
.timeline li { position: relative; padding: 0 0 30px 28px; border-left: 1px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.timeline span { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .22em; color: var(--gold); }
.timeline p { font-size: 1rem; color: #4a443c; margin-top: 4px; }

.gallery { background: var(--bg-2); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid figure { overflow: hidden; aspect-ratio: 3 / 4; background: var(--bg); cursor: zoom-in; }
.grid figure:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.grid figure:only-child { aspect-ratio: 4 / 5; max-width: 320px; margin: 0 auto; }
.grid img { transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.grid figure:hover img { transform: scale(1.05); }

.rsvp form { display: grid; gap: 16px; text-align: left; max-width: 380px; margin: 0 auto; }
.rsvp label { font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: grid; gap: 6px; }
.rsvp input, .rsvp select, .rsvp textarea {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  outline: none;
  resize: vertical;
}
.rsvp input:focus, .rsvp select:focus, .rsvp textarea:focus { border-bottom-color: var(--gold); }
.rsvp .btn { justify-self: center; margin-top: 8px; }
.form-msg { text-align: center; font-style: italic; color: var(--gold); min-height: 1.4em; }
.guestbook { list-style: none; max-width: 380px; margin: 36px auto 0; text-align: left; max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
.guestbook li { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.guestbook b { font-weight: 600; font-size: 1.02rem; }
.guestbook p { font-size: .98rem; color: #4a443c; }

.gift-note { max-width: 360px; margin: 10px auto 26px; color: #4a443c; }
.accounts { display: grid; gap: 16px; }
.account { border: 1px solid var(--line); padding: 28px 22px; background: rgba(255, 253, 248, .7); }
.account .bank-logo { width: auto; height: 30px; max-width: 150px; object-fit: contain; margin: 0 auto 12px; }
.account .bank { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.account .accno { font-size: 1.7rem; letter-spacing: .08em; margin: 6px 0 2px; }
.account .holder { font-size: .98rem; color: var(--muted); margin-bottom: 18px; }

.closing { padding-bottom: clamp(120px, 24vw, 150px); }
.closing-photo {
  width: min(300px, 78vw);
  aspect-ratio: 1;
  margin: 0 auto 34px;
  border-radius: 50%;
  overflow: hidden;
  outline: 1px solid var(--line);
  outline-offset: 10px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, #fffdf8, var(--bg-2));
}

.closing-photo .illo.pair { width: 86%; margin-bottom: -10%; }
.closing-text { max-width: 360px; margin: 0 auto 26px; font-style: italic; color: #4a443c; }
.closing h2 { margin-top: 10px; }
.closing small { display: block; margin-top: 40px; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; color: var(--muted); }

.dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(140%);
  z-index: 30;
  display: flex;
  gap: 2px;
  padding: 7px;
  width: min(var(--col), calc(100vw - 28px));
  justify-content: space-between;
  background: rgba(40, 35, 30, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  transition: transform .6s cubic-bezier(.2, .9, .2, 1);
}

body.opened .dock { transform: translateX(-50%) translateY(0); }

.dock a {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 8px 2px 6px;
  border-radius: 999px;
  color: rgba(247, 241, 232, .66);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .3s, background .3s;
}

.dock a::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.dock a[data-icon="home"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'><path d='M3 10.5 12 3l9 7.5V21H3z'/></svg>"); }
.dock a[data-icon="rings"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'><circle cx='9' cy='14' r='6'/><circle cx='16' cy='14' r='6'/></svg>"); }
.dock a[data-icon="calendar"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'><rect x='3' y='5' width='18' height='16'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>"); }
.dock a[data-icon="photo"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'><rect x='3' y='5' width='18' height='14'/><path d='m3 16 5-5 4 4 3-3 6 6'/></svg>"); }
.dock a[data-icon="pen"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'><path d='M4 20h4L20 8l-4-4L4 16z'/></svg>"); }

.dock a.active { color: #fffdf8; background: rgba(180, 144, 88, .55); }
.dock a[hidden] { display: none; }

.music {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 232, .5);
  background: rgba(40, 35, 30, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.music[hidden] { display: none; }

.disc {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #f7f1e8;
  border-top-color: var(--gold);
  position: relative;
}

.disc::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #f7f1e8;
}

.music.playing .disc { animation: spin 3s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 19, 16, .94);
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox[hidden] { display: none; }
.lightbox img { width: auto; height: auto; max-width: 100%; max-height: 86vh; object-fit: contain; }

.lb-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 2rem;
  line-height: 1;
  color: #f7f1e8;
  background: none;
  border: 0;
  cursor: pointer;
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 900px) {
  body {
    background:
      radial-gradient(60% 50% at 15% 20%, rgba(180, 144, 88, .14), transparent 70%),
      radial-gradient(60% 50% at 85% 80%, rgba(79, 111, 92, .16), transparent 70%),
      var(--bg-2);
  }
  main { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .music.playing .disc, .fig, .ronce, .goyang { animation: none; }
}
