/* base.css · fichas (cor, tipo, espaço, curvas), reset, escala de tipo, grade e botões. */

/* ---------- Fichas ---------- */
:root {
  color-scheme: dark;

  /* Paleta (plano, seção 2). Toda outra cor vem da mídia. */
  --palco: #000000;          /* fundo, preto de verdade */
  --gelo: #F5F5F7;           /* texto principal, botão principal */
  --nevoa: #A1A1A6;          /* texto secundário */
  --fosco: #111216;          /* superfícies opacas (projetos, currículo) */
  --luz-monitor: #8FC7FF;    /* única luz própria. Só no topo */
  --cursor: #B42923;         /* amostrado do 1º quadro de dentro-da-telinha.mp4. Só cursor e ponto da marca */

  --luz-monitor-rgb: 143 199 255;
  --gelo-rgb: 245 245 247;
  --cursor-rgb: 180 41 35;

  /* Fios (linhas finas) e texto terciário */
  --fio: rgb(255 255 255 / .09);
  --fio-forte: rgb(255 255 255 / .16);
  --texto-3: #6E6E73;        /* só para detalhe não essencial (passa AA em tamanho grande) */

  /* Tipo */
  --fonte: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fonte-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --t-display: clamp(3.25rem, 10.5vw, 8.5rem);
  --t-h2: clamp(2.25rem, 6vw, 4.5rem);
  --t-h3: 1.5rem;
  --t-lead: clamp(1.125rem, 1.6vw, 1.375rem);
  --t-corpo: 1.0625rem;
  --t-pequeno: .875rem;
  --medida: 62ch;            /* linha de leitura máxima */

  /* Espaço e grade */
  --margem: 20px;
  --largura: 1200px;
  --vao: 16px;               /* espaço entre colunas */
  --espaco-secao: clamp(96px, 14vh, 200px);

  /* Raios (concêntricos: dentro = fora − recuo) */
  --raio-painel: 28px;       /* 36 no computador */
  --raio-cartao: 22px;
  --raio-pequeno: 14px;

  /* Movimento */
  --expo: cubic-bezier(.16, 1, .3, 1);       /* ~ expo.out */
  --suave: cubic-bezier(.4, 0, .2, 1);
  --dur-chegada: .8s;

  /* Navegação (reservas para não cobrir conteúdo) */
  --nav-alto: 84px;                                          /* altura reservada no alto (computador) */
  --barra-alto: 64px;                                        /* barra de baixo (celular) */
  --seguro-baixo: env(safe-area-inset-bottom, 0px);
  --seguro-topo: env(safe-area-inset-top, 0px);
  --reserva-baixo: calc(var(--barra-alto) + 24px + var(--seguro-baixo));
}

@media (min-width: 768px) {
  :root { --margem: 40px; --vao: 24px; --raio-painel: 36px; --raio-cartao: 26px; }
}
@media (min-width: 980px) {
  :root { --reserva-baixo: 0px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
  scroll-padding-bottom: var(--reserva-baixo);
  background: var(--palco);
}
@media (min-width: 980px) { html { scroll-padding-top: var(--nav-alto); } }
/* Sem scroll-behavior: smooth no CSS: ele faz o ScrollTrigger medir errado quando recalcula com a
   página rolada (o refresh leva a rolagem a 0 e volta; com smooth essa ida não acontece). A rolagem
   suave dos links #âncora é feita pelo main.js (instantânea com movimento reduzido). */

body {
  min-height: 100svh;
  background: var(--palco);
  color: var(--gelo);
  font-family: var(--fonte);
  font-size: var(--t-corpo);
  line-height: 1.55;
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;   /* reserva para iOS < 16 (sem "clip"); no body passa para a janela e não quebra o sticky */
  overflow-x: clip;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
main:focus { outline: none; }
::selection { background: rgb(var(--gelo-rgb) / .9); color: #000; }

/* Foco visível em tudo que é interativo. Só o contorno: nunca muda a forma do elemento
   (o outline acompanha o border-radius que ele já tem). */
:focus-visible {
  outline: 2px solid var(--gelo);
  outline-offset: 3px;
}
/* alvo de um link #âncora recebe o foco (para o Tab continuar dali), sem anel em volta da seção */
[data-foco-ancora]:focus { outline: none; }

/* ---------- Utilitários ---------- */
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icone { width: 1.25em; height: 1.25em; flex: none; }

.pular {
  position: fixed; z-index: 100; top: calc(12px + var(--seguro-topo)); left: 12px;
  padding: 12px 20px; border-radius: 999px;
  background: var(--gelo); color: #000; font-weight: 500;
  transform: translateY(calc(-100% - 40px));
  transition: transform .3s var(--expo);
}
.pular:focus, .pular:focus-visible { transform: none; }

/* ---------- Escala de tipo ---------- */
.t-display {
  font-size: var(--t-display); line-height: .95; letter-spacing: -.045em; font-weight: 600;
}
.t-h2, .capitulo__titulo {
  font-size: var(--t-h2); line-height: 1.02; letter-spacing: -.035em; font-weight: 600;
}
.t-h3 { font-size: var(--t-h3); line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.t-lead, .capitulo__apoio {
  font-size: var(--t-lead); line-height: 1.45; letter-spacing: -.01em; color: var(--nevoa);
}
.t-pequeno { font-size: var(--t-pequeno); line-height: 1.45; }
.t-mono { font-family: var(--fonte-mono); letter-spacing: 0; }

/* ---------- Layout ---------- */
.conteudo {
  width: min(100% - 2 * var(--margem), var(--largura));
  margin-inline: auto;
}
.grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--vao);
}
@media (min-width: 768px) {
  .grade { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.secao {
  position: relative;
  padding-block: var(--espaco-secao);
  /* link do menu: o título chega logo abaixo da navegação, sem a faixa preta do respiro de cima */
  scroll-margin-top: calc(32px - var(--espaco-secao));
}
/* Abertura de capítulo: centralizada, muito respiro */
.capitulo {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: clamp(16px, 2.2vw, 24px);
  margin-bottom: clamp(48px, 7vw, 88px);
}
.capitulo__titulo { max-width: 16ch; }
.capitulo__apoio { max-width: 38em; }

/* Link de texto */
.link {
  color: var(--gelo);
  text-decoration: underline;
  text-decoration-color: rgb(var(--gelo-rgb) / .35);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color .25s;
}
.link:hover { text-decoration-color: var(--gelo); }

/* Marca "● fakee.dev" (texto de terminal de verdade: mono) */
.marca {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--fonte-mono); font-size: .9375rem; font-weight: 500; letter-spacing: -.01em;
  color: var(--gelo); white-space: nowrap;
}
.marca__ponto {
  width: .5em; height: .5em; border-radius: 50%;
  background: var(--cursor);
  box-shadow: 0 0 10px rgb(var(--cursor-rgb) / .55);
}

/* ---------- Botões ---------- */
.botao {
  --botao-alto: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--botao-alto);
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--fonte); font-size: 1.0625rem; font-weight: 500; line-height: 1.1; letter-spacing: -.012em;
  text-align: center; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .45s var(--expo), background-color .25s, color .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.botao:active { transform: scale(.97); }
.botao--principal { background: var(--gelo); color: #000; }
.botao--principal:hover { background: #fff; }
.botao--secundario {
  background: rgb(255 255 255 / .1); color: var(--gelo);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07);
}
.botao--secundario:hover { background: rgb(255 255 255 / .16); }
.botao--pequeno { --botao-alto: 44px; padding: 0 20px; font-size: .9375rem; }
.botao--grande { --botao-alto: 60px; padding: 0 34px; font-size: 1.125rem; }
.botao--largo { width: 100%; }
.botao .icone { width: 1.15em; height: 1.15em; }
@media (hover: none) {
  .botao--principal:hover { background: var(--gelo); }
  .botao--secundario:hover { background: rgb(255 255 255 / .1); }
}

/* ---------- Rodapé ---------- */
.rodape {
  padding: 40px 0 calc(32px + var(--reserva-baixo));
  border-top: 1px solid var(--fio);
  color: var(--nevoa);
  font-size: var(--t-pequeno);
}
.rodape__corpo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
