/* ==========================================================================
   YAF MKT · base.css
   Reset, design tokens (cores/tipografia/espaço), tipografia e utilitários.
   Tudo que é "sistema" mora aqui. Se for mudar a identidade, comece por
   :root — as outras folhas só consomem essas variáveis.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;           /* o smooth scroll é do Lenis, não do CSS */
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas, picture {
  display: block;
  max-width: 100%;
}

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; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.02; text-wrap: balance; }
p { text-wrap: pretty; }

::selection { background: var(--blue); color: #fff; }


/* --------------------------------------------------------------------------
   2. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- Cores: preto com sub-tom azul + azul elétrico como único acento --- */
  --void:        #04050A;   /* fundo da página                    */
  --ink:         #070911;   /* superfícies elevadas               */
  --surface:     #0B0E18;   /* cards                              */
  --surface-2:   #10141F;   /* hover de cards                     */

  --blue:        #2F63FF;   /* acento principal                   */
  --blue-lt:     #6E9BFF;   /* hover / destaque de texto          */
  --blue-deep:   #0B1B4D;   /* base de brilhos e gradientes       */

  --white:       #F2F4F8;
  --muted:       #8A93A8;   /* texto secundário                   */
  --faint:       #545C70;   /* texto terciário / rótulos          */

  --line:        rgba(140, 170, 255, 0.11);   /* bordas            */
  --line-strong: rgba(140, 170, 255, 0.22);

  /* --- Tipografia --- */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  /* Escala fluida — cresce sozinha entre 480px e 1600px de viewport.
     clamp(mínimo, preferido, máximo)                                    */
  /* O h1 tem 4 linhas: a escala é calculada para o bloco inteiro (título +
     lead + botões) caber em 100svh num notebook de 1440x900.              */
  --fs-display: clamp(2.4rem, 1rem + 5.5vw, 6.25rem);      /* h1 do herói  */
  --fs-h2:      clamp(2rem,   1.1rem + 3.6vw, 4.25rem);
  --fs-h3:      clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
  --fs-lead:    clamp(1rem,   0.94rem + 0.35vw, 1.2rem);
  --fs-body:    clamp(0.94rem, 0.9rem + 0.2vw, 1.05rem);
  --fs-small:   0.8125rem;
  --fs-label:   0.6875rem;                                 /* rótulos mono */

  /* --- Espaçamento --- */
  --gutter:     clamp(1.25rem, 0.6rem + 3.2vw, 5rem);      /* respiro lateral */
  --section-y:  clamp(5rem, 2.5rem + 8vw, 11rem);          /* respiro vertical */
  --max-w:      1560px;

  /* --- Motion --- */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);             /* expo.out        */
  --ease-io:    cubic-bezier(0.76, 0, 0.24, 1);            /* quart.inOut     */
  --dur:        0.5s;

  --header-h:   clamp(64px, 5vw, 88px);
  --radius:     14px;
}


/* --------------------------------------------------------------------------
   3. PÁGINA
   -------------------------------------------------------------------------- */
body {
  background: var(--void);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100svh;
}

/* Textura de grão + vinheta: tira o "plano demais" do fundo preto.
   pointer-events:none para não interferir em nenhum clique.            */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url('../images/grain.png');
  background-size: 160px;
  opacity: 0.55;
  mix-blend-mode: overlay;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

/* Trava a rolagem enquanto o preloader está na tela e com o menu aberto */
body.is-loading,
body.menu-open { overflow: hidden; }


/* --------------------------------------------------------------------------
   4. LENIS (smooth scroll)
   Regras mínimas exigidas pela lib — evita um request extra de CSS.
   -------------------------------------------------------------------------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }


/* --------------------------------------------------------------------------
   5. TIPOGRAFIA
   -------------------------------------------------------------------------- */
.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 16ch;
}

.h2 em,
.hero__title em,
.contact__title em {
  font-style: normal;
  color: var(--blue-lt);
}

/* Rótulo mono que abre cada seção */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.eyebrow__num { color: var(--blue); }

.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 99, 255, 0.18);
  animation: pulse 2.4s var(--ease-io) infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47, 99, 255, 0.22); }
  50%      { box-shadow: 0 0 0 8px rgba(47, 99, 255, 0); }
}


/* --------------------------------------------------------------------------
   6. UTILITÁRIOS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Some em telas de toque, onde a miniatura já aparece empilhada e a
   instrução "passe o mouse" não faz sentido. */
@media (max-width: 768px), (hover: none) {
  .so-desktop { display: none; }
}

/* Só para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Link "pular para o conteúdo" — aparece ao navegar por teclado */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
  padding: 0.7rem 1.1rem;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: var(--fs-small);
  font-weight: 500;
  transform: translateY(-150%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

/* Foco visível e consistente em tudo que é interativo */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue-lt);
  outline-offset: 4px;
  border-radius: 4px;
}

[data-reveal],
[data-split] { will-change: transform, opacity; }

/* Se o GSAP não carregar, js/main.js marca o body com .no-js-fallback e
   todo o conteúdo volta a ficar visível. O site nunca fica em branco.   */
.no-js-fallback [data-reveal],
.no-js-fallback [data-split],
.no-js-fallback .split-word__inner {
  opacity: 1 !important;
  transform: none !important;
}

/* --------------------------------------------------------------------------
   PALAVRAS QUEBRADAS (geradas por YAF.splitWords em js/utils.js)

   .split-word        → a máscara. overflow:hidden é o que "corta" a palavra
                        enquanto ela sobe.
   .split-word__inner → o que o GSAP move (yPercent 118 → 0).

   O par padding-bottom / margin-bottom negativo dá espaço para as descidas
   das letras (g, p, q, y) sem alterar a altura da linha: sem isso a máscara
   corta o rabinho das letras.
   -------------------------------------------------------------------------- */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.split-word__inner {
  display: inline-block;
  will-change: transform;
}


/* --------------------------------------------------------------------------
   7. ACESSIBILIDADE — respeitar "reduzir movimento"
   Quem pediu menos animação recebe o site estático e completo.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal],
  [data-split] { opacity: 1 !important; transform: none !important; }

  .cursor { display: none !important; }
}
