:root {
  color-scheme: light;
  --red-900: #4d0808;
  --red-800: #710d0d;
  --red-700: #9b1715;
  --red-600: #bd211c;
  --gold-100: #fff4bd;
  --gold-300: #f3ca64;
  --gold-500: #c88d2f;
  --gold-700: #8f5b19;
  --ink: #342014;
  --paper: #fff7df;
  --paper-deep: #f1dfb2;
  --jade: #1c6b5d;
  --shadow: rgba(54, 7, 4, 0.34);
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--red-900);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 218, 112, 0.16), transparent 32rem),
    linear-gradient(135deg, #390505, #861212 48%, #4d0808);
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.door-stage {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  perspective: 1600px;
  isolation: isolate;
}

.backdrop-pattern {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(30deg, rgba(255, 225, 134, 0.08) 12%, transparent 12.5%, transparent 87%, rgba(255, 225, 134, 0.08) 87.5%, rgba(255, 225, 134, 0.08)),
    linear-gradient(150deg, rgba(255, 225, 134, 0.08) 12%, transparent 12.5%, transparent 87%, rgba(255, 225, 134, 0.08) 87.5%, rgba(255, 225, 134, 0.08)),
    radial-gradient(circle at 50% 50%, rgba(255, 234, 166, 0.08), transparent 28rem);
  background-position: 0 0, 0 0, center;
  background-size: 4.5rem 7.8rem, 4.5rem 7.8rem, cover;
  opacity: 0.8;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
  color: var(--gold-100);
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
}

.gate::before,
.gate::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.gate::before {
  inset: 1.15rem;
  z-index: 2;
  border: 2px solid rgba(255, 229, 145, 0.52);
  box-shadow:
    inset 0 0 0 0.38rem rgba(104, 11, 10, 0.44),
    inset 0 0 0 0.5rem rgba(244, 195, 83, 0.24);
}

.gate::after {
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 4;
  width: 0.45rem;
  background:
    linear-gradient(90deg, rgba(255, 241, 177, 0.1), rgba(255, 239, 168, 0.62), rgba(100, 48, 8, 0.38)),
    var(--gold-500);
  box-shadow: 0 0 1.4rem rgba(49, 0, 0, 0.5);
  transform: translateX(-50%);
  transition: opacity 0.25s ease 0.28s;
}

.gate__panel {
  position: relative;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(255, 219, 121, 0.12), transparent 18% 82%, rgba(59, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4.6rem),
    linear-gradient(160deg, var(--red-600), var(--red-800) 58%, var(--red-900));
  box-shadow:
    inset 0 0 0 1px rgba(255, 226, 142, 0.28),
    inset 0 0 4rem rgba(49, 0, 0, 0.38);
  transform-style: preserve-3d;
  transition:
    transform 1.25s cubic-bezier(0.77, 0, 0.18, 1),
    filter 1s ease;
}

.gate__panel--left {
  transform-origin: left center;
}

.gate__panel--right {
  transform-origin: right center;
}

.gate__border {
  position: absolute;
  inset: clamp(2.1rem, 5vw, 4rem);
  border: 0.35rem double rgba(255, 223, 132, 0.72);
  box-shadow:
    inset 0 0 0 1.15rem rgba(97, 10, 8, 0.32),
    inset 0 0 0 1.3rem rgba(255, 213, 98, 0.22);
}

.gate__rings {
  position: absolute;
  top: 52%;
  width: clamp(4.4rem, 14vw, 7.4rem);
  aspect-ratio: 1;
  border: 0.45rem solid rgba(255, 235, 156, 0.82);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0.8rem rgba(91, 50, 2, 0.34),
    0 0 1.4rem rgba(77, 4, 4, 0.5);
  transform: translateY(-50%);
}

.gate__panel--left .gate__rings {
  right: clamp(1.7rem, 5vw, 4rem);
}

.gate__panel--right .gate__rings {
  left: clamp(1.7rem, 5vw, 4rem);
}

.gate__rings::before,
.gate__rings::after {
  position: absolute;
  content: "";
  inset: 17%;
  border: 1px solid rgba(255, 247, 199, 0.72);
  border-radius: inherit;
}

.gate__rings::after {
  inset: 42% auto auto 42%;
  width: 16%;
  aspect-ratio: 1;
  background: var(--gold-100);
  border: 0;
}

.crest {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  display: grid;
  width: clamp(16.25rem, 55vw, 26.25rem);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 203, 0.22), transparent 68%);
  filter: drop-shadow(0 1.1rem 1.3rem rgba(38, 3, 3, 0.5));
  transform: translate(-50%, -50%);
  transition:
    opacity 0.48s ease,
    transform 0.78s ease;
}

.crest img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.12);
}

.gate__prompt {
  position: absolute;
  left: 50%;
  bottom: max(2rem, env(safe-area-inset-bottom));
  z-index: 6;
  min-width: 9rem;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #ffeeb3;
  border: 1px solid rgba(255, 233, 162, 0.58);
  background: rgba(76, 7, 6, 0.42);
  transform: translateX(-50%);
  transition:
    opacity 0.35s ease,
    transform 0.5s ease;
}

.invitation {
  position: relative;
  z-index: 1;
  width: min(100%, 56rem);
  padding: clamp(4rem, 11vh, 7rem) 0;
  opacity: 0;
  transform: translateY(2rem) scale(0.98);
  transition:
    opacity 0.9s ease 0.42s,
    transform 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.42s;
}

.paper {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.8rem);
  border: 1px solid rgba(151, 92, 23, 0.38);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 28% 72%, rgba(138, 76, 18, 0.08)),
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.56), transparent 16rem),
    linear-gradient(135deg, var(--paper), #f7e9c2 64%, var(--paper-deep));
  box-shadow:
    0 2rem 5rem rgba(48, 5, 3, 0.32),
    inset 0 0 0 0.65rem rgba(255, 250, 226, 0.32);
}

.paper > * {
  position: relative;
  z-index: 1;
}

.paper::before,
.paper::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.paper::before {
  inset: 1rem;
  border: 1px solid rgba(176, 113, 35, 0.44);
}

.paper::after {
  inset: 1.65rem;
  border: 2px solid rgba(168, 29, 23, 0.14);
}

.paper__ornament {
  width: min(17rem, 62vw);
  height: 2.2rem;
  margin: 0 auto 1.6rem;
  background:
    radial-gradient(circle at 50% 50%, var(--gold-700) 0 0.22rem, transparent 0.25rem),
    linear-gradient(90deg, transparent, var(--gold-500) 18% 82%, transparent),
    radial-gradient(ellipse at 50% 100%, transparent 34%, rgba(166, 29, 23, 0.34) 35% 38%, transparent 39%);
  background-repeat: no-repeat;
  background-position: center, center, center;
  background-size: 2rem 2rem, 100% 1px, 68% 100%;
}

.parents-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.55rem, 2vw, 1rem);
  margin-bottom: clamp(1.35rem, 4vw, 2.5rem);
}

.parent-card {
  min-width: 0;
  padding: clamp(0.75rem, 2.5vw, 1.25rem);
  text-align: center;
  border: 1px solid rgba(156, 91, 24, 0.32);
  background: rgba(255, 249, 225, 0.62);
}

.parent-card p,
.person p {
  margin: 0 0 0.45rem;
  color: var(--red-700);
  font-size: clamp(0.72rem, 2.4vw, 0.9rem);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.parent-card strong {
  display: block;
  min-height: 1.55rem;
  color: #322012;
  font-family: "Corinthia", cursive;
  font-size: clamp(1.45rem, 4.8vw, 2.05rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.eyebrow,
.detail-label,
.person p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--red-700);
}

.eyebrow {
  display: block;
  width: 100%;
  text-align: center;
}

.couple {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.45rem, 2vw, 1.2rem);
  margin: 0.35rem 0 0.85rem;
}

.person {
  min-width: 0;
  text-align: center;
}

.person p {
  margin-bottom: 0.15rem;
}

.person h1 {
  display: grid;
  height: clamp(6.4rem, 17vw, 10rem);
  align-content: center;
  justify-items: center;
  margin: 0;
  color: #731010;
  font-family: "Corinthia", cursive;
  font-size: clamp(2.15rem, 6.8vw, 4.6rem);
  font-weight: 700;
  line-height: 0.9;
  overflow-wrap: anywhere;
}

.person h1.is-long {
  font-size: clamp(1.9rem, 5.8vw, 4.1rem);
}

.person h1.is-very-long {
  font-size: clamp(1.65rem, 5vw, 3.55rem);
}

.person h1 span {
  display: block;
  max-width: 100%;
}

.person h1 .family-name {
  font-size: 0.72em;
}

.person h1 .given-name {
  font-size: 1em;
  text-wrap: balance;
}

.couple__amp {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-700);
  font-family: "Corinthia", cursive;
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 1;
}

.intro {
  max-width: 36rem;
  margin: 0 auto clamp(2rem, 5vw, 3.4rem);
  color: #4f3723;
  font-family: "Send Flowers", cursive;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

.event-box {
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.2rem, 3vw, 2rem);
  text-align: center;
  border: 1px solid rgba(156, 91, 24, 0.28);
  background: rgba(255, 249, 225, 0.68);
}

.detail-value {
  margin: 0.55rem 0 0.35rem;
  color: #2f1e12;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.detail-note {
  margin: 0;
  color: #65503d;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.actions a {
  display: inline-flex;
  min-height: 2.85rem;
  min-width: 8.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.2rem;
  color: #fff7dd;
  font-weight: 800;
  text-decoration: none;
  background: #8e1714;
  border: 1px solid rgba(255, 228, 145, 0.54);
  box-shadow: 0 0.55rem 1.3rem rgba(112, 13, 10, 0.2);
}

.actions a:last-child {
  color: #381f0c;
  background: linear-gradient(135deg, #fff0a8, #d89b31);
  border-color: rgba(122, 74, 12, 0.42);
}

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

.is-open .gate::before,
.is-open .gate::after {
  opacity: 0;
}

.is-open .gate__panel--left {
  filter: brightness(0.72);
  transform: rotateY(-112deg);
}

.is-open .gate__panel--right {
  filter: brightness(0.72);
  transform: rotateY(112deg);
}

.is-open .crest {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.84);
}

.is-open .gate__prompt {
  opacity: 0;
  transform: translate(-50%, 0.75rem);
}

.is-open .invitation {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (hover: hover) {
  .gate:hover .crest {
    transform: translate(-50%, -50%) scale(1.04);
  }

  .actions a:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 720px) {
  .door-stage {
    padding: 0.8rem;
  }

  .gate::before {
    inset: 0.65rem;
  }

  .gate__border {
    inset: 1.25rem 0.95rem;
  }

  .paper {
    padding: 2.2rem 1.1rem;
  }

  .paper::before {
    inset: 0.6rem;
  }

  .paper::after {
    inset: 0.95rem;
  }

  .parents-row {
    gap: 0.45rem;
  }

  .parent-card {
    padding: 0.75rem 0.45rem;
  }

  .couple {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.35rem;
  }

  .person h1 {
    height: 6.8rem;
  }
}

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