@font-face {
  font-family: "BillaMount";
  src: url("../assets/fonts/BillaMount-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Griffo Classico";
  src: url("../assets/fonts/GriffoClassico-SmallCaps.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Le Jour Script";
  src: url("../assets/fonts/LeJourScript.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Chopin Script";
  src: url("../assets/fonts/ChopinScript.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --page-max: 540px;
  --paper: #f3efe8;
  --gold: #b9a06a;
  --ink: #3a352e;
  --slate: #4a5568;
  --stone: #efefef;
  --linen: #f2f2f4;
  --foil-deep: #8f7439;
  --foil-light: #f0dfae;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Griffo Classico", Georgia, serif;
}

img {
  display: block;
  max-width: 100%;
}

/* Abertura: cobre o convite até o toque, para a arte não ser vista antes */
.opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(170deg, #faf7f1, var(--paper) 55%, #ece5d8);
  cursor: pointer;
  transition: opacity 0.9s ease;
}

.opening__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.opening__hint {
  position: relative;
  margin: 0;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: clamp(20px, 5vw, 34px);
  letter-spacing: 0.22em;
  color: var(--gold);
  animation: hint-breath 2.8s ease-in-out infinite;
}

.opening--opened .opening__hint {
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: none;
}

.opening--gone {
  opacity: 0;
  pointer-events: none;
}

.opening-active {
  overflow: hidden;
}

@keyframes hint-breath {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .opening__hint {
    animation: none;
    opacity: 1;
  }
}

/* Pétalas nas laterais: só desktop, atrás do main, sem interceptar clique */
.petals-side {
  display: none;
}

@media (min-width: 540px) {
  .petals-side {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }
}

/* Container único da página: toda medida em cqw das seções resolve contra ele */
main {
  max-width: var(--page-max);
  margin: 0 auto;
  container-type: inline-size;
}

/* Mobile first: seção ocupa largura total, altura pela proporção 9:16 */
.hero {
  display: flex;
  justify-content: center;
  background: var(--paper);
}

.hero__image {
  width: 100%;
  height: auto;
  aspect-ratio: 1080 / 1920;
}

/* Desktop: trava em 540x960 centralizado */
@media (min-width: 540px) {
  .hero__image {
    width: 540px;
    height: 960px;
  }
}

/*
  Seção 2: imagem sempre ao fundo, conteúdo sobreposto.
  Medidas em cqw (1cqw = 1% da largura da seção), então o layout
  desenhado em 1080px escala igual em qualquer tela. 400px = 37.04cqw.
*/
.event {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  container-type: inline-size;
}

.event__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.event__content {
  position: relative;
  z-index: 1;
  padding: 44cqw 4cqw 0;
  text-align: center;
  color: var(--slate);
}

.event__date {
  margin: 0;
  color: var(--gold);
  line-height: 1.1;
}

.event__date .script {
  font-family: "Le Jour Script", cursive;
  font-size: 11cqw;
}

.event__date .numeral {
  font-family: "Chopin Script", "Griffo Classico", cursive;
  font-size: 19cqw;
  letter-spacing: 0.01em;
}

.event__date .smallcaps {
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 4.6cqw;
  letter-spacing: 0.08em;
  margin-inline: 1.4cqw;
}

/* O redondo do "10" em Chopin abre um vão óptico: puxa o primeiro "de" */
.event__date .numeral + .smallcaps {
  margin-left: -1.4cqw;
}

.event__details {
  margin-top: 6cqw;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 3.9cqw;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.event__line,
.event__time {
  margin: 0;
}

.event__time {
  font-family: "Chopin Script", "Griffo Classico", cursive;
  font-size: 7cqw;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.event__hour {
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 4.8cqw;
  letter-spacing: 0.06em;
}

.event__map {
  display: inline-block;
  margin-top: 3cqw;
  padding: 1.6cqw 5cqw;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 3.2cqw;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.event__map:hover,
.event__map:focus-visible {
  background: var(--gold);
  color: #fff;
}

/*
  O dialog vai para a top layer, fora do fluxo do container de 1080,
  então aqui as medidas são absolutas em vez de cqw.
*/
.maps {
  width: min(88vw, 26rem);
  padding: 2rem 1.75rem 1.5rem;
  border: 1px solid rgba(143, 116, 57, 0.5);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

.maps::backdrop {
  background: rgba(58, 53, 46, 0.45);
  backdrop-filter: blur(2px);
}

.maps__title {
  margin: 0 0 0.4rem;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.maps__hint {
  margin: 0 0 1.4rem;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.maps__item {
  display: block;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(185, 160, 106, 0.45);
  border-radius: 0.6rem;
  font-family: "Griffo Classico", Georgia, serif;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.maps__item:hover,
.maps__item:focus-visible {
  border-color: var(--gold);
  background: rgba(185, 160, 106, 0.1);
}

.maps__label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.maps__place {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.maps__close {
  margin-top: 0.75rem;
  padding: 0.5rem 1.5rem;
  border: 0;
  background: none;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: var(--slate);
  cursor: pointer;
}

.maps__close:hover,
.maps__close:focus-visible {
  color: var(--gold);
}

/* Seção 3: altura natural, mesma régua de 1080 das anteriores */
.rsvp {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12cqw 8cqw 33cqw;
  background: var(--stone) url("../assets/img/background3.jpg") no-repeat bottom center;
  background-size: 100% auto;
  text-align: center;
  color: var(--ink);
}

.rsvp__title {
  margin: 0 0 3cqw;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: 5.2cqw;
  min-width: 0;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--gold);
}

.rsvp__form {
  position: relative;
  display: grid;
  gap: 6cqw;
  max-width: 64cqw;
  margin: 0 auto;
  padding: 8cqw 7cqw;
  border: 1px solid rgba(143, 116, 57, 0.45);
  border-radius: 3cqw;
  background: var(--linen);
  text-align: left;
}

/* Moldura dupla: fio interno de folha, como no papel impresso */
.rsvp__form::before {
  content: "";
  position: absolute;
  inset: 1.6cqw;
  border: 1px solid rgba(185, 160, 106, 0.32);
  border-radius: 2cqw;
  pointer-events: none;
}

.field {
  position: relative;
  display: grid;
  gap: 0.8cqw;
}

.field__label {
  font-family: "Griffo Classico", Georgia, serif;
  font-size: max(12px, 2.3cqw);
  letter-spacing: 0.16em;
  color: var(--slate);
}

.field__input {
  width: 100%;
  padding: 1.4cqw 0;
  border: 0;
  border-bottom: 1px solid rgba(143, 116, 57, 0.35);
  border-radius: 0;
  background: transparent;
  position: relative;
  z-index: 1;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: max(16px, 3.2cqw);
  letter-spacing: 0.04em;
  color: var(--ink);
}

.field__input::placeholder {
  color: rgba(74, 85, 104, 0.4);
}

.field__input:focus {
  outline: none;
}

/* Assinatura: a luz corre pela linha de folha dourada quando o campo recebe foco */
.field::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--foil-deep) 20%,
    var(--foil-light) 50%,
    var(--foil-deep) 80%,
    transparent
  );
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.field:focus-within::after {
  transform: scaleX(1);
}

.field--invalid .field__input {
  border-bottom-color: #a4453a;
}

.rsvp__submit {
  position: relative;
  justify-self: start;
  margin-top: 1cqw;
  padding: 2.4cqw 7cqw;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(100deg, var(--foil-deep), var(--gold) 45%, var(--foil-light) 60%, var(--gold));
  font-family: "Griffo Classico", Georgia, serif;
  font-size: max(15px, 3.1cqw);
  letter-spacing: 0.14em;
  color: #fff;
  cursor: pointer;
}

.rsvp__submit-label {
  position: relative;
  z-index: 1;
}

.rsvp__submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.85) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: foil-sweep 5s ease-in-out infinite;
}

.rsvp__submit:hover::after,
.rsvp__submit:focus-visible::after {
  animation-duration: 1.6s;
}

.rsvp__submit:focus-visible {
  outline: 2px solid var(--foil-deep);
  outline-offset: 3px;
}

@keyframes foil-sweep {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

.rsvp__status {
  min-height: 4cqw;
  margin: 4cqw 0 0;
  font-family: "Griffo Classico", Georgia, serif;
  font-size: max(13px, 2.5cqw);
  letter-spacing: 0.08em;
  color: var(--slate);
}

.rsvp__status--error {
  color: #a4453a;
}

@media (prefers-reduced-motion: reduce) {
  .field::after,
  .rsvp__submit::after {
    transition: none;
    animation: none;
  }
}

.verse {
  max-width: 74cqw;
  margin: 10cqw auto 0;
  font-family: "Griffo Classico", Georgia, serif;
  color: var(--slate);
}

.verse__text {
  margin: 0;
  font-size: max(14px, 3.1cqw);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.verse__source,
.verse__ref {
  color: var(--gold);
}

.verse__ref {
  display: block;
  margin-top: 3cqw;
  font-size: max(13px, 2.7cqw);
  font-style: normal;
  letter-spacing: 0.14em;
  color: var(--gold);
}
