/* ==========================================================================
   RR Ferramentaria — Reset, tipografia e primitivas de layout
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-copy);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-3) var(--ease), color var(--dur-3) var(--ease);
}

body.is-locked { overflow: hidden; }

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

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

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

/* --- Tipografia ----------------------------------------------------------- */
/*
  Três vozes com papéis fixos:
  · serifa de display  — só as afirmações grandes
  · grotesca           — tudo que se lê e se opera
  · monoespaçada       — números, cotas e etiquetas técnicas
*/

h1, h2, h3, h4 { font-weight: 700; line-height: var(--lh-title); text-wrap: balance; }

.display,
.h1,
.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.035em;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: 1.05;
  font-stretch: var(--wdth-display);
  letter-spacing: -0.03em;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  font-stretch: var(--wdth-mid);
  letter-spacing: -0.028em;
}

/* Ênfase dentro de um título: mesma letra, cor de acento */
.display em,
.h1 em,
.h2 em { font-style: normal; color: var(--accent); }

.h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.021em;
}

.h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 46ch;
}

p { text-wrap: pretty; }

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

/* Etiqueta monoespaçada — a camada técnica do sistema */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.label--accent { color: var(--accent); }

.label::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  flex: none;
}

.label--bare::before { display: none; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

/* Números — o argumento de venda desta empresa */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* --- Links ---------------------------------------------------------------- */

a { color: inherit; text-decoration: none; }

.link {
  display: inline-block;
  padding-bottom: 1px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur-2) var(--ease), color var(--dur-1) var(--ease);
}

.link:hover,
.link:focus-visible { background-size: 0 1px; background-position: 100% 100%; color: var(--accent); }

.link-quiet {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size var(--dur-2) var(--ease);
}

.link-quiet:hover,
.link-quiet:focus-visible { background-size: 100% 1px; }

/* --- Foco ----------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  transform: translateY(-160%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

/* --- Layout --------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
  background-color: var(--bg);
  color: var(--fg);
}

.section--tight { padding-block: var(--section-y-sm); }
.section--flush-top { padding-top: 0; }

/* Luz de bancada: o brilho substitui a antiga trama quadriculada */
.section--lit { position: relative; isolation: isolate; }

.section--lit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glow);
  pointer-events: none;
}

.rule { height: 1px; border: 0; background: var(--line); margin: 0; }

.section-head {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .section-head__aside { padding-bottom: 0.4rem; }
}

.section-head__title { margin-top: 0.85rem; }

/*
  Marcas de registro nos cantos — o eco do instrumento de medição que
  substitui a trama de fundo. Duas, na diagonal: sugerem sem decorar.
*/
.marks { position: relative; }

.marks::before,
.marks::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  pointer-events: none;
}

/* Ficam por dentro da caixa: as figuras recortam o que passa da borda. */
.marks::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.marks::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* --- Utilidades ----------------------------------------------------------- */

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

.text-muted { color: var(--fg-muted); }
.text-accent { color: var(--accent); }
.nowrap { white-space: nowrap; }

/* --- Revelação no scroll -------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible { opacity: 1; transform: none; }

/*
  Revelação em cortina para imagens. Usa um pseudo-elemento em vez de
  clip-path no próprio nó: o IntersectionObserver considera o recorte e
  um elemento clipado nunca chegaria a 12% de interseção.
*/
[data-reveal="mask"] {
  position: relative;
  opacity: 1;
  transform: none;
  transition: none;
}

[data-reveal="mask"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 3;
  background: var(--bg);
  transform-origin: 50% 100%;
  transition: transform 900ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  pointer-events: none;
}

[data-reveal="mask"].is-visible::after { transform: scaleY(0); }

/* --- Preferência por menos movimento -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-reveal="mask"]::after { display: none !important; }
}

/* --- Impressão ------------------------------------------------------------ */

@media print {
  .site-header, .site-footer, .dock, .actionbar, .to-top, .hero__media { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-reveal="mask"]::after { display: none !important; }
}
