/* Abertura (3,5 s): a casa se desenha, a porta abre com luz, a câmera entra pela porta
   e aparecem "Chá Rifa / Marcela & Guga" com a casinha ao lado do nome. */
#intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 38%, #5a1226 0%, #2a0711 55%, #12040a 100%);
  color: #fff4ea; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: intro-sai .5s ease 3s forwards;
}
.sem-intro #intro { display: none; }
#intro.saindo { animation: intro-sai .45s ease forwards; }
@keyframes intro-sai { to { opacity: 0; visibility: hidden; transform: scale(1.06); } }
@keyframes intro-aparece { to { opacity: 1; } }

/* ---------- Cena 1: a casa ---------- */
.intro-cena {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  animation: cena-entra .6s cubic-bezier(.5, 0, .75, 0) 1.35s forwards;
}
@keyframes cena-entra { to { transform: scale(3.2) translateY(-4%); opacity: 0; } }
.casa-grande { width: min(64vw, 300px); height: auto; overflow: visible; }
.casa-grande .desenho path {
  fill: none; stroke: #f4d48e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400; animation: casa-desenha .7s ease-out forwards;
  filter: drop-shadow(0 0 6px rgba(244, 212, 142, .35));
}
.casa-grande .t1 { animation-delay: 0s; }
.casa-grande .t2 { animation-delay: .09s; }
.casa-grande .t3 { animation-delay: .18s; }
.casa-grande .t4 { animation-delay: .32s; }
.casa-grande .t5 { animation-delay: .4s; }
@keyframes casa-desenha { to { stroke-dashoffset: 0; } }

/* Porta: aparece fechada e depois abre (gira na dobradiça da esquerda). */
.porta { opacity: 0; transform-box: fill-box; transform-origin: left center; animation: porta-surge .25s ease .45s forwards, porta-abre .6s cubic-bezier(.4, 0, .2, 1) .72s forwards; }
.porta rect { fill: #8a1630; stroke: #f4d48e; stroke-width: 2; }
.porta circle { fill: #f4d48e; }
@keyframes porta-surge { to { opacity: 1; } }
@keyframes porta-abre { to { opacity: 1; transform: scaleX(.12) skewY(-8deg); } }

/* Luz quente saindo de dentro da casa quando a porta abre. */
.luz {
  fill: #ffe3a1; opacity: 0;
  filter: drop-shadow(0 0 10px #ffd27a) drop-shadow(0 0 26px rgba(255, 196, 92, .8));
  animation: luz-acende .5s ease .72s forwards;
}
@keyframes luz-acende { to { opacity: 1; } }
.coracao-janela {
  fill: #ff3b5c; transform-box: fill-box; transform-origin: center; transform: scale(0);
  animation: coracao-pulsa .6s cubic-bezier(.3, 1.6, .5, 1) .9s forwards;
}

/* ---------- Cena 2: os nomes ---------- */
.intro-bloco { position: relative; text-align: center; padding: 0 20px; }
.intro-cha {
  margin: 0; font: 800 clamp(34px, 11vw, 64px) / 1 var(--titulo); letter-spacing: .06em;
  text-transform: uppercase; color: #f4d48e; text-shadow: 0 4px 24px rgba(244, 212, 142, .35);
}
.intro-nomes {
  position: relative; display: inline-flex; align-items: flex-start; gap: 6px; margin: 10px 0 0;
  font: 400 clamp(40px, 12vw, 78px) / 1.15 'Alex Brush', 'Great Vibes', cursive; color: #fff4ea;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .45); white-space: nowrap;
}
.intro-sub {
  margin: 8px 0 0; font: 800 clamp(12px, 3.6vw, 17px) / 1 var(--titulo); letter-spacing: .42em;
  text-transform: uppercase; color: #f4d48e; opacity: 0; animation: intro-aparece .7s ease 1.7s forwards;
}
.intro-pular {
  position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0;
  text-align: center; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 244, 234, .55);
  opacity: 0; animation: intro-aparece .5s ease .55s forwards;
}

/* Cada letra começa espalhada e desfocada e se encaixa no lugar. */
.letra {
  display: inline-block; white-space: pre; opacity: 0;
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.8); filter: blur(10px);
  animation: letra-monta .7s cubic-bezier(.2, .85, .25, 1) var(--d) forwards;
}
@keyframes letra-monta { to { opacity: 1; transform: none; filter: blur(0); } }

/* Casinha ao lado do nome, desenhada traço a traço. */
.intro-casa {
  flex: 0 0 auto; width: clamp(34px, 9.5vw, 56px); height: auto; margin-top: -.12em; overflow: visible;
}
.intro-casa .traco {
  fill: none; stroke: #f4d48e; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 120; stroke-dashoffset: 120; animation: casa-desenha .6s ease-out forwards;
}
.intro-casa .traco:nth-child(1) { animation-delay: 1.7s; }
.intro-casa .traco:nth-child(2) { animation-delay: 1.85s; }
.intro-casa .traco:nth-child(3) { animation-delay: 1.98s; }
.intro-casa .traco:nth-child(4) { animation-delay: 2.03s; }
.coracao-casa {
  fill: #ff3b5c; transform-origin: 32px 32px; transform: scale(0);
  animation: coracao-pulsa .6s cubic-bezier(.3, 1.6, .5, 1) 2.3s forwards;
}
@keyframes coracao-pulsa { to { transform: scale(1); } }

/* Coraçõezinhos subindo ao fundo. */
.intro-coracoes { position: absolute; inset: 0; pointer-events: none; }
.intro-coracoes i {
  position: absolute; bottom: -40px; width: 18px; height: 16px; background: rgba(255, 90, 120, .35);
  -webkit-mask: url(/img/coracao.svg) center / contain no-repeat;
  mask: url(/img/coracao.svg) center / contain no-repeat;
  animation: coracao-sobe 6s linear infinite;
}
.intro-coracoes i:nth-child(1) { left: 8%; animation-delay: 0s; transform: scale(.8); }
.intro-coracoes i:nth-child(2) { left: 22%; animation-delay: 1.4s; }
.intro-coracoes i:nth-child(3) { left: 38%; animation-delay: .6s; width: 12px; height: 11px; }
.intro-coracoes i:nth-child(4) { left: 55%; animation-delay: 2.2s; }
.intro-coracoes i:nth-child(5) { left: 70%; animation-delay: .3s; width: 24px; height: 22px; }
.intro-coracoes i:nth-child(6) { left: 84%; animation-delay: 1.8s; width: 14px; height: 13px; }
.intro-coracoes i:nth-child(7) { left: 93%; animation-delay: 3s; }
@keyframes coracao-sobe {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #intro { animation-delay: 2.2s; }
  .intro-cena { display: none; }
  .letra { transform: none; filter: none; animation: intro-aparece .6s ease forwards; }
  .intro-sub, .intro-pular { animation-delay: .3s; }
  .intro-casa .traco { stroke-dashoffset: 0; animation: none; }
  .coracao-casa { transform: none; animation: none; }
  .intro-coracoes { display: none; }
}
