:root {
  --ink: #2f261f;
  --muted: #76695e;
  --cream: #fff8ec;
  --paper: rgba(255, 250, 241, .82);
  --rose: #b76476;
  --wine: #693244;
  --gold: #d9b467;
  --sage: #758b78;
  --sky: #dce8e7;
  --shadow: 0 28px 90px rgba(60, 42, 28, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(217,180,103,.28), transparent 26%),
    radial-gradient(circle at 95% 20%, rgba(183,100,118,.16), transparent 26%),
    linear-gradient(145deg, #fff8ec 0%, #eef3ef 44%, #fbefe8 100%);
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(105,50,68,.035) 1px, transparent 1px),
    linear-gradient(rgba(105,50,68,.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
}

img { display: block; width: 100%; }

.open-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff7eb, #eadbc6 58%, #d7b982);
  overflow: hidden;
  animation: stageGone .8s ease 3.6s forwards;
}

.petal-field span {
  position: absolute;
  width: 12px;
  height: 18px;
  border-radius: 999px 999px 999px 0;
  background: rgba(255,255,255,.76);
  animation: petalFloat 3.5s ease-in-out infinite;
}

.petal-field span:nth-child(1) { left: 12%; top: 28%; animation-delay: .1s; }
.petal-field span:nth-child(2) { left: 24%; top: 64%; animation-delay: .6s; }
.petal-field span:nth-child(3) { right: 18%; top: 22%; animation-delay: .25s; }
.petal-field span:nth-child(4) { right: 12%; bottom: 20%; animation-delay: .9s; }
.petal-field span:nth-child(5) { left: 48%; top: 12%; animation-delay: 1.1s; }

.seal-card {
  width: min(360px, 78vw);
  aspect-ratio: .74;
  perspective: 1400px;
  filter: drop-shadow(0 30px 60px rgba(75,44,21,.24));
  animation: sealedCardExit .85s ease 2.75s forwards;
}

.seal-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: sealedCardOpen 2.2s cubic-bezier(.2,.75,.2,1) .35s forwards;
}

.seal-front,
.seal-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border-radius: 26px;
  overflow: hidden;
  backface-visibility: hidden;
}

.seal-front {
  color: var(--wine);
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.76), transparent 34%),
    linear-gradient(145deg, #fff7e8, #e7cfaa 56%, #cda66d);
  border: 1px solid rgba(255,255,255,.66);
}

.seal-front::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(105,50,68,.18);
  border-radius: 20px;
}

.seal-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cream);
  background: radial-gradient(circle, #b76476, #693244);
  font-weight: 700;
  box-shadow: 0 16px 42px rgba(105,50,68,.28);
}

.seal-front small {
  letter-spacing: .12em;
  color: var(--muted);
}

.seal-front strong {
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: .9;
}

.seal-back {
  transform: rotateY(180deg);
  background: var(--cream);
}

.seal-back img {
  height: 100%;
  object-fit: cover;
}

.wed-page {
  width: min(1180px, calc(100% - 22px));
  margin: 0 auto;
  padding: 14px 0 64px;
  opacity: 0;
  transform: translateY(18px);
  animation: pageIn .8s ease 3.45s forwards;
}

.hero {
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 16px;
  align-items: stretch;
}

.hero-media,
.hero-card,
.quick-info article,
.schedule,
.rsvp-card,
.final-card {
  border: 1px solid rgba(255,255,255,.58);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.72), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.66), rgba(255,248,236,.34));
  backdrop-filter: blur(18px) saturate(1.24);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-media img {
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: center;
}

.hero-card {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(26px, 5vw, 58px);
  position: relative;
}

.hero-card::after,
.schedule::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(217,180,103,.34);
  border-radius: 18px;
  pointer-events: none;
}

.overline,
.script {
  color: var(--rose);
  margin: 0 0 10px;
  font-style: italic;
}

.overline {
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .84rem;
  font-style: normal;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin: 0 0 14px;
  color: var(--wine);
  font-size: clamp(3.2rem, 11vw, 8.3rem);
  line-height: .86;
}

h1 span { color: var(--gold); }

h2 {
  margin-bottom: 14px;
  color: var(--wine);
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: .94;
}

.date-pill {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(217,180,103,.22);
  border: 1px solid rgba(217,180,103,.38);
  font-weight: 700;
  letter-spacing: .08em;
}

.lead,
.story-text p,
.final-card p {
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  line-height: 1.65;
}

.quick-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.quick-info article {
  min-height: 180px;
  padding: 22px;
  display: grid;
  align-content: center;
  text-align: center;
}

.quick-info .accent {
  background: linear-gradient(145deg, rgba(105,50,68,.92), rgba(183,100,118,.76));
  color: var(--cream);
}

.quick-info span {
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
}

.quick-info .accent span,
.quick-info .accent p { color: rgba(255,248,236,.84); }

.quick-info strong {
  margin: 8px 0;
  color: var(--wine);
  font-size: 2.4rem;
}

.quick-info .accent strong { color: var(--cream); }

.quick-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.map-link,
.inline-link,
.phone-actions a {
  text-decoration: none;
}

.map-link {
  width: fit-content;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  margin: 14px auto 0;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(217,180,103,.22);
  border: 1px solid rgba(217,180,103,.38);
  font-weight: 700;
}

.accent .map-link {
  color: var(--cream);
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.28);
}

.split-story {
  display: grid;
  grid-template-columns: minmax(290px, .85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: center;
  margin: 24px 0;
}

.story-text {
  padding: clamp(18px, 4vw, 42px);
}

.stacked-photos {
  min-height: 560px;
  position: relative;
}

.stacked-photos img {
  position: absolute;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.photo-a {
  width: 72%;
  height: 62%;
  left: 0;
  top: 0;
  transform: rotate(-2deg);
}

.photo-b {
  width: 68%;
  height: 62%;
  right: 0;
  bottom: 0;
  transform: rotate(2deg);
}

.schedule {
  margin: 18px 0;
  padding: clamp(24px, 5vw, 54px);
  text-align: center;
  position: relative;
}

.schedule-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.schedule-list div {
  display: grid;
  grid-template-columns: 92px 150px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.48);
  text-align: left;
}

.schedule time {
  color: var(--rose);
  font-size: 1.8rem;
  font-weight: 700;
}

.schedule span {
  color: var(--wine);
  font-weight: 700;
}

.schedule p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.inline-link {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(217,180,103,.2);
  border: 1px solid rgba(217,180,103,.34);
  font-weight: 700;
  white-space: nowrap;
}

.rsvp-card {
  margin: 24px 0;
  padding: clamp(24px, 5vw, 52px);
  text-align: center;
}

.phone-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.phone-actions a {
  min-height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 20px;
  color: var(--cream);
  background: linear-gradient(145deg, rgba(105,50,68,.94), rgba(183,100,118,.78));
  box-shadow: 0 18px 48px rgba(105,50,68,.18);
}

.phone-actions span {
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .78rem;
  opacity: .86;
}

.phone-actions strong {
  font-size: clamp(1.25rem, 4vw, 1.7rem);
}

.moments {
  display: grid;
  grid-template-columns: .8fr 1.15fr .8fr;
  gap: 14px;
  margin: 24px 0;
  align-items: center;
}

.moments img {
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.moments img:nth-child(2) {
  height: clamp(280px, 42vw, 560px);
}

.final-card {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.final-card div {
  padding: clamp(16px, 4vw, 36px);
}

.final-card img {
  height: min(58vw, 560px);
  min-height: 320px;
  object-fit: cover;
  border-radius: 18px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(.985);
  transition: opacity .8s ease, transform .8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .22s; }

@keyframes sealedCardOpen {
  0% { transform: rotateY(0deg) scale(.92); }
  42% { transform: rotateY(0deg) scale(1); }
  100% { transform: rotateY(180deg) scale(1.1); }
}

@keyframes sealedCardExit {
  to { opacity: 0; transform: translateY(-18px) scale(1.12); }
}

@keyframes stageGone {
  to { opacity: 0; visibility: hidden; }
}

@keyframes pageIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes captionFade {
  to { opacity: 0; transform: translateY(8px); }
}

@keyframes petalFloat {
  50% { transform: translate3d(22px, -26px, 0) rotate(28deg); }
}

@media (max-width: 860px) {
  .wed-page {
    width: min(100% - 12px, 1180px);
    padding-top: 6px;
  }

  .hero,
  .quick-info,
  .split-story,
  .moments,
  .final-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-media {
    border-radius: 24px 24px 14px 14px;
  }

  .hero-media img {
    min-height: 0;
    height: min(72vh, 560px);
  }

  .hero-card {
    padding: 28px 18px 34px;
  }

  .quick-info article {
    min-height: 136px;
    padding: 18px;
  }

  .stacked-photos {
    min-height: 0;
    display: grid;
    gap: 12px;
  }

  .stacked-photos img {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 1.42;
    transform: none;
  }

  .schedule-list div {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 6px;
  }

  .phone-actions {
    grid-template-columns: 1fr;
  }

  .moments img,
  .moments img:nth-child(2),
  .final-card img {
    height: auto;
    min-height: 0;
    aspect-ratio: 1.28;
  }

@media (max-width: 420px) {
  h1 { font-size: clamp(3rem, 18vw, 5rem); }
  .lead, .story-text p, .final-card p { font-size: 1rem; }
  .seal-card { width: min(290px, 78vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .open-stage { display: none; }
  .wed-page, .reveal { opacity: 1; transform: none; }
}
