:root {
  color-scheme: light;
  --ink: #203f61;
  --ink-soft: #5d7791;
  --accent: #426f93;
  --accent-dark: #365f80;
  --secondary: #53684e;
  --gold: #8a6515;
  --paper: #fffef9;
  --wash-a: rgb(164 190 166 / 28%);
  --wash-b: rgb(111 158 193 / 22%);
  --body-start: #f4f0e4;
  --body-middle: #fbfaf5;
  --body-end: #edf3f0;
  --frame-radius: 1.75rem;
  --details-radius: 1.75rem;
  --heading-font: Georgia, "Times New Roman", serif;
  --body-font: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, var(--wash-a), transparent 25rem),
    radial-gradient(circle at 88% 76%, var(--wash-b), transparent 30rem),
    linear-gradient(145deg, var(--body-start), var(--body-middle) 48%, var(--body-end));
  font-family: var(--body-font);
  transition: background 260ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgb(128 96 32 / 16%) 0.8px, transparent 0.8px);
  background-size: 25px 25px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

.page {
  width: 100%;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) 5rem;
}

.load-error {
  max-width: 760px;
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgb(128 67 67 / 25%);
  border-radius: 1rem;
  color: #713d3d;
  background: rgb(255 248 246 / 88%);
  line-height: 1.5;
}

.intro {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  text-align: center;
  animation: intro-in 800ms ease-out both;
}

.cross {
  position: relative;
  display: block;
  width: 3px;
  height: 38px;
  margin: 0 auto 1.2rem;
  border-radius: 999px;
  background: linear-gradient(#d9b861, var(--gold));
  box-shadow: 0 2px 8px rgb(115 82 18 / 16%);
}

.cross::after {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 22px;
  height: 3px;
  border-radius: inherit;
  background: inherit;
  content: "";
  transform: translateX(-50%);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin-top: 0;
  font-family: var(--heading-font);
  font-weight: 400;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.intro-date {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-family: var(--heading-font);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.invitation-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.invitation-frame {
  position: relative;
  padding: clamp(0.5rem, 1.5vw, 0.8rem);
  overflow: hidden;
  border: 1px solid rgb(128 96 32 / 27%);
  border-radius: var(--frame-radius);
  background: rgb(255 254 249 / 83%);
  box-shadow:
    0 2rem 5rem rgb(42 65 60 / 17%),
    0 0 0 0.45rem rgb(255 255 255 / 30%);
  animation: card-in 900ms 100ms cubic-bezier(0.22, 1, 0.36, 1) both;
  backdrop-filter: blur(12px);
}

.invitation-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--frame-radius);
}

.details {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--details-radius);
  background: rgb(255 255 255 / 58%);
  box-shadow: 0 1.5rem 4rem rgb(42 65 60 / 10%);
  animation: details-in 800ms 240ms ease-out both;
  backdrop-filter: blur(18px);
}

.actions,
.rsvp-actions {
  display: grid;
  gap: 0.8rem;
}

.actions {
  margin: 0;
}

.action {
  display: flex;
  min-height: 3.25rem;
  padding: 0.8rem 1.05rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.action:hover,
.download-link:hover {
  box-shadow: 0 0.75rem 1.6rem rgb(39 61 77 / 17%);
  transform: translateY(-2px);
}

.action:focus-visible,
.download-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.action-secondary {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-dark);
  background: rgb(255 255 255 / 72%);
}

.action-secondary:hover,
.action-whatsapp:hover {
  background: white;
}

.rsvp-label {
  margin: 0.45rem 0.25rem -0.15rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(32 63 97 / 12%);
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.5;
}

.action-whatsapp {
  border-color: rgb(54 92 64 / 30%);
  color: #31583a;
  background: rgb(248 252 247 / 86%);
}

.action-whatsapp small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.downloads {
  position: relative;
  z-index: 1;
  display: grid;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--details-radius);
  background: rgb(255 255 255 / 50%);
  box-shadow: 0 1.5rem 4rem rgb(42 65 60 / 8%);
  backdrop-filter: blur(15px);
}

.downloads h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.download-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.download-link {
  display: flex;
  min-height: 3.2rem;
  padding: 0.75rem 0.9rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 0.9rem;
  color: var(--accent-dark);
  background: rgb(255 255 255 / 72%);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

.decoration {
  position: fixed;
  z-index: -1;
  width: 18rem;
  height: 8rem;
  border: 1px solid color-mix(in srgb, var(--secondary) 18%, transparent);
  border-radius: 100% 0 100% 0;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--secondary) 14%, transparent),
    transparent 68%
  );
  pointer-events: none;
}

.decoration-left {
  top: 14%;
  left: -8rem;
  transform: rotate(25deg);
}

.decoration-right {
  right: -8rem;
  bottom: 8%;
  transform: rotate(205deg);
}

@keyframes intro-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
}

@keyframes details-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

@media (max-width: 850px) {
  .page {
    max-width: 650px;
  }

  .invitation-layout {
    grid-template-columns: 1fr;
  }

  .details {
    margin: 0 clamp(0rem, 4vw, 1.5rem);
  }

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

@media (max-width: 540px) {
  .page {
    padding-inline: 0.75rem;
    padding-bottom: 2rem;
  }

  .intro {
    padding-inline: 0.5rem;
  }

  .details {
    margin: 0;
  }

  .download-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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