/* ═══════════════════════════════════════════════════════════
   HERANÇA INVISÍVEL — SISTEMA DE DESIGN
   
   Filosofia visual: O livro Espólio tem linguagem limpa,
   tipografia séria, espaço branco generoso. O site traduz
   isso para o digital com fundo escuro quente (papel antigo),
   tipografia editorial e conforto visual para neurodivergentes.
   
   Princípios UX neurodivergente:
   - Espaçamento generoso: reduz sobrecarga visual
   - Hierarquia clara: sem ambiguidade de onde clicar
   - Linha de base confortável: 1.8 no corpo
   - Contraste adequado sem ser agressivo
   - Largura de coluna controlada: leitura fluida
═══════════════════════════════════════════════════════════ */

:root {
  /* Paleta — inspirada no livro: papel, tinta, âmbar */
  --bg:          #141210;   /* papel antigo escuro */
  --bg2:         #1c1915;   /* superfície levemente mais clara */
  --bg3:         #252119;   /* cards, containers */
  --bg4:         #2e2921;   /* hover states */
  --border:      rgba(255, 245, 220, 0.08);
  --border-soft: rgba(255, 245, 220, 0.04);

  --ink:         #f5f0e8;   /* texto principal — papel creme */
  --ink-soft:    #b8ad9e;   /* texto secundário */
  --ink-faint:   #6b6055;   /* texto terciário */

  --accent:      #c8954a;   /* âmbar quente — a cor do livro */
  --accent2:     #e8b06a;   /* âmbar claro */
  --accent-dim:  rgba(200, 149, 74, 0.12);
  --accent-soft: rgba(200, 149, 74, 0.06);

  --teal:        #5ab4a0;   /* saúde, triagem */
  --teal-dim:    rgba(90, 180, 160, 0.10);

  --sage:        #7a9e7e;   /* ferramentas */
  --sage-dim:    rgba(122, 158, 126, 0.10);

  --rose:        #c47a7a;   /* alertas suaves */
  --rose-dim:    rgba(196, 122, 122, 0.10);

  --navy:        #3a5276;   /* links, referências */

  /* Tipografia */
  --font-serif:  'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;

  /* Espaçamento — generoso para neurodivergentes */
  --r:     12px;
  --r-l:   20px;
  --r-xl:  32px;

  /* Sombras */
  --shadow:    0 2px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.4);

  /* Transições */
  --trans: .28s cubic-bezier(.4,0,.2,1);

  /* Largura máxima de leitura */
  --read-width: 680px;
  --wide-width: 1000px;
}

/* ── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── TIPOGRAFIA ────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.3px; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1rem; font-weight: 600; font-family: var(--font-sans); }

p { max-width: var(--read-width); line-height: 1.85; }
p + p { margin-top: 1em; }

img { max-width: 100%; height: auto; image-rendering: auto; }
a { color: var(--accent); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--accent2); }

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

/* ── LAYOUT ────────────────────────────────────────────── */
.wrap {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow {
  max-width: var(--read-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── NAVEGAÇÃO ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(20, 18, 16, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex; gap: 4px; align-items: center;
  list-style: none;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r);
  transition: all var(--trans);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--bg3);
}
.nav-cta {
  background: var(--accent);
  color: #1a1208 !important;
  border-radius: var(--r);
  font-weight: 600 !important;
  padding: 7px 16px !important;
}
.nav-cta:hover {
  background: var(--accent2) !important;
  color: #1a1208 !important;
}

/* Mobile menu */
.nav-hamburger {
  display: none;
  background: none; border: none;
  color: var(--ink-soft); cursor: pointer;
  font-size: 1.4rem; padding: 4px;
}
.nav-mobile {
  display: none;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px 20px;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  color: var(--ink-soft);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 1rem;
  font-weight: 500;
}
.nav-mobile a:last-child { border-bottom: none; }

/* ── BOTÕES ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r);
  padding: 13px 28px;
  font-family: var(--font-sans);
  font-size: .95rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--trans);
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #1a1208;
  box-shadow: 0 2px 16px rgba(200,149,74,.25);
}
.btn-primary:hover {
  background: var(--accent2);
  color: #1a1208;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(200,149,74,.35);
}
.btn-secondary {
  background: var(--bg3);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg4);
  color: var(--ink);
  border-color: rgba(255,245,220,.14);
}
.btn-ghost {
  background: none;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg3);
  color: var(--ink);
}
.btn:disabled {
  opacity: .45; cursor: not-allowed; transform: none !important;
}
.btn-sm { padding: 8px 18px; font-size: .84rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: 28px 32px;
  transition: all var(--trans);
}
.card:hover {
  border-color: rgba(255,245,220,.14);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-sm { padding: 20px 24px; border-radius: var(--r); }

/* ── FORMULÁRIOS ───────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .3px;
}
.field input,
.field textarea,
.field select {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .95rem;
  line-height: 1.6;
  padding: 12px 16px;
  transition: border-color var(--trans);
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); }
.field textarea { min-height: 100px; }

/* ── PROGRESSO ─────────────────────────────────────────── */
.progress-track {
  height: 3px; background: var(--bg3); border-radius: 2px;
}
.progress-fill {
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}

/* ── BADGE / PILL ──────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 3px 12px; border-radius: 20px;
}

/* ── DIVIDER ───────────────────────────────────────────── */
.divider {
  height: 1px; background: var(--border);
  margin: 48px 0;
}
.divider-sm { margin: 24px 0; }

/* ── CITAÇÃO / PULL QUOTE ──────────────────────────────── */
.pullquote {
  border-left: 3px solid var(--accent);
  padding: 4px 24px;
  margin: 32px 0;
}
.pullquote p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.7;
}
.pullquote cite {
  display: block;
  font-size: .82rem;
  color: var(--ink-faint);
  margin-top: 8px;
  font-style: normal;
}

/* ── ALERT / NOTICE ────────────────────────────────────── */
.notice {
  background: var(--accent-dim);
  border: 1px solid rgba(200,149,74,.2);
  border-radius: var(--r);
  padding: 16px 20px;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.7;
}
.notice-teal {
  background: var(--teal-dim);
  border-color: rgba(90,180,160,.2);
}
.notice-rose {
  background: var(--rose-dim);
  border-color: rgba(196,122,122,.2);
}

/* ── LOADING ───────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ANIMAÇÕES ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-up   { animation: fadeUp .5s ease both; }
.anim-fade { animation: fadeIn .4s ease both; }

/* ── FOOTER ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink-faint);
}
.footer-brand span { color: var(--accent); }
.footer-links {
  display: flex; gap: 24px; list-style: none; flex-wrap: wrap;
}
.footer-links a {
  font-size: .82rem; color: var(--ink-faint);
}
.footer-links a:hover { color: var(--ink-soft); }
.footer-note {
  font-size: .78rem; color: var(--ink-faint); width: 100%;
  padding-top: 16px; border-top: 1px solid var(--border-soft);
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .card { padding: 20px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
}

/* ── PRINT ─────────────────────────────────────────────── */
@media print {
  .nav, .footer, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
