/* ===========================================================================
   CASA TOHMÉ — base.css · reset, tipografia e utilitários
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Âncoras param abaixo da nav fixa */
  scroll-padding-top: calc(var(--nav-h) + 24px);
  /* Rede de segurança contra rolagem lateral. `clip` não cria contexto de
     rolagem, então position:sticky segue funcionando na página inteira. */
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
/* `contents` faz o <picture> sumir da caixa: a <img> vira filha direta do
   container e o height:100% dos painéis de foto passa a resolver. */
picture { display: contents; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--orange); color: var(--areia); }

/* ---- Foco visível: obrigatório, nunca remover ---------------------------- */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--areia); }

/* ---- Tipografia: a hierarquia é regra de marca ---------------------------
   H1 → Gotham Black 900. H2/H3 → Gotham Bold 700. Corpo → Book 400.
   Bolota SÓ em .eyebrow / .kicker / .tag. Nunca em título.                  */
h1, .h1 {
  font-size: var(--step-5);
  font-weight: 900;
  line-height: .96;
  letter-spacing: -.035em;
  text-wrap: balance;
}
h2, .h2 {
  font-size: var(--step-4);
  /* Regra do manual: H1 é Black (900), H2 e H3 são Bold (700). */
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}
h3, .h3 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h4, .h4 {
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
}

p { text-wrap: pretty; }

/* Eyebrow / kicker / tag — o único território da Bolota */
.eyebrow {
  font-family: var(--font-tag);
  font-weight: 700;
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: .16em;
  line-height: 1.4;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.eyebrow::before {
  content: "";
  width: 1.8em;
  height: 1px;
  background: currentColor;
  opacity: .5;
  flex: none;
}
/* Sem o traço não há motivo para ser flex — e como bloco o texto quebra em
   duas linhas no celular em vez de vazar pela borda. */
.eyebrow--sem-traco { display: block; }
.eyebrow--sem-traco::before { display: none; }
.on-dark .eyebrow { color: var(--green-soft); }

/* Kicker: tagline colada no H1 (regra 3 do manual — nunca solta no topo) */
.kicker {
  font-family: var(--font-tag);
  font-weight: 700;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--orange);
  display: block;
  margin-bottom: .45em;
}

.tag {
  font-family: var(--font-tag);
  font-weight: 700;
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: .1em;
  border-radius: var(--r-pill);
  padding: 7px 15px 6px;
  background: var(--surface-alt);
  color: var(--green);
  display: inline-block;
  border: 1px solid var(--border);
}

/* Lettering ilustrado — 1 a 3 palavras, nunca um parágrafo.
   A Florest é caixa-alta: minúsculas viram versaletes sublinhados e as
   acentuadas perdem o acento. Por isso o uppercase é forçado aqui e a regra
   prática é: só frases curtas SEM acento (ex.: "TRAZ O CACHORRO"). */
.lettering {
  font-family: var(--font-lettering);
  font-weight: 400;
  line-height: .95;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* A UMA palavra laranja do título */
.destaque { color: var(--orange); }
.on-dark .destaque { color: var(--orange); }

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 46ch;
}
.on-dark .lead { color: var(--text-on-dark-muted); }

.prosa { max-width: var(--maxw-prosa); }
.prosa p + p { margin-top: 1.1em; }

.mono-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- Utilitários --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--largo { max-width: 1560px; }

.secao {
  padding-block: var(--section-y);
  position: relative;
  /* clip (não hidden): corta a árvore de respiro que sangra pela borda sem
     criar contexto de rolagem — position:sticky lá dentro continua valendo. */
  overflow-x: clip;
}

.on-dark { color: var(--text-on-dark); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--text-on-dark); }

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

.pular-para-conteudo {
  position: fixed; top: 8px; left: 8px; z-index: 999;
  background: var(--ink); color: var(--areia);
  padding: 12px 20px; border-radius: var(--r-btn);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.pular-para-conteudo:focus { transform: translateY(0); }

/* ---- Ícones -------------------------------------------------------------- */
.ico {
  width: 1em; height: 1em;
  flex: none;
  fill: currentColor;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Grão: textura sutil que tira o "plástico" da tela ------------------- */
.grao {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .038;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Regra que se desenha ao entrar na tela ------------------------------ */
.regua {
  height: 1px;
  background: var(--border);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-out);
}
.on-dark .regua { background: var(--border-dark); }
.is-visivel .regua, .regua.is-visivel { transform: scaleX(1); }
