:root {
  --midnight: #0d2943;
  --deep-blue: #133c5f;
  --ice: #c8e4f2;
  --ice-bright: #eaf7ff;
  --silver: #aebfce;
  --white: #ffffff;
  --paper: #f7fbfd;
  --ink: #20384d;
  --line: rgba(91, 131, 160, 0.25);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Parisienne", cursive;
  --sans: "Montserrat", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #071827;
  color: var(--ink);
  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: min(100vw, 680px);
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: #dcecf4;
  transition: opacity 0.85s ease, visibility 0.85s 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;
}

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

.envelope-open {
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.75s ease, transform 1.5s 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-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 31, 50, 0.08), transparent 48%, rgba(6, 31, 50, 0.45));
  pointer-events: none;
}

.open-invitation {
  position: absolute;
  bottom: clamp(2rem, 8vh, 5rem);
  left: 50%;
  display: grid;
  width: min(84%, 390px);
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(14, 49, 76, 0.66);
  color: white;
  cursor: pointer;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.open-invitation span {
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.open-invitation strong {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
}

.invitation {
  position: relative;
  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.48);
}

.snowfall {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: min(100vw, 680px);
  margin: 0 auto;
  overflow: hidden;
  pointer-events: none;
}

.snow-particle {
  position: absolute;
  top: -12px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, var(--opacity));
  box-shadow: 0 0 7px rgba(211, 239, 255, 0.5);
  animation: snowFall var(--duration) linear var(--delay) infinite;
}

.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 24%;
  animation: heroDrift 16s ease-in-out infinite alternate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 25, 42, 0.44), rgba(4, 25, 42, 0.02) 38%, rgba(4, 25, 42, 0.16) 58%, rgba(4, 25, 42, 0.86));
}

.hero-frame {
  position: absolute;
  inset: 1.1rem;
  border: 1px solid rgba(234, 247, 255, 0.78);
  pointer-events: none;
}

.hero-frame::after {
  position: absolute;
  inset: 0.45rem;
  border: 1px solid rgba(234, 247, 255, 0.28);
  content: "";
}

.hero-crest {
  position: absolute;
  top: -1.7rem;
  left: 50%;
  z-index: 2;
  width: min(90%, 560px);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 10px rgba(7, 35, 56, 0.5));
}

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

.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.kicker.blue {
  color: #4f87ad;
}

.kicker.light {
  color: var(--ice);
}

.hero h1 {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(5rem, 22vw, 9.5rem);
  font-weight: 400;
  line-height: 0.82;
}

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

.hero-message {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  font-style: italic;
}

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

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

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

.section h2 {
  max-width: 540px;
  margin: 0 auto 1.6rem;
  color: var(--midnight);
  font-family: var(--serif);
  font-size: clamp(2.55rem, 9vw, 4.35rem);
  font-weight: 600;
  line-height: 1.02;
}

.welcome {
  background:
    radial-gradient(circle at top left, rgba(188, 224, 242, 0.45), transparent 34%),
    var(--paper);
}

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

.crystal-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 2.5rem auto;
  border: 1px solid #8bb9d3;
  background: rgba(226, 243, 252, 0.75);
  color: var(--deep-blue);
  font-size: 0;
  transform: rotate(45deg);
}

.crystal-mark::after {
  content: "S";
  font-family: var(--script);
  font-size: 2.65rem;
  transform: rotate(-45deg);
}

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

.family article {
  display: grid;
  gap: 0.25rem;
  padding: 1.6rem 1rem;
  background: rgba(255, 255, 255, 0.76);
}

.family span {
  margin-bottom: 0.55rem;
  color: #4f87ad;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.countdown-section,
.locations,
.music {
  color: white;
  background:
    radial-gradient(circle at 16% 12%, rgba(108, 174, 210, 0.38), transparent 30%),
    linear-gradient(145deg, var(--deep-blue), var(--midnight));
}

.countdown-section h2,
.locations h2,
.music h2 {
  color: white;
}

.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(234, 247, 255, 0.34);
  border-bottom: 1px solid rgba(234, 247, 255, 0.34);
}

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

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

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

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

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

.portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(5, 31, 50, 0.85));
}

.portrait-copy {
  position: absolute;
  right: 2rem;
  bottom: 3.2rem;
  left: 2rem;
  color: white;
  text-align: center;
}

.portrait-copy p {
  margin: 0 0 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.portrait-copy h2 {
  max-width: 530px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 7vw, 3rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
}

.schedule {
  background:
    linear-gradient(180deg, rgba(219, 241, 251, 0.55), transparent 40%),
    white;
}

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

.schedule-list article {
  display: grid;
  grid-template-columns: 78px 22px 1fr;
  gap: 0.85rem;
  min-height: 130px;
}

.schedule-list time {
  color: #4f87ad;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.schedule-line {
  position: relative;
}

.schedule-line span {
  position: absolute;
  top: 0.25rem;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #5f9cbe;
  background: white;
  transform: translateX(-50%) rotate(45deg);
}

.schedule-line::after {
  position: absolute;
  top: 1.35rem;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #b8d5e5;
  content: "";
}

.schedule-list article:last-child .schedule-line::after {
  display: none;
}

.schedule h3,
.location-card h3,
.details h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 600;
}

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

.location-card {
  max-width: 540px;
  margin: 1rem auto;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(234, 247, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.location-label {
  margin: 0 0 0.6rem !important;
  color: var(--ice) !important;
  font-family: var(--sans) !important;
  font-size: 0.66rem !important;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.location-card h3 {
  color: white;
  font-size: 1.9rem;
}

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

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

.ghost-button {
  margin-top: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: transparent;
  color: white;
}

.primary-button {
  border: 1px solid var(--deep-blue);
  background: var(--deep-blue);
  color: white;
}

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

.details-grid article {
  padding: 2rem 1.25rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.detail-symbol {
  margin-bottom: 1rem;
  color: #6fa8c8;
  font-size: 1.9rem;
}

.quote {
  padding: 7rem clamp(2rem, 10vw, 5rem);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.22), transparent 52%),
    #79a9c4;
  color: white;
  text-align: center;
}

.quote p {
  max-width: 540px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(2rem, 7.5vw, 3.2rem);
  font-style: italic;
  line-height: 1.25;
}

.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.71rem;
  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 input {
  border-color: rgba(234, 247, 255, 0.4);
  color: white;
}

input::placeholder {
  color: #8ca6b7;
}

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

.rsvp {
  background:
    radial-gradient(circle at bottom right, rgba(192, 228, 245, 0.42), transparent 32%),
    var(--paper);
}

.rsvp-intro {
  max-width: 440px;
  margin: 0 auto;
  color: #5a7081;
  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 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

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

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

footer {
  padding: 4.5rem 2rem;
  background: #071d2f;
  color: white;
  text-align: center;
}

.footer-monogram {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  border: 1px solid rgba(234, 247, 255, 0.65);
  color: var(--ice);
  font-size: 0;
  transform: rotate(45deg);
}

.footer-monogram::after {
  content: "S";
  font-family: var(--script);
  font-size: 2.25rem;
  transform: rotate(-45deg);
}

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(--midnight);
  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 heroDrift {
  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);
  }
}

@keyframes snowFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }

  12% {
    opacity: var(--opacity);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 105vh, 0);
  }
}

@media (min-width: 681px) {
  body {
    background:
      radial-gradient(circle at top, rgba(103, 166, 202, 0.25), transparent 38%),
      #071827;
  }

  .envelope-gate,
  .snowfall {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

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

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

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

@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;
  }

  .snowfall {
    display: none;
  }
}
