:root {
  --ink: #201d18;
  --ink-soft: #4b463b;
  --olive: #4f533d;
  --olive-deep: #2f3427;
  --paper: #eee8dc;
  --paper-warm: #e6dece;
  --cream: #f7f1e7;
  --gold: #a18b64;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  overflow-x: hidden;
}
img { display: block; width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.paper-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: multiply;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E"),
    linear-gradient(90deg, rgba(80,65,35,.04) 1px, transparent 1px),
    linear-gradient(rgba(80,65,35,.025) 1px, transparent 1px);
  background-size: 180px 180px, 17px 100%, 100% 23px;
}

.photo-fill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.image-edge-frame {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(247,241,231,.32);
  pointer-events: none;
  z-index: 5;
}
.image-edge-frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(247,241,231,.11);
}

/* Reusable antique photograph frame */
.classic-frame {
  position: relative;
  margin: 0;
  padding: 10px;
  background: rgba(239,232,218,.93);
  border: 1px solid rgba(99,87,63,.24);
  box-shadow: 0 18px 55px rgba(47,43,32,.10);
}
.classic-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(88,76,53,.20);
  z-index: 4;
  pointer-events: none;
}
.frame-inner { position: relative; overflow: hidden; background: #d9d0bd; }
.frame-inner img { width: 100%; height: 100%; object-fit: cover; }

.mini-header {
  position: fixed;
  z-index: 40;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 58px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(247,243,233,.92);
  mix-blend-mode: difference;
  pointer-events: none;
}
.mini-header a { pointer-events: auto; }
.monogram { font-family: var(--display); font-size: 13px; letter-spacing: .18em; }
.mini-header nav { display: flex; gap: 22px; }
.mini-header nav a { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; }

/* HERO — one uninterrupted first page; all invitation text remains together */
.hero {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #20261d;
}
.hero-photo {
  z-index: 0;
  transform: none;
}
.hero-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(235,230,213,.10), rgba(67,70,49,.22) 42%, rgba(22,27,20,.55) 100%),
    radial-gradient(circle at 50% 43%, rgba(245,232,197,.07), transparent 55%);
}
.hero .paper-grain { z-index: 2; opacity: .17; }
.hero-copy {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  width: min(92vw, 760px);
  padding: 0 20px;
  color: #f8f2e7;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0,0,0,.34), 0 0 34px rgba(0,0,0,.16);
}
.tiny-italic { font-size: 14px; font-style: italic; letter-spacing: .02em; margin: 0; }
.tiny-serif { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; margin: 4px 0 0; }
.spaced { letter-spacing: .24em; }
.script-display {
  font-family: var(--script);
  font-weight: 400;
  line-height: .72;
  text-align: center;
}
.hero-invite-line { font-size: clamp(22px, 2.8vw, 32px); }
.hero-to-the {
  margin-top: 7px;
  font-family: var(--display);
  font-size: clamp(12px, 1.5vw, 17px);
  letter-spacing: .18em;
}
.hero-title {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 12px auto 24px;
  font-size: clamp(104px, 14vw, 164px);
  line-height: .72;
  white-space: nowrap;
}
.hero-celebration { font-size: clamp(22px, 2.7vw, 32px); margin-bottom: 16px; }
.couple-names {
  display: grid;
  justify-items: center;
  gap: 1px;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: clamp(21px, 4vw, 30px);
  line-height: 1.36;
}
.couple-names em {
  font-family: var(--serif);
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0;
  font-weight: 400;
}
.hero-names {
  font-size: clamp(28px, 4.7vw, 46px);
  letter-spacing: .15em;
  line-height: 1.15;
}
.hero-names em {
  font-family: var(--script);
  font-size: clamp(26px, 3.8vw, 39px);
  line-height: .82;
  margin: 3px 0 2px;
  color: #fff8ec;
}
.script-small { font-family: var(--script); font-size: 38px; line-height: 1; font-weight: 400; }
.hero-scroll {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 22px));
  transform: translateX(-50%);
  width: max-content;
  max-width: 90vw;
  margin: 0;
  color: #f6f0e5;
  font-size: 31px;
  opacity: .9;
  text-shadow: 0 2px 16px rgba(0,0,0,.30);
  pointer-events: none;
}

/* PAPER */
.section-paper {
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.38), transparent 32%),
    linear-gradient(135deg, #f1ebdf, #e4dccb 74%, #ddd3bf);
  overflow: hidden;
}

/* COMPACT VERSE TRANSITIONS */
.verse-section {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #f3eee5;
}
.verse-section .paper-grain { opacity: .075; }
.verse-inner {
  position: relative;
  z-index: 2;
  width: min(88vw, 860px);
  margin: 0 auto;
  padding: 74px 0 70px;
  text-align: center;
}
.verse-kicker {
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--olive-deep);
}
.verse-lead {
  margin: 0 auto 7px;
  max-width: 800px;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -.025em;
  color: var(--olive-deep);
}
.verse-rest {
  margin: 0 auto;
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.5vw, 29px);
  line-height: 1.25;
  font-style: italic;
  color: var(--ink-soft);
}
.verse-reference {
  margin: 23px 0 0;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #777264;
}
.verse-inner-second { padding: 62px 0 60px; }
.verse-beloved {
  margin: 0 auto;
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.08;
  font-style: italic;
  color: var(--olive-deep);
}

/* STORY */
.story { padding: 95px 0 125px; }
.story .paper-grain, .dress .paper-grain, .closing .paper-grain { opacity: .09; }
.story-header {
  width: min(88vw, 700px);
  margin: 0 auto 52px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.script-heading {
  font-family: var(--script);
  font-size: clamp(72px, 9vw, 124px);
  font-weight: 400;
  line-height: .84;
  margin: 12px 0 20px;
}
.story-intro { margin: 0; font-size: 18px; font-style: italic; color: var(--ink-soft); }
.carousel-shell { width: min(90vw, 980px); margin: 0 auto; position: relative; z-index: 2; }
.carousel-frame { width: 100%; }
.carousel-viewport { aspect-ratio: 4 / 3; touch-action: pan-y; }
.carousel-track {
  height: 100%;
  display: flex;
  transition: transform .8s cubic-bezier(.22,.7,.2,1);
  will-change: transform;
}
.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.carousel-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(13,15,11,.74) 0%, rgba(13,15,11,.34) 43%, rgba(13,15,11,0) 100%);
}
.slide-caption {
  position: absolute;
  z-index: 3;
  bottom: 3.8%;
  margin: 0;
  max-width: 68%;
  font-family: var(--script);
  font-size: clamp(31px, 4vw, 52px);
  line-height: .96;
  text-shadow: 0 2px 16px rgba(0,0,0,.50);
}
.slide-caption.light { color: #fff8ec; }
.slide-caption.dark { color: #fff8ec; }
.slide-caption.bottom-left { left: 5%; right: auto; text-align: left; }
.slide-caption.bottom-center { left: 50%; transform: translateX(-50%); width: 80%; max-width: 80%; text-align: center; }
.slide-caption.bottom-right { right: 5%; left: auto; text-align: right; }
.carousel-arrow {
  position: absolute;
  z-index: 6;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(247,241,231,.6);
  border-radius: 50%;
  background: rgba(33,35,27,.18);
  color: #f7f1e7;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 34px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.carousel-prev { left: 22px; }
.carousel-next { right: 22px; }
.carousel-meta { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.carousel-count { font-family: var(--display); font-size: 10px; letter-spacing: .16em; display: flex; align-items: center; gap: 8px; color: #6b6556; }
.count-rule { width: 34px; height: 1px; background: rgba(79,74,63,.36); }
.carousel-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 68%; }
.carousel-dot { width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; background: rgba(69,67,57,.30); cursor: pointer; }
.carousel-dot.is-active { background: rgba(69,67,57,.88); transform: scale(1.35); }

/* DETAILS */
.details {
  min-height: 105svh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7svh 0;
  overflow: hidden;
  isolation: isolate;
}
.details-bg { z-index: -3; }
.details-wash {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(31,39,27,.38), rgba(35,42,29,.65)), rgba(91,93,68,.14);
  backdrop-filter: saturate(.78) contrast(.95);
}
.details .paper-grain { z-index: -1; opacity: .24; }
.details-card {
  position: relative;
  z-index: 2;
  width: min(86vw, 580px);
  margin: auto;
  text-align: center;
  color: #f5efe3;
  padding: 64px 32px 68px;
  background: rgba(43,49,34,.13);
  border: 1px solid rgba(245,239,227,.35);
  box-shadow: inset 0 0 80px rgba(255,244,215,.04), 0 20px 65px rgba(11,14,10,.12);
  overflow: hidden;
}
.details-script {
  display: block;
  width: 100%;
  margin: 2px auto 42px;
  font-size: clamp(82px, 12vw, 115px);
  white-space: nowrap;
  text-align: center;
}
.detail-block { margin: 24px auto; max-width: 100%; }
.detail-label { font-family: var(--display); letter-spacing: .26em; font-size: 11px; margin: 0 0 13px; text-transform: uppercase; }
.detail-time { font-size: 25px; font-style: italic; margin: 0 0 10px; }
.detail-venue { font-family: var(--display); font-size: 20px; letter-spacing: .08em; text-transform: uppercase; margin: 0 auto; max-width: 100%; overflow-wrap: anywhere; }
.detail-place { font-size: 15px; margin: 5px 0 0; }
.maps-link {
  display: inline-block;
  margin-top: 9px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(245,239,227,.50);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: .20em;
  text-transform: uppercase;
  color: #f5efe3;
  transition: opacity .25s ease, border-color .25s ease;
}
.maps-link:hover, .maps-link:focus-visible { opacity: .78; border-color: rgba(245,239,227,.9); }
.maps-link span { margin-left: 3px; font-family: var(--serif); letter-spacing: 0; }
.ornament { margin: 30px 0; font-size: 10px; opacity: .8; }

/* DRESS */
.dress { padding: 110px 0 125px; }
.dress-inner {
  width: min(1040px, 88vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.03fr .97fr;
  gap: clamp(45px, 8vw, 100px);
  align-items: center;
  position: relative;
  z-index: 2;
}
.dress-image { width: 100%; }
.dress-image .frame-inner { aspect-ratio: 3/4; }
.dress-copy { text-align: center; }
.dress-copy .script-heading { margin: 18px 0; }
.dress-text { font-family: var(--display); font-size: clamp(19px, 2vw, 26px); letter-spacing: .05em; }

/* CLOSING */
.closing { padding: 105px 0 120px; }
.closing-inner {
  width: min(920px, 88vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
  gap: clamp(42px, 8vw, 95px);
  position: relative;
  z-index: 2;
}
.closing-image { width: 100%; }
.closing-image .frame-inner { aspect-ratio: 2/3; }
.closing-copy { text-align: center; }
.closing-copy .script-heading { font-size: clamp(80px, 10vw, 130px); margin-bottom: 25px; }
.closing-names { font-family: var(--display); text-transform: uppercase; letter-spacing: .17em; font-size: 16px; margin: 0 0 24px; }

/* REVEALS */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.15s ease, transform 1.15s cubic-bezier(.2,.75,.25,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
/* Opening animation must preserve the hero's centering transform. */
.hero-copy.reveal-on-load { animation: invitationIn 1.65s .18s both ease-out; }
@keyframes invitationIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* MOBILE — primary guest experience */
@media (max-width: 760px) {
  .mini-header {
    height: 46px;
    padding: 0 17px;
  }
  .monogram { font-size: 11px; }
  .mini-header nav { gap: 13px; }
  .mini-header nav a { font-size: 8px; letter-spacing: .13em; }
  .image-edge-frame { inset: 11px; }

  .hero { height: 100svh; min-height: 100svh; }
  .hero-copy {
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    width: min(100%, 430px);
    max-width: 100%;
    padding-inline: 24px;
    margin: 0;
    text-align: center;
  }
  .hero-copy > * {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .tiny-italic { font-size: 13px; }
  .tiny-serif { font-size: 10px; }
  .hero-invite-line { font-size: clamp(20px, 5.8vw, 25px); }
  .hero-to-the { font-size: 11px; margin-top: 5px; }
  .hero-title {
    font-size: clamp(76px, 21vw, 94px);
    line-height: .73;
    margin: 11px auto 20px;
    letter-spacing: -.025em;
  }
  .hero-celebration { font-size: clamp(21px, 6.3vw, 27px); margin-bottom: 13px; }
  .hero-names {
    font-size: clamp(23px, 6.8vw, 29px);
    letter-spacing: .14em;
    width: 100%;
  }
  .hero-names em { font-size: clamp(25px, 7.2vw, 31px); }
  .hero-scroll { font-size: 26px; bottom: max(26px, calc(env(safe-area-inset-bottom, 0px) + 18px)); }
  .hero-photo { background-position: 50% 56% !important; }

  .verse-inner {
    width: 86vw;
    padding: 50px 0 48px;
  }
  .verse-kicker { margin-bottom: 18px; font-size: 8px; letter-spacing: .25em; }
  .verse-lead { font-size: clamp(32px, 9.7vw, 42px); line-height: 1.02; }
  .verse-rest { max-width: 88vw; font-size: clamp(19px, 5.8vw, 24px); line-height: 1.2; }
  .verse-reference { margin-top: 18px; font-size: 8px; letter-spacing: .18em; }
  .verse-inner-second { padding: 44px 0 42px; }
  .verse-beloved { max-width: 88vw; font-size: clamp(27px, 8.6vw, 36px); line-height: 1.05; }

  .story { padding: 76px 0 92px; }
  .story-header { width: 88vw; margin-bottom: 38px; }
  .script-heading { font-size: clamp(68px, 20vw, 92px); }
  .story-intro { font-size: 17px; }
  .carousel-shell { width: 90vw; }
  .carousel-frame { padding: 8px; }
  .carousel-viewport { aspect-ratio: 4 / 5; }
  .slide-shade { height: 27%; }
  .slide-caption {
    bottom: 3.5%;
    max-width: 72%;
    font-size: clamp(28px, 8vw, 36px);
    line-height: .96;
  }
  .slide-caption.bottom-left { left: 5%; }
  .slide-caption.bottom-right { right: 5%; }
  .slide-caption.bottom-center { width: 82%; max-width: 82%; }
  .carousel-arrow {
    width: 38px;
    height: 38px;
    font-size: 28px;
    background: rgba(33,35,27,.12);
  }
  .carousel-prev { left: 12px; }
  .carousel-next { right: 12px; }
  .carousel-meta { margin-top: 15px; }

  .details {
    min-height: 100svh;
    padding: 7svh 0;
    align-items: center;
    justify-content: center;
  }
  .details-edge-frame { inset: 12px; }
  .details-card {
    width: calc(100% - 46px);
    max-width: 440px;
    margin: auto;
    padding: 52px 18px 58px;
  }
  .details-script {
    font-size: clamp(72px, 20vw, 82px);
    line-height: .76;
    margin: 0 auto 34px;
    transform: translateX(-1%);
  }
  .detail-time { font-size: 23px; }
  .detail-venue { font-size: clamp(15px, 4.7vw, 19px); letter-spacing: .06em; }
  .detail-place { font-size: 14px; max-width: 240px; margin-left: auto; margin-right: auto; }
  .maps-link { margin-top: 8px; font-size: 8px; }
  .detail-block { margin: 22px auto; }

  .dress { padding: 86px 0 95px; }
  .dress-inner { grid-template-columns: 1fr; width: 88vw; gap: 42px; }
  .dress-image { width: 82%; margin: 0 auto; padding: 8px; }
  .dress-copy { padding: 0 16px; }

  .closing { padding: 88px 0 95px; }
  .closing-inner { grid-template-columns: 1fr; width: 88vw; gap: 36px; }
  .closing-image { width: 72%; margin: 0 auto; padding: 8px; }
  .closing-copy .script-heading { font-size: 88px; margin: 0 0 22px; }
}

@media (max-width: 380px) {
  .hero-copy { padding-inline: 20px; }
  .hero-title { font-size: 74px; }
  .hero-names { font-size: 22px; }
  .details-card { width: calc(100% - 36px); }
  .details-script { font-size: 72px; }
  .mini-header nav { gap: 10px; }
}

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

/* V4.5 — mobile UX polish (no visual redesign) */
html { -webkit-text-size-adjust: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
.hero-copy, .story-header, .verse-inner, .details-card, .dress-copy, .closing-copy { min-width: 0; }
.hero-copy, .verse-inner, .story-header, .details-card, .dress-copy, .closing-copy { overflow-wrap: normal; }
.verse-lead, .verse-rest, .verse-beloved, .story-intro, .dress-text { text-wrap: balance; }

@media (max-width: 760px) {
  .hero-copy {
    box-sizing: border-box;
    width: 100%;
    max-width: 430px;
    padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right));
  }
  .hero-names { padding-inline: 4px; }
  .mini-header { padding-left: max(17px, env(safe-area-inset-left)); padding-right: max(17px, env(safe-area-inset-right)); }
  .carousel-arrow { width: 44px; height: 44px; }
  .details-card, .story-header, .verse-inner, .dress-inner, .closing-inner { margin-left: auto; margin-right: auto; }
  .detail-block, .detail-place, .detail-venue, .dress-copy, .closing-copy { text-align: center; }
  .maps-link { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding-top: 7px; }
}

@media (max-width: 760px) {
  .mini-header .monogram,
  .mini-header nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
