/*
 * base.css — Reset e tipografia base
 *
 * EB Garamond: todo o texto (corpo, títulos, UI labels)
 * Share Tech Mono: exclusivamente números, leituras, valores medidos
 */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--inst-text-primary);
  background-color: var(--inst-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Títulos — instrumento por padrão ──────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.20;
  letter-spacing: -0.01em;
  color: var(--inst-text-primary);
}

h1 { font-size: var(--text-3xl); font-weight: 300; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: 400; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); font-weight: 500; }
h6 { font-size: var(--text-base); font-weight: 500; }

p {
  margin-bottom: var(--space-4);
  color: var(--inst-text-secondary);
  font-size: var(--text-md);
  line-height: 1.75;
}

p:last-child { margin-bottom: 0; }

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

/* ── Mono: apenas para números e leituras ────────── */

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--inst-bg-panel);
  color: var(--amber);
  padding: 0.05em 0.30em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--inst-border-base);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--inst-bg-deep);
  border: 1px solid var(--inst-border-base);
  border-radius: var(--radius-base);
  padding: var(--space-4);
  overflow-x: auto;
  line-height: 1.60;
  color: var(--inst-text-secondary);
}

a {
  color: var(--nb-blue);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.75; }

ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}
li {
  margin-bottom: var(--space-2);
  color: var(--inst-text-secondary);
  line-height: 1.65;
}

hr {
  border: none;
  border-top: 1px solid var(--inst-border-base);
  margin: var(--space-8) 0;
}

/* ── Interativos ─────────────────────────────────── */

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-body);
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ── Classes utilitárias ─────────────────────────── */

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

.hidden     { display: none !important; }
.invisible  { visibility: hidden; }

/* Valores numéricos — mono, âmbar */
.value, .mono {
  font-family: var(--font-mono);
  color: var(--amber);
  letter-spacing: 0.04em;
}

.text-muted     { color: var(--inst-text-muted); }
.text-secondary { color: var(--inst-text-secondary); }
.text-amber     { color: var(--amber); }

/* ── Equação — estética caderno ──────────────────── */
/*
 * Sem caixa escura. Sem border-left de código.
 * Linha horizontal fina, fundo papel, variáveis em itálico.
 * Usado dentro de .notebook-panel.
 */
.equation {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--nb-text-primary);
  display: block;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--nb-border);
  border-bottom: 1px solid var(--nb-border);
  margin: var(--space-3) 0;
  letter-spacing: 0.01em;
  line-height: 1.40;
}

/* Variável em destaque (símbolo) dentro de uma equação */
.equation .sym {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 500;
  color: var(--amber);
}
