:root {
  --paper: #f7f1e7;
  --paper-deep: #ede2d1;
  --ink: #22372f;
  --ink-soft: #607067;
  --sage: #9daf9c;
  --sage-dark: #59705f;
  --rose: #be8e83;
  --gold: #a9844f;
  --cream: #fffaf2;
  --shadow: 0 24px 65px rgba(45, 38, 28, 0.19), 0 6px 18px rgba(45, 38, 28, 0.10);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  padding: .75rem 1rem;
  background: var(--ink);
  color: white;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.opening {
  --open-progress: 0;
  --zoom-progress: 0;
  --scene-scale: 1;
  --scene-x: 0px;
  --scene-y: 0px;
  --cue-opacity: 1;
  --caption-opacity: 0;
  --live-page-left: 50vw;
  --live-page-top: 50svh;
  --live-page-width: 0px;
  --live-page-height: 0px;
  height: 410vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(190, 142, 131, .2), transparent 26rem),
    radial-gradient(circle at 90% 80%, rgba(157, 175, 156, .22), transparent 28rem),
    var(--paper);
}

.opening__sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 1800px;
  padding: clamp(1rem, 4vw, 3rem);
}

.ambient {
  position: absolute;
  width: 25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .18;
  pointer-events: none;
}
.ambient--one {
  top: -12rem;
  left: -8rem;
  background: repeating-radial-gradient(circle, transparent 0 16px, var(--rose) 17px 18px);
}
.ambient--two {
  right: -10rem;
  bottom: -13rem;
  background: repeating-radial-gradient(circle, transparent 0 16px, var(--sage-dark) 17px 18px);
}

.card-scene {
  position: relative;
  z-index: 3;
  width: min(84vw, 980px);
  aspect-ratio: 1.55 / 1;
  perspective: 2000px;
  transform: translate3d(var(--scene-x), var(--scene-y), 0) scale(var(--scene-scale));
  transform-origin: center center;
  will-change: transform;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  filter: drop-shadow(0 25px 28px rgba(42, 35, 27, .16));
}

.card__inside,
.card__cover {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--cream);
}

.card__inside {
  overflow: hidden;
  padding: clamp(1.5rem, 3vw, 3.5rem);
  border: 1px solid rgba(34, 55, 47, .12);
}

.card__inside--right {
  right: 0;
  padding: 0;
  background: transparent;
  border-radius: 0 .25rem .25rem 0;
  box-shadow: inset 18px 0 30px rgba(90, 70, 45, .05);
}

.card__cover h2 {
  margin: .5rem 0 .75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.2vw, 4.7rem);
  line-height: .96;
}
.card__cover h2 span {
  display: block;
  margin: .2em 0;
  color: var(--gold);
  font-size: .58em;
  font-style: italic;
}

.card__cover {
  left: 50%;
  z-index: 4;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--open-progress) * -179deg));
  will-change: transform;
}

.cover__front,
.cover__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border-radius: 0 .25rem .25rem 0;
}

.cover__front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 3rem);
  background:
    linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)),
    repeating-linear-gradient(90deg, rgba(70, 55, 35, .012) 0 1px, transparent 1px 4px),
    var(--paper-deep);
  text-align: center;
  box-shadow: var(--shadow), inset 18px 0 34px rgba(74, 54, 34, .07);
}
.cover__back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.4rem;
  padding: clamp(1.5rem, 3vw, 3.5rem);
  text-align: center;
  background: var(--paper-deep);
  box-shadow: inset -18px 0 34px rgba(74, 54, 34, .08);
}

.cover-border {
  position: absolute;
  inset: clamp(.75rem, 2vw, 1.45rem);
  border: 1px solid rgba(169, 132, 79, .65);
  pointer-events: none;
}

.small-caps,
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: clamp(.65rem, 1.1vw, .78rem);
  font-weight: 650;
}
.eyebrow { color: var(--sage-dark); }
.cover-date,
.location-line,
.invitation-copy,
.inside-note {
  margin: .4rem 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}
.inside-note { max-width: 24ch; line-height: 1.55; }
.cover-rule {
  width: 3rem;
  height: 1px;
  margin: .8rem 0;
  background: var(--gold);
}

.monogram {
  display: grid;
  place-items: center;
  width: 7.2rem;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--gold);
}
.monogram--back { opacity: .82; }

.botanical {
  position: absolute;
  width: 11rem;
  height: 11rem;
  opacity: .55;
  background:
    radial-gradient(ellipse at 35% 25%, transparent 0 23%, var(--sage-dark) 24% 25%, transparent 26%),
    radial-gradient(ellipse at 62% 45%, transparent 0 19%, var(--sage-dark) 20% 21%, transparent 22%),
    radial-gradient(ellipse at 28% 72%, transparent 0 17%, var(--rose) 18% 19%, transparent 20%);
  transform: rotate(-20deg);
  pointer-events: none;
}
.botanical::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3%;
  width: 1px;
  height: 94%;
  background: var(--sage-dark);
  transform: rotate(30deg);
  transform-origin: bottom;
}
.botanical--cover-top { right: -2rem; top: -2rem; }
.botanical--cover-bottom { left: -2rem; bottom: -2rem; transform: rotate(160deg); }
.botanical--left { left: -3rem; bottom: -3rem; }
.botanical--right { right: -3rem; top: -3rem; transform: rotate(25deg); }

/*
  Persistent live right page
  --------------------------
  The physical right page above is only a transparent shell. This component
  supplies the visible paper and every piece of its content from the first
  frame to the last. JavaScript changes its real rectangle rather than scaling
  it with a transform, while container-relative units enlarge the layout and
  typography. The browser therefore redraws all wording sharply and there is
  no hand-off between separate versions of the invitation.
*/
.live-page {
  position: absolute;
  z-index: 2;
  left: var(--live-page-left);
  top: var(--live-page-top);
  width: var(--live-page-width);
  height: var(--live-page-height);
  container-type: size;
  contain: layout paint style;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(34, 55, 47, .12);
  border-radius: 0 .25rem .25rem 0;
  background:
    linear-gradient(rgba(255, 255, 255, .12), rgba(255, 255, 255, .12)),
    repeating-linear-gradient(90deg, rgba(70, 55, 35, .008) 0 1px, transparent 1px 4px),
    var(--cream);
  box-shadow: inset 3cqw 0 5cqw rgba(90, 70, 45, .05);
  text-align: center;
  pointer-events: none;
  overflow-wrap: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.live-page__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 8cqw;
}

.live-page .eyebrow {
  font-size: min(2.4cqw, 1.7cqh);
  letter-spacing: .2em;
  white-space: nowrap;
}

.live-page h1 {
  margin: 1.4cqh 0 2cqh;
  font-family: var(--serif);
  font-size: min(13.5cqw, 8.6cqh);
  font-weight: 400;
  line-height: .96;
  white-space: nowrap;
}

.live-page h1 span {
  display: block;
  margin: .2em 0;
  color: var(--gold);
  font-size: .58em;
  font-style: italic;
}

.live-page .invitation-copy,
.live-page .location-line {
  font-size: min(3.2cqw, 2.1cqh);
  line-height: 1.25;
}

.live-page .location-line {
  max-width: 88%;
}

.live-page .date-lockup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 2.6cqw;
  width: 78%;
  margin: 3.8cqh 0;
  font-family: var(--serif);
}

.live-page .date-lockup strong {
  padding: .4cqh 3.2cqw;
  border-left: max(1px, .12cqw) solid var(--gold);
  border-right: max(1px, .12cqw) solid var(--gold);
  font-size: min(9cqw, 6.2cqh);
  font-weight: 400;
  line-height: 1.1;
}

.live-page .date-lockup span {
  font-size: min(2.5cqw, 1.8cqh);
  line-height: 1.25;
}

.live-page .botanical--right {
  width: 28cqw;
  height: 28cqw;
  right: -8cqw;
  top: -8cqw;
  opacity: .55;
}

.scroll-cue,
.opening-caption {
  position: absolute;
  z-index: 10;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-soft);
  font-size: .67rem;
  transition: opacity .25s ease;
}
.scroll-cue {
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  gap: .7rem;
  opacity: var(--cue-opacity);
}
.scroll-cue__line {
  width: 1px;
  height: 2rem;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}
.opening-caption {
  top: 1.5rem;
  opacity: var(--caption-opacity);
}
@keyframes pulse { 0%,100%{transform:scaleY(.4); opacity:.35} 50%{transform:scaleY(1); opacity:1} }

.details {
  scroll-snap-type: y proximity;
}
.panel {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 6vw, 6rem);
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}
.panel__inner { width: min(100%, 1050px); position: relative; z-index: 1; }
.panel__inner--narrow { width: min(100%, 760px); text-align: center; }
.panel h2 {
  margin: .25rem 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: .95;
  font-weight: 400;
  letter-spacing: -.035em;
}
.panel h3 { margin: 0 0 .35rem; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.lead { font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.65rem); line-height: 1.55; color: var(--ink-soft); }
.section-number { margin: 0 0 1rem; color: var(--rose); font-size: .75rem; letter-spacing: .22em; }
.section-heading { margin-bottom: clamp(2rem, 5vw, 4rem); }
.ornament { margin-top: 2.5rem; color: var(--gold); font-size: 1.5rem; }

.panel--welcome { background: var(--cream); }
.panel--schedule { background: #dfe7df; }
.panel--venue { background: #f0e4d7; }
.panel--practical { background: #faf6ef; }
.panel--playlist { background: #d8c5bd; }
.panel--rsvp { background: var(--ink); color: var(--cream); }
.panel--rsvp .eyebrow, .panel--rsvp .section-number { color: #d8c5bd; }
.panel--rsvp .lead, .panel--closing .eyebrow { color: rgba(255,250,242,.72); }
.panel--closing { background: #182720; color: var(--cream); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; }
.timeline li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid rgba(34, 55, 47, .18);
}
.timeline li:last-child { border-bottom: 1px solid rgba(34, 55, 47, .18); }
.timeline time { color: var(--sage-dark); font-size: .85rem; letter-spacing: .15em; }
.timeline p { margin: 0; color: var(--ink-soft); line-height: 1.5; }

.venue-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); }
address { margin: 2rem 0; font-style: normal; line-height: 1.7; color: var(--ink-soft); }
.text-link { display: inline-flex; gap: .5rem; padding-bottom: .2rem; text-decoration: none; border-bottom: 1px solid currentColor; font-weight: 650; }
.venue-card {
  min-height: min(60vh, 560px);
  position: relative;
  overflow: hidden;
  border-radius: 45% 45% .3rem .3rem;
  background: linear-gradient(#d6e2dc 0 62%, #b4c0a6 62% 100%);
  box-shadow: var(--shadow);
}
.venue-card__sun { position:absolute; width:8rem; aspect-ratio:1; border-radius:50%; background:#edd6aa; top:15%; right:15%; }
.venue-card__house { position:absolute; left:50%; bottom:22%; width:54%; height:36%; background:#f8f0e3; transform:translateX(-50%); box-shadow:0 14px 30px rgba(34,55,47,.15); }
.venue-card__house::before { content:""; position:absolute; left:-10%; right:-10%; top:-40%; border-left:calc(min(60vw,560px) * .18) solid transparent; border-right:calc(min(60vw,560px) * .18) solid transparent; border-bottom:calc(min(60vw,560px) * .14) solid #b96f62; }
.venue-card__house span { position:relative; display:inline-block; width:15%; height:40%; margin:28% 8% 0; background:#668174; }
.venue-card__ground { position:absolute; width:120%; height:20%; left:-10%; bottom:-8%; border-radius:50%; background:#738a6c; }

.detail-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.detail-cards article { padding: clamp(1.6rem, 3vw, 2.6rem); border: 1px solid rgba(34,55,47,.13); background: rgba(255,255,255,.45); }
.detail-cards p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.detail-icon { display: block; margin-bottom: 2rem; color: var(--gold); font-size: 1.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  margin-top: 1.5rem;
  padding: 1rem 1.35rem;
  border: 1px solid var(--cream);
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 750;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button--secondary { border-color: var(--ink); background: transparent; color: var(--ink); }
.fine-print { margin-top: 1rem; color: rgba(255,250,242,.55); font-size: .76rem; }
.signature { margin-top: 2.3rem; font-family: var(--serif); font-size: 1.35rem; font-style: italic; line-height: 1.6; }
.monogram--footer { margin: 0 auto 2rem; border-color: rgba(255,250,242,.6); color: var(--cream); }
.back-to-top { display: inline-block; margin-top: 3rem; color: rgba(255,250,242,.72); text-underline-offset: .3rem; }

@media (max-width: 760px) {
  .opening { height: 380vh; }
  .card-scene { width: min(96vw, 660px); aspect-ratio: 1.12 / 1; }
  .card__inside { padding: 1rem; }
  .card__inside--right { padding: 0; }
  .card__cover h2 { font-size: clamp(1.6rem, 8vw, 2.8rem); }
  .inside-note { font-size: .76rem; }
  .monogram { width: 4.7rem; font-size: 1rem; }
  .small-caps, .eyebrow { font-size: .58rem; letter-spacing: .16em; }
  .cover-date, .location-line, .invitation-copy { font-size: .78rem; }
  .botanical { width: 7rem; height: 7rem; }
  .opening-caption { display: none; }
  .venue-grid, .detail-cards { grid-template-columns: 1fr; }
  .venue-card { min-height: 380px; order: -1; }
  .timeline li { grid-template-columns: 4.5rem 1fr; gap: .75rem; }
  .panel { min-height: auto; padding-top: 6rem; padding-bottom: 6rem; }

  .live-page__content { padding: 8cqw 7cqw; }
  .live-page .eyebrow { font-size: min(5cqw, 2.8cqh); }
  .live-page h1 { font-size: min(14.5cqw, 8.5cqh); }
  .live-page .invitation-copy,
  .live-page .location-line { font-size: min(5.4cqw, 3.2cqh); }
  .live-page .date-lockup { width: 92%; gap: 2cqw; margin: 3cqh 0; }
  .live-page .date-lockup strong {
    padding: .25cqh 2.8cqw;
    font-size: min(11cqw, 6.5cqh);
  }
  .live-page .date-lockup span { font-size: min(4.8cqw, 2.7cqh); }
}

@media (max-width: 420px) {
  .card-scene { width: 98vw; }
  .cover__back .small-caps, .cover__back .inside-note { display: none; }
  .cover-border { inset: .55rem; }
  .botanical--cover-top { right: -3rem; top: -3rem; }
  .botanical--cover-bottom { left: -3rem; bottom: -3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .opening {
    height: 100svh;
    --open-progress: 1;
    --zoom-progress: 0;
  }
  .card-scene {
    transform: none;
  }
  .card__cover { transform: rotateY(-179deg); }
  .scroll-cue, .opening-caption { display: none; }
}
