:root {
  --branco: #FFFFFF;
  --papel: #FCFBF8;
  --ouro: #CFA962;          /* dourado do brasão */
  --ouro-escuro: #8E6C2F;   /* botões e textos em dourado (contraste) */
  --ouro-claro: #EFE3C8;
  --serenity: #92A8D1;
  --serenity-claro: #EEF2F9;
  --texto: #45433F;
  --texto-suave: #77736B;
  --erro: #9A3B2E;
  --sombra: 0 18px 40px -22px rgba(142, 108, 47, .35);
  --script: 'Pinyon Script', cursive;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  background: var(--branco);
  color: var(--texto);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
strong { font-weight: 500; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h2 { font-family: var(--script); color: var(--ouro); font-size: clamp(2.4rem, 9vw, 3.2rem); line-height: 1.2; text-align: center; }
h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; color: var(--texto); }

.sobre {
  font-family: var(--sans); font-weight: 400; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .3em; color: var(--ouro-escuro);
  text-align: center; margin: 0 0 4px;
}

/* ---------- Flores do envelope ---------- */
.decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.flor { position: absolute; user-select: none; mix-blend-mode: multiply; }
.flor-buque { bottom: 190px; left: -30px; width: 130px; transform: scaleX(-1); }

/* ---------- Flores ---------- */
.flor-hortensia { top: -50px; right: -60px; width: 170px; }
.flor-ramo { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 100svh;
  padding: 80px 16px 70px;
  background: radial-gradient(ellipse 70% 50% at 50% 38%, var(--serenity-claro), transparent 70%);
}
.brasao { width: 180px; height: auto; margin-bottom: 14px; }
h1 { font-family: var(--script); color: var(--ouro); font-size: clamp(3.2rem, 14vw, 5.4rem); line-height: 1.1; }
.hero-data {
  font-family: var(--sans); font-weight: 300; font-size: 1.15rem;
  letter-spacing: .35em; margin: 14px 0 2px; color: var(--texto);
}
.hero-data span { color: var(--ouro); }
.hero-local { font-style: italic; color: var(--texto-suave); margin: 0 0 22px; }
.rolar {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid var(--ouro); border-radius: 14px;
}
.rolar span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--ouro); animation: rolagem 1.8s ease-in-out infinite;
}
@keyframes rolagem { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Entradas animadas (só com JS e sem "reduzir movimento") ---------- */
html.anima .hero > * { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
html.anima .hero.pronto > * { opacity: 1; transform: none; }
html.anima .hero.pronto > :nth-child(2) { transition-delay: .15s; }
html.anima .hero.pronto > :nth-child(3) { transition-delay: .35s; }
html.anima .hero.pronto > :nth-child(4) { transition-delay: .5s; }
html.anima .hero.pronto > :nth-child(5) { transition-delay: .7s; }
html.anima .hero.pronto > :nth-child(6) { transition-delay: .85s; }
html.anima .hero.pronto > :nth-child(7) { transition-delay: 1.2s; }
html.anima .hero.pronto > .rolar { transform: translateX(-50%); }
html.anima .hero > .rolar { transform: translateX(-50%) translateY(18px); }
html.anima .revelar { opacity: 0; transform: translateY(30px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
html.anima .revelar.visivel { opacity: 1; transform: none; }
html.anima .linha-tempo li { opacity: 0; transform: translateX(-14px); transition: opacity .7s ease, transform .7s ease; }
html.anima .visivel .linha-tempo li { opacity: 1; transform: none; }
html.anima .visivel .linha-tempo li:nth-child(2) { transition-delay: .2s; }
html.anima .visivel .linha-tempo li:nth-child(3) { transition-delay: .4s; }

.contagem {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin: 0 0 28px; padding: 8px 18px;
  border: 1px solid var(--ouro-claro); border-radius: 999px;
  background: rgba(255,255,255,.7); font-style: italic;
}
.contagem strong { font-family: var(--sans); font-style: normal; font-weight: 500; color: var(--ouro-escuro); font-size: 1.05rem; }

/* ---------- Envelope de abertura ---------- */
html.travado, html.travado body { overflow: hidden; }
.envelope-tela {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  padding: 24px 16px;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, var(--serenity-claro), var(--branco) 75%);
  transition: opacity .9s ease, visibility .9s;
}
.envelope-tela.saindo { opacity: 0; visibility: hidden; }
.env-nomes { font-family: var(--script); color: var(--ouro); font-size: clamp(2.6rem, 11vw, 3.6rem); margin: 0; transition: opacity .5s; }
.env-dica {
  margin: 0; font-family: var(--sans); font-size: .72rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ouro-escuro); animation: pulsa 2.2s ease-in-out infinite; transition: opacity .4s;
}
@keyframes pulsa { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.env-pular {
  position: absolute; top: 14px; right: 14px; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--texto-suave);
  padding: 8px;
}
.envelope {
  position: relative; display: block;
  width: min(68vw, 300px); aspect-ratio: 100 / 145;
  padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 1600px;
  animation: flutua 4.5s ease-in-out infinite;
}
@keyframes flutua { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-7px) rotate(.4deg); } }
.env-fundo {
  position: absolute; inset: 0; border-radius: 3px;
  background: #EFEBE2;
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 2px 4px rgba(69, 52, 20, .08),
    0 40px 70px -34px rgba(69, 52, 20, .55);
}
.env-carta {
  position: absolute; left: 7%; right: 7%; top: 4%; height: 90%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--branco); border: 1px solid var(--ouro);
  box-shadow: 0 2px 6px rgba(69,52,20,.1);
  transition: transform 1.2s cubic-bezier(.2, .75, .25, 1);
}
.env-carta img { width: 48%; }
.env-carta-nomes { font-family: var(--script); color: var(--ouro); font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.2; }
.env-carta-data { font-family: var(--sans); font-size: .6rem; letter-spacing: .3em; color: var(--texto-suave); }
.env-bolso { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; border-radius: 3px; }
.aba-sombra {
  position: absolute; left: 0; right: 0; top: 0; height: 44%; z-index: 3;
  width: 100%; transform: translateY(4px); transition: opacity .3s;
}
.env-aba {
  position: absolute; left: 0; right: 0; top: 0; height: 44%; z-index: 4;
  transform-origin: top center; transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.45, 0, .2, 1);
}
.aba-frente, .aba-verso { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.aba-frente {
  clip-path: polygon(0 0, 100% 0, 52% 96%, 50% 100%, 48% 96%);
  background:
    linear-gradient(to bottom, rgba(255,255,255,.55), rgba(255,255,255,0) 40%, rgba(120,95,50,.06)),
    #F7F4EE;
}
.aba-verso {
  transform: rotateX(180deg);
  clip-path: polygon(0 100%, 100% 100%, 52% 4%, 50% 0, 48% 4%);
  background:
    url("assets/hortensia-azul.png") 78% 100% / 52% auto no-repeat,
    url("assets/buque-azul.png") 18% 100% / 36% auto no-repeat,
    #FFFFFF;
}
.env-selo {
  position: absolute; z-index: 5; left: 50%; top: 44%; width: 34%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-8deg);
  filter: drop-shadow(0 3px 3px rgba(40, 50, 70, .35)) drop-shadow(0 8px 12px rgba(40, 50, 70, .18));
  transition: opacity .4s, transform .4s;
}
.env-selo svg { width: 100%; height: 100%; display: block; }

/* sequência de abertura */
.abrindo .envelope { animation: none; }
.abrindo .env-selo { opacity: 0; transform: translate(-50%, -40%) rotate(-8deg) scale(.85); }
.abrindo .aba-sombra { opacity: 0; }
.abrindo .env-dica, .abrindo .env-nomes, .abrindo .env-pular { opacity: 0; }
.abrindo .env-aba { transform: rotateX(180deg); }
.carta-sobe .env-aba { z-index: 1; }
.carta-sobe .env-carta { transform: translateY(-48%); }

@media (prefers-reduced-motion: reduce) {
  .envelope, .env-dica { animation: none; }
}

/* ---------- Botões ---------- */
.botao {
  display: inline-block;
  font-family: var(--sans); font-size: .78rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: .2em; text-decoration: none;
  color: var(--branco); background: var(--ouro-escuro);
  border: 1px solid var(--ouro-escuro); border-radius: 0;
  padding: 15px 30px; cursor: pointer;
  transition: background .2s, transform .2s;
}
.botao:hover { background: #765924; border-color: #765924; }
.botao:focus-visible, input:focus-visible, textarea:focus-visible, .escolha input:focus-visible + span,
.opcoes-grupo button:focus-visible, a:focus-visible {
  outline: 2px solid var(--serenity); outline-offset: 3px;
}
.botao.contorno { background: transparent; color: var(--ouro-escuro); border-color: var(--ouro); }
.botao.contorno:hover { background: var(--papel); }
.botao:disabled { opacity: .6; cursor: wait; }

/* ---------- Blocos ---------- */
main { position: relative; z-index: 1; }
.bloco { max-width: 680px; margin: 0 auto; padding: 64px 16px; }
.bloco + .bloco { border-top: 1px solid var(--ouro-claro); }

.cartao {
  background: var(--branco); border: 1px solid var(--ouro-claro);
  box-shadow: var(--sombra); padding: 26px 22px; text-align: center;
}
.icone {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--papel); border: 1px solid var(--ouro-claro);
  color: var(--ouro-escuro); margin-bottom: 10px;
}
.icone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Moldura dourada com cantos recortados ---------- */
.moldura { --r: 18px; position: relative; background: var(--branco); border: 1px solid var(--ouro); box-shadow: var(--sombra); }
.canto { position: absolute; width: var(--r); height: var(--r); background: var(--branco); border: 1px solid var(--ouro); }
.canto.tl { top: -1px; left: -1px;  border-top: 0; border-left: 0;  border-bottom-right-radius: 100%; }
.canto.tr { top: -1px; right: -1px; border-top: 0; border-right: 0; border-bottom-left-radius: 100%; }
.canto.bl { bottom: -1px; left: -1px;  border-bottom: 0; border-left: 0;  border-top-right-radius: 100%; }
.canto.br { bottom: -1px; right: -1px; border-bottom: 0; border-right: 0; border-top-left-radius: 100%; }

/* ---------- RSVP ---------- */
#rsvp { scroll-margin-top: 10px; }
.cartao-rsvp { padding: 40px 22px 34px; }
.prazo { text-align: center; margin: 6px 0 10px; }

label { display: block; margin: 20px 0 6px; font-size: 1.05rem; }
.opcional { color: var(--texto-suave); font-style: italic; font-size: .95rem; }
input[type="text"], textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--texto);
  background: var(--papel); border: 1px solid #DCD3C0; border-radius: 0;
  padding: 12px 14px; transition: border-color .2s, background .2s;
}
input[type="text"]:focus, textarea:focus { background: var(--branco); border-color: var(--ouro); }
input::placeholder, textarea::placeholder { color: #AAA497; font-style: italic; }
textarea { resize: vertical; }
.linha-busca { display: flex; gap: 8px; }
.linha-busca input { flex: 1; min-width: 0; }

.mensagem { min-height: 1.6em; margin: 12px 0 0; font-style: italic; }
.mensagem.erro { color: var(--erro); }

.opcoes-grupo { display: grid; gap: 8px; margin-top: 8px; }
.opcoes-grupo button {
  text-align: left; font: inherit; color: var(--texto); background: var(--papel);
  border: 1px solid var(--ouro-claro); padding: 12px 14px; cursor: pointer;
}
.opcoes-grupo button:hover { border-color: var(--ouro); }
.opcoes-grupo small { display: block; font-size: .85rem; font-style: italic; color: var(--texto-suave); }

.ola { font-family: var(--script); color: var(--ouro); font-size: 2.2rem; line-height: 1.2; margin: 0; text-align: center; }
.ja-respondeu { background: var(--serenity-claro); padding: 10px 14px; font-style: italic; text-align: center; }
fieldset { border: 0; padding: 0; margin: 20px 0 0; }
legend { padding: 0; margin-bottom: 6px; font-size: 1.05rem; }

.membro {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--ouro-claro);
}
.membro-nome { font-size: 1.1rem; }
.escolhas { display: flex; gap: 8px; }
.escolha { position: relative; margin: 0; font-size: inherit; }
.escolha input { position: absolute; opacity: 0; pointer-events: none; }
.escolha span {
  display: inline-block; padding: 7px 14px;
  font-family: var(--sans); font-size: .8rem; letter-spacing: .06em;
  border: 1px solid #DCD3C0; cursor: pointer; user-select: none;
}
.escolha input:checked + span { background: var(--ouro-escuro); border-color: var(--ouro-escuro); color: var(--branco); }
.escolha.nao input:checked + span { background: var(--texto-suave); border-color: var(--texto-suave); }

.acoes { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.obrigado { text-align: center; outline: none; }
.buque-obrigado { width: 110px; mix-blend-mode: multiply; }
.obrigado h3 { font-family: var(--script); font-weight: 400; color: var(--ouro); font-size: 2.6rem; margin-bottom: 6px; }
.obrigado p { margin: 0 0 24px; }

/* ---------- Linha do tempo ---------- */
.linha-tempo { list-style: none; margin: 34px 0 0; padding: 0; position: relative; }
.linha-tempo::before {
  content: ""; position: absolute; left: 25px; top: 26px; bottom: 26px;
  width: 1px; background: linear-gradient(var(--ouro-claro), var(--ouro), var(--ouro-claro));
}
.linha-tempo li {
  position: relative;
  display: grid; grid-template-columns: 52px 1fr; column-gap: 18px;
  padding-bottom: 28px;
}
.linha-tempo li:last-child { padding-bottom: 0; }
.linha-tempo .icone { grid-row: span 3; margin: 0; background: var(--branco); position: relative; }
.linha-tempo .destaque .icone { background: var(--ouro-escuro); border-color: var(--ouro-escuro); color: var(--branco); }
.linha-tempo .hora {
  font-family: var(--sans); font-weight: 500; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .2em; color: var(--ouro-escuro); padding-top: 4px;
}
.linha-tempo h3 { margin: 0; }
.linha-tempo p { margin: 2px 0 0; color: var(--texto-suave); font-style: italic; }

/* ---------- Local e detalhes ---------- */
.local { margin-top: 30px; }
.local p { margin: 4px 0 0; color: var(--texto-suave); }
.selo {
  display: inline-block; margin-top: 14px !important; padding: 6px 14px;
  background: var(--serenity-claro); border-radius: 999px;
  font-style: italic; color: var(--texto) !important; font-size: .98rem;
}
.gps { display: flex; justify-content: center; gap: 22px; margin-top: 22px; }
.gps-botao {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--texto-suave);
  font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
}
.gps-botao svg {
  width: 64px; height: 64px; padding: 12px; border-radius: 18px;
  background: var(--branco); border: 1px solid var(--ouro-claro); box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s;
}
.gps-botao:hover svg { transform: translateY(-3px); box-shadow: 0 22px 40px -20px rgba(142,108,47,.5); }

.detalhes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.detalhes p { margin: 4px 0 0; font-style: italic; font-size: 1.15rem; }
.agenda { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.agenda a {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ouro-escuro); text-decoration: none; border-bottom: 1px solid var(--ouro-claro);
  align-self: center; padding-bottom: 2px;
}
.agenda a:hover { border-color: var(--ouro); }

/* ---------- Presentes e ajuda ---------- */
.presentes { margin-top: 16px; }
.presentes p { margin: 4px auto 18px; max-width: 42ch; font-style: italic; color: var(--texto-suave); }
.acoes-obrigado { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ajuda { font-style: italic; color: var(--texto-suave); margin: 10px 0 0; font-size: 1rem; }
.whats-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.whats {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: 1px solid var(--ouro-claro); border-radius: 999px;
  background: var(--branco); color: var(--texto); text-decoration: none; font-style: normal;
  font-family: var(--sans); font-size: .82rem; letter-spacing: .04em;
  transition: border-color .2s, background .2s;
}
.whats svg { width: 18px; height: 18px; color: #25D366; }
.whats:hover { border-color: #25D366; background: #F3FBF5; }
.ajuda { text-align: center; }
footer .ajuda { margin-top: 10px; }

/* ---------- Rodapé e botão fixo ---------- */
footer { position: relative; z-index: 1; text-align: center; padding: 40px 16px 110px; color: var(--texto-suave); font-style: italic; }
footer img { display: block; margin: 0 auto 6px; }
footer p { margin: 0; }

.cta-fixo {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10;
  text-align: center; text-decoration: none;
  font-family: var(--sans); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--branco); background: var(--ouro-escuro);
  padding: 16px; box-shadow: 0 12px 30px -10px rgba(69, 52, 20, .55);
  transition: opacity .3s, transform .3s;
}
.cta-fixo.oculto { opacity: 0; transform: translateY(120%); pointer-events: none; }

/* ---------- Telas maiores ---------- */
@media (min-width: 760px) {
  .flor-buque { width: 200px; left: 4%; bottom: 120px; }
  .flor-hortensia { width: 300px; right: 2%; top: -24px; }
  .flor-ramo { display: block; width: 200px; left: 2%; top: 420px; }
  .brasao { width: 210px; }
  .cartao-rsvp { padding: 50px 50px 44px; }
  .bloco { padding: 80px 24px; }
  .cta-fixo { display: none; }
  footer { padding-bottom: 40px; }
}

@media (max-width: 560px) {
  body { font-size: 18px; }
  .linha-busca { flex-direction: column; }
  .acoes { flex-direction: column-reverse; }
  .acoes .botao { width: 100%; text-align: center; }
  .detalhes { grid-template-columns: 1fr; }
  .cartao-rsvp h2 { font-size: 2.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
