:root {
  --wine: #5a2032;
  --wine-deep: #35111f;
  --wine-soft: #7b4050;
  --cream: #f8f4ec;
  --paper: #fffdf8;
  --linen: #eee5d8;
  --gold: #b9975b;
  --gold-light: #dfc99e;
  --ink: #49343a;
  --muted: #8d7777;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* Match the footer behind mobile safe-area / home-indicator space. */
  background: var(--wine-deep);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
body.lock, html:has(body.lock) { overflow: hidden; }
::selection { background: var(--wine); color: var(--cream); }

#envelope {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 100svh;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(137, 76, 85, .42), transparent 44%),
    radial-gradient(ellipse at center, #542538 0%, var(--wine-deep) 74%);
  transition: opacity 1s ease, visibility 1s ease;
}
#envelope::before, #envelope::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(223, 201, 158, .28);
  pointer-events: none;
}
#envelope::after { inset: 29px; border-color: rgba(223, 201, 158, .12); }
#envelope:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -8px; }
.envelope-glow {
  position: absolute;
  width: min(80vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(224, 190, 145, .07);
  filter: blur(50px);
}
.env-box {
  position: relative;
  width: min(82vw, 430px);
  aspect-ratio: 3 / 2;
  transform: translateY(-3%);
  animation: float 4s ease-in-out infinite;
  perspective: 1000px;
  filter: drop-shadow(0 30px 28px rgba(0,0,0,.28));
}
@keyframes float { 50% { translate: 0 -9px; } }
.env-box > * { position: absolute; }
.env-back {
  inset: 0;
  border: 1px solid rgba(226, 199, 151, .55);
  background: linear-gradient(145deg, #814354, #542337 72%);
}
.env-letter {
  z-index: 2;
  left: 7%; right: 7%; top: 5%; bottom: 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding-top: 9%;
  color: var(--wine);
  background: var(--paper);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 5px rgba(185,151,91,.08);
  transition: transform 1.05s cubic-bezier(.18,.72,.25,1) .42s;
  will-change: transform;
}
.letter-kicker { font: 600 9px var(--serif); letter-spacing: .22em; }
.letter-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 112px;
  color: var(--wine);
  font: 600 34px/1 var(--serif);
  letter-spacing: .04em;
}
.letter-names i {
  display: inline-block;
  color: var(--gold);
  font: italic 22px/1 var(--serif);
  transform: translateY(-1px);
}
.letter-date { font: 10px var(--serif); letter-spacing: .25em; }
.env-front {
  z-index: 3;
  inset: 0;
  background: linear-gradient(150deg, #874657, #60283b);
  clip-path: polygon(0 0, 50% 59%, 100% 0, 100% 100%, 0 100%);
  backface-visibility: hidden;
}
.env-flap {
  z-index: 4;
  inset: 0 0 auto;
  height: 59%;
  background: linear-gradient(155deg, #a36b70, #78394c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0%;
  transform: rotateX(0deg);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  opacity: 1;
  transition:
    transform .9s cubic-bezier(.2,.72,.25,1),
    opacity .55s ease .62s;
  will-change: transform, opacity;
}
.env-seal {
  z-index: 5;
  left: 50%; top: 59%;
  width: 76px; height: 76px;
  translate: -50% -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 0 2px 1px;
  white-space: nowrap;
  border-radius: 50%;
  color: #795d43;
  font: 600 25px/1 var(--serif);
  letter-spacing: .015em;
  background: radial-gradient(circle at 35% 28%, #fff9e9, #d8c29b 75%);
  border: 1px solid #f1dfb8;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.3), 0 5px 18px rgba(0,0,0,.28);
  transition: opacity .35s ease;
}
.env-seal span {
  display: inline-block;
  margin: 0;
  font: italic 17px/1 var(--serif);
  transform: translateY(-1px);
}
.env-tap {
  position: absolute;
  bottom: max(8%, 38px);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; margin: 0;
  color: #e8d7bd;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: opacity .4s ease;
}
.tap-line { width: 25px; height: 1px; background: var(--gold); opacity: .75; }
#envelope.open .env-box { animation: none; }
#envelope.open .env-flap {
  transform: rotateX(180deg);
  opacity: 0;
}
#envelope.open .env-seal, #envelope.open .env-tap { opacity: 0; }
#envelope.open .env-letter { transform: translateY(-66%); }
#envelope.done { opacity: 0; visibility: hidden; pointer-events: none; }

.hero {
  position: relative;
  min-height: 760px;
  min-height: min(100svh, 920px);
  display: grid;
  place-items: center;
  padding: 90px 28px 110px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(255,255,255,.42), transparent 64%),
    var(--linen);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: min(70vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(185,151,91,.23);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after { width: min(62vw, 500px); border-style: dashed; opacity: .55; }
.hero-ornament {
  position: absolute; top: 8%; color: var(--gold);
  font-size: 25px; opacity: .8;
}
.frame {
  position: relative;
  width: min(100%, 610px);
  padding: clamp(48px, 8vw, 82px) 26px;
  border: 1px solid var(--gold);
  outline: 1px solid rgba(185,151,91,.55);
  outline-offset: 8px;
  background: rgba(255,253,248,.38);
}
.frame::before, .frame::after {
  content: "❧";
  position: absolute;
  color: var(--gold);
  font-size: 27px;
  line-height: 1;
}
.frame::before { top: 10px; left: 13px; transform: rotate(-45deg); }
.frame::after { right: 13px; bottom: 10px; transform: rotate(135deg); }
.eyebrow, .label {
  margin: 0;
  color: var(--wine-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  line-height: 1.8;
}
.label { margin-top: 17px; color: var(--gold); letter-spacing: .3em; text-transform: uppercase; }
h1 {
  margin: 22px 0 20px;
  color: var(--wine);
  /* Extra leading keeps script descenders/ascenders from colliding between lines. */
  font: 400 clamp(3.25rem, 9vw, 5.6rem)/1.12 var(--script);
}
h1 span { color: var(--gold); font-size: .72em; }
.date { margin: 0; color: var(--wine); font-size: 21px; letter-spacing: .04em; }
.city { margin: 8px 0 0; color: var(--muted); font-size: 15px; letter-spacing: .16em; text-transform: uppercase; }
.city span { color: var(--gold); padding: 0 5px; }
.hero-note { margin: 32px 0 0; color: var(--muted); font-size: 15px; font-style: italic; letter-spacing: .04em; }
.divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 110px; margin: 22px auto 25px; color: var(--gold);
}
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--gold); opacity: .75; }
.divider span { font-size: 13px; }
.scroll-cue {
  position: absolute; bottom: 27px; display: flex; flex-direction: column;
  align-items: center; gap: 9px; color: var(--muted);
  font: 9px var(--serif); letter-spacing: .22em;
}
.scroll-cue span { width: 1px; height: 25px; background: var(--gold); }

section h2 {
  margin: 0;
  color: var(--wine);
  font: 400 clamp(2.6rem, 6vw, 3.5rem)/1.05 var(--script);
}
.countdown { padding: 68px 22px 72px; background: var(--linen); }
.countdown h2 { margin-top: 8px; }
.timer {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: clamp(9px, 2vw, 18px); margin: 0 auto; max-width: 570px;
}
.time-unit {
  display: flex; flex-direction: column; justify-content: center;
  width: clamp(68px, 16vw, 112px); aspect-ratio: 1 / 1;
  border: 1px solid rgba(185,151,91,.75);
  background: rgba(255,253,248,.34);
}
.time-unit b { color: var(--wine); font: 500 clamp(2rem, 5vw, 2.8rem)/1 var(--serif); }
.time-unit span { margin-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }

.schedule { padding: 76px 24px 80px; background: var(--paper); }
.schedule .eyebrow, .location .eyebrow, .invite .eyebrow { margin-bottom: 9px; }
.timeline {
  position: relative; width: min(100%, 390px); margin: 42px auto 0;
  text-align: left;
}
.timeline::before {
  content: ""; position: absolute; left: 24px; top: 12px; bottom: 22px;
  width: 1px; background: linear-gradient(var(--gold), rgba(185,151,91,.2));
}
.event {
  position: relative; display: grid; grid-template-columns: 49px 1fr;
  gap: 18px; align-items: start; padding: 0 0 29px;
}
.event-number {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 49px; height: 49px; border-radius: 50%;
  color: var(--gold); background: var(--paper);
  border: 1px solid rgba(185,151,91,.6); font-size: 12px;
  transition: color .45s ease, background-color .45s ease, border-color .45s ease, box-shadow .45s ease, transform .45s ease;
}
.event.active .event-number {
  color: var(--cream);
  background: var(--wine);
  border-color: var(--wine);
  box-shadow: 0 5px 16px rgba(90,32,50,.22);
  transform: scale(1.06);
}
.event b { display: block; margin: 2px 0 2px; color: var(--wine); font-size: 19px; font-weight: 600; letter-spacing: .04em; }
.event p { margin: 0; color: var(--muted); font-size: 17px; }

.location {
  padding: 76px 24px 82px;
  background: linear-gradient(rgba(238,229,216,.88), rgba(238,229,216,.88));
}
.venue-name { margin: 4px 0 5px; color: var(--wine); font-size: 27px; font-weight: 600; }
.address { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.map {
  width: min(100%, 620px); margin: 32px auto 25px; padding: 7px;
  border: 1px solid var(--gold); background: var(--paper);
  box-shadow: 0 16px 38px rgba(67,39,40,.09);
}
.map iframe { display: block; width: 100%; height: 300px; border: 0; filter: saturate(.78) sepia(.08); }
.map-link {
  display: inline-flex; align-items: center; gap: 13px;
  padding: 13px 25px; border: 1px solid var(--wine);
  color: var(--cream); background: var(--wine);
  text-decoration: none; font: 600 12px var(--serif);
  letter-spacing: .14em; text-transform: uppercase;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.map-link:hover { color: var(--wine); background: transparent; transform: translateY(-2px); }

.invite { padding: 78px 24px 66px; background: var(--paper); }
.invite-text { max-width: 470px; margin: 0 auto 28px; color: var(--muted); font-size: 19px; line-height: 1.7; }
.signoff { margin: 0; color: var(--muted); font-size: 16px; font-style: italic; line-height: 1.4; }
.signoff span { display: inline-block; margin-top: 8px; color: var(--wine); font: 38px var(--script); }
.closing-mark { margin-top: 35px; color: var(--gold); font-size: 20px; }
footer {
  padding: 20px 15px calc(20px + env(safe-area-inset-bottom));
  color: #d8c5ad;
  background: var(--wine-deep);
  font-size: 9px;
  letter-spacing: .22em;
}
footer span { padding: 0 5px; color: #d3a66b; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .85s ease, transform .85s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 520px) {
  body { font-size: 18px; }
  .hero { min-height: 760px; min-height: 100svh; padding-inline: 25px; }
  .frame { padding: 55px 14px; }
  .eyebrow { font-size: 9px; letter-spacing: .18em; }
  h1 { font-size: clamp(3.1rem, 13.5vw, 4.2rem); line-height: 1.16; }
  .date { font-size: 18px; }
  .countdown, .schedule, .location, .invite { padding-top: 62px; padding-bottom: 64px; }
  .map iframe { height: 250px; }
  #envelope::before { inset: 13px; }
  #envelope::after { inset: 19px; }
  .env-box { width: min(86vw, 390px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}








/* Simple, elegant vertical event timeline */
.schedule {
  position: relative;
  height: auto;
  min-height: 0;
  padding: 78px 24px 86px;
  display: block;
  overflow: visible;
}
.schedule-stage {
  position: relative;
  top: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
}
.schedule-heading { flex: 0 0 auto; }
.schedule .timeline {
  position: relative;
  width: min(100%, 430px);
  height: auto;
  min-height: 0;
  margin: 42px auto 0;
}
.schedule .event {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: 49px 1fr;
  gap: 18px;
  align-items: start;
  padding: 0 0 29px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
}
.schedule .event:last-child { padding-bottom: 0; }
.schedule .event-number {
  flex: initial;
  color: var(--wine);
  background: var(--paper);
  border-color: rgba(185,151,91,.6);
}
.schedule .event.active .event-number {
  color: var(--wine);
  background: var(--paper);
  border-color: rgba(185,151,91,.6);
  box-shadow: none;
  transform: none;
}
.schedule .timeline::before { bottom: 22px; }
.schedule.visible .event {
  animation: schedule-event-in .55s both;
}
.schedule.visible .event:nth-child(1) { animation-delay: .05s; }
.schedule.visible .event:nth-child(2) { animation-delay: .16s; }
.schedule.visible .event:nth-child(3) { animation-delay: .27s; }
.schedule.visible .event:nth-child(4) { animation-delay: .38s; }
@keyframes schedule-event-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 520px) {
  .schedule { padding: 64px 24px 70px; }
  .schedule .timeline { margin-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .schedule.visible .event { animation: none; }
}
