/* A CSS da página (marca, painel de pagamento, partes, valor livre). Antes eram dois <style> do index.html; a CSP só com 'self' (rodada 8) não os deixa inline. */

/* Fontes locais (rodada 8): os mesmos arquivos latinos que o Google Fonts servia, com os mesmos descritores; licença em assets/fonts/OFL.txt.
   Sem face itálica de propósito: a despedida da carta continua sintetizada, como antes. */
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/eb-garamond-v33-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(assets/fonts/jost-v20-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Pinyon Script'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/pinyon-script-v24-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --p-bg: #eeecea; --p-surface: #e4e1dd; --p-ink: #333231; --p-muted: #625f5b;
  --p-accent: #5c6b54; --p-accent-ink: #ffffff; --p-action: #5c6b54; --p-action-ink: #ffffff;
  --p-inv-bg: #333231; --p-inv-surface: #3e3d3c; --p-inv-ink: #eeecea; --p-inv-muted: #adaba9;
  --p-inv-accent: #eeecea; --p-inv-accent-ink: #333231; --p-inv-action: #eeecea; --p-inv-action-ink: #333231;
  --font-display: "EB Garamond", Georgia, serif;
  --font-text: "Jost", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.012em;
  --display-tracking-xl: -0.018em;
  --ly-scale: 1.12;
}

  /* page CSS: a marca do casal (os nomes em script) e o painel de pagamento.
     A marca diminui com a tela e, no limite (zoom de 200% no celular), quebra em duas linhas em vez de empurrar o menu. */
  .wordmark { display: inline-block; font: 400 clamp(20px, 4vw + 10px, 30px)/1.1 "Pinyon Script", cursive; letter-spacing: 0; text-wrap: balance; }
  .sign { font: 400 40px/1.1 "Pinyon Script", cursive; color: var(--accent); }
  #presentes .tile { --tile-ratio: 4 / 5; }
  #presentes .tile__note { color: var(--ink); margin-top: calc(-1 * var(--s-3)); }
  @media (max-width: 639px) { #presentes .tile { --tile-ratio: 1 / 1; } #presentes .tile__note { display: none; } }
  #presentes .tile__cta { color: var(--action); font-weight: 500; }
  .pay { --error: color-mix(in oklab, #d92d20 72%, var(--ink)); }
  .pay h3 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
  .pay [data-state]:not([hidden]) { display: grid; gap: var(--s-5); }
  /* QR e texto lado a lado; quando o texto ficaria com menos de ~14 caracteres por linha (zoom, tela estreita), ele desce */
  .pay .qr { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: center; }
  .pay .qr > .stack-4 { flex: 1 1 14ch; min-width: 0; }
  .pay .qr svg { width: 148px; height: 148px; display: block; border-radius: var(--r-sm); border: 1px solid var(--line); }
  /* o código Pix é longo e sem espaços: 2 linhas e reticências; quem paga usa o botão de copiar */
  .pay .code { padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--muted); font: 400 13px/1.5 ui-monospace, Consolas, monospace; }
  .pay .code > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
  .pay .btn { width: 100%; }
  /* empilhado (tablet e celular), a foto da carta ganha altura própria em vez de sumir */
  #carta .frame { aspect-ratio: 1 / 1; }
  @media (max-width: 639px) { #carta .frame { aspect-ratio: 4 / 3; } }
  /* tablet: 4 presentes por linha, para a lista caber nas duas telas */
  @media (min-width: 640px) and (max-width: 1023px) { #presentes .grid > .tile.span-3 { grid-column: auto / span 3; } #presentes .tile__head { flex-wrap: wrap; } }
  @media (max-width: 639px) { .pay .qr svg { width: 120px; height: 120px; } }
  /* capa com os nomes, partes com barra, valor livre, seletor de partes, taxa só no passo do cartão */
  .hero__names { font: 400 clamp(56px, 20.5vw, 80px)/.92 "Pinyon Script", cursive; letter-spacing: 0; color: var(--ink); padding-block: .08em; }
  @media (min-width: 1024px) { .hero__names { font-size: clamp(96px, 10vw, 150px); } }
  .hero__names .amp { color: var(--accent); font-size: .7em; }
  .hero__kicker--lg { font-size: var(--t-lead); color: var(--ink); letter-spacing: 0; }
  .hero__lead + .hero__lead { margin-top: var(--s-4); }
  .bar { height: 6px; border-radius: 3px; background: var(--surface); overflow: clip; margin-top: calc(-1 * var(--s-2)); }
  .bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
  .tile.is-full .tile__media::after { content: attr(data-selo); position: absolute; left: var(--s-3); top: var(--s-3); padding: 6px 12px; border-radius: 999px; background: var(--bg); color: var(--accent); font: 500 var(--t-small)/1.2 var(--font-text); }
  .tile.is-full .tile__cta::after { content: " (ainda pode presentear)"; color: var(--muted); font-weight: 400; }
  .livre { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); margin-top: var(--s-6, 32px); padding: var(--s-5) var(--s-6, 32px); border: 1px solid var(--line-strong); border-radius: var(--r-lg); color: inherit; }
  .livre h3 { font: 400 var(--t-h3, 28px)/1.2 var(--font-display); margin-bottom: var(--s-2); }
  .livre p { color: var(--muted); max-width: 64ch; } .nw { white-space: nowrap; }
  @media (max-width: 639px) { .livre { flex-direction: column; align-items: stretch; padding: var(--s-5); } .livre .btn { width: 100%; } }
  .stepper { display: grid; grid-template-columns: 52px 72px 52px; width: max-content; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: clip; }
  .stepper button { border: 0; height: 52px; font: 400 24px/1 var(--font-text); background: var(--bg); color: var(--ink); }
  .field .stepper input { border: 0; border-inline: 1px solid var(--line); border-radius: 0; text-align: center; font-size: 18px; height: 52px; -moz-appearance: textfield; }
  .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
  .chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
  .chips button { min-height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); font: 500 16px/1 var(--font-text); }
  .chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
  .money { display: flex; align-items: center; gap: var(--s-2); }
  .money span { font-size: 18px; color: var(--muted); }
  .money input { font-size: 18px !important; }
  .sum { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s-4); font-size: var(--t-small); color: var(--muted); padding: var(--s-3) 0 0; }
  /* revisão visual: botões de texto sem a aparência padrão do navegador; "Voltar" aponta para trás */
  button.link { background-color: transparent; border: 0; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
  @media (pointer: coarse) { .nav__logo, .credits { min-height: 44px; display: inline-flex; align-items: center; } }
  /* selo do item completo: cabe em cards estreitos sem virar pílula de duas linhas */
  .tile.is-full .tile__media::after { border-radius: 10px; max-width: calc(100% - 2 * var(--s-3)); line-height: 1.3; }
  @media (max-width: 1023px) { .tile.is-full .tile__media::after { font-size: 13px; padding: 5px 10px; left: var(--s-2); top: var(--s-2); max-width: calc(100% - 2 * var(--s-2)); } }
  /* tablet e celular: painel de pagamento na largura toda; sem altura mínima de duas telas (abria buracos entre as linhas) */
  @media (max-width: 1023px) { #presentear .grid > .pay { grid-column: 1 / -1; } }
  /* as duas linhas de cards e o bloco do valor livre: um espaço só entre eles (a seção mede o conteúdo, ADR-015) */
  #presentes > .wrap { row-gap: var(--s-6); }
  @media (min-width: 1024px) { #presentes > .wrap { row-gap: var(--s-7); } }
  .sum { padding-top: 0; }
  .sum dd { font-variant-numeric: tabular-nums; text-align: right; } .sum .sum__total { color: var(--ink); font-weight: 500; padding-top: 6px; } .gift-value { font: 400 var(--t-h3, 28px)/1.2 var(--font-display); }
  /* "Para onde vai o seu presente": as três partes à vista, lado a lado no computador e empilhadas no celular (ADR-015) */
  main > #historia > .destino { display: grid; gap: var(--s-7); align-content: start; }
  .destino__head { display: grid; gap: var(--s-4); max-width: 46ch; }
  .destino__list { display: grid; gap: var(--s-6) var(--s-5); margin: 0; padding: 0; list-style: none; }
  .destino__ch { display: grid; gap: var(--s-2); align-content: start; }
  .destino__pic { margin: 0 0 var(--s-3); border-radius: var(--r-md); overflow: hidden; }
  .destino__pic > img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
  .destino__ch h3 { font-family: var(--font-text); font-weight: 500; font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
  .destino__ch p { color: var(--ink); max-width: 44ch; }
  @media (min-width: 640px) { .destino__list { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } .destino__pic > img { aspect-ratio: 4 / 5; max-height: 44svh; } }
  /* capa (ADR-019, A3): a foto na largura toda, com os nomes e o convite por cima; sem coluna, sem vazio. No celular e no tablet a capa
     mede o conteúdo mais um pouco de foto em cima (não é mais uma tela cheia). O véu escuro garante o contraste do texto branco. */
  main > .hero.hero--split { isolation: isolate; }
  main > .hero.hero--split > .wrap, main > .hero.hero--split .hero-text { position: static; }
  main > .hero.hero--split .hero__media { position: absolute; inset: 0; z-index: 0; height: auto; min-height: 0; margin: 0; border-radius: 0; }
  .hero--split .hero__media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgb(20 18 16 / .8) 0%, rgb(20 18 16 / .62) 35%, rgb(20 18 16 / .3) 60%, rgb(20 18 16 / .05) 100%); }
  main > .hero.hero--split .hero__text { position: relative; z-index: 2; align-self: center; }
  main > .hero.hero--split :is(.hero__kicker, .hero__lead, .hero__names, .hero__names .amp) { color: #fff; }
  main > .hero.hero--split .btn--secondary { background: rgb(255 255 255 / .14); color: #fff; border-color: rgb(255 255 255 / .7); }
  @media (max-width: 1023px) {
    main > .hero.hero--split { display: block; min-height: 0; padding-top: clamp(150px, 36vw, 250px); padding-bottom: calc(var(--s-7) + var(--bar)); }
    main > .hero.hero--split .hero-text { display: block; }
    .hero--split .hero__media::before { background: linear-gradient(180deg, rgb(20 18 16 / .58) 0%, rgb(20 18 16 / .64) 45%, rgb(20 18 16 / .86) 100%); }
  }
  /* carta (ADR-019): uma folha de papel dentro de um envelope alto, com a foto presa ao lado. O envelope continua para baixo e a
     divisa da seção o corta (clip-path), como se a carta coubesse nele. Celular e tablet: a foto sobe e o envelope fica por último. */
  #carta { clip-path: inset(-12px -12px 0 -12px); }
  #carta .grid--top { align-items: start; }
  /* partes (nomes usados com o dono, web/CLAUDE.md): folha (.papel), aba (::before, o fundo reto), bolso (::after, a frente em V)
     e base (--rest, cortada pela divisa). Regra do dono (04/12): a aba sobe acima do envelope (--corpo = bolso + base) 40% da
     folha, nunca mais que o envelope. A sombra fica dentro do envelope, na boca da abertura; contornos em --env-linha. */
  #carta .env { --rest: 90px; --corpo: calc(var(--rest) + 112px); --env-linha: #a8956f; display: flow-root; position: relative; margin-bottom: calc(-1 * var(--padb) - 28px); padding: 0 clamp(18px, 3.4vw, 40px) var(--rest); transform: rotate(-1deg); }
  #carta .env::before { content: ""; position: absolute; z-index: 0; left: 0; right: 0; bottom: 0;
    height: calc(var(--corpo) + min(calc((100% - var(--rest)) * .4), var(--corpo)));
    background: linear-gradient(to top, #c4b08a var(--corpo), rgb(196 176 138 / 0) calc(var(--corpo) + 90px)), #e7decc;
    border: 1px solid var(--env-linha); border-bottom: 0; border-radius: 4px 4px 0 0; }
  /* bolso: traço do V e dobras das abas laterais em SVG (vetor: liso em qualquer tela; gradiente de borda dura serrilha na
     diagonal). As dobras sobem dos cantos visíveis (a divisa corta os 28 px de baixo) e somem sob o V; abas laterais um tom mais escuras. */
  #carta .env::after { content: ""; position: absolute; z-index: 2; left: -2px; right: -2px; bottom: 0; height: var(--corpo);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 80' preserveAspectRatio='none'%3E%3Cpolyline points='0,1 50,59 100,1' stroke='%23a8956f' stroke-width='1.25' stroke-linejoin='round' vector-effect='non-scaling-stroke' fill='none'/%3E%3C/svg%3E") left top / 100% 80px no-repeat,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='0,0 50,8 0,100' fill='%23786240' fill-opacity='.07'/%3E%3Cpolygon points='100,0 50,8 100,100' fill='%23786240' fill-opacity='.07'/%3E%3Cpolyline points='0,100 50,8 100,100' stroke='%23a8956f' stroke-opacity='.55' stroke-width='1' stroke-linecap='round' vector-effect='non-scaling-stroke' fill='none'/%3E%3C/svg%3E") left top / 100% calc(100% - 28px) no-repeat,
      linear-gradient(180deg, #f3ecde, #ebe1cd);
    background-origin: border-box; border-inline: 1px solid var(--env-linha); clip-path: polygon(0 0, 50% 58px, 100% 0, 100% 100%, 0 100%); }
  #carta .papel { position: relative; z-index: 1; padding: clamp(32px, 4vw, 64px) clamp(32px, 4vw, 64px) 120px; background: #fffdf8;
    border: 1px solid #e4dccd; box-shadow: 0 2px 6px rgb(60 50 30 / .18); }
  #carta .papel h2 { font: 400 var(--t-small, 16px)/1.3 var(--font-text); color: var(--muted); margin: 0 0 var(--s-6); }
  #carta .saud { font: 400 clamp(34px, 3.4vw, 48px)/1.1 "Pinyon Script", cursive; color: var(--accent); margin: 0 0 var(--s-5); }
  #carta .papel .t-lead { font: 400 clamp(21px, 1.9vw, 26px)/1.55 var(--font-display); color: var(--ink); max-width: 30ch; margin: 0 0 var(--s-4); }
  #carta .desp { font: italic 400 clamp(21px, 1.9vw, 26px)/1.5 var(--font-display); margin: var(--s-6) 0 0; }
  #carta .papel .sign { font-size: clamp(40px, 4vw, 56px); margin: var(--s-2) 0 0; }
  @media (min-width: 1024px) and (max-width: 1279px) { #carta .papel .sign { font-size: 40px; } }   /* folha estreita: a assinatura numa linha só */
  #carta .frame { align-self: center; transform: rotate(2.2deg); border: 10px solid #fff; border-radius: 3px; box-shadow: 0 18px 40px -16px rgb(0 0 0 / .35); margin-left: -2%; }
  @media (max-width: 1023px) {
    #carta .frame { order: -1; transform: none; margin: var(--s-6) auto var(--s-4); width: 100%; max-width: 600px; }
    #carta .env { transform: none; width: 100%; max-width: 600px; margin: var(--s-4) auto calc(-1 * var(--padb) - 28px); }
    #carta .papel .t-lead { max-width: 36ch; }
  }
  @media (min-width: 640px) and (max-width: 1023px) { #carta .frame { aspect-ratio: 16 / 10; } #carta .frame__img { height: 100%; object-fit: cover; } }
  @media (max-width: 639px) { #carta .env { --rest: 80px; } }
  /* perguntas (ADR-019, C3): a foto na altura das perguntas, com o convite para escolher sobre a base dela */
  #duvidas .grid--top { align-items: stretch; }
  /* foto e cartão na mesma célula da grade: o cartão fica sobre a base da foto e, se for mais alto que ela (zoom), a célula cresce em vez de o cartão passar por cima das perguntas */
  #duvidas .duv__media { display: grid; }
  #duvidas .duv__media > * { grid-area: 1 / 1; }
  #duvidas .duv__media .frame { position: relative; overflow: hidden; min-height: 0; aspect-ratio: auto; }
  #duvidas .duv__media .frame__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  #duvidas .cta-duvida { position: relative; z-index: 1; align-self: end; margin: var(--s-5); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4) var(--s-6);
    padding: var(--s-6); background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 14px 30px -12px rgb(0 0 0 / .35); }
  #duvidas .cta-duvida > div { flex: 1 1 22ch; } #duvidas .cta-duvida p { margin: 0; } #duvidas .cta-duvida .btn { flex: none; }
  #duvidas .cta-duvida h3 { font: 400 var(--t-h3, 28px)/1.2 var(--font-display); margin: 0 0 var(--s-2); }
  @media (max-width: 1023px) { #duvidas .duv__media .frame { aspect-ratio: 16 / 10; } }
  @media (max-width: 639px) { #duvidas .duv__media .frame { aspect-ratio: 4 / 5; }
    #duvidas .cta-duvida { margin: var(--s-3); padding: var(--s-4); gap: var(--s-3); } #duvidas .cta-duvida h3 { font-size: 22px; } #duvidas .cta-duvida p { font-size: 15px; } #duvidas .cta-duvida .btn { width: 100%; } }
  /* seu presente: a foto do presente escolhido no topo do cartão (troca em app.js) */
  .pay__photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); }
  @media (min-width: 1024px) { .pay__photo { aspect-ratio: 21 / 9; } }
  /* divisas entre seções (ADR-015, D1 + D2): o fundo alterna (carta, seu presente e perguntas no tom de pedra) e uma linha fina
     com um losango oliva marca a troca. Ornamento da marca, decorativo: sem texto nem aria. */
  main > section + section::before, footer.closing::before { content: ""; position: absolute; top: 0; left: 50%; z-index: 2; transform: translateX(-50%);
    width: min(100% - 2 * var(--gut), var(--container)); height: 1px; background: var(--line-strong); }
  main > section + section::after, footer.closing::after { content: ""; position: absolute; top: 0; left: 50%; z-index: 3; width: 9px; height: 9px;
    transform: translate(-50%, -50%) rotate(45deg); background: var(--bg); border: 1px solid var(--accent); }

/* A posição da foto da capa. Era style="--ly-pos" no <img>; a CSP não deixa estilo inline (rodada 8). */
.hero__media > img { --ly-pos: 50% 30%; }

/* Posição das fotos do casal que são em pé (rodada 10b). Medida com o núcleo do seletor (scripts/fotos/core.js): a que melhor guarda os rostos em cada caixa.
   Carta: quadrada no computador, 16:10 no tablet, 4:3 no celular. Destinos: 16:10 no celular e 4:5 a partir de 640 px. Os cards ficam no centro. */
#carta .frame__img { object-position: 50% 5%; }
.destino__ch:nth-child(-n+2) .destino__pic > img { object-position: 50% 80%; }
.destino__ch:nth-child(3) .destino__pic > img { object-position: 50% 70%; }
@media (max-width: 1023px) { #carta .frame__img { object-position: 50% 30%; } }
@media (max-width: 639px) { #carta .frame__img { object-position: 50% 25%; } }
@media (min-width: 640px) {
  .destino__ch:nth-child(-n+2) .destino__pic > img { object-position: 50% 100%; }
  .destino__ch:nth-child(3) .destino__pic > img { object-position: 50% 85%; }
}
