:root {
  --black: #120e10;
  --black-soft: #1d171a;
  --ivory: #f4efe5;
  --paper: #fbf8f2;
  --silver: #c7c1b7;
  --silver-dark: #817a73;
  --burgundy: #6f1828;
  --burgundy-dark: #3f0c16;
  --line: rgba(129, 122, 115, 0.35);
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Playfair Display", Georgia, serif;
  --sans: "Montserrat", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #080607;
  color: var(--black);
  font-family: var(--sans);
  font-size: 16px;
}

body.locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.envelope-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: #080607;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.envelope-gate.is-open {
  pointer-events: none;
}

.envelope-gate.is-complete {
  opacity: 0;
  visibility: hidden;
}

.envelope-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.82) contrast(1.08) saturate(0.9);
}

.envelope-open {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.75s ease, transform 1.4s ease;
}

.envelope-closed {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.55s ease, transform 1.4s ease;
}

.envelope-gate.is-open .envelope-closed {
  opacity: 0;
  transform: scale(1.06);
}

.envelope-gate.is-open .envelope-open {
  opacity: 1;
  transform: scale(1);
}

.envelope-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 42%, rgba(0, 0, 0, 0.62)),
    rgba(65, 6, 19, 0.08);
  mix-blend-mode: normal;
  pointer-events: none;
}

.envelope-shade::before {
  display: none;
}

.open-invitation {
  position: absolute;
  left: 50%;
  bottom: clamp(2.25rem, 8vh, 5.5rem);
  display: grid;
  width: min(82%, 380px);
  padding: 1rem 1.5rem;
  border: 1px solid rgba(244, 239, 229, 0.55);
  background: rgba(18, 14, 16, 0.76);
  color: var(--ivory);
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.open-kicker {
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.open-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.invitation {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
}

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: white;
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  animation: heroBreath 15s ease-in-out infinite alternate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 7, 8, 0.45) 0%, rgba(10, 7, 8, 0.03) 34%, rgba(10, 7, 8, 0.12) 55%, rgba(10, 7, 8, 0.86) 100%);
}

.hero-frame {
  position: absolute;
  inset: 1.15rem;
  border: 1px solid rgba(233, 228, 216, 0.7);
  pointer-events: none;
}

.hero-frame::after {
  position: absolute;
  inset: 0.45rem;
  border: 1px solid rgba(233, 228, 216, 0.25);
  content: "";
}

.hero-crest {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  z-index: 2;
  width: min(88%, 540px);
  height: auto;
  transform: translateX(-50%);
  filter: grayscale(1) brightness(1.55) contrast(1.15) drop-shadow(0 5px 8px rgba(0, 0, 0, 0.55));
}

.hero-copy {
  position: absolute;
  right: 2.3rem;
  bottom: 8.5rem;
  left: 2.3rem;
  z-index: 3;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--burgundy);
}

.eyebrow.light {
  color: var(--silver);
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.4rem, 19vw, 8.5rem);
  font-style: italic;
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.hero-date {
  margin: 1.35rem 0 0.7rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.38em;
}

.hero-line {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-style: italic;
}

.scroll-cue {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  transform: translateX(-50%);
}

.scroll-cue span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  animation: scrollDot 1.8s ease-in-out infinite;
}

.section {
  padding: 6.5rem clamp(1.5rem, 7vw, 4.5rem);
  text-align: center;
}

.section h2 {
  margin: 0 auto 1.6rem;
  max-width: 540px;
  font-family: var(--display);
  font-size: clamp(2.35rem, 8vw, 4rem);
  font-weight: 600;
  line-height: 1.08;
}

.message-section {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(111, 24, 40, 0.08), transparent 42%),
    var(--paper);
}

.lead,
.invitation-line {
  max-width: 500px;
  margin: 0 auto;
  color: #494144;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.75;
}

.monogram {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 2.5rem auto;
  border: 1px solid var(--silver-dark);
  border-radius: 50%;
  color: var(--burgundy);
  font-family: var(--display);
  font-size: 2.35rem;
  font-style: italic;
}

.family-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  max-width: 520px;
  margin: 3.5rem auto 0;
  background: var(--line);
}

.family-grid > div {
  display: grid;
  gap: 0.3rem;
  padding: 1.6rem 1rem;
  background: var(--paper);
}

.family-label {
  margin-bottom: 0.55rem;
  color: var(--burgundy);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.family-grid strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}

.countdown-section,
.locations-section,
.music-section {
  color: var(--ivory);
  background:
    radial-gradient(circle at 10% 20%, rgba(111, 24, 40, 0.35), transparent 34%),
    linear-gradient(145deg, var(--black-soft), var(--black));
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 2.8rem;
}

.countdown div {
  padding: 1.15rem 0.25rem;
  border-top: 1px solid rgba(244, 239, 229, 0.3);
  border-bottom: 1px solid rgba(244, 239, 229, 0.3);
}

.countdown strong,
.countdown span {
  display: block;
}

.countdown strong {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 8vw, 3.15rem);
  font-weight: 500;
  line-height: 1;
}

.countdown span {
  margin-top: 0.55rem;
  color: var(--silver);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portrait-section {
  position: relative;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
}

.portrait-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.portrait-section::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 7, 8, 0.82));
  content: "";
}

.portrait-caption {
  position: absolute;
  right: 2rem;
  bottom: 3rem;
  left: 2rem;
  z-index: 2;
  color: white;
  text-align: center;
}

.portrait-caption span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.portrait-caption p {
  max-width: 500px;
  margin: 0.75rem auto 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  font-style: italic;
  line-height: 1.25;
}

.schedule-section {
  background: var(--ivory);
}

.timeline {
  max-width: 540px;
  margin: 3.5rem auto 0;
  text-align: left;
}

.timeline article {
  display: grid;
  grid-template-columns: 80px 24px 1fr;
  gap: 0.85rem;
  min-height: 132px;
}

.time {
  padding-top: 0.1rem;
  color: var(--burgundy);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline-mark {
  position: relative;
}

.timeline-mark::before {
  position: absolute;
  top: 0.25rem;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--burgundy);
  border-radius: 50%;
  background: var(--ivory);
  content: "";
  transform: translateX(-50%);
}

.timeline-mark::after {
  position: absolute;
  top: 1.35rem;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--silver);
  content: "";
}

.timeline article:last-child .timeline-mark::after {
  display: none;
}

.timeline h3,
.location-card h3,
.detail-grid h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
}

.timeline p,
.location-card p,
.detail-grid p {
  margin: 0.45rem 0 0;
  color: #5a5154;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
}

.location-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 1.25rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(244, 239, 229, 0.25);
  text-align: left;
}

.location-card:last-child {
  border-bottom: 1px solid rgba(244, 239, 229, 0.25);
}

.location-number {
  color: var(--silver);
  font-family: var(--serif);
  font-size: 2.4rem;
  font-style: italic;
}

.location-card h3 {
  color: var(--ivory);
  font-size: 1.8rem;
}

.location-card p {
  color: var(--silver);
}

.location-type {
  margin-bottom: 0.45rem !important;
  color: #c78b96 !important;
  font-family: var(--sans) !important;
  font-size: 0.66rem !important;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.outline-button,
.solid-button {
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  border: 1px solid currentColor;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.outline-button {
  margin-top: 1.2rem;
  background: transparent;
  color: var(--ivory);
}

.solid-button {
  border-color: var(--burgundy);
  background: var(--burgundy);
  color: white;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 560px;
  margin: 3rem auto 0;
}

.detail-grid article {
  padding: 2rem 1.2rem;
  border: 1px solid var(--line);
}

.detail-number {
  display: block;
  margin-bottom: 1rem;
  color: var(--burgundy);
  font-family: var(--serif);
  font-size: 1.7rem;
  font-style: italic;
}

.quote-section {
  padding: 7rem clamp(2rem, 10vw, 5rem);
  background: var(--burgundy-dark);
  color: var(--ivory);
  text-align: center;
}

.quote-section p {
  max-width: 540px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-style: italic;
  line-height: 1.32;
}

.music-section > p:not(.eyebrow) {
  color: var(--silver);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.simple-form,
.rsvp-form {
  display: grid;
  gap: 1.25rem;
  max-width: 500px;
  margin: 2.5rem auto 0;
  text-align: left;
}

.simple-form label,
.rsvp-form > label {
  display: grid;
  gap: 0.55rem;
}

.simple-form label span,
.rsvp-form label > span,
.rsvp-form legend {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
}

.music-section input {
  border-color: rgba(244, 239, 229, 0.35);
  color: white;
}

input::placeholder {
  color: #938a8d;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #c78b96;
  outline-offset: 3px;
}

.rsvp-section {
  background: var(--paper);
}

.rsvp-copy {
  max-width: 440px;
  margin: 0 auto;
  color: #5a5154;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.rsvp-form fieldset {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
}

.rsvp-form legend {
  padding: 0 0.45rem;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.radio-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--burgundy);
}

.radio-row span {
  font-size: 0.92rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

footer {
  padding: 4.5rem 2rem;
  background: #0d090b;
  color: var(--ivory);
  text-align: center;
}

.footer-monogram {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 1.3rem;
  border: 1px solid var(--silver-dark);
  border-radius: 50%;
  color: #c78b96;
  font-family: var(--display);
  font-size: 1.8rem;
  font-style: italic;
}

footer p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

footer span {
  display: block;
  margin-top: 0.45rem;
  color: var(--silver);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 200;
  max-width: 440px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  background: var(--burgundy-dark);
  color: white;
  font-family: var(--serif);
  font-size: 1.05rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroBreath {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.045);
  }
}

@keyframes scrollDot {
  0%, 100% {
    opacity: 0.35;
    transform: translateY(-8px);
  }
  50% {
    opacity: 1;
    transform: translateY(8px);
  }
}

@media (min-width: 681px) {
  body {
    background:
      radial-gradient(circle at top, rgba(111, 24, 40, 0.22), transparent 38%),
      #080607;
  }

  .envelope-gate {
    left: 0;
    right: 0;
    transform: none;
  }
}

@media (max-width: 520px) {
  .section {
    padding-top: 5.25rem;
    padding-bottom: 5.25rem;
  }

  .family-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .timeline article {
    grid-template-columns: 68px 20px 1fr;
    gap: 0.65rem;
  }

  .location-card {
    grid-template-columns: 46px 1fr;
  }

  .location-number {
    font-size: 2rem;
  }
}

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