:root {
  --paper: #f8f6f1;
  --paper-deep: #efece4;
  --ink: #161616;
  --muted: #67635d;
  --line: rgba(22, 22, 22, 0.2);
  --copper: #a75f32;
  --surface: rgba(255,255,255,0.56);
  --shadow: 0 24px 70px rgba(29, 25, 20, 0.11);
  --radius: 28px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("../images/paper-texture.webp") center top / 980px auto repeat;
  opacity: 0.82;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 16% 16%, rgba(255,255,255,0.8), transparent 30%),
    radial-gradient(circle at 82% 54%, rgba(255,255,255,0.58), transparent 35%);
  pointer-events: none;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 80;
  background: transparent;
}
.page-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.08s linear;
}

.topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  width: min(calc(100% - 28px), 760px);
  z-index: 70;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(22,22,22,0.12);
  border-radius: 999px;
  background: rgba(248,246,241,0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 35px rgba(20,20,20,0.08);
  transition: transform 0.35s ease;
}
.topbar.is-visible { transform: translateX(-50%) translateY(0); }
.topbar__names {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
}
.topbar__rsvp {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
}

.section {
  position: relative;
  padding: 92px 22px;
}
.section--contained {
  width: min(100%, calc(var(--max) + 44px));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.45rem, 5vw, 2rem);
  font-weight: 600;
}

h1, h2, h3 { margin-top: 0; }
h1, h2 {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-weight: 700;
  line-height: 0.98;
}
h2 { font-size: clamp(3rem, 11vw, 5.6rem); margin-bottom: 20px; }
h3 { font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 2rem; line-height: 1; margin-bottom: 12px; }
p { margin-top: 0; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 13px 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-2px); background: #000; box-shadow: 0 10px 26px rgba(0,0,0,.14); }
.button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(167,95,50,.32); outline-offset: 3px; }
.button--wide { width: 100%; border: 0; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding-top: max(70px, env(safe-area-inset-top));
  padding-bottom: max(42px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.hero__ornament {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) rotate(-9deg);
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 3.2rem;
}
.hero__content { align-self: end; z-index: 2; }
.hero h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(4.2rem, 18vw, 9rem);
  letter-spacing: -0.035em;
}
.hero h1 span { display: block; font-size: .55em; margin: -0.08em 0; }
.hero__date {
  margin: 20px 0 0;
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  font-weight: 600;
}
.hero__date span { padding-inline: 6px; color: var(--copper); }
.hero__image {
  width: min(94vw, 660px);
  max-height: 48svh;
  object-fit: contain;
  object-position: center bottom;
  margin-top: -8px;
}
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.scroll-hint i { width: 1px; height: 28px; background: var(--ink); animation: scrollPulse 1.8s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { transform: scaleY(.45); opacity: .35; } 50% { transform: scaleY(1); opacity: 1; } }

.welcome {
  display: grid;
  gap: 36px;
  align-items: center;
}
.welcome__text { max-width: 620px; }
.welcome__text > p:not(.eyebrow) { font-size: 1.02rem; color: #393733; }
.signature { margin-top: 26px; font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 2rem; }
.welcome__art img { width: min(100%, 440px); margin-inline: auto; }

.section-heading { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.section-heading > p:last-child { color: var(--muted); }

.calendar {
  width: min(100%, 650px);
  margin-inline: auto;
  padding: 28px 20px 24px;
  border: 1px solid rgba(22,22,22,.17);
  border-radius: var(--radius);
  background: rgba(255,255,255,.48);
  box-shadow: var(--shadow);
}
.calendar__month {
  text-align: center;
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.calendar__weekdays, .calendar__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; text-align: center; }
.calendar__weekdays { margin-bottom: 8px; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.calendar__days span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 50%;
  font-size: .9rem;
}
.calendar__special { position: relative; color: white; font-weight: 700; }
.calendar__special::before {
  content: "♥";
  position: absolute;
  z-index: -1;
  color: var(--ink);
  font-size: 2.75rem;
  line-height: 1;
  transform: rotate(-8deg);
}

.location__card {
  max-width: 820px;
  margin-inline: auto;
  padding: 44px 22px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(22,22,22,.12);
  box-shadow: var(--shadow);
}
.location__pin { font-size: 2rem; margin-bottom: 8px; }
.location h2 { font-size: clamp(2.7rem, 10vw, 5rem); }
.location__address { color: var(--muted); margin: 0 0 28px; }

.timeline { position: relative; max-width: 760px; margin-inline: auto; }
.timeline::before { content: ""; position: absolute; left: 42px; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
.timeline__item { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 18px; padding: 18px 0 34px; }
.timeline__item time {
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: start;
  width: 84px;
  height: 84px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 1.7rem;
  font-weight: 700;
}
.timeline__item h3 { margin-bottom: 8px; }
.timeline__item p { color: var(--muted); margin-bottom: 0; }

.countdown {
  margin-block: 50px;
  padding-block: 72px;
  background: var(--ink);
  color: white;
  overflow: hidden;
}
.countdown::before, .countdown::after {
  content: "♡";
  position: absolute;
  font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  color: rgba(255,255,255,.08);
  font-size: 15rem;
}
.countdown::before { left: -20px; top: -80px; transform: rotate(-14deg); }
.countdown::after { right: -20px; bottom: -110px; transform: rotate(15deg); }
.countdown__inner { text-align: center; }
.countdown__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 12px; max-width: 720px; margin: 30px auto 0; }
.countdown__grid div { display: flex; flex-direction: column; align-items: center; }
.countdown__grid strong { font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: clamp(3.8rem, 18vw, 7rem); line-height: .8; font-weight: 600; }
.countdown__grid span { margin-top: 12px; color: rgba(255,255,255,.7); font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; }

.wishes__layout { display: grid; gap: 38px; align-items: center; }
.wishes__cards { display: grid; gap: 16px; }
.wish-card {
  position: relative;
  padding: 28px 24px 26px;
  border: 1px solid rgba(22,22,22,.13);
  border-radius: 24px;
  background: rgba(255,255,255,.44);
}
.wish-card__number { position: absolute; top: 22px; right: 22px; color: rgba(22,22,22,.3); font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 1.5rem; }
.wish-card p { margin: 0; color: #45423d; }
.wishes__art img { width: min(100%, 470px); margin-inline: auto; }

.rsvp { background: rgba(231,227,218,.64); }
.rsvp__inner { max-width: 820px; }
.rsvp-form {
  padding: 26px 18px;
  border: 1px solid rgba(22,22,22,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.63);
  box-shadow: var(--shadow);
}
.form-field { margin: 0 0 26px; padding: 0; border: 0; }
.form-field label, .form-field legend { display: block; margin-bottom: 10px; font-weight: 600; }
.form-field input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid rgba(22,22,22,.22);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,255,.72);
}
.form-field input[type="text"]::placeholder { color: #96918a; }
.form-field input[type="text"].is-invalid { border-color: #9c2e2e; }
.form-field--honeypot { position: absolute; left: -9999px; }
.choice-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choice { display: flex !important; align-items: center; gap: 11px; margin: 0 !important; padding: 12px 14px; border: 1px solid rgba(22,22,22,.14); border-radius: 14px; background: rgba(255,255,255,.55); cursor: pointer; font-weight: 500 !important; }
.choice input { width: 18px; height: 18px; accent-color: var(--ink); flex: 0 0 auto; }
.form-error { display: block; min-height: 1.2em; margin-top: 7px; color: #982f2f; font-size: .82rem; }
.form-status { min-height: 24px; margin-top: 14px; text-align: center; font-weight: 600; }
.form-status.is-success { color: #2a613e; }
.form-status.is-error { color: #982f2f; }
.is-disabled { opacity: .42; pointer-events: none; }

.final {
  min-height: 88svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.final__content { z-index: 1; }
.final h2 { font-size: clamp(3.4rem, 13vw, 7rem); }
.final__content > p:last-child { font-family: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 1.8rem; }
.final__image { width: min(94vw, 650px); margin-top: 24px; }
.footer { padding: 24px; text-align: center; color: var(--muted); font-size: .8rem; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal--delay { transition-delay: .12s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (min-width: 640px) {
  .section { padding: 120px 32px; }
  .hero h1 span { display: inline; font-size: .52em; margin-inline: .1em; vertical-align: .18em; }
  .calendar { padding: 38px; }
  .calendar__days span { min-height: 54px; font-size: 1rem; }
  .countdown__grid { grid-template-columns: repeat(4, 1fr); }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .rsvp-form { padding: 38px; }
}

@media (min-width: 860px) {
  .welcome { grid-template-columns: 1.08fr .92fr; gap: 70px; }
  .wishes__layout { grid-template-columns: 1.12fr .88fr; gap: 70px; }
  .hero { grid-template-rows: 1fr auto 60px; }
  .hero__image { max-height: 54svh; }
  .timeline::before { left: 72px; }
  .timeline__item { grid-template-columns: 144px 1fr; gap: 30px; }
  .timeline__item time { width: 110px; height: 110px; font-size: 2rem; margin-left: 18px; }
  .timeline__item div { padding-top: 18px; }
  .final { grid-template-columns: 1fr 1fr; max-width: var(--max); margin: auto; text-align: left; }
  .final__image { margin-top: 0; }
}

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