/*
  Resolve Academy — tokens de design (docs/produto/experiencia.md §5 e §6).

  - Cores: claro em :root; escuro com prefers-color-scheme (quando a pessoa não escolheu
    o claro) e com data-theme="dark" (quando escolheu o escuro).
  - Movimento: data-motion="reduce" ou prefers-reduced-motion levam as durações a 0 e
    tiram os deslocamentos (--lift, --press).
  - Contrastes conferidos em tests/integration/web/test_tokens.py e mostrados em /_estilo.
  - Fontes: Geist e Geist Mono servidas pelo Academy (SIL OFL 1.1, fonts/Geist-LICENSE.txt).
*/

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* ── Cores: tema claro ── */
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eef0f2;
  --border: #e2e5e9;
  --border-strong: #868c95;
  --text: #1a1d21;
  --text-2: #52565e;
  --text-3: #656a73;
  --text-4: #b0b4ba;
  --green: #41a500;
  --green-hover: #3a9400;
  --green-ink: #0b0c0e;
  --green-text: #2e7d32;
  --green-bg: rgba(65, 165, 0, 0.1);
  --green-track: rgba(65, 165, 0, 0.16);
  --focus: #2e7d32;
  --new-bg: #fef3c7;
  --new-text: #8a3c0c;
  --updated-border: #e0b341;
  --danger-bg: #fdecec;
  --danger-text: #b42318;
  --stage: #12151b;
  --stage-2: #1b1e25;
  --stage-3: #2a2e37;
  --stage-text: #eceef1;
  --stage-text-2: #a3a7af;
  --stage-green: #6ed228;
  --scrim: rgba(11, 12, 14, 0.45);
  /* O balão vermelho dos menus dos hosts (integracoes/v1/hosts.md §6). No Academy, o
     contador do sino é verde; o vermelho só aparece como ponto de "não lida". */
  --badge-red: #ef4444;
  --badge-red-text: #ffffff;
  --badge-red-ring: rgba(239, 68, 68, 0.25);

  /* ── Sombras ── */
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-3: 0 24px 48px rgba(16, 24, 40, 0.18);

  /* ── Tipografia ── */
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --lh-xs: 1rem;
  --fs-sm: 0.875rem;
  --lh-sm: 1.25rem;
  --fs-base: 1rem;
  --lh-base: 1.5rem;
  --fs-md: 1.125rem;
  --lh-md: 1.625rem;
  --fs-read: 1.125rem;
  --lh-read: 1.875rem;
  --fs-lg: 1.25rem;
  --lh-lg: 1.75rem;
  --fs-xl: 1.5rem;
  --lh-xl: 1.875rem;
  --fs-2xl: 1.875rem;
  --lh-2xl: 2.25rem;
  --fs-3xl: 2.5rem;
  --lh-3xl: 2.75rem;
  --tracking-tight: -0.015em; /* a partir de 20 px */
  --tracking-tighter: -0.02em; /* a partir de 30 px */
  --tracking-caps: 0.07em; /* sobretítulos em maiúsculas */

  /* ── Espaçamento (base 4) ── */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --gap-section: 2rem; /* 40 px a partir de 768 px */
  --gutter: 1rem; /* margens laterais: 16 · 24 · 32 px */

  /* ── Raios ── */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* ── Camadas ── */
  --z-bar: 30;
  --z-menu: 40;
  --z-toast: 50;
  --z-dialog: 60;
  --z-skip: 70;

  /* ── Larguras ── */
  --w-page: 1200px;
  --w-lesson: 1320px;
  --w-admin: 1440px;
  --w-read: 68ch;
  --bar-top: 3.5rem; /* 56 px; 64 px a partir de 768 px */
  --bar-bottom: 4rem; /* barra inferior do celular, sem a área segura */

  /* ── Ícones ── */
  --ico: 1.25rem; /* 20 px na interface */
  --ico-nav: 1.5rem; /* 24 px na barra inferior */
  --ico-tag: 1rem; /* 16 px dentro das etiquetas */

  /* ── Movimento ── */
  --dur-1: 120ms; /* cor, passar do rato, pressionar, foco */
  --dur-2: 180ms; /* menus, dicas, avisos, chips, troca de página */
  --dur-3: 240ms; /* acordeões, painéis, diálogos, barras de progresso */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1); /* só nas celebrações */
  --lift: -3px; /* capas no passar do rato */
  --press: 0.98; /* pressionar um botão */
}

@media (max-width: 479.98px) {
  :root {
    --fs-read: 1.0625rem; /* 17 / 28 abaixo de 480 px */
    --lh-read: 1.75rem;
  }
}

@media (min-width: 768px) {
  :root {
    --gap-section: 2.5rem;
    --gutter: 1.5rem;
    --bar-top: 4rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 2rem;
  }
}

/* ── Tema escuro: pelo sistema, salvo quem escolheu o claro ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1015;
    --surface: #16181f;
    --surface-2: #1c1f27;
    --surface-3: #22252e;
    --border: #2a2d36;
    --border-strong: #737882;
    --text: #e8e9ec;
    --text-2: #a8aab0;
    --text-3: #8d919a;
    --text-4: #4a4d54;
    --green-text: #6ed228;
    --green-bg: rgba(110, 210, 40, 0.12);
    --green-track: rgba(110, 210, 40, 0.16);
    --focus: #6ed228;
    --new-bg: rgba(251, 191, 36, 0.14);
    --new-text: #fcd34d;
    --updated-border: rgba(251, 191, 36, 0.45);
    --danger-bg: rgba(248, 113, 113, 0.14);
    --danger-text: #fca5a5;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.5);
  }
}

/* ── Tema escuro escolhido pela pessoa (mesmos valores do bloco acima) ── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1015;
  --surface: #16181f;
  --surface-2: #1c1f27;
  --surface-3: #22252e;
  --border: #2a2d36;
  --border-strong: #737882;
  --text: #e8e9ec;
  --text-2: #a8aab0;
  --text-3: #8d919a;
  --text-4: #4a4d54;
  --green-text: #6ed228;
  --green-bg: rgba(110, 210, 40, 0.12);
  --green-track: rgba(110, 210, 40, 0.16);
  --focus: #6ed228;
  --new-bg: rgba(251, 191, 36, 0.14);
  --new-text: #fcd34d;
  --updated-border: rgba(251, 191, 36, 0.45);
  --danger-bg: rgba(248, 113, 113, 0.14);
  --danger-text: #fca5a5;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 24px 56px rgba(0, 0, 0, 0.5);
}

/* ── Movimento reduzido: pelo sistema ou pela preferência "Animações: sempre reduzidas" ── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 0ms;
    --dur-2: 0ms;
    --dur-3: 0ms;
    --lift: 0px;
    --press: 1;
  }
}

:root[data-motion="reduce"] {
  --dur-1: 0ms;
  --dur-2: 0ms;
  --dur-3: 0ms;
  --lift: 0px;
  --press: 1;
}
