:root {
  --midnight: #0b2147;
  --midnight-deep: #06142e;
  --blue: #89afd7;
  --ice: #d8edf9;
  --frost: #edf6fb;
  --pearl: #fffdf8;
  --silver: #aebfcf;
  --ink: #23344f;
  --muted: #68788c;
  --script: "Allura", cursive;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0, rgba(137, 175, 215, 0.3), transparent 30rem),
    #020918;
  font: 400 1rem/1.72 var(--sans);
}

body.locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.invitation {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--pearl);
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.64);
}

.section {
  position: relative;
  padding: 96px 28px;
  text-align: center;
}

.pearl {
  background:
    radial-gradient(circle at 50% 0, rgba(216, 237, 249, 0.7), transparent 22rem),
    var(--pearl);
}

.frost {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), transparent 45%),
    var(--frost);
}

.midnight {
  color: white;
  background:
    radial-gradient(circle at 50% 0, rgba(137, 175, 215, 0.24), transparent 25rem),
    linear-gradient(160deg, var(--midnight), var(--midnight-deep));
}

.eyebrow {
  margin: 0 0 14px;
  color: #6287b2;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.55;
  text-transform: uppercase;
}

.midnight .eyebrow,
.hero .eyebrow {
  color: var(--ice);
}

h2 {
  max-width: 520px;
  margin: 0 auto 28px;
  font: 400 clamp(2.9rem, 11vw, 4.8rem)/0.98 var(--serif);
  letter-spacing: -0.035em;
}

.midnight h2 {
  color: white;
}

h3 {
  font-family: var(--serif);
}

p {
  margin-top: 0;
}

.envelope-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: var(--midnight-deep);
  transition: opacity 0.85s ease, visibility 0.85s ease;
}

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

.envelope-button {
  position: relative;
  width: min(100vw, 640px);
  height: 100svh;
  padding: 0;
  border: 0;
  color: white;
  background: transparent;
  cursor: pointer;
}

.envelope-stage {
  position: absolute;
  inset: 0;
  display: block;
  transition: transform 0.45s ease;
}

.envelope-button:hover .envelope-stage,
.envelope-button:focus-visible .envelope-stage {
  transform: scale(1.012);
}

.envelope-button:focus-visible {
  outline: 2px solid white;
  outline-offset: -10px;
}

.envelope-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.envelope-open {
  opacity: 0;
  transform: scale(0.985);
}

.envelope-button.is-opening .envelope-closed {
  opacity: 0;
  transform: scale(0.985);
}

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

.open-label {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  width: max-content;
  margin: auto;
  padding: 11px 19px;
  border: 1px solid rgba(216, 237, 249, 0.6);
  border-radius: 999px;
  color: white;
  background: rgba(6, 20, 46, 0.64);
  backdrop-filter: blur(10px);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.open-label::before,
.open-label::after {
  content: "✦";
  margin: 0 10px;
  color: var(--ice);
  font-size: 0.58rem;
}

.hero {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 128px 24px 40px;
  overflow: hidden;
  color: white;
  background: var(--midnight);
  isolation: isolate;
}

.hero-background,
.hero-shade,
.hero-frame {
  position: absolute;
  inset: 0;
}

.hero-background {
  z-index: -3;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 43%;
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(2, 9, 24, 0.08), transparent 38%, rgba(2, 9, 24, 0.92) 100%),
    linear-gradient(90deg, rgba(2, 9, 24, 0.15), transparent 45%, rgba(2, 9, 24, 0.08));
}

.hero-frame {
  z-index: 2;
  inset: 27px 15px 15px;
  border: 1px solid rgba(216, 237, 249, 0.7);
  border-radius: 48% 48% 12px 12px;
  box-shadow: inset 0 0 24px rgba(137, 175, 215, 0.12);
  pointer-events: none;
}

.hero-frame::before,
.hero-frame::after {
  content: "✦";
  position: absolute;
  bottom: 10px;
  color: var(--ice);
  font-size: 0.66rem;
}

.hero-frame::before {
  left: 13px;
}

.hero-frame::after {
  right: 13px;
}

.hero-crest {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  width: min(82%, 460px);
  max-width: none;
  filter: drop-shadow(0 4px 10px rgba(3, 14, 35, 0.52));
  pointer-events: none;
  transform: translateX(-50%);
}

.hero-copy,
.scroll-note {
  position: relative;
  z-index: 1;
}

.hero-copy {
  width: 100%;
}

.hero h1 {
  margin: 0;
  color: white;
  font: 400 clamp(5.3rem, 22vw, 8.6rem)/0.76 var(--script);
  text-shadow: 0 4px 24px rgba(2, 9, 24, 0.7);
}

.hero h1 span {
  display: block;
  margin-bottom: 18px;
  color: var(--ice);
  font: 600 0.14em/1 var(--sans);
  letter-spacing: 0.5em;
  text-transform: uppercase;
}

.date {
  margin: 22px 0 0;
  color: white;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.scroll-note {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-note span {
  display: block;
  color: var(--ice);
  font-size: 1.35rem;
}

.star-medallion {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid var(--silver);
  border-radius: 50%;
  color: #6a96c5;
  background: white;
  box-shadow: 0 0 0 8px rgba(216, 237, 249, 0.42);
  font-size: 1.6rem;
}

.script-line {
  margin-bottom: 6px;
  color: #6287b2;
  font: 400 2rem/1 var(--script);
}

.lead {
  max-width: 470px;
  margin: 0 auto 46px;
  color: var(--muted);
}

.family {
  display: grid;
  max-width: 500px;
  margin: 0 auto;
  padding: 30px 12px;
  border-block: 1px solid rgba(98, 135, 178, 0.3);
}

.family p {
  margin: 0;
}

.family small,
.family strong {
  display: block;
}

.family small {
  color: #6287b2;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.family strong {
  margin-top: 5px;
  font: 500 1.55rem/1.2 var(--serif);
}

.family > span {
  margin: 14px 0;
  color: var(--blue);
}

.countdown {
  padding-block: 82px;
}

.timer {
  display: grid;
  max-width: 520px;
  margin: 44px auto 0;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(216, 237, 249, 0.36);
  border-radius: 70px;
  overflow: hidden;
}

.timer div {
  padding: 22px 4px;
}

.timer div + div {
  border-left: 1px solid rgba(216, 237, 249, 0.24);
}

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

.timer strong {
  color: var(--ice);
  font: 400 clamp(1.9rem, 8vw, 3rem)/1 var(--serif);
}

.timer span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.59rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portrait-break {
  position: relative;
  min-height: 88svh;
  overflow: hidden;
}

.portrait-break img {
  width: 100%;
  height: 88svh;
  object-fit: cover;
  object-position: center 42%;
}

.portrait-break::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(6, 20, 46, 0.9));
}

.portrait-copy {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: 48px;
  left: 28px;
  color: white;
  text-align: center;
}

.portrait-copy span,
.portrait-copy strong {
  display: block;
}

.portrait-copy span {
  color: var(--ice);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portrait-copy strong {
  margin-top: 7px;
  font: 400 2.25rem/1.08 var(--serif);
}

.timeline {
  position: relative;
  max-width: 500px;
  margin: 46px auto 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 1px;
  background: linear-gradient(var(--blue), rgba(137, 175, 215, 0.16));
}

.timeline article {
  position: relative;
  display: grid;
  min-height: 116px;
  grid-template-columns: 1fr 46px 1fr;
  align-items: center;
}

.timeline article > span {
  z-index: 1;
  display: grid;
  width: 35px;
  height: 35px;
  margin: auto;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: #6287b2;
  background: var(--pearl);
  font-size: 0.8rem;
}

.timeline time {
  padding-right: 15px;
  font: 500 1.45rem/1 var(--serif);
  text-align: right;
}

.timeline time small {
  display: block;
  margin-top: 6px;
  color: #6287b2;
  font: 600 0.6rem/1 var(--sans);
}

.timeline article div {
  padding-left: 15px;
  text-align: left;
}

.timeline h3 {
  margin: 0;
  font-size: 1.4rem;
}

.timeline p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.location-grid {
  display: grid;
  max-width: 520px;
  margin: 44px auto 0;
  gap: 18px;
}

.location-card {
  position: relative;
  padding: 42px 27px 34px;
  overflow: hidden;
  border: 1px solid rgba(98, 135, 178, 0.28);
  border-radius: 50% 50% 10px 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(35, 52, 79, 0.1);
}

.location-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(137, 175, 215, 0.22);
  border-radius: inherit;
  pointer-events: none;
}

.location-icon {
  display: block;
  color: #6a96c5;
  font-size: 1.7rem;
}

.location-card small {
  display: block;
  margin-top: 14px;
  color: #6287b2;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.location-card h3 {
  max-width: 360px;
  margin: 12px auto 7px;
  font-size: 1.85rem;
  line-height: 1;
}

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

.location-card button,
form button {
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: white;
  background: var(--midnight);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.location-card button:hover,
form button:hover {
  transform: translateY(-2px);
  background: #163866;
}

.blue-card {
  color: white;
  background: linear-gradient(145deg, #193c6b, var(--midnight-deep));
}

.blue-card h3,
.blue-card .location-icon {
  color: white;
}

.blue-card p {
  color: rgba(255, 255, 255, 0.66);
}

.blue-card button {
  color: var(--midnight);
  background: var(--ice);
}

.detail-list {
  display: grid;
  max-width: 520px;
  margin: 44px auto 0;
  gap: 2px;
}

.detail-list article {
  display: grid;
  padding: 24px 0;
  grid-template-columns: 52px 1fr;
  align-items: start;
  border-bottom: 1px solid rgba(216, 237, 249, 0.2);
  text-align: left;
}

.detail-list article > span {
  color: var(--ice);
  font-size: 1.25rem;
}

.detail-list h3 {
  margin: 0;
  color: white;
  font-size: 1.5rem;
}

.detail-list p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.9rem;
}

.gallery-grid {
  display: grid;
  max-width: 520px;
  margin: 42px auto 0;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.gallery-grid figure {
  min-height: 500px;
  margin: 0;
  overflow: hidden;
  border-radius: 150px 150px 8px 8px;
}

.gallery-grid figure:nth-child(2) {
  margin-top: 54px;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid figure:first-child img {
  object-position: 38% center;
}

.gallery-grid figure:last-child img {
  object-position: 60% center;
}

.gallery blockquote {
  max-width: 470px;
  margin: 38px auto 0;
  color: #6287b2;
  font: italic 400 1.45rem/1.3 var(--serif);
}

.wish > p:not(.eyebrow),
.rsvp > p:not(.eyebrow) {
  max-width: 460px;
  margin-right: auto;
  margin-left: auto;
}

.moon-mark {
  display: block;
  margin-bottom: 17px;
  color: #6a96c5;
  font-size: 2.5rem;
}

.clock-mark {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(216, 237, 249, 0.6);
  border-radius: 50%;
  color: var(--ice);
  font: 400 1.2rem/1 var(--serif);
}

form {
  display: grid;
  max-width: 500px;
  margin: 38px auto 0;
  gap: 18px;
  text-align: left;
}

form label > span,
fieldset legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid rgba(35, 52, 79, 0.2);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(137, 175, 215, 0.18);
}

form button {
  justify-self: center;
  margin-top: 7px;
}

.rsvp form label > span,
.rsvp fieldset legend {
  color: var(--ice);
}

.rsvp fieldset {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 9px;
  border: 0;
}

.rsvp fieldset label {
  display: flex;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid rgba(216, 237, 249, 0.24);
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.rsvp fieldset input {
  width: 18px;
  min-height: 18px;
  margin: 0 12px 0 0;
  accent-color: var(--blue);
}

.rsvp fieldset label > span {
  margin: 0;
  color: white;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.rsvp form button {
  color: var(--midnight);
  background: var(--ice);
}

footer {
  padding: 78px 24px 62px;
  border-top: 1px solid rgba(216, 237, 249, 0.28);
  color: white;
  background: #020918;
  text-align: center;
}

footer > span {
  color: var(--ice);
  font-size: 1.8rem;
}

footer strong {
  display: block;
  margin-top: 9px;
  font: 400 4.2rem/0.9 var(--script);
}

footer p {
  margin: 20px 0 12px;
  color: var(--ice);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
}

footer small {
  color: rgba(255, 255, 255, 0.5);
}

.floating-stars {
  position: absolute;
  z-index: 8;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star-dot {
  position: absolute;
  top: -20px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px rgba(216, 237, 249, 0.7);
  opacity: 0;
  animation: float-down var(--duration) linear var(--delay) infinite;
}

@keyframes float-down {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  14% {
    opacity: var(--opacity);
  }
  86% {
    opacity: var(--opacity);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), calc(100svh + 60px), 0);
  }
}

.toast {
  position: fixed;
  z-index: 1100;
  right: 18px;
  bottom: 22px;
  left: 18px;
  max-width: 430px;
  margin: auto;
  padding: 15px 18px;
  border: 1px solid rgba(216, 237, 249, 0.66);
  border-radius: 7px;
  color: white;
  background: rgba(6, 20, 46, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 700px) {
  .invitation {
    margin-block: 30px;
    border: 1px solid rgba(216, 237, 249, 0.3);
    border-radius: 12px;
  }

  .hero,
  .portrait-break,
  .portrait-break img {
    min-height: min(920px, calc(100vh - 60px));
  }

  .portrait-break img {
    height: min(920px, calc(100vh - 60px));
  }

  .section {
    padding-inline: 54px;
  }
}

@media (max-width: 390px) {
  .section {
    padding-inline: 22px;
  }

  .hero h1 {
    font-size: 5rem;
  }

  .timer strong {
    font-size: 1.62rem;
  }

  .gallery-grid {
    gap: 7px;
  }

  .gallery-grid figure {
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
