/* ============================================================================
   BASE — reset, tipografia, layout de pagina, textura de fundo.
   ========================================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

/* O atributo hidden tem de vencer qualquer display declarado por nos.
   Sem isto, um modal display:grid nasce aberto. */
[hidden] { display: none !important; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--space-6));
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Textura de fundo do site — grid tecnico quase imperceptivel.
   De perto se percebe; de longe parece fundo escuro liso. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--texture-opacity);
  background-image:
    linear-gradient(to right, var(--text) 1px, transparent 1px),
    linear-gradient(to bottom, var(--text) 1px, transparent 1px);
  background-size: 64px 64px;
}

body > * { position: relative; z-index: 1; }

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----------------------------------------------------------- tipografia */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p { text-wrap: pretty; }

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--purple-bright); }

/* Manuscrito. NAO transmite informacao — so frases de personalidade.
   Proibido em menu, card, descricao ou qualquer dado tecnico. */
.script {
  font-family: var(--font-accent);
  font-weight: 500;
  color: var(--purple-bright);
  line-height: 1.15;
  letter-spacing: 0;
}

/* --------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--compact { padding-block: var(--space-16); }
.section--kpi { padding-block: var(--space-12); }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--purple);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-btn);
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Mesmo problema em qualquer <select> do site (admin incluso). */
select option { background: var(--surface-elevated); color: var(--text); }
