/* ============================================================
   base.css — reset, variáveis e tipografia
   ============================================================ */

:root {
  /* Paleta: do crepúsculo da superfície ao negror do abismo */
  --bg-surface: #0e1018;
  --bg-deep: #030208;
  --ink: #cfc9bb;
  --ink-dim: #847e6f;
  --ink-bright: #e9e3d3;
  --accent: #d8a04a;            /* âmbar — a cor dos olhos no escuro */
  --accent-soft: rgba(216, 160, 74, 0.18);
  --line: rgba(207, 201, 187, 0.12);
  --card-bg: rgba(255, 255, 255, 0.025);

  --font-display: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --content-w: 44rem;
  --content-w-wide: 68rem;

  /* 0 na superfície → 1 no fundo do abismo (atualizado via JS no scroll) */
  --depth: 0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink-bright);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover,
a:focus-visible {
  color: #f0c178;
  text-shadow: 0 0 14px rgba(216, 160, 74, 0.45);
}

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

::selection {
  background: rgba(216, 160, 74, 0.3);
  color: #fff;
}

/* Barra de rolagem */
html {
  scrollbar-width: thin;
  scrollbar-color: #2a2433 #050409;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #050409;
}

::-webkit-scrollbar-thumb {
  background: #2a2433;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a3d2a;
}

.noscript-warning {
  max-width: var(--content-w);
  margin: 40vh auto 0;
  padding: 0 1.5rem;
  text-align: center;
  font-style: italic;
  color: var(--ink-dim);
}

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

/* Aviso de falha de boot (ver o script clássico no fim do HTML) */
.boot-error {
  max-width: var(--content-w);
  margin: 0 auto;
  /* padding em vez de margin: margem superior colapsaria com o body */
  padding: 18vh 1.5rem 0;
  text-align: center;
}

.boot-error h1 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.boot-error p {
  margin-bottom: 0.8rem;
  color: var(--ink-dim);
}

.boot-error pre,
.boot-error code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--accent);
}

.boot-error pre {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.8rem;
}
