/* ============ Fontes (OFL, hospedadas aqui) ============ */
@font-face { font-family: "Pinyon Script"; src: url("fontes/pinyon-script-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fontes/cinzel-400.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Tinos"; src: url("fontes/tinos-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tinos"; src: url("fontes/tinos-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ============ Cores (tiradas do vídeo) ============ */
:root {
  --fundo: #F6DBDE;
  --fundo-aba: #F7DEE1;
  --rosa: #C0587F;
  --rosa-escuro: #A94C6F;
  --rosa-botao: #D05F8A;
  --ouro: #C9A46A;
  --fora: #EFD0D6;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --caps: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Tinos", "Times New Roman", Times, serif;
  /* cetim: faixas de brilho em diagonal */
  --cetim:
    repeating-linear-gradient(116deg, rgba(255,255,255,0) 0, rgba(255,255,255,.32) 170px, rgba(255,255,255,0) 340px, rgba(255,255,255,0) 620px),
    repeating-linear-gradient(158deg, rgba(214,140,160,0) 0, rgba(214,140,160,.12) 250px, rgba(214,140,160,0) 500px, rgba(214,140,160,0) 880px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--fora); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fora); color: var(--rosa); font-family: var(--caps); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
p, h1, h2 { margin: 0; font-weight: 400; }
img { display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Tudo é medido em "u": 1u = largura do convite / 944. */
.palco { width: min(100%, 480px); margin: 0 auto; container-type: inline-size; }
@media (min-width: 560px) {
  .palco { margin: 40px auto; border-radius: 26px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(150, 50, 85, .45); }
}

/* ============ Convite ============ */
.cartao {
  --u: calc(min(100vw, 480px) / 944);
  position: relative; overflow: hidden; isolation: isolate;
  background-color: var(--fundo); background-image: var(--cetim);
  padding-bottom: calc(560 * var(--u));
  text-align: center;
}
.moldura { position: absolute; inset: calc(15 * var(--u)); border: max(1px, calc(1.8 * var(--u))) solid var(--ouro); pointer-events: none; z-index: 1; opacity: .9; }
.orn { position: absolute; width: calc(150 * var(--u)); height: calc(150 * var(--u)); z-index: 1; fill: none; stroke: var(--ouro); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.orn-tr { top: calc(15 * var(--u)); right: calc(15 * var(--u)); }
.orn-bl { bottom: calc(15 * var(--u)); left: calc(15 * var(--u)); transform: rotate(180deg); }

.flor { position: absolute; z-index: 2; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.canto-tl { left: calc(-50 * var(--u)); top: calc(-56 * var(--u)); width: calc(650 * var(--u)); }
.canto-br { right: calc(-40 * var(--u)); bottom: calc(-46 * var(--u)); width: calc(640 * var(--u)); }
.lado { width: calc(250 * var(--u)); }
.lado.d1 { right: calc(-95 * var(--u)); top: calc(1010 * var(--u)); rotate: -10deg; }
.lado.e1 { left: calc(-95 * var(--u)); top: calc(1330 * var(--u)); transform: scaleX(-1); rotate: 8deg; }
.lado.d2 { right: calc(-95 * var(--u)); top: calc(1980 * var(--u)); rotate: -6deg; }
.lado.e2 { left: calc(-95 * var(--u)); top: calc(2390 * var(--u)); transform: scaleX(-1); rotate: 10deg; }

.conteudo { position: relative; z-index: 3; padding: calc(500 * var(--u)) calc(60 * var(--u)) 0; }

/* Abertura */
.pre { display: block; width: calc(560 * var(--u)); height: calc(120 * var(--u)); margin: 0 auto; overflow: visible; }
.pre text { font-family: var(--caps); font-size: 36px; font-weight: 500; letter-spacing: 5px; fill: var(--ouro); text-transform: uppercase; }
.nome { margin-top: calc(10 * var(--u)); font-family: var(--script); line-height: .78; }
.nome:focus { outline: none; }
.nome span { display: block; white-space: nowrap; font-size: calc(188 * var(--u)); }
.nome .l1 { translate: calc(-50 * var(--u)) 0; }
.nome .l2 { translate: calc(60 * var(--u)) 0; }

.divisor { display: block; width: calc(380 * var(--u)); height: calc(28 * var(--u)); margin: calc(80 * var(--u)) auto 0; fill: none; stroke: var(--ouro); stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.divisor .cheio { fill: var(--ouro); stroke: none; }

/* Data */
.data { margin-top: calc(40 * var(--u)); color: var(--rosa-escuro); }
.mes { font-size: calc(60 * var(--u)); font-weight: 500; letter-spacing: .03em; text-transform: uppercase; line-height: 1; }
.linha-data { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: calc(560 * var(--u)); margin: calc(18 * var(--u)) auto 0; }
.lado-txt {
  justify-self: center; width: calc(126 * var(--u)); padding: calc(16 * var(--u)) 0 calc(14 * var(--u));
  border-top: max(1px, calc(2 * var(--u))) solid var(--ouro); border-bottom: max(1px, calc(2 * var(--u))) solid var(--ouro);
  font-size: calc(50 * var(--u)); font-weight: 500; line-height: 1; text-transform: uppercase;
}
.dia { font-size: calc(200 * var(--u)); font-weight: 500; line-height: .86; padding: 0 calc(26 * var(--u)); color: var(--rosa); }
.ano { margin-top: calc(22 * var(--u)); font-size: calc(58 * var(--u)); font-weight: 500; line-height: 1; }

/* Contagem */
.contagem { margin-top: calc(110 * var(--u)); }
.faltam { font-family: var(--script); font-size: calc(120 * var(--u)); line-height: 1; }
.relogio { display: flex; justify-content: center; align-items: flex-start; margin-top: calc(24 * var(--u)); color: var(--rosa); }
.unid { display: flex; flex-direction: column; align-items: center; min-width: calc(140 * var(--u)); }
.unid .n { font-family: var(--serif); font-weight: 700; font-size: calc(104 * var(--u)); line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.unid .r { margin-top: calc(16 * var(--u)); font-family: var(--serif); font-size: max(8px, calc(21 * var(--u))); letter-spacing: .04em; text-transform: uppercase; }
.dois { font-family: var(--serif); font-weight: 700; font-size: calc(90 * var(--u)); line-height: 1.1; padding: 0 calc(14 * var(--u)); }

/* Dica */
.dica { display: flex; align-items: center; justify-content: center; gap: calc(18 * var(--u)); margin-top: calc(120 * var(--u)); font-size: max(10px, calc(31 * var(--u))); font-weight: 500; line-height: 1.3; text-transform: uppercase; }
.dica svg { width: max(16px, calc(50 * var(--u))); flex: none; fill: var(--rosa-botao); }
.dica .toque { fill: none; stroke: var(--rosa-botao); stroke-width: 1.2; stroke-linecap: round; }

/* Botões em zigue-zague, como no vídeo */
.acoes { display: flex; flex-direction: column; gap: calc(110 * var(--u)); margin-top: calc(100 * var(--u)); }
.acao {
  display: flex; align-items: center; gap: calc(30 * var(--u));
  width: calc(652 * var(--u)); margin-left: calc(86 * var(--u)); padding: 0;
  border: 0; background: none; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; border-radius: 999px;
}
.acao.inv { flex-direction: row-reverse; text-align: right; }
.bola {
  flex: none; display: grid; place-items: center;
  width: calc(218 * var(--u)); height: calc(218 * var(--u)); border-radius: 50%;
  background: var(--rosa-botao); transition: transform .18s ease, filter .18s ease;
}
.bola svg { width: 52%; fill: none; stroke: #fff; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.rotulo {
  padding: calc(16 * var(--u)) calc(26 * var(--u));
  font-size: max(11px, calc(39 * var(--u))); font-weight: 500; line-height: 1.3; text-transform: uppercase;
  background: rgba(255, 255, 255, .15); border-radius: calc(6 * var(--u));
}
.acao:hover .bola { filter: brightness(1.05); }
.acao:active .bola { transform: scale(.94); }
.acao:focus-visible { outline: 2px solid var(--rosa); outline-offset: 6px; }

.fecho { margin-top: calc(170 * var(--u)); font-family: var(--script); font-size: calc(118 * var(--u)); line-height: 1.1; }

/* ============ Capa ============ */
.capa { display: none; }
.js .capa { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; background: var(--fora); transition: opacity .4s ease; }
.js.abrindo .capa { opacity: 0; pointer-events: none; }
.js:not(.aberto), .js:not(.aberto) body { overflow: hidden; }

.capa-palco {
  --u: min(calc(min(100vw, 480px) / 944), calc(100vh / 1500));
  position: relative; width: min(100vw, 480px); height: 100%; overflow: hidden; container-type: size;
}
.capa-esq, .capa-aba { position: absolute; top: 0; bottom: 0; background-color: var(--fundo); background-image: var(--cetim); }
.capa-esq { left: 0; width: 52%; }
.capa-aba {
  left: 50.4%; right: 0; background-color: var(--fundo-aba);
  border-left: max(1.5px, calc(3.2 * var(--u))) solid #CF7D98; overflow: hidden;
  box-shadow: calc(-16 * var(--u)) 0 calc(34 * var(--u)) rgba(150, 45, 85, .2);
}
.capa-nome { position: absolute; top: calc(30 * var(--u)); left: calc(26 * var(--u)); font-family: var(--script); line-height: .8; text-align: left; }
.capa-nome span { display: block; font-size: calc(112 * var(--u)); white-space: nowrap; }
.capa-nome .l2 { padding-left: calc(64 * var(--u)); }

.aba-coluna, .aba-canto { position: absolute; pointer-events: none; user-select: none; }
.aba-coluna { top: 19%; height: 64%; width: auto; left: calc(-46 * var(--u)); }
.aba-canto { height: auto; width: calc(300 * var(--u)); }
.aba-canto.tr { right: calc(-70 * var(--u)); top: calc(-95 * var(--u)); transform: scaleX(-1); }
.aba-canto.br { right: calc(-60 * var(--u)); bottom: calc(-80 * var(--u)); }

.selo {
  --u: min(calc(min(100vw, 480px) / 944), calc(100vh / 1500));
  position: absolute; z-index: 3;
  width: calc(345 * var(--u)); aspect-ratio: 1;
  left: calc(50.4% - 193.5 * var(--u)); top: calc(52% - 193.5 * var(--u));
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.selo svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 calc(6 * var(--u)) calc(8 * var(--u)) rgba(110, 10, 50, .35)); }
.selo:focus-visible { outline: 2px solid var(--rosa); outline-offset: 4px; }
.selo:active svg { transform: scale(.96); transform-origin: 56.1% 56.1%; }
.selo-dica { font-family: var(--caps); font-size: 27px; font-weight: 500; letter-spacing: 4px; fill: var(--rosa); text-transform: uppercase; }
.selo-num { font-family: var(--script); font-size: 150px; fill: #F8C6D7; }
.selo-num.sombra { fill: #7E0A3A; fill-opacity: .55; }
.selo-ramo { fill: none; stroke: #F8C6D7; stroke-opacity: .8; stroke-width: 3; stroke-linecap: round; }

/* ============ Aparecer (fade, como no vídeo) ============ */
.js .revela { opacity: 0; }
.js .revela.visivel { animation: aparece .75s ease both; animation-delay: calc(var(--d, 0) * 120ms); }
.js .canto-tl.visivel { animation-delay: .25s; }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes folha-sobe { from { translate: 0 100%; } to { translate: 0 0; } }

/* ============ Janelas de baixo ============ */
.folha-aberta, .folha-aberta body { overflow: hidden; }
dialog.folha {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(100%, 480px); max-width: 100%; max-height: 88dvh; overflow: auto;
  border: 0; border-radius: 26px 26px 0 0; padding: 34px 22px calc(26px + env(safe-area-inset-bottom));
  background-color: #FBEBEE; background-image: var(--cetim); color: var(--rosa); box-shadow: 0 -20px 60px rgba(120, 30, 60, .25);
}
dialog.folha[open] { animation: folha-sobe .4s cubic-bezier(.2, .8, .2, 1); }
dialog.folha::backdrop { background: rgba(110, 30, 60, .35); }
dialog.folha::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(192, 88, 127, .25); }
.folha h2 { font-family: var(--script); font-size: 46px; line-height: 1.1; text-align: center; margin: 0 40px 14px; }
.fechar { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(192, 88, 127, .1); font-size: 26px; line-height: 1; cursor: pointer; font-family: var(--serif); }
.fechar:focus-visible, .botao:focus-visible { outline: 2px solid var(--rosa); outline-offset: 3px; }
.folha-texto { margin-bottom: 22px; text-align: center; font-size: 15px; font-weight: 500; line-height: 1.6; letter-spacing: .04em; text-transform: uppercase; }
.botoes { display: grid; gap: 10px; }
.botao {
  display: block; width: 100%; padding: 16px 18px; border: 1.5px solid var(--rosa-botao); border-radius: 999px;
  background: var(--rosa-botao); color: #fff; text-align: center; text-decoration: none; cursor: pointer;
  font-family: var(--caps); font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent; transition: filter .15s ease, background .15s ease;
}
.botao:active { filter: brightness(.92); }
.botao.claro { background: transparent; color: var(--rosa); }
.botao.claro:hover { background: rgba(208, 95, 138, .07); }
.nota { margin-top: 12px; text-align: center; font-family: var(--serif); font-size: 14px; line-height: 1.45; opacity: .85; }

.campo > span, .escolha legend { display: block; margin-bottom: 7px; padding: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.campo input {
  width: 100%; padding: 14px 16px; border: 1.5px solid rgba(192, 88, 127, .35); border-radius: 14px;
  background: #fff; color: var(--rosa-escuro); font-family: var(--serif); font-size: 17px;
}
.campo input::placeholder { color: rgba(192, 88, 127, .45); }
.campo input:focus { outline: none; border-color: var(--rosa); box-shadow: 0 0 0 3px rgba(192, 88, 127, .15); }
.escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; padding: 0; border: 0; }
.escolha legend { grid-column: 1 / -1; }
.escolha label { position: relative; }
.escolha input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.escolha span { display: block; padding: 14px 8px; border: 1.5px solid rgba(192, 88, 127, .35); border-radius: 14px; background: #fff; text-align: center; font-family: var(--serif); font-size: 15px; color: var(--rosa-escuro); transition: background .15s ease, border-color .15s ease; }
.escolha input:checked + span { background: #F9D3DE; border-color: var(--rosa); }
.escolha input:focus-visible + span { outline: 2px solid var(--rosa); outline-offset: 2px; }
.erro { margin-top: 12px; font-family: var(--serif); font-size: 14px; color: #A3203B; }
.form .botao { margin-top: 20px; }

.aviso {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 100;
  max-width: calc(100% - 32px); padding: 11px 20px; border-radius: 999px;
  background: var(--rosa-botao); color: #fff; font-family: var(--serif); font-size: 15px;
  opacity: 0; translate: -50% 10px; pointer-events: none; transition: opacity .25s ease, translate .25s ease;
}
.aviso.mostra { opacity: 1; translate: -50% 0; }

/* Navegadores novos medem pelo próprio convite; os antigos (iOS 15) pela tela. */
@supports (width: 1cqw) {
  .cartao { --u: calc(100cqw / 944); }
  .capa-palco { --u: min(calc(100cqw / 944), calc(100cqh / 1500)); }
  .selo { --u: min(calc(100cqw / 944), calc(100cqh / 1500)); }
}

/* ============ Página 404 ============ */
.nao-achei { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; gap: 18px; padding: 24px; text-align: center; background-color: var(--fundo); background-image: var(--cetim); }
.nao-achei-script { font-family: var(--script); font-size: 80px; line-height: 1.1; }
.nao-achei-texto { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.nao-achei .botao { justify-self: center; width: auto; padding-inline: 28px; }

/* ============ Menos movimento ============ */
@media (prefers-reduced-motion: reduce) {
  .js .capa { transition-duration: .2s; }
  .js .revela.visivel { animation-duration: .3s; animation-delay: 0s !important; }
  dialog.folha[open] { animation: none; }
}
