:root {
  --ink: #212121;
  --taupe: #86786a;
  --script: #8a7764;
  --paper: #f7f3ee;
  --beige: #e6e0d6;
  --gray: #6d6d6d;
  --line: rgba(33, 33, 33, 0.14);
  --gold: #c6a36a;
  --sheet: 448px;
  --font-script: "Great Vibes", cursive;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Jost", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--gray);
  font-family: var(--font-sans);
  font-weight: 300;
}

body.is-locked {
  overflow: hidden;
  height: 100dvh;
}

button, input, select, textarea { font: inherit; color: inherit; }

.stage {
  min-height: 100dvh;
}

.sheet {
  width: min(var(--sheet), 100%);
  margin: 0 auto;
  background: #fff;
  min-height: 100dvh;
  position: relative;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--gray);
  display: flex;
  justify-content: center;
}

.gate.is-gone {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.gate-sheet { overflow: hidden; }

.env {
  position: relative;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), transparent 30%),
    #fbfbfb;
}

.env-folds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.env-folds line {
  stroke: rgba(90, 90, 90, 0.28);
  stroke-width: 1;
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  background: linear-gradient(180deg, #ffffff 0%, #f3f3f3 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 2;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.07));
  transform-origin: top center;
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.env.is-open .env-flap {
  transform: translateY(-18%) rotateX(70deg);
  opacity: 0;
}

.env-names {
  position: absolute;
  z-index: 5;
  top: 7%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  pointer-events: none;
  color: var(--script);
  font-family: var(--font-script);
  font-size: clamp(3rem, 10vw, 4.1rem);
  line-height: 0.86;
}

.env-names i {
  display: block;
  font-style: normal;
  font-size: 0.62em;
  margin: 0.15em 0;
}

.seal {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.seal-wax {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  color: #7a6233;
  background:
    radial-gradient(circle at 35% 30%, #f3e2b0, #d7b56a 42%, #b08a3e 78%);
  box-shadow:
    inset 0 0 0 7px rgba(255, 236, 190, 0.35),
    inset 0 0 0 8px rgba(120, 86, 32, 0.28),
    0 10px 18px rgba(0, 0, 0, 0.16);
}

.seal-sprig { width: 46px; height: 46px; }

.env.is-open .seal {
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  transition: 0.35s ease;
}

.env-cta {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 16%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.04em;
}

.env-cta span,
.env-cta strong {
  display: block;
  font-weight: 400;
  font-size: 0.92rem;
}

.env-cta strong {
  margin-top: 0.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.block {
  padding: 4.5rem 1.6rem 3.2rem;
  text-align: center;
}

.block--white { background: #fff; }
.block--beige { background: var(--beige); }

.script {
  margin: 0 0 1.2rem;
  font-family: var(--font-script);
  font-size: clamp(3.3rem, 11vw, 4.5rem);
  font-weight: 400;
  line-height: 0.9;
}

.script--ink { color: var(--script); }
.script--paper { color: var(--script-beige, #5e5146); }

.place,
.label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.addr, .hour, .note, .route, .tiny, .titular {
  margin: 0.7rem 0 0;
  line-height: 1.55;
}

.hour { letter-spacing: 0.08em; }

.note { max-width: 22rem; margin-left: auto; margin-right: auto; }
.note--on-beige { color: #2b2b2b; }

.maps {
  display: inline-block;
  margin-top: 0.8rem;
  color: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.frame {
  margin: 1.4rem auto 0;
  max-width: 340px;
  border-radius: 14px;
  overflow: hidden;
}

.frame svg, .scene svg { display: block; width: 100%; height: auto; }

.cover { padding-top: 3.2rem; padding-bottom: 2.2rem; }

.wreath {
  position: relative;
  width: min(300px, 78%);
  margin: 0 auto 1.6rem;
}

.wreath svg { display: block; width: 100%; height: auto; }

.wreath-names {
  position: absolute;
  inset: 18% 12% 18%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--script);
  font-family: var(--font-script);
  font-size: clamp(2.35rem, 8vw, 3rem);
  line-height: 0.82;
}

.wreath-names i { font-style: normal; font-size: 0.7em; }

.cover-kicker {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.cover-date {
  margin: 0.35rem 0 0;
  letter-spacing: 0.28em;
  font-size: 0.95rem;
}

.scene { background: #e7dccc; }
.scene svg { height: min(68vh, 520px); }

.torn {
  height: 34px;
  background: #fff;
  position: relative;
  z-index: 2;
}

.torn--down {
  margin-bottom: -34px;
  clip-path: polygon(0 0, 5% 70%, 10% 15%, 16% 90%, 23% 20%, 31% 78%, 39% 8%, 47% 92%, 55% 18%, 64% 80%, 73% 10%, 81% 86%, 89% 22%, 95% 74%, 100% 0, 100% 100%, 0 100%);
}

.torn--up {
  margin-top: -34px;
  clip-path: polygon(0 100%, 6% 28%, 13% 88%, 19% 16%, 28% 82%, 36% 12%, 45% 90%, 53% 20%, 62% 84%, 71% 14%, 80% 78%, 88% 24%, 95% 70%, 100% 100%);
}

.quote-block { position: relative; padding-top: 3.4rem; }
.quote-block .serif { max-width: 20rem; margin: 0 auto 1rem; font-family: var(--font-serif); font-size: 1.45rem; line-height: 1.35; }
.serif--soft { font-style: italic; color: #4a433c; font-size: 1.25rem !important; }

.corner-leaf { position: absolute; top: 0; left: 0; width: 120px; }

.dress { display: flex; justify-content: center; gap: 1rem; margin: 1rem 0; }
.dress svg { width: 42px; height: 42px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1.6rem;
  text-align: center;
}

.route span { display: block; margin: 0.2rem 0; }

.mini-env {
  position: relative;
  width: 148px;
  height: 110px;
  margin: 1.2rem auto 0;
  border: 0;
  background: #f7f4ef;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.mini-env__flap {
  position: absolute;
  inset: 0 0 40% 0;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.mini-env__seal {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #f3e2b0, #b08a3e);
}

.mini-env__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  font-size: 0.72rem;
}

.rsvp {
  max-width: 320px;
  margin: 1.4rem auto 0;
  text-align: left;
}

.rsvp label {
  display: block;
  margin: 0.8rem 0 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rsvp input,
.rsvp select,
.rsvp textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(33, 33, 33, 0.25);
  background: transparent;
  padding: 0.45rem 0;
  border-radius: 0;
}

.rsvp textarea { min-height: 72px; resize: vertical; }

.check {
  display: flex !important;
  gap: 0.5rem;
  align-items: center;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.btn-rsvp,
.account,
.code {
  border: 0;
  cursor: pointer;
  background: transparent;
}

.btn-rsvp {
  display: block;
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.8rem 1rem;
  background: #2b2b2b;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.alert { min-height: 1.2rem; text-align: center; }
.alert.is-ok { color: #2f5d3a; }
.alert.is-err { color: #8a3030; }

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 260px;
}

.timeline li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline time { letter-spacing: 0.06em; }

.label--light { color: #5e5146; letter-spacing: 0.18em; }

.titular {
  font-family: var(--font-serif);
  font-size: 1.6rem;
}

.account, .code {
  margin-top: 0.8rem;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.account span { border-bottom: 1px solid currentColor; }

.qr {
  width: 148px;
  margin: 1.2rem auto 0.4rem;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.qr svg { width: 100%; height: auto; fill: #2b2b2b; }

.tiny { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }

.count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.count span {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1;
}

.count small {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.foot {
  margin: 0;
  padding: 0 1rem 5.5rem;
  text-align: center;
  background: var(--beige);
  color: rgba(33, 33, 33, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.foot a { color: inherit; }

.swipe {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(40, 36, 32, 0.72);
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 5;
}

.swipe.is-gone { opacity: 0; transition: opacity 0.4s ease; }

@media (max-width: 520px) {
  .split { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .env-flap, .seal, .gate.is-gone, .swipe.is-gone { transition: none; }
}
