/* === FONTES ===
   No próprio site, não no Google: o visitante não manda o IP pra ninguém só por abrir a página, e a letra
   chega mais rápido. Arquivos variáveis (um por família e por faixa de letras) em fontes/. */
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 500 900; font-display: swap;
  src: url(../fontes/montserrat-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: 'Montserrat'; font-style: normal; font-weight: 500 900; font-display: swap;
  src: url(../fontes/montserrat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fontes/caveat-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: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fontes/caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* === TOKENS === */
:root {
  --bg: #08090B;
  --navy: #0E1116;
  --card: #14171D;
  --line: rgba(255, 255, 255, 0.08);
  --line-forte: rgba(255, 255, 255, 0.2);
  --ideiaria: #E70847;
  --ideiaria-hover: #FF3363;
  --branco: #FFFFFF;
  --giz: #F4EEE3;
  --sussurro: #15171B; /* mensagem do rodapé: quase da cor do fundo */
  /* mundo de papel (o único claro): texto e traço escuros */
  --tinta: #15171B;
  --tinta-suave: rgba(21, 23, 27, .82);
  --grafite: #23252B;
  /* cores da tokn.id, só no painel de marca (é trabalho de cliente, não a paleta da Ideiaria) */
  --toknid-rosa: #FF0054;
  --toknid-fundo: #08090B;
  --toknid-claro: #F4F5F7;
  --bolha: #22262E; /* balão do robô no chat */
  --ink: rgba(255, 255, 255, 0.96);
  --ink-soft: rgba(255, 255, 255, 0.9);
  --ink-muted: rgba(255, 255, 255, 0.74);
  --ink-dim: rgba(255, 255, 255, 0.55);
  --fonte: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mao: 'Caveat', 'Segoe Print', cursive;
  --pad-x: clamp(22px, 4vw, 64px);
  --topo-h: 76px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip; /* vazamento lateral desloca todo position:fixed no celular (regra da raiz) */
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fonte);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--ideiaria); color: var(--branco); }
:focus-visible { outline: 2px solid var(--ideiaria-hover); outline-offset: 4px; border-radius: 4px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pular {
  position: fixed; left: var(--pad-x); top: 12px; z-index: 100;
  padding: 10px 16px; background: var(--ideiaria); color: var(--branco);
  font-weight: 700; text-decoration: none; border-radius: 999px;
  transform: translateY(-160%); transition: transform .3s var(--ease);
}
.pular:focus { transform: none; }

/* === BOTOES === */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: .01em; text-decoration: none;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.botao-solido { background: var(--ideiaria); color: var(--branco); }
.botao-solido:hover { background: var(--ideiaria-hover); }
/* o par do sólido: fundo neutro e só a borda (nunca fundo tingido da cor da marca, regra da casa) */
.botao-borda { border: 1px solid var(--line-forte); color: var(--branco); }
.botao-borda:hover { border-color: var(--branco); }
.botao:active { transform: scale(.97); }

/* === TOPO === */
.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--topo-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
  pointer-events: none;
}
.topo::before {
  content: ''; position: absolute; inset: 0 0 -30px 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 9, 11, .72), rgba(8, 9, 11, 0));
  pointer-events: none;
}
.topo > * { pointer-events: auto; }
.topo-marca { position: relative; display: flex; align-items: center; text-decoration: none; }
.topo-marca img { height: 26px; width: auto; transition: opacity .5s; }
.topo-marca .marca-escura { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: 0; }

/* tema claro (mundo de papel): logo original, botão escuro */
.topo::before { transition: opacity .5s; }
.topo::after {
  content: ''; position: absolute; inset: 0 0 -30px 0; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(246, 242, 234, .82), rgba(246, 242, 234, 0)); transition: opacity .5s;
}
.tema-claro:not(.menu-aberto) .topo::before { opacity: 0; }
.tema-claro:not(.menu-aberto) .topo::after { opacity: 1; }
.tema-claro:not(.menu-aberto) .marca-clara { opacity: 0; }
.tema-claro:not(.menu-aberto) .marca-escura { opacity: 1; }
.tema-claro:not(.menu-aberto) .topo-menu { color: var(--tinta); border-color: rgba(21, 23, 27, .3); background: rgba(255, 255, 255, .45); }
.tema-claro:not(.menu-aberto) .topo-menu-ico { background: var(--tinta); }
.tema-claro:not(.menu-aberto) .topo-menu-ico i { background: var(--branco); }
.topo-menu {
  display: inline-flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 8px 0 18px; border-radius: 999px;
  border: 1px solid var(--line-forte);
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  background: rgba(8, 9, 11, .35);
  transition: border-color .25s, background-color .25s, color .25s;
}
.topo-menu:hover { border-color: var(--branco); }
.topo-menu-ico {
  position: relative; width: 30px; height: 30px; border-radius: 50%;
  background: var(--branco);
}
.topo-menu-ico i {
  position: absolute; left: 9px; right: 9px; height: 2px; background: var(--bg);
  border-radius: 2px; transition: transform .4s var(--ease), top .4s var(--ease);
}
.topo-menu-ico i:first-child { top: 11px; }
.topo-menu-ico i:last-child { top: 17px; }
.menu-aberto .topo-menu-ico i:first-child { top: 14px; transform: rotate(45deg); }
.menu-aberto .topo-menu-ico i:last-child { top: 14px; transform: rotate(-45deg); }

/* === MENU === */
.menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--bg);
  display: flex; align-items: stretch;
  clip-path: circle(0% at calc(100% - 60px) 38px);
  transition: clip-path .8s var(--ease-io), visibility 0s .8s;
  visibility: hidden;
}
.menu[hidden] { display: flex; }
.menu-aberto .menu {
  clip-path: circle(150% at calc(100% - 60px) 38px);
  transition: clip-path .9s var(--ease-io), visibility 0s 0s;
  visibility: visible;
}
.menu-dentro {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: calc(var(--topo-h) + 4vh) var(--pad-x) 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  overflow-y: auto;
}
.menu-lista { counter-reset: m; columns: 2; column-gap: 6vw; }
.menu-lista li { counter-increment: m; break-inside: avoid; }
.menu-lista a {
  display: flex; align-items: baseline; gap: 14px;
  padding: .28em 0; text-decoration: none;
  font-weight: 800; font-size: clamp(26px, 3.6vw, 54px); line-height: 1.05; letter-spacing: -.03em;
  color: var(--ink);
  opacity: 0; transform: translateY(24px);
  transition: color .2s, opacity .5s var(--ease), transform .7s var(--ease);
}
.menu-lista a::before {
  content: counter(m, decimal-leading-zero);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-dim);
  min-width: 22px;
}
.menu-lista a:hover { color: var(--ideiaria-hover); }
.menu-aberto .menu-lista a { opacity: 1; transform: none; }
.menu-aberto .menu-lista li:nth-child(n) a { transition-delay: calc(.25s + var(--i, 0) * 40ms); }
.menu-pe { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink-muted); }

/* === BOTAO FLUTUANTE === */
.flutuante {
  position: fixed; z-index: 40;
  right: max(var(--pad-x), env(safe-area-inset-right));
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  display: inline-flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 22px 0 18px; border-radius: 999px;
  background: var(--ideiaria); color: var(--branco);
  font-weight: 700; font-size: 15px; text-decoration: none;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7);
  transition: background-color .25s, transform .4s var(--ease);
}
.flutuante:hover { background: var(--ideiaria-hover); transform: translateY(-2px); }
.flutuante svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.menu-aberto .flutuante { transform: translateY(140%); }

/* === GRAO === */
.grao {
  /* 10% de sobra cobre a tremida de até 3% da animação; com -50% a camada misturada (overlay) por cima
     do mergulho tinha 4x a área da tela, e o celular pagava isso a cada quadro (rodada 8) */
  position: absolute; inset: -10%; z-index: 30; pointer-events: none;
  background: url(../img/grao.png);
  opacity: .07; mix-blend-mode: overlay;
  animation: grao 1s steps(6) infinite;
}
@keyframes grao {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* === COOKIES ===
   O aviso da primeira visita (canto de baixo) e o painel de preferências; quem monta os dois é o
   js/cookies.js. Aceitar e recusar com o mesmo peso, lado a lado (orientação da ANPD). */
.cookies {
  position: fixed; z-index: 60;
  left: max(var(--pad-x), env(safe-area-inset-left));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  width: min(440px, calc(100% - 2 * var(--pad-x)));
  padding: 24px 24px 20px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line-forte);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85);
  color: var(--ink-soft);
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.cookies.on { opacity: 1; transform: none; }
.cookies h2 { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; color: var(--branco); }
.cookies p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; }
.cookies a, .cookies-caixa a { color: var(--branco); text-underline-offset: 3px; }
.cookies-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cookies-botoes .botao, .cookies-pe .botao { flex: 1 1 auto; min-height: 46px; padding: 0 20px; font-size: 14px; }
.cookies-escolher {
  margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.cookies-escolher:hover { color: var(--branco); }

.cookies-painel {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 20px var(--pad-x);
  background: rgba(8, 9, 11, .74);
  opacity: 0; transition: opacity .35s var(--ease);
}
.cookies-painel.on { opacity: 1; }
.cookies-caixa {
  position: relative; width: min(560px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 28px 24px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line-forte);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9);
  transform: translateY(14px); transition: transform .45s var(--ease);
}
.cookies-painel.on .cookies-caixa { transform: none; }
.cookies-caixa h2 { padding-right: 48px; font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; color: var(--branco); }
.cookies-caixa > p { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.cookies-fechar {
  position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-forte); transition: border-color .25s;
}
.cookies-fechar:hover { border-color: var(--branco); }
.cookies-fechar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cookies-grupos { margin-top: 18px; border-top: 1px solid var(--line); }
.cookies-grupo {
  display: grid; grid-template-columns: 1fr auto; column-gap: 20px; row-gap: 6px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cookies-grupo h3 { grid-column: 1; grid-row: 1; font-size: 16px; font-weight: 800; color: var(--branco); }
.cookies-grupo p { grid-column: 1 / -1; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.cookies-grupo small { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-muted); }
.cookies-sempre { grid-column: 2; grid-row: 1; padding-top: 2px; font-size: 13px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
/* chave: desligada só com borda, ligada sólida em branco (o carmim fica só no botão principal: um destaque) */
.cookies-chave {
  grid-column: 2; grid-row: 1;
  appearance: none; -webkit-appearance: none; margin: 0; position: relative;
  width: 48px; height: 28px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-forte); background: transparent;
  transition: background-color .25s, border-color .25s;
}
.cookies-chave::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-soft); transition: transform .3s var(--ease), background-color .25s;
}
.cookies-chave:checked { background: var(--branco); border-color: var(--branco); }
.cookies-chave:checked::after { transform: translateX(20px); background: var(--bg); }
.cookies-pe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cookies-mais { margin-top: 16px; font-size: 13.5px; color: var(--ink-muted); }
/* página sem rolagem suave (privacidade, 404): o painel aberto trava o fundo */
html.cookies-aberto { overflow: hidden; }

@media (max-width: 760px) {
  :root { --topo-h: 64px; }
  .cookies { left: 12px; right: 12px; width: auto; bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px)); padding: 20px 18px 16px; }
  .cookies-caixa { padding: 26px 20px 20px; }
  /* com o aviso aberto, o botão flutuante e a dica de rolar saem da frente */
  .cookies-visivel .flutuante { transform: translateY(160%); }
  .cookies-visivel .hero-rolar { visibility: hidden; }
  .topo-marca img { height: 22px; }
  .topo-menu { height: 42px; padding-left: 14px; }
  .topo-menu-ico { width: 28px; height: 28px; }
  .topo-menu-ico i:first-child { top: 10px; } .topo-menu-ico i:last-child { top: 16px; }
  .menu-aberto .topo-menu-ico i { top: 13px !important; }
  .menu-lista { columns: 1; }
  .menu-lista a { font-size: clamp(24px, 7.4vw, 34px); }
  .flutuante { height: 50px; font-size: 14px; padding: 0 18px 0 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .grao { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
