/* ═══════════════════════════════════════════════════════════════════
   base.css — o que TODAS as páginas de woss.tech compartilham:
   tokens de tema, reset, utilitários, nav, rodapé e a grade de
   caracteres ASCII. Carregue sempre primeiro.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   anderson.woss — POC de home de blog pessoal
   Paleta: quase-branco / quase-preto + 1 cor de acento (vermilion)
   ═══════════════════════════════════════════════════════════ */

/* ---------- tokens: tema claro (padrão) ---------- */
:root {
  --paper:        #f5f4f1;
  --paper-deep:   #eceae5;
  --surface:      #fdfcfa;
  --ink:          #14130f;
  --ink-70:       rgba(20, 19, 15, .70);
  --ink-45:       rgba(20, 19, 15, .45);
  --ink-20:       rgba(20, 19, 15, .20);
  --line:         rgba(20, 19, 15, .13);
  --accent:       #d33d17;
  --accent-ink:   #b93410;
  --accent-soft:  rgba(211, 61, 23, .10);

  --ascii-dim:    rgba(20, 19, 15, .26);
  --ascii-hot:    rgba(211, 61, 23, .52);

  /* Mermaid — precisa de cor sólida (a lib deriva tons a partir daqui) */
  --mm-node:           #fdfcfa;
  --mm-node-border:    #c9c5bc;
  --mm-text:           #14130f;
  --mm-line:           #6d6a62;
  --mm-cluster:        #eceae4;
  --mm-cluster-border: #d6d2ca;
  --mm-note:           #f8e3db;
  --mm-note-border:    #d33d17;
  --mm-alt:            #f0eee9;

  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --shell:  1160px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- tokens: tema escuro ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #0b0b0a;
    --paper-deep:  #060605;
    --surface:     #131311;
    --ink:         #f3f1ec;
    --ink-70:      rgba(243, 241, 236, .70);
    --ink-45:      rgba(243, 241, 236, .45);
    --ink-20:      rgba(243, 241, 236, .20);
    --line:        rgba(243, 241, 236, .14);
    --accent:      #ff5c2b;
    --accent-ink:  #ff7346;
    --accent-soft: rgba(255, 92, 43, .12);

    --ascii-dim:   rgba(243, 241, 236, .30);
    --ascii-hot:   rgba(255, 92, 43, .85);

    --mm-node:           #171715;
    --mm-node-border:    #3d3c37;
    --mm-text:           #f3f1ec;
    --mm-line:           #8d8b84;
    --mm-cluster:        #101010;
    --mm-cluster-border: #2b2a27;
    --mm-note:           #2b1610;
    --mm-note-border:    #ff5c2b;
    --mm-alt:            #161614;
  }
}

:root[data-theme="dark"] {
  --paper:       #0b0b0a;
  --paper-deep:  #060605;
  --surface:     #131311;
  --ink:         #f3f1ec;
  --ink-70:      rgba(243, 241, 236, .70);
  --ink-45:      rgba(243, 241, 236, .45);
  --ink-20:      rgba(243, 241, 236, .20);
  --line:        rgba(243, 241, 236, .14);
  --accent:      #ff5c2b;
  --accent-ink:  #ff7346;
  --accent-soft: rgba(255, 92, 43, .12);

  --ascii-dim:   rgba(243, 241, 236, .30);
  --ascii-hot:   rgba(255, 92, 43, .85);

  --mm-node:           #171715;
  --mm-node-border:    #3d3c37;
  --mm-text:           #f3f1ec;
  --mm-line:           #8d8b84;
  --mm-cluster:        #101010;
  --mm-cluster-border: #2b2a27;
  --mm-note:           #2b1610;
  --mm-note-border:    #ff5c2b;
  --mm-alt:            #161614;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

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

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

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

/* ---------- utilitários ---------- */
.mono {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
}

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

.sr-only, .skip-link {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  clip-path: none;
  margin: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  z-index: 999;
}

.section-label {
  display: block;
  color: var(--ink-45);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  margin: 0 0 14px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -.015em;
  margin: 0 0 18px;
}

.meta {
  color: var(--ink-45);
  margin: 0;
}
.meta .sep { opacity: .5; padding-inline: .5em; }
.meta .tag { color: var(--accent-ink); }

/* ═══════════════════════ GRADE ASCII ═══════════════════════ */

/* Base compartilhada: a home usa em tela cheia, a publicação
   usa como faixa no cabeçalho. O posicionamento é de cada página. */
.ascii {
  position: absolute;
  inset: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  font-variant-ligatures: none;
}

.ascii--dim { color: var(--ascii-dim); }
.ascii--hot { color: var(--ascii-hot); font-weight: 500; }

/* ═══════════════════════ NAV ═══════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.brand {
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: -.01em;
  margin-right: auto;
}
.brand__dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 26px;
  font-size: .875rem;
}
.nav__links a {
  color: var(--ink-70);
  position: relative;
  transition: color .2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
  color: var(--ink-70);
  font-size: .72rem;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink-20); color: var(--ink); }

.theme-toggle__icon {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

/* ═══════════════════════ FOOTER ═══════════════════════ */
.footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  background: var(--paper-deep);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--ink-45);
}
.footer p { margin: 0; font-size: .72rem; }
.footer__note { color: var(--ink-20); }

/* ═══════════════════════ REVEAL ═══════════════════════ */
.reveal > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in > * {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════ MOVIMENTO REDUZIDO ═══════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal > * { opacity: 1; transform: none; }
  .caret { animation: none; }
}
