@font-face { font-family: "Pinyon Script"; src: url("/fonts/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --cream: #f8f6ec;
  --cream-2: #f2efdf;
  --sage: #a9bfa1;
  --sage-deep: #7f9878;
  --khaki: #dedbbb;
  --olive: #4a4d38;
  --olive-2: #5d6147;
  --ink: #46473a;
  --ink-soft: #6e6e5e;
  --wine: #8a2537;
  --line: rgba(74, 77, 56, .25);
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --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;
  min-height: 100svh;
  background: radial-gradient(120% 80% at 50% 0%, #c3d2bc 0%, var(--sage) 55%, #93ab8c 100%) fixed;
  color: var(--ink);
  font: 500 19px/1.45 var(--serif);
  -webkit-font-smoothing: antialiased;
}
body.sealed { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.script { font-family: var(--script); font-weight: 400; line-height: 1.15; margin: 0; }
.display {
  font: 500 clamp(2rem, 9vw, 2.6rem)/1.1 var(--serif);
  letter-spacing: .06em; text-transform: uppercase; margin: 0;
}
.title { font: 500 1.45rem/1.2 var(--serif); letter-spacing: .02em; margin: 0 0 .75rem; }
.mono { font-variant-numeric: lining-nums tabular-nums; letter-spacing: .02em; }

/* ---------- Envelope ---------- */
.envelope {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(90% 70% at 50% 45%, #fbfaf3 0%, var(--cream) 50%, var(--cream-2) 100%);
  transition: opacity .9s var(--ease) .55s, visibility 0s linear 1.5s;
}
.envelope__to { margin: 0; text-align: center; font-size: 1.15rem; color: var(--ink-soft); letter-spacing: .04em; }
.envelope__to .script { display: block; font-size: clamp(2.1rem, 10vw, 2.8rem); color: var(--olive); letter-spacing: 0; margin-top: .2rem; overflow-wrap: anywhere; }
.envelope__art { position: relative; width: min(88vw, 440px); filter: drop-shadow(0 18px 28px rgba(60, 70, 50, .18)); transition: transform 1s var(--ease) .25s, opacity .8s var(--ease) .35s; }
.envelope__paper { width: 100%; }
.envelope__seal {
  position: absolute; left: 50%; top: 61%; width: 21%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
  transition: transform .6s var(--ease), opacity .5s var(--ease) .1s;
}
.envelope__seal:focus-visible { outline: 3px solid var(--olive); outline-offset: 4px; }
.envelope__seal img { width: 100%; filter: drop-shadow(0 4px 6px rgba(90, 30, 30, .3)); }
.envelope__hint { margin: 0; font-style: italic; color: var(--ink-soft); font-size: 1.05rem; animation: fade-blink 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.06); } }
@keyframes fade-blink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

body.opening .envelope__seal { animation: none; transform: translate(-50%, -50%) scale(1.35) rotate(-8deg); opacity: 0; }
body.opening .envelope__art { transform: translateY(40px) scale(.92); opacity: 0; }
body.opening .envelope__hint, body.opening .envelope__to { opacity: 0; transition: opacity .4s; }
body.opening .envelope { opacity: 0; visibility: hidden; pointer-events: none; }
body.opened .envelope { display: none; }

/* ---------- Invitation ---------- */
.invitation {
  max-width: 480px; margin: 0 auto;
  box-shadow: 0 0 60px rgba(40, 50, 35, .25);
  overflow: hidden;
  animation: rise 1.1s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.card {
  position: relative; isolation: isolate;
  padding: 56px 24px; text-align: center;
  background: var(--cream);
  overflow: hidden;
}
.deco { position: absolute; z-index: -1; pointer-events: none; user-select: none; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* 2. hero */
.card--hero { padding-top: 128px; padding-bottom: 64px; }
.kicker { margin: 0 0 .6rem; font-style: italic; font-size: 1.2rem; color: var(--ink-soft); overflow-wrap: anywhere; padding: 0 56px; }
.script--names { font-size: clamp(2.4rem, 11vw, 3rem); color: var(--ink); margin-top: .2rem; }
.arch {
  width: min(70%, 290px); margin: 28px auto 0; aspect-ratio: 413 / 600;
  border-radius: 999px 999px 0 0; overflow: hidden;
  box-shadow: 0 14px 30px rgba(50, 50, 30, .18);
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.deco--hero-tr1 { width: 112px; top: -26px; right: -22px; transform: rotate(-12deg); }
.deco--hero-tr2 { width: 96px; top: -14px; right: 62px; transform: rotate(28deg); z-index: -2; }
.deco--hero-tr3 { width: 62px; top: 62px; right: 4px; transform: rotate(30deg); }
.deco--hero-tl { width: 58px; top: 6px; left: 10px; transform: rotate(-30deg) scaleX(-1); opacity: .9; }
.deco--hero-bl1 { width: 118px; bottom: 18px; left: -16px; transform: rotate(-8deg); z-index: 1; }
.deco--hero-bl2 { width: 96px; bottom: -14px; left: 66px; z-index: 1; }
.deco--hero-bl3 { width: 92px; bottom: 96px; left: -30px; transform: rotate(-24deg); }
.deco--hero-bl4 { width: 52px; bottom: 112px; left: 50px; transform: rotate(-20deg); z-index: 0; }
.deco--hero-br { width: 70px; bottom: 30px; right: 6px; transform: rotate(-150deg); opacity: .9; }

/* 3. date */
.card--date { background: var(--khaki); padding: 64px 24px 56px; }
.date-frame { position: relative; width: min(100%, 380px); margin: 0 auto 20px; filter: drop-shadow(0 8px 14px rgba(60, 60, 40, .15)); }
.script--date { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2.2rem, 10.5vw, 2.9rem); color: var(--olive); padding-top: .1em; }
.time { margin: 0 0 14px; font-size: 1.2rem; letter-spacing: .04em; }
.countdown { display: flex; justify-content: center; gap: 10px; margin: 8px 0 26px; }
.countdown div { min-width: 62px; padding: 8px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .35); }
.countdown span { display: block; font: 600 1.6rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--olive); }
.countdown small { font-size: .85rem; color: var(--ink-soft); letter-spacing: .05em; }

/* 4. venue */
.card--venue { padding: 28px 18px; }
.ornament-frame {
  position: relative; padding: 52px 18px 52px;
  border: 1px solid var(--olive-2); outline: 1px solid var(--olive-2); outline-offset: -7px;
  border-radius: 4px;
}
.ornament-frame::before, .ornament-frame::after {
  content: "❦"; position: absolute; left: 50%; transform: translateX(-50%);
  background: var(--cream); padding: 0 10px; color: var(--olive-2); font-size: 1.3rem; line-height: 1;
}
.ornament-frame::before { top: -11px; }
.ornament-frame::after { bottom: -11px; transform: translateX(-50%) rotate(180deg); }
.script--venue { font-size: clamp(2.6rem, 12vw, 3.2rem); color: var(--ink); }
.address { margin: .4rem 0 0; color: var(--ink-soft); }
.lake { width: min(92%, 340px); margin: 18px auto 26px; }
.garland { width: min(80%, 300px); margin: 0 auto; opacity: .9; }
.garland--top { margin-bottom: 18px; }
.garland--bottom { margin-top: 28px; transform: scaleY(-1); }

/* 5. dress code */
.card--dress {
  background: #eeece4 url("/img/bg-peonies.webp") center / cover no-repeat;
  padding: 72px 16px 96px;
}
.dress { position: relative; min-height: 420px; }
.dress__paper {
  position: relative; z-index: 2;
  width: min(74%, 290px); margin: 0 0 0 4%; padding: 48px 20px 42px;
  background: url("/img/paper.webp") center / 100% 100% no-repeat;
  transform: rotate(-3deg);
  filter: drop-shadow(0 10px 16px rgba(60, 60, 40, .18));
}
.dress__paper .title { margin-bottom: .1rem; font-size: 1.6rem; }
.script--dress { font-size: clamp(2rem, 9vw, 2.5rem); color: var(--olive); }
.dress__frame { position: absolute; z-index: 1; width: min(52%, 220px); right: 2%; top: 140px; transform: rotate(6deg); filter: drop-shadow(0 10px 16px rgba(60, 60, 40, .22)); }
.deco--dress1 { width: 130px; left: 6%; top: 230px; z-index: 3; }
.deco--dress2 { width: 104px; left: 34%; top: 290px; z-index: 3; transform: rotate(10deg); }
.deco--dress3 { width: 110px; left: -10px; top: 270px; z-index: 2; transform: rotate(-30deg); }

/* 6. gift */
.card--gift { padding: 64px 18px 150px; }
.script--gift { font-size: clamp(1.55rem, 7vw, 1.85rem); line-height: 1.35; max-width: 20em; margin: 0 auto 28px; color: var(--ink); }
.tape {
  position: relative; z-index: 1;
  margin: 0 auto; width: min(100%, 400px); padding: 40px 30px 36px;
  background: url("/img/paper.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 12px rgba(80, 60, 30, .16));
  transform: rotate(-1.2deg);
}
.tape::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 150px; height: 38px;
  transform: translateX(-50%) rotate(3deg);
  background: url("/img/tape.webp") center / 100% 100% no-repeat; opacity: .85;
}
.tape dl { margin: 0; display: grid; gap: 10px; font-size: 1.08rem; }
.tape dl div { display: grid; gap: 0; justify-items: center; }
.tape dt { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.tape dd { margin: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; font-weight: 600; }
.copy {
  border: 1px solid var(--olive-2); background: rgba(255, 255, 255, .55); color: var(--olive);
  border-radius: 999px; padding: 1px 10px; font-size: .85rem; cursor: pointer;
}
.copy:active { transform: scale(.96); }
.deco--gift { width: 120px; right: 18px; bottom: 10px; transform: rotate(8deg); z-index: 0; }

/* 7. rsvp */
.card--rsvp { padding: 64px 22px 56px; border-top: 1px solid var(--line); }
.card--rsvp .title { font-size: 1.6rem; }
.who { margin: 0 auto 26px; max-width: 24em; }
.who p { margin: 0 0 .4rem; }
.who strong { font-weight: 600; color: var(--olive); }
.seats { display: block; color: var(--ink-soft); font-style: italic; }
.who__warn {
  font-size: .98rem; color: var(--wine); background: rgba(138, 37, 55, .06);
  border: 1px dashed rgba(138, 37, 55, .35); border-radius: 10px; padding: 8px 12px;
}
.who__warn a, .contact-line a { color: inherit; font-weight: 600; }
.yesno { display: flex; justify-content: center; gap: 56px; margin: 8px 0 18px; }
.round {
  width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--olive); color: #f4f1e3;
  font: 400 2.3rem/1 var(--script); padding-top: 6px;
  box-shadow: 0 10px 18px rgba(50, 52, 36, .25);
  transition: transform .2s var(--ease), background .2s;
}
.round:hover { background: var(--olive-2); }
.round:active { transform: scale(.95); }
.round:focus-visible, .btn:focus-visible, .copy:focus-visible, .stepper button:focus-visible { outline: 3px solid var(--sage-deep); outline-offset: 3px; }
.deadline { color: var(--ink-soft); font-style: italic; margin: 0; font-size: 1rem; }
.rsvp-note p { margin: 0 0 .6rem; }

.rsvp-form { text-align: left; max-width: 380px; margin: 0 auto; }
.form-title { text-align: center; font-family: var(--script); font-size: 2.1rem; margin: 0 0 14px; color: var(--olive); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-soft); font-size: .92rem; margin-top: 4px; }
.opt { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; font: 500 1.08rem/1.35 var(--serif); color: var(--ink);
  background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage-deep); box-shadow: 0 0 0 3px rgba(127, 152, 120, .25); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fffdf6; }
.stepper button { width: 46px; height: 44px; border: 0; background: none; font-size: 1.5rem; cursor: pointer; color: var(--olive); border-radius: 999px; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 2.2em; text-align: center; font: 600 1.4rem/1 var(--serif); }
.form-error { color: var(--wine); margin: 0 0 12px; }
.form-actions { display: flex; gap: 12px; justify-content: space-between; }
.form-actions .btn { flex: 1; }

.rsvp-done p { margin: 0 0 .6rem; }
.script--thanks { font-size: 2.5rem; color: var(--olive); margin-bottom: .6rem; }
.rsvp-done .btn { margin: 14px 0 10px; }

/* 8. closing */
.card--closing { padding: 72px 24px 48px; }
.script--closing { font-size: clamp(1.7rem, 8vw, 2.05rem); line-height: 1.35; max-width: 14em; margin: 0 auto 22px; }
.card--closing .script--names { margin-bottom: 30px; }
.card--closing .garland { width: 100%; }

/* buttons */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: 11px 26px; font: 600 1.08rem/1.2 var(--serif); letter-spacing: .03em;
  transition: transform .15s var(--ease), background .2s;
}
.btn:active { transform: scale(.97); }
.btn--dark { background: var(--olive); color: #f4f1e3; border: 1px solid var(--olive); box-shadow: 0 8px 16px rgba(50, 52, 36, .2); }
.btn--dark:hover { background: var(--olive-2); }
.btn--dark:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; color: var(--olive); border: 1px solid var(--olive-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--olive); color: #f4f1e3; padding: 10px 18px; border-radius: 999px; font-size: 1rem;
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 520px) {
  .invitation { margin: 32px auto; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
