:root {
  color-scheme: light;
  --paper: #f8f5ed;
  --surface: #fffefa;
  --ink: #222d25;
  --muted: #555e55;
  --green: #244a38;
  --green-hover: #183a2a;
  --tint: #eaf1e8;
  --rule: #d9ded2;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--green); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #5c826b; outline-offset: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.topbar { border-bottom: 1px solid #e5e4d9; }
.topbar-inner {
  max-width: 68rem; margin: 0 auto; min-height: 3.5rem;
  padding: .65rem clamp(1rem, 4vw, 2rem);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font: 600 1.25rem/1 var(--serif); }
.fold {
  width: 1rem; height: .78rem; border: 1.5px solid var(--green); border-radius: .15rem;
  position: relative; transform: rotate(-9deg);
}
.fold::after {
  content: ''; position: absolute; left: .18rem; top: -.13rem; width: .47rem; height: .47rem;
  border-right: 1px solid var(--green); border-bottom: 1px solid var(--green); transform: rotate(45deg);
}
.sample-label { font-size: .82rem; color: var(--muted); }

.layout {
  max-width: 68rem; margin: 0 auto; padding: clamp(.95rem, 3vw, 2.6rem) clamp(1rem, 4vw, 2rem) 3rem;
  display: grid; gap: clamp(1rem, 3vw, 2rem); align-items: start;
}
.invitation, .reply-card { background: var(--surface); border: 1px solid #e2e3d8; border-radius: 1.2rem; }
.invitation { overflow: hidden; }
.invitation-art {
  display: grid; justify-items: center; text-align: center; isolation: isolate;
  min-height: 13rem; padding: 1.35rem 1.1rem 1.45rem; position: relative; background: #f6efe0;
}
.invitation-art::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(252, 248, 236, .88), rgba(250, 245, 230, .3)),
              url('/assets/botanical-card.jpg') center / cover;
}
.invitation-art[data-theme="confetti"]::before {
  background: linear-gradient(0deg, rgba(255, 248, 229, .9), rgba(255, 248, 229, .42)),
              url('/assets/confetti-card.jpg') center / cover;
}
.portrait {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; overflow: hidden;
  border: .22rem solid #fff9ed; outline: 1px solid #a1a68c;
  margin: 0 auto .85rem; box-shadow: 0 4px 18px #453a2826;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.invitation-copy { align-self: center; max-width: 27rem; }
.occasion {
  margin: 0 0 .45rem; color: #405e47; font-weight: 700; font-size: .83rem;
  letter-spacing: .11em; text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.037em; }
h1 { margin: 0; font-size: clamp(2.4rem, 10vw, 3.75rem); line-height: 1.04; overflow-wrap: anywhere; }
.intro { margin: .6rem auto 0; max-width: 28ch; color: #404e42; font-size: .95rem; }
.details { margin: 0; padding: 0 1rem; }
.details > div { display: grid; grid-template-columns: 3.65rem 1fr; gap: .65rem; padding: .78rem 0; }
.details > div + div { border-top: 1px solid #e8ebe1; }
dt { font-size: .91rem; font-weight: 700; color: var(--muted); padding-top: .06rem; }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-secondary { display: block; margin-top: .12rem; font: 400 .9rem/1.38 var(--sans); color: var(--muted); }
.quiet-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .92rem; font-weight: 650; }
.calendar-link { margin: .04rem 1rem .34rem; }

.reply-card { scroll-margin-top: 1rem; padding: clamp(1rem, 4vw, 1.65rem); }
.reply-header { margin-bottom: 1rem; }
h2 { font-size: clamp(1.95rem, 7.3vw, 2.75rem); line-height: 1.08; margin: 0; }
.reply-header .occasion { letter-spacing: .08em; text-transform: none; font-size: .91rem; }
form { display: grid; gap: 1.08rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.choice {
  min-height: 3.18rem; border: 1px solid var(--rule); border-radius: .68rem; padding: .5rem .32rem;
  display: flex; justify-content: center; align-items: center; gap: .34rem;
  font-weight: 650; color: var(--ink); cursor: pointer;
}
.choice:has(:checked) { border-color: var(--green); background: var(--tint); color: var(--green); }
.choice input { appearance: none; width: .92rem; height: .92rem; margin: 0; border: 1.5px solid #788476; border-radius: 50%; flex: none; }
.choice input:checked { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 44%, transparent 49%); }
.field { display: grid; gap: .33rem; }
.field span, .field-label, summary { font-weight: 650; }
.field input, textarea {
  width: 100%; min-height: 3.05rem; padding: .64rem .75rem; color: var(--ink);
  border: 1px solid var(--rule); border-radius: .65rem; background: var(--surface);
}
::placeholder { color: #667069; }

.count-field { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.field-note { margin: .11rem 0 0; font-size: .87rem; color: var(--muted); }
.stepper { display: inline-grid; grid-template-columns: 2.75rem minmax(1.7rem, auto) 2.75rem; align-items: center; }
.stepper button {
  border: 1px solid var(--rule); background: var(--tint); color: var(--green);
  border-radius: .6rem; min-height: 2.75rem; font-size: 1.35rem; line-height: 1;
}
.stepper button:disabled { background: #f5f5f0; color: #777e73; }
.stepper output { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.note-field { border-top: 1px solid #e8ebe1; border-bottom: 1px solid #e8ebe1; }
summary { cursor: pointer; padding: .64rem 0; min-height: 2.75rem; }
summary span { font-size: .85rem; font-weight: 400; color: var(--muted); margin-left: .2rem; }
textarea { margin: .15rem 0 .75rem; resize: vertical; }
.primary, .secondary {
  border: 1px solid var(--green); border-radius: .72rem; min-height: 3rem;
  padding: .7rem 1.05rem; font-weight: 700; line-height: 1.25;
}
.primary { width: 100%; background: var(--green); color: white; }
.primary:disabled { opacity: .72; }
.secondary { background: var(--surface); color: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-hover); }
.secondary:hover { background: var(--tint); }
.privacy-note { text-align: center; margin-top: -.4rem; }
.form-error { margin: 0; color: #8b2929; }
.notice { margin: .25rem 0; padding: .8rem 1rem; background: var(--tint); border-radius: .6rem; }
.confirmation { text-align: center; padding: 1.1rem .35rem .4rem; }
.success-mark {
  width: 2.85rem; height: 2.85rem; background: var(--tint); border-radius: 50%;
  margin: 0 auto .9rem; display: grid; place-items: center;
}
.success-mark::before {
  content: ''; width: .85rem; height: .45rem; border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: translateY(-.12rem) rotate(-45deg);
}
h3 { margin: 0; font-size: 2rem; line-height: 1.15; }
.confirmation p { color: var(--muted); margin: .55rem auto 1rem; max-width: 26rem; overflow-wrap: anywhere; }
.empty-state, .noscript { max-width: 29rem; margin: 3rem auto; padding: 1.2rem; text-align: center; }
.empty-state h1 { font-size: 2.3rem; }
.empty-state p { color: var(--muted); }
.loading-mark { display: inline-block; width: 1.3rem; height: 1.3rem; border: 2px solid var(--rule); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-bar {
  position: fixed; inset: auto 0 0;
  background: #f8f5edf2; border-top: 1px solid #e0e1d5; padding: .6rem 1rem max(.6rem, env(safe-area-inset-bottom));
  z-index: 1; backdrop-filter: blur(8px);
}
body:has(.mobile-bar:not([hidden])) .layout { padding-bottom: 5.35rem; }
body:has(input:focus, textarea:focus) .mobile-bar { display: none; }
.legal { max-width: 43rem; margin: 0 auto; padding: 2rem 1.2rem 3.5rem; }
.legal h1 { font-size: clamp(2.2rem, 8vw, 3.1rem); }
.legal h2 { margin: 1.8rem 0 .45rem; font-size: 1.6rem; }
.legal p { color: var(--muted); }

@media (min-width: 46rem) {
  .layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  body:has(.mobile-bar:not([hidden])) .layout { padding-bottom: 3rem; }
  .invitation-art { min-height: 19.5rem; padding: 2rem 1.5rem; align-content: center; }
  .portrait { width: 7rem; height: 7rem; margin-bottom: 1rem; }
  .details { padding: 0 1.4rem; }
  .details > div { grid-template-columns: 4.5rem 1fr; padding: .95rem 0; }
  .calendar-link { margin-left: 1.4rem; }
  .mobile-bar { display: none; }
}
@media (max-width: 23rem) {
  .choice { gap: .21rem; font-size: .94rem; }
  .choice input { width: .75rem; height: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-mark { animation: none; }
}
