:root {
  --navy: #071329;
  --navy-soft: #102345;
  --navy-light: #18345e;
  --gold: #d8b36a;
  --gold-bright: #f1d69a;
  --ivory: #fffaf0;
  --mist: #edf0f5;
  --rose: #c99394;
  --ink: #17213a;
  --muted: #6d7180;
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Italiana", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 6%, rgba(216, 179, 106, 0.2), transparent 30rem),
    #030815;
  color: var(--ink);
  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(--ivory);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.58);
}

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

.ivory {
  background:
    linear-gradient(90deg, rgba(216, 179, 106, 0.08) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(216, 179, 106, 0.08) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--ivory);
}

.mist {
  background:
    radial-gradient(circle at 10% 10%, rgba(216, 179, 106, 0.2), transparent 15rem),
    var(--mist);
}

.navy {
  background:
    radial-gradient(circle at 50% 0, rgba(216, 179, 106, 0.16), transparent 26rem),
    var(--navy);
  color: white;
}

.eyebrow {
  margin: 0 0 14px;
  color: #9d7537;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.6;
  text-transform: uppercase;
}

.navy .eyebrow,
.hero .eyebrow {
  color: var(--gold-bright);
}

h2 {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--navy);
  font: 400 clamp(2.8rem, 11vw, 4.7rem)/0.98 var(--serif);
}

.navy 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:
    radial-gradient(circle at 50% 45%, rgba(54, 85, 132, 0.55), transparent 30rem),
    linear-gradient(155deg, #020711, #0b1934 55%, #020711);
  transition: opacity 0.85s ease, visibility 0.85s ease;
}

.envelope-gate::before,
.envelope-gate::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(216, 179, 106, 0.46);
  border-radius: 50% 50% 18px 18px;
  pointer-events: none;
}

.envelope-gate::after {
  inset: 30px;
  border-color: rgba(216, 179, 106, 0.17);
}

.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;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.38));
  transition: transform 0.4s ease;
}

.envelope-button:hover .envelope-stage,
.envelope-button:focus-visible .envelope-stage {
  transform: translateY(-6px);
}

.envelope-button:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 8px;
}

.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.98);
}

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

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

.royal-monogram {
  position: absolute;
  top: 44%;
  left: 50%;
  color: var(--gold-bright);
  font: 400 3.2rem/1 var(--display);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease 0.2s;
}

.envelope-button.is-opening .royal-monogram {
  opacity: 1;
}

.open-label {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  width: max-content;
  margin: auto;
  align-items: center;
  padding: 11px 18px;
  border: 1px solid rgba(241, 214, 154, 0.46);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(3, 8, 21, 0.68);
  backdrop-filter: blur(8px);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.open-label::before,
.open-label::after {
  content: "✦";
  margin: 0 12px;
  font-size: 0.62rem;
}

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

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

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

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

.hero-overlay {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(4, 11, 25, 0.12) 0%, rgba(4, 11, 25, 0.03) 38%, rgba(4, 11, 25, 0.93) 100%),
    linear-gradient(90deg, rgba(4, 11, 25, 0.22), transparent 38%, rgba(4, 11, 25, 0.14));
}

.hero-frame {
  z-index: 2;
  inset: 22px 14px 14px;
  border: 1px solid rgba(241, 214, 154, 0.6);
  border-radius: 260px 260px 18px 18px;
  pointer-events: none;
}

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

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

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

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

.hero-copy {
  width: 100%;
}

.crown {
  display: block;
  margin-bottom: 7px;
  color: var(--gold-bright);
  font-size: 2rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  margin: 0;
  color: white;
  font: 400 clamp(5rem, 21vw, 8rem)/0.82 var(--serif);
  letter-spacing: -0.045em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.hero h1 span {
  display: block;
  margin-bottom: 14px;
  color: var(--gold-bright);
  font: 500 0.16em/1 var(--sans);
  letter-spacing: 0.48em;
  text-transform: uppercase;
}

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

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

.scroll-note span {
  display: block;
  color: var(--gold-bright);
  font-size: 1.4rem;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  width: 80px;
  height: 1px;
  margin: 0 14px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.ornament::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.script-line {
  margin-bottom: 10px;
  color: #9d7537;
  font: italic 400 1.55rem/1.2 var(--serif);
}

.lead {
  max-width: 480px;
  margin: 0 auto 46px;
  color: #5e6170;
}

.parents {
  display: grid;
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 12px;
  border-block: 1px solid rgba(157, 117, 55, 0.3);
}

.parents p {
  margin: 0;
}

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

.parents small {
  color: #9d7537;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.parents strong {
  color: var(--navy);
  font: 500 1.7rem/1.25 var(--serif);
}

.parents i {
  margin: 14px 0;
  color: var(--gold);
  font-style: normal;
}

.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, 179, 106, 0.42);
}

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

.timer div + div {
  border-left: 1px solid rgba(216, 179, 106, 0.3);
}

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

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

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

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

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

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

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

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

.portrait-caption span {
  color: var(--gold-bright);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.portrait-caption strong {
  margin-top: 8px;
  font: 400 2.4rem/1.05 var(--serif);
}

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

.timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 1px;
  background: linear-gradient(var(--gold), rgba(216, 179, 106, 0.15));
}

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

.timeline article > span {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  margin: auto;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: #9d7537;
  background: var(--ivory);
  font-size: 0.8rem;
}

.timeline time {
  padding-right: 14px;
  color: var(--navy);
  font: 500 1.5rem/1 var(--serif);
  text-align: right;
}

.timeline time small {
  display: block;
  margin-top: 7px;
  color: #9d7537;
  font: 600 0.62rem/1 var(--sans);
  letter-spacing: 0.12em;
}

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

.timeline h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.45rem;
}

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

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

.location-card {
  position: relative;
  padding: 44px 28px 34px;
  overflow: hidden;
  border: 1px solid rgba(157, 117, 55, 0.28);
  border-radius: 120px 120px 8px 8px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 18px 38px rgba(7, 19, 41, 0.09);
}

.location-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(216, 179, 106, 0.25);
  border-radius: inherit;
  pointer-events: none;
}

.card-number {
  display: block;
  color: var(--gold);
  font: 400 2rem/1 var(--display);
}

.location-card small {
  display: block;
  margin-top: 18px;
  color: #9d7537;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.location-card h3 {
  max-width: 340px;
  margin: 12px auto 6px;
  color: var(--navy);
  font-size: 1.9rem;
  line-height: 1;
}

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

.location-card button,
form button {
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: white;
  background: var(--navy);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  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: var(--navy-light);
}

.dark-card {
  border-color: rgba(216, 179, 106, 0.55);
  color: white;
  background: var(--navy);
}

.dark-card h3,
.dark-card .card-number {
  color: var(--gold-bright);
}

.dark-card p {
  color: rgba(255, 255, 255, 0.7);
}

.dark-card button {
  color: var(--navy);
  background: var(--gold-bright);
}

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

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

.detail-list article > span {
  color: var(--gold-bright);
  font-size: 1.35rem;
}

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

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

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

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

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

.gallery-grid figure:nth-child(2) img {
  object-position: 58% center;
}

.gallery-grid blockquote {
  display: grid;
  margin: 0;
  padding: 28px 20px;
  grid-column: 1 / -1;
  place-items: center;
  border: 1px solid rgba(157, 117, 55, 0.24);
  color: #8f6d36;
  font: italic 400 1.55rem/1.25 var(--serif);
}

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

.crown-small,
.crown-large {
  display: block;
  margin-bottom: 20px;
  color: var(--gold);
  font-size: 2rem;
}

.crown-large {
  color: var(--gold-bright);
  font-size: 3rem;
}

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(--navy);
  font-size: 0.72rem;
  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(23, 33, 58, 0.18);
  border-radius: 5px;
  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(--gold);
  box-shadow: 0 0 0 3px rgba(216, 179, 106, 0.18);
}

form button {
  justify-self: center;
  margin-top: 8px;
  padding-inline: 30px;
}

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

.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, 179, 106, 0.28);
  border-radius: 5px;
  color: white;
  cursor: pointer;
}

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

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

.rsvp form button {
  color: var(--navy);
  background: var(--gold-bright);
}

footer {
  padding: 78px 24px 62px;
  border-top: 1px solid rgba(216, 179, 106, 0.4);
  color: white;
  background: #030815;
  text-align: center;
}

footer > span {
  color: var(--gold-bright);
  font-size: 2.2rem;
}

footer strong {
  display: block;
  margin-top: 12px;
  font: 400 3.6rem/1 var(--serif);
}

footer p {
  margin: 16px 0 12px;
  color: var(--gold-bright);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
}

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

.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: var(--gold-bright);
  box-shadow: 0 0 8px rgba(241, 214, 154, 0.58);
  opacity: 0;
  animation: float-down var(--duration) linear var(--delay) infinite;
}

@keyframes float-down {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  12% {
    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, 179, 106, 0.62);
  border-radius: 6px;
  color: white;
  background: rgba(7, 19, 41, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  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, 179, 106, 0.36);
    border-radius: 10px;
  }

  .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: 4.7rem;
  }

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

  .timer span {
    font-size: 0.58rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid blockquote {
    grid-column: auto;
  }
}

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