/* ==========================================================================
   Mapa de Carreira 2027 · base visual compartilhada (acesso e vendas)
   Pergaminho envelhecido sobre veludo vinho, ornamentos dourados, lacre, cartas.
   ========================================================================== */

:root {
  --vinho: #5B0F1C;
  --vinho-escuro: #2A050B;
  --vinho-brilho: #7A1626;
  --verde: #2F4A3B;
  --verde-claro: #4B6B57;
  --ouro: #B99147;
  --ouro-claro: #E2C887;
  --papel: #F2E4C6;
  --papel-borda: #D7BE8E;
  --tinta: #3A2116;
  --tinta-suave: #6E4E3A;

  --display: 'Cinzel', 'Times New Roman', Georgia, serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --veludo: radial-gradient(70% 55% at 50% 40%, var(--vinho-brilho) 0%, #4A0A15 55%, #22040A 100%);
  /* borda envelhecida do pergaminho, feita com gradiente (sai igual na tela e no PDF) */
  --vinheta: radial-gradient(ellipse at 50% 48%, rgba(150, 105, 50, 0) 0%, rgba(150, 105, 50, 0) 58%, rgba(150, 105, 50, .18) 84%, rgba(120, 80, 30, .4) 100%);
  --sombra-papel: inset 0 0 70px rgba(150, 105, 50, .42), inset 0 0 12px rgba(120, 80, 30, .32);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
img, svg { display: block; max-width: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--tinta);
  background-color: var(--vinho-escuro);
  min-height: 100vh;
  overflow-x: hidden;
}
/* No iOS, background-attachment: fixed não funciona bem; o veludo vai numa camada fixa */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url(../assets/veludo-grao.webp) 0 0 / 200px 200px, var(--veludo);
}

.oculto { display: none !important; }
.so-leitor {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--ouro-claro); outline-offset: 3px; }

/* ---------- Papel ---------- */
.papel {
  position: relative;
  background: var(--vinheta), var(--papel) url(../assets/papel.webp) 0 0 / 384px 384px;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55), var(--sombra-papel);
}

/* ---------- Lacre de cera ---------- */
.selo { width: 120px; height: 120px; margin: 0 auto; }
.flutua { animation: flutua 6s ease-in-out infinite; }
@keyframes flutua { 50% { transform: translateY(-10px); } }

/* ---------- Botões ----------
   Efeito "noise background": em volta da face do botão corre um aro com degradê dourado e vinho
   em movimento lento, com textura de grão por cima.
   ::before = aro animado (atrás)  ·  ::after = face do botão  ·  o texto fica por cima dos dois */
.botao {
  --face: linear-gradient(180deg, #8A1D2E, var(--vinho));
  --face-hover: linear-gradient(180deg, #9C2537, #6A1222);
  --aro: 4px;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  width: 100%;
  padding: 16px 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  color: #FBF1DC;
  background: none;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(60, 5, 15, .45);
  cursor: pointer;
  transition: transform .12s;
}
.botao::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--face);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 0 0 1px rgba(226, 200, 135, .45);
  transition: background .25s;
}
.botao::before {
  content: "";
  position: absolute;
  inset: calc(var(--aro) * -1);
  z-index: -2;
  border-radius: calc(6px + var(--aro));
  background:
    url(../assets/veludo-grao.webp) 0 0 / 90px 90px,
    radial-gradient(38% 120% at 15% 50%, rgba(255, 236, 190, .95), rgba(255, 236, 190, 0) 70%),
    radial-gradient(38% 120% at 85% 50%, rgba(176, 44, 66, .95), rgba(176, 44, 66, 0) 70%),
    radial-gradient(45% 130% at 50% 50%, rgba(201, 165, 90, .95), rgba(201, 165, 90, 0) 72%),
    #3A0610;
  background-size: 90px 90px, 240% 100%, 240% 100%, 240% 100%, auto;
  box-shadow: 0 0 18px rgba(226, 200, 135, .25);
  animation: ruido 7s ease-in-out infinite alternate;
}
@keyframes ruido {
  0%   { background-position: 0 0,     0% 0, 100% 0,  50% 0; }
  33%  { background-position: 45px 30px, 70% 0, 20% 0,   0% 0; }
  66%  { background-position: 20px 80px, 100% 0, 60% 0, 100% 0; }
  100% { background-position: 90px 45px, 30% 0, 0% 0,   40% 0; }
}
.botao:hover::after { background: var(--face-hover); }
.botao:hover::before { box-shadow: 0 0 26px rgba(226, 200, 135, .45); }
.botao:active { transform: scale(.98); }
.botao[disabled] { opacity: .65; cursor: progress; }
.botao.secundario {
  --face: rgba(42, 5, 11, .94);
  --face-hover: rgba(70, 10, 20, .96);
  --aro: 3px;
  color: var(--ouro-claro);
  box-shadow: none;
}
.botao.verde { --face: linear-gradient(180deg, var(--verde-claro), var(--verde)); --face-hover: linear-gradient(180deg, #557A63, var(--verde-claro)); }

/* ==========================================================================
   Borda que acende perto do mouse ("glowing effect")
   O js/brilho.js marca as caixas com .brilha e informa o ângulo do mouse em --brilho-inicio.
   No celular (sem mouse) a luz percorre a borda sozinha enquanto a caixa está na tela.
   ========================================================================== */
@property --brilho-inicio { syntax: '<number>'; inherits: true; initial-value: 0; }
.brilha {
  --brilho-ativo: 0;
  --brilho-abertura: 34;      /* metade do arco aceso, em graus */
  --brilho-espessura: 3px;
  position: relative;
  transition: --brilho-inicio .7s cubic-bezier(.2, .8, .2, 1);
}
/* ::after = fio de luz de 3 px  ·  ::before = auréola larga e suave */
.brilha::after,
.brilha::before {
  content: "";
  /* arco aceso: some nas pontas e fica cheio no meio (declarado aqui para a animação do celular funcionar) */
  --brilho-arco: conic-gradient(from calc((var(--brilho-inicio) - var(--brilho-abertura)) * 1deg),
    #0000 0deg, #000 calc(var(--brilho-abertura) * .55deg), #000 calc(var(--brilho-abertura) * 1.45deg), #0000 calc(var(--brilho-abertura) * 2deg));
  position: absolute;
  inset: calc(var(--brilho-largura) * -1);   /* a luz corre por fora da borda da caixa */
  z-index: 3;
  border-radius: calc(var(--brilho-raio, 4px) + var(--brilho-largura));
  border: var(--brilho-largura) solid transparent;
  pointer-events: none;
  opacity: var(--brilho-ativo);
  transition: opacity .35s ease;
  /* só o anel em volta da caixa (border-box menos padding-box), recortado no arco perto do mouse */
  -webkit-mask: var(--brilho-arco) border-box, linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0) border-box;
  -webkit-mask-composite: source-in, xor;
  mask: var(--brilho-arco) border-box, linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0) border-box;
  mask-composite: intersect, exclude;
}
.brilha::after {
  --brilho-largura: var(--brilho-espessura);
  background: repeating-conic-gradient(from 0deg at 50% 50%, #F3DC9F 0%, #FFF6DD 5%, #D4AE5E 10%, #B23047 16%, #F3DC9F 25%) border-box;
}
.brilha::before {
  --brilho-largura: 12px;
  z-index: 2;
  background: rgba(240, 205, 130, .22);
}
/* caixas que ficam sobre o pergaminho: luz em vinho e ouro velho, mais forte, para aparecer no papel claro */
.brilha.sobre-papel { --brilho-abertura: 46; --brilho-espessura: 3px; }
.brilha.sobre-papel::after {
  background: repeating-conic-gradient(from 0deg at 50% 50%, #8E1F33 0%, #C9A55A 6%, #F3DC9F 10%, #A0283B 16%, #8E1F33 25%) border-box;
}
.brilha.sobre-papel::before {
  --brilho-largura: 10px;
  background: rgba(142, 31, 51, .22);
}
/* moldura de luz em volta do botão do Instagram (o próprio botão já usa ::before/::after no aro animado) */
.moldura-insta { display: inline-block; padding: 4px; border-radius: 10px; margin-top: .3em; --brilho-raio: 10px; }
.moldura-insta .botao-insta { margin-top: 0 !important; }
.brilha.sobre-papel { --brilho-raio: 6px; }

.brilho-auto .brilha.em-vista::after,
.brilho-auto .brilha.em-vista::before { opacity: .95; animation: brilho-orbita 7s linear infinite; }
@keyframes brilho-orbita { from { --brilho-inicio: 0; } to { --brilho-inicio: 360; } }

@media (prefers-reduced-motion: reduce) {
  .botao::before { animation: none; }
  .brilha { transition: none; }
  .brilho-auto .brilha.em-vista::after, .brilho-auto .brilha.em-vista::before { animation: none; opacity: 0; }
}

/* ---------- Ornamento ---------- */
.ornamento { width: 180px; height: auto; margin: 0 auto 18px; }

/* ==========================================================================
   Cartas de tarô
   Tamanhos em em: a carta cresce em altura quando o texto pede, nada sai da moldura.
   ========================================================================== */
.tarot {
  width: 9.4em;
  min-height: 15em;
  padding: .32em;
  border-radius: 10px;
  border: 1px solid var(--ouro);
  background: #EEDDB6;
  box-shadow: 0 10px 24px rgba(60, 20, 10, .25);
  display: flex;
  flex: none;
}
/* moldura dupla: borda da carta + borda interna + fio fino (sem sombras internas, que o PDF não desenha bem) */
.tarot-in::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(185, 145, 71, .5);
  border-radius: 5px;
  pointer-events: none;
}
.tarot-in {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15em;
  padding: .8em .45em;
  text-align: center;
  border: 1px solid var(--ouro);
  border-radius: 7px;
  background: #F8EDD3;
  min-width: 0;
}
.tarot-rom {
  font-family: var(--display);
  font-size: .8em;
  letter-spacing: .2em;
  line-height: 1;
  color: var(--ouro);
  padding-left: .2em; /* compensa o espaçamento da última letra */
}
.tarot-ico { width: 3.6em; height: 4.9em; flex: none; margin: .25em 0; }
.tarot-num { font-family: var(--display); font-size: 2.1em; line-height: 1.25; color: var(--vinho); }
.tarot-rot {
  font-weight: 600;
  font-size: .6em;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
  margin-top: .2em;
  color: var(--tinta);
  max-width: 100%;
}
.tarot-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: .95em;
  line-height: 1.15;
  color: var(--tinta-suave);
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Moeda de Ouros */
.moeda { width: 30px; height: 30px; flex: none; }

/* ==========================================================================
   Movimento ao rolar (as duas páginas)
   O js/revela.js marca blocos com .revela; quando chegam na tela, ganham .visivel.
   Só vale com .js-anima no <html> (posto no <head>, nunca para quem pede menos movimento).
   Usa translate/scale, que somam com os transform já existentes.
   ========================================================================== */
@keyframes surgir { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.js-anima .revela {
  opacity: 0;
  translate: 0 34px;
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1) var(--atraso, 0s), translate 1s cubic-bezier(.2, .7, .2, 1) var(--atraso, 0s), scale 1s cubic-bezier(.2, .7, .2, 1) var(--atraso, 0s);
}
.js-anima .revela.amplia { translate: 0 20px; scale: .94; }
.js-anima .revela.da-esquerda { translate: -34px 0; }
.js-anima .revela.da-direita { translate: 34px 0; }
.js-anima .revela.visivel { opacity: 1; translate: 0 0; scale: 1; }
