html {
  background: #fff;
}

body {
  margin: 0;
  background: #fff;
}

.invite {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #fff;
}

.invite__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.invite__open {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 2;
  width: clamp(88px, 40vmin, 220px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.invite__open:focus-visible {
  outline: 3px solid #31567f;
  outline-offset: 2px;
}

/* Sem `display` aqui: o popover fechado precisa herdar o `display: none` do
   navegador, senao a imagem fica invisivel na frente do botao e rouba o clique. */
.invite__inside {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #fff;
  opacity: 0;
  transition:
    opacity 700ms ease,
    display 700ms allow-discrete,
    overlay 700ms allow-discrete;
}

/* Mesmo enquadramento de um `object-fit: cover`, porem num box com a proporcao
   real da arte (2250x4000) - e o que faz os links acompanharem a imagem quando
   a tela corta as bordas. */
.invite__art {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: max(100dvw, calc(100dvh * 2250 / 4000));
  height: max(100dvh, calc(100dvw * 4000 / 2250));
}

.invite__art img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Areas clicaveis sobre os tres botoes da arte. Centros medidos na imagem:
   21.0% / 46.2% / 71.4% da largura, 74.6% da altura. */
.invite__spot {
  position: absolute;
  top: 74.6%;
  translate: -50% -50%;
  display: block;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.invite__spot--local {
  left: 21%;
}

.invite__spot--rsvp {
  left: 46.2%;
}

.invite__spot--gift {
  left: 71.4%;
}

.invite__spot:focus-visible {
  outline: 3px solid #31567f;
  outline-offset: 2px;
}

.invite__inside:popover-open {
  opacity: 1;
}

@starting-style {
  .invite__inside:popover-open {
    opacity: 0;
  }
}

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

.page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

.page__note {
  margin: 0;
  color: #31567f;
  font: 500 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  text-wrap: balance;
}
