/* =========================================================================
   BASE — fontes, cores, tipografia e regras gerais
   Para mudar a identidade do site, edite as variáveis em ":root" logo abaixo.
   ========================================================================= */

/* ---------- Fontes (hospedadas no próprio site, pasta /fonts) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-variavel.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;   /* eixo de largura: é ele que deixa os títulos "comprimidos" */
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Variáveis ---------- */
:root {
  /* Cores da marca */
  --marinho: #07182c;       /* fundo */
  --marinho-2: #0c2440;     /* fundo elevado */
  --marinho-3: #16385c;     /* linhas e bordas */
  --aco: #8fa3b8;           /* texto secundário e anotações */
  --texto: #b9c6d4;         /* texto corrido */
  --papel: #e9eef3;         /* texto principal e "folhas" claras */
  --laser: #c8ff3d;         /* destaque único (linha de nível a laser) */
  --linha: rgba(233, 238, 243, .13);

  /* Escala de tensões: único momento multicolorido (a mesma do Robot) */
  --t1: #2440d9; --t2: #5fa8ee; --t3: #bfe3f5; --t4: #f6edcf; --t5: #f7c46a; --t6: #f08a2c; --t7: #e0401c;

  /* Tipografia */
  --fonte: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Medidas */
  --margem: clamp(20px, 5.2vw, 96px);
  --topo: 72px;
  --suave: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- Reset enxuto ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--topo); }
body {
  margin: 0;
  background: var(--marinho);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: clamp(1rem, .96rem + .22vw, 1.1875rem);
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure, fieldset, blockquote, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--laser); color: var(--marinho); }

/* ---------- Foco visível para quem navega por teclado ---------- */
:focus-visible { outline: 2px solid var(--laser); outline-offset: 4px; }
.pular {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  padding: 12px 16px; background: var(--laser); color: var(--marinho); font-weight: 700; text-decoration: none;
}
.pular:focus { top: 12px; }

/* ---------- Títulos: caixa alta, condensados e pesados ---------- */
.titulo {
  font-family: var(--fonte);
  font-stretch: calc(var(--largura, 62) * 1%);   /* --largura muda com a "carga" (js/revelar.js) */
  font-weight: 800;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.005em;
  font-size: clamp(2.55rem, 5.9vw, 6rem);
  color: var(--papel);
  text-wrap: balance;
}
.titulo .linha { display: block; }
.titulo--hero { font-size: clamp(3rem, 13.4vw, 4.6rem); line-height: .88; }
.titulo--gigante { font-size: clamp(2.9rem, 9.4vw, 10rem); line-height: .86; }
@media (min-width: 861px) {
  .titulo--hero { font-size: clamp(4.2rem, 6.7vw, 8.8rem); }
  .titulo--hero .linha { white-space: nowrap; }
}

/* ---------- Anotações de prancha (texto técnico em monoespaçada) ---------- */
.nota {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .09em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--aco);
}
.nota i { font-style: normal; color: var(--laser); margin: 0 .35em; }
.nota--fina { text-transform: none; letter-spacing: .01em; font-weight: 400; font-size: .76rem; max-width: 52ch; }
.nota--tinta { color: var(--marinho); }
.nota--tinta i { color: var(--marinho); opacity: .5; }

/* ---------- Linha de cota (medida com tiques nas pontas) ---------- */
.cota {
  position: relative;
  display: block;
  width: min(100%, 30rem);
  height: 26px;
  border-top: 1px solid var(--laser);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--laser);
}
.cota::before, .cota::after {
  content: ""; position: absolute; top: -7px; width: 1px; height: 13px; background: var(--laser);
}
.cota::before { left: 0; }
.cota::after { right: 0; }
.cota span { display: block; padding-top: 6px; }

/* ---------- Ajudas ---------- */
.so-toque { display: none; }
.so-sem-js { display: none; }
.sem-js .so-sem-js { display: block; }
@media (pointer: coarse) {
  .so-mouse { display: none; }
  .so-toque { display: inline; }
}

/* ---------- Entrada dos elementos (montagem de peças) ----------
   Com JavaScript, cada bloco marcado com data-montar entra de baixo para cima,
   como peça sendo assentada. Sem JavaScript, tudo aparece direto. */
.js [data-montar] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .7s var(--suave), transform .9s var(--suave);
  transition-delay: calc(var(--ordem, 0) * 70ms);
}
.js [data-montar].montado { opacity: 1; transform: none; }
.js .titulo .linha[data-montar] { clip-path: inset(0 0 100% 0); transform: translate3d(0, .5em, 0); opacity: 1;
  transition: clip-path .9s var(--suave), transform .9s var(--suave); transition-delay: calc(var(--ordem, 0) * 90ms); }
.js .titulo .linha[data-montar].montado { clip-path: inset(-10% -5% -10% -5%); transform: none; }

/* ---------- Quem pediu menos movimento no sistema ---------- */
.sem-movimento { scroll-behavior: auto; }
.sem-movimento [data-montar], .sem-movimento .titulo .linha[data-montar] { opacity: 1; transform: none; clip-path: none; transition: none; }
.sem-movimento *, .sem-movimento *::before, .sem-movimento *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ---------- Título do hero reage à "carga" do cursor ----------
   A linha sob o ponteiro se alonga e volta oscilando (eixo de largura da fonte variável). */
@media (hover: hover) and (min-width: 861px) {
  .js:not(.sem-movimento) .titulo--hero .linha[data-montar] {
    pointer-events: auto;
    transition: clip-path .9s var(--suave), transform .9s var(--suave), font-stretch .7s cubic-bezier(.3, 1.8, .4, 1);
    transition-delay: calc(var(--ordem, 0) * 90ms), calc(var(--ordem, 0) * 90ms), 0s;
  }
  .js:not(.sem-movimento) .titulo--hero .linha[data-montar]:hover { font-stretch: 68%; }
}
