/* ==========================================================================
   MoonLayers — tokens de design e temas
   Carregue este arquivo ANTES de styles.css e moon.css.

   Temas: o atributo data-theme no <html> recebe "dark", "light" ou "black".
   /js/theme.js define o atributo antes da pintura, a partir da escolha salva
   (Sistema, Escuro, Claro, Preto). Sem JavaScript, vale o tema escuro.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* Tema escuro (padrão). Também vale dentro das "ilhas" que imitam a interface
   do After Effects e do painel, que continuam escuras em qualquer tema. */
:root,
:is(.ae, .bx, .px__viewport, .px__bar, .xp__frame, .xp__zoom, .custom__try, .duo, .shot, .edpromo__shot, .lightbox) {
  color-scheme: dark;

  --g-0: #0b0c0f;          /* fundo de página */
  --g-1: #101116;          /* faixa alternada, rodapé, barra lateral, campos */
  --g-2: #15171d;          /* superfície: painéis, cartões */
  --g-3: #1c1f27;          /* superfície elevada */
  --g-4: #262a34;          /* hover, controle ativo */
  --g-5: #343946;          /* trilhos, bordas fortes */

  --ink-rgb: 236 235 241;
  --ink: #ecebf1;          /* 15:1 sobre --g-2 */
  --ink-2: #b4b5c1;        /* 8.8:1 */
  --ink-3: #8a8c9b;        /* 5.4:1 */
  --ink-inverse: #0b0c0f;

  --v-rgb: 139 108 255;
  --v-300: #c8bbff;        /* violeta como texto/ícone */
  --v-400: #a892ff;
  --v-500: #8b6cff;
  --v-600: #7253f0;        /* fundo do botão primário (branco 5:1) */
  --v-700: #5a3fd0;
  --on-accent: #ffffff;

  --ok: #56d3a4;   --warn: #f1b851;   --bad: #ff7385;   --info: #74b8ff;
  --danger-bg: #b8334a; --danger-bg-hover: #cf3e57;

  --nav-bg: rgb(11 12 15 / .86);
  --shadow-rgb: 0 0 0;
  --shadow-a: .45;
}

[data-theme="black"] {
  color-scheme: dark;
  --g-0: #000000; --g-1: #060607; --g-2: #0c0c0e; --g-3: #141417; --g-4: #1d1d21; --g-5: #2c2c32;
  --nav-bg: rgb(0 0 0 / .88);
  --shadow-a: .6;
}

[data-theme="light"] {
  color-scheme: light;
  --g-0: #ffffff; --g-1: #f6f6f8; --g-2: #ffffff; --g-3: #f2f2f5; --g-4: #e8e8ee; --g-5: #d3d4dc;

  --ink-rgb: 17 18 22;
  --ink: #111216;          /* 18:1 sobre branco */
  --ink-2: #484a55;        /* 9:1 */
  --ink-3: #686a76;        /* 5.4:1 */
  --ink-inverse: #ffffff;

  --v-rgb: 98 70 230;
  --v-300: #4f33c4;        /* violeta como texto: 7.7:1 */
  --v-400: #5b3fd6;
  --v-500: #6246e6;
  --v-600: #5b3fd6;
  --v-700: #4a31b8;
  --on-accent: #ffffff;

  --ok: #0f7a56;   --warn: #8a5a00;   --bad: #c0213a;   --info: #1b5fc2;
  --danger-bg: #c0213a; --danger-bg-hover: #a51a31;

  --nav-bg: rgb(255 255 255 / .88);
  --shadow-rgb: 20 20 40;
  --shadow-a: .1;
}

/* Valores derivados: dependem do tema, por isso ficam fora dos blocos acima. */
:root,
:is(.ae, .bx, .px__viewport, .px__bar, .xp__frame, .xp__zoom, .custom__try, .duo, .shot, .edpromo__shot, .lightbox) {
  --line-soft: rgb(var(--ink-rgb) / .07);
  --line: rgb(var(--ink-rgb) / .11);
  --line-strong: rgb(var(--ink-rgb) / .19);
  --hover: rgb(var(--ink-rgb) / .04);

  --v-wash: rgb(var(--v-rgb) / .12);
  --v-wash-strong: rgb(var(--v-rgb) / .2);
  --v-line: rgb(var(--v-rgb) / .35);
  --v-ring: rgb(var(--v-rgb) / .45);

  --ok-wash: color-mix(in srgb, var(--ok) 12%, transparent);    --ok-line: color-mix(in srgb, var(--ok) 35%, transparent);
  --warn-wash: color-mix(in srgb, var(--warn) 12%, transparent); --warn-line: color-mix(in srgb, var(--warn) 35%, transparent);
  --bad-wash: color-mix(in srgb, var(--bad) 11%, transparent);  --bad-line: color-mix(in srgb, var(--bad) 35%, transparent);
  --info-wash: color-mix(in srgb, var(--info) 11%, transparent); --info-line: color-mix(in srgb, var(--info) 35%, transparent);

  --shadow-1: 0 1px 2px rgb(var(--shadow-rgb) / var(--shadow-a));
  --shadow-2: 0 12px 32px -12px rgb(var(--shadow-rgb) / calc(var(--shadow-a) * 1.6));
  --shadow-3: 0 30px 70px -24px rgb(var(--shadow-rgb) / calc(var(--shadow-a) * 2));

  /* Apelidos de compatibilidade: o HTML e o JavaScript existentes usam estes
     nomes em estilos inline (ex.: style="color:var(--dim)"). */
  --bg: var(--g-0);
  --bg-2: var(--g-1);
  --surface: var(--g-2);
  --surface-2: var(--g-3);
  --line-2: var(--line-strong);
  --text: var(--ink);
  --muted: var(--ink-2);
  --dim: var(--ink-3);
  --accent: var(--v-500);
  --accent-2: var(--v-400);
  --accent-3: var(--v-300);
  --accent-glow: rgb(var(--v-rgb) / .3);
}

/* Ilhas escuras: fixam a cor do texto herdada da página. */
:is(.ae, .bx, .px__viewport, .px__bar, .xp__frame, .xp__zoom, .custom__try, .duo, .shot, .edpromo__shot, .lightbox) { color: var(--ink); }

:root {
  /* Tipografia: uma família; pesos e tamanhos fazem a hierarquia. */
  --font-display: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font: var(--font-body);
  --serif: var(--font-display);
  --mono: var(--font-mono);

  --fs-1: 12px; --fs-2: 13px; --fs-3: 14px; --fs-4: 15px; --fs-5: 17px; --fs-6: 20px;
  --fs-7: clamp(26px, 3vw, 32px);
  --fs-8: clamp(32px, 4.6vw, 54px);
  --fs-9: clamp(40px, 6.4vw, 80px);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 80px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --nav-h: 64px;

  --r-1: 4px; --r-2: 8px; --r-3: 10px; --r-4: 14px; --r-pill: 999px;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-1: .12s; --t-2: .18s; --t-3: .3s;

  --ctl-h: 40px; --ctl-h-sm: 32px; --ctl-h-lg: 46px;

  /* Mantidos por compatibilidade com estilos herdados; sem efeito visual. */
  --glow: none;
  --layer-violet: var(--v-500); --layer-aqua: #4cc9d6; --layer-peach: #f59a6b; --layer-lime: #a6d95b; --layer-rose: #ef6fa5;
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-1: 0s; --t-2: 0s; --t-3: 0s; }
}
