:root {
  color-scheme: light;
  --arabic-font: "Amiri", "DecoType Naskh", "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;
  --wine: #40181c;
  --ink: #59321e;
  --gold: #855020;
  --cream: #fff0d7;
  --stage-width: min(100%, 31rem);
  font-family: var(--arabic-font);
  background: var(--wine);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 30%, #743332, var(--wine) 58%, #261214);
}

:root.gated {
  overflow: hidden;
  overscroll-behavior: none;
}

.invitation,
.gate {
  width: var(--stage-width);
}

.invitation {
  margin-inline: auto;
  background: #e9c69e;
  box-shadow: 0 0 3rem #18080990;
}

.invitation:focus,
.directions:focus {
  outline: none;
}

.scene {
  position: relative;
  container-type: inline-size;
}

.scene-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 911 / 1726;
}

.card {
  position: absolute;
  inset: 18.5% 23% auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.26;
}

.card p,
.couple {
  margin: 0;
}

.card .verse {
  font-size: clamp(1.02rem, 5.65cqw, 1.9rem);
  font-weight: 700;
  color: var(--gold);
}

.card .verse-reference {
  margin-block-start: 1.35cqw;
  font-size: clamp(.81rem, 3.2cqw, 1rem);
}

.card .greeting {
  margin-block: 4.5cqw 2cqw;
  font-size: clamp(.99rem, 4.32cqw, 1.36rem);
  font-weight: 700;
}

.couple {
  display: grid;
  justify-items: center;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.05;
}

.name {
  font-size: clamp(2.6rem, 13cqw, 4.1rem);
}

.conjunction {
  font-size: clamp(1.15rem, 5.4cqw, 1.7rem);
  line-height: 1.03;
  color: var(--ink);
}

.card .date {
  margin-block-start: 3.6cqw;
  font-weight: 700;
  font-size: clamp(.95rem, 4.4cqw, 1.4rem);
}

.date bdi {
  display: block;
  margin-block-start: .45cqw;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: clamp(1.1rem, 5.45cqw, 1.7rem);
  font-variant-numeric: lining-nums tabular-nums;
}

.venue {
  display: grid;
  justify-items: center;
  margin-block-start: 4.3cqw;
  color: inherit;
  text-decoration: none;
  border-radius: .3rem;
}

.venue-name {
  display: grid;
  justify-items: center;
  font-size: clamp(1.1rem, 5.3cqw, 1.65rem);
  font-weight: 700;
}

.pin {
  display: block;
  width: clamp(.78rem, 3.5cqw, 1.14rem);
  margin-block-end: 1cqw;
  color: var(--gold);
}

.city {
  margin-block-start: .5cqw;
  font-size: clamp(.9rem, 3.75cqw, 1.15rem);
}

.venue:hover .venue-name {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.directions {
  display: grid;
  place-items: center;
  min-height: clamp(9rem, 27svh, 15rem);
  padding: 1.35rem 1rem max(1.45rem, env(safe-area-inset-bottom));
  background: #f7e5cd;
  border-top: 1px solid #bd945e;
}

.map-link {
  min-height: 44px;
  padding: .68rem 1.25rem;
  border: 1px solid #916136;
  border-radius: 999px;
  background: var(--wine);
  color: var(--cream);
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
}

.map-link:hover {
  background: #62282c;
}

.venue:focus-visible,
.map-link:focus-visible {
  outline: 2px solid #713927;
  outline-offset: 4px;
}

.gate {
  position: fixed;
  z-index: 1;
  inset-block: 0;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: end;
  justify-items: center;
  isolation: isolate;
  overflow: hidden;
  margin: 0;
  padding: 0 1rem max(1.45rem, env(safe-area-inset-bottom));
  border: 0;
  background: var(--wine);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gated .gate {
  display: grid;
}

.leaf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}

.is-ready .leaf {
  visibility: visible;
}

.leaf-left {
  clip-path: inset(0 50% 0 0);
}

.leaf-right {
  clip-path: inset(0 0 0 50%);
}

.gate.is-opening {
  background: transparent;
  pointer-events: none;
}

.gate-label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .46rem 1.35rem;
  border: 1px solid #d5a967;
  border-radius: 999px;
  background: #40181cf5;
  color: var(--cream);
  font: 700 1.07rem/1.3 var(--arabic-font);
  transition: opacity 180ms ease-out;
}

.gate:hover .gate-label {
  background: #62282c;
}

.gate:focus-visible .gate-label {
  outline: 2px solid #fff4db;
  outline-offset: 4px;
}

.is-opening .gate-label {
  opacity: 0;
}

.gated [data-reveal],
[data-reveal].waiting {
  opacity: 0;
}

.venue.waiting {
  pointer-events: none;
}

[data-reveal].shown {
  animation: appear 390ms ease-out both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 44rem) {
  :root {
    --stage-width: clamp(23rem, 55svh, 33rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-label {
    transition: none;
  }

  [data-reveal].shown {
    animation: none;
  }
}
