/* ==========================================================
   NETWAVE — Base
   Reset, tipografia, grid de 12 colunas, utilitários de
   layout. Camada 1 de 3: base → components → pages.
   ========================================================== */

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

* { margin: 0; padding: 0; }

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  display: flex;
  flex-direction: column;
}

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

img { height: auto; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { background: none; border: none; cursor: pointer; }

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

ul,
ol { list-style: none; }

table { border-collapse: collapse; width: 100%; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
}

/* ---------- Foco acessível ---------- */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--brand-soft);
  color: var(--text);
}

/* ---------- Scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--r-full);
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  text-wrap: balance;
}

h1 { font-size: var(--t-4xl); }
h2 { font-size: var(--t-3xl); }
h3 { font-size: var(--t-xl); letter-spacing: var(--tr-snug); }
h4 { font-size: var(--t-lg); letter-spacing: var(--tr-snug); line-height: var(--lh-snug); }

/* ---------- Texto ---------- */
p { text-wrap: pretty; }

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

code,
kbd,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 0.1em 0.4em;
  color: var(--cyan);
}

.lead {
  font-size: var(--t-md);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  max-width: 62ch;
}

/* Quebra de linha só em telas largas: em 390px um <br> fixo
   empurra a linha além da viewport e cria scroll horizontal. */
.br-wide { display: inline; }

@media (max-width: 720px) {
  .br-wide { display: none; }
}

@media (max-width: 480px) {
  body { overflow-x: clip; }
}

.muted { color: var(--text-muted); }
.small { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.field-help { font-size: var(--t-xs); color: var(--text-muted); margin-top: var(--s-2); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

main { flex: 1 0 auto; }

/* Grid de 12 colunas */
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-5);
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  /* Colapsa para 1 coluna. Só trocar span 12 não resolve: as 11
     colunas vazias e seus gaps continuariam ocupando ~16rem. */
  .grid12 {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-12 { grid-column: 1 / -1; }
}

/* ---------- Seções ---------- */
.section { padding-block: var(--section-y); }
.section-sm { padding-block: var(--section-y-sm); }

.section-head { max-width: 68ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: var(--s-4); }

/* ---------- Divisores ---------- */
.hairline { height: 1px; background: var(--border); border: 0; }

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: calc(var(--z-header) + 1);
  padding: var(--s-2) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--t-sm);
  transition: top var(--t-base) var(--ease);
}

.skip-link:focus { top: var(--s-4); }

/* ---------- Visually hidden ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
