/* Vagas Tech Brasil — design tokens and shared primitives.
 *
 * Dark-first "modern tech" look: near-black surfaces, one electric accent
 * (violet -> cyan gradient for brand moments only), green for good matches.
 * Every page links this file first and keeps only page-specific CSS inline.
 *
 * Token names are the ones the pages already use (--bg, --card, --line, ...),
 * so older rules keep working; new rules should prefer the semantic names
 * below (--surface-*, --brand-*, --radius-*, --shadow-*).
 *
 * Light mode is opt-in: <html data-theme="light"> (toggle stored in
 * localStorage "theme"; see theme.js). Dark is the default.
 */

:root {
  color-scheme: dark;

  /* surfaces: deep navy, glass cards over a soft gradient mesh */
  --bg: #050a18;
  --surface-1: #0b1428;   /* cards (opaque fallback of --glass-bg) */
  --surface-2: #101b33;   /* raised: dialogs, hovered cards, inputs */
  --surface-3: #16233f;   /* chips, pressed */
  --card: var(--surface-1);
  --chip: var(--surface-3);
  --line: #1a2846;
  --line-strong: #263a61;
  --glass-bg: linear-gradient(180deg, rgba(22, 36, 68, .62) 0%, rgba(11, 20, 40, .72) 100%);
  --glass-border: rgba(120, 160, 255, .12);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass-blur: blur(14px) saturate(140%);
  --bg-mesh:
    radial-gradient(1200px 600px at 12% -10%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(34, 211, 238, .08), transparent 60%);

  /* text */
  --text: #e9eefb;
  --muted: #93a3c3;
  --faint: #7a8bb0;       /* >= 4.5:1 on --bg and --surface-2 */

  /* brand */
  --brand-1: #6366f1;     /* indigo */
  --brand-2: #22d3ee;     /* cyan */
  --blue: #3b82f6;
  --brand-gradient: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  --accent: #7aa2ff;
  --accent-strong: #3b82f6;
  --accent-bg: rgba(59, 130, 246, .16);
  --accent-ring: rgba(96, 140, 255, .45);

  /* semantic */
  --ok: #34d399;   --ok-bg: rgba(52, 211, 153, .12);
  --clt: #34d399;  --clt-bg: rgba(52, 211, 153, .12);
  --pj: #c4b5fd;   --pj-bg: rgba(167, 139, 250, .14);
  --new: #fbbf24;  --new-bg: rgba(251, 191, 36, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --err: #f87171;  --err-bg: rgba(248, 113, 113, .12);
  --sim: #22d3ee;  --sim-bg: rgba(34, 211, 238, .12);   /* resume similarity */
  --chart-1: #3b82f6; --chart-2: #22d3ee; --chart-3: #34d399; --chart-4: #fbbf24; --chart-5: #a78bfa;

  /* shape & depth */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
  --glow: 0 0 0 1px var(--accent-ring), 0 8px 30px -8px rgba(59, 130, 246, .5);

  /* type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --fs-xs: 11.5px; --fs-sm: 13px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 28px; --fs-2xl: 44px;

  /* motion (all of it is switched off under prefers-reduced-motion) */
  --ease: cubic-bezier(.2, .7, .2, 1);          /* default: quick start, soft landing */
  --ease-out: cubic-bezier(.16, 1, .3, 1);      /* entrances (expo-out) */
  --ease-in: cubic-bezier(.4, 0, 1, 1);         /* exits */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1); /* small overshoot: pops, counters */
  --dur-fast: 120ms;
  --dur: 160ms;
  --dur-slow: 280ms;
  --dur-enter: 420ms;
  --enter-y: 8px;                               /* page / reveal slide distance */
  --stagger: 45ms;                              /* delay per --i step in .reveal */
  --glow-hover: 0 0 0 1px color-mix(in srgb, var(--accent-ring) 70%, transparent), 0 8px 26px -12px rgba(59, 130, 246, .55);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface-1: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #eef1f6;
  --line: #e3e7ee;
  --line-strong: #cfd6e1;
  --text: #0f1520;
  --muted: #535d6e;
  --faint: #636d80;       /* >= 4.5:1 on white and --surface-3 */
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-bg: rgba(124, 58, 237, .09);
  --accent-ring: rgba(124, 58, 237, .35);
  --ok: #047857;  --ok-bg: #d1fae5;   /* >= 4.5:1 on --ok-bg */
  --clt: #047857; --clt-bg: #d1fae5;
  --pj: #6d28d9;  --pj-bg: #ede9fe;
  --new: #b45309; --new-bg: #fef3c7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --err: #b91c1c; --err-bg: #fee2e2;
  --sim: #0e7490; --sim-bg: #cffafe;
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .82));
  --glass-border: rgba(15, 21, 32, .08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .8);
  --bg-mesh:
    radial-gradient(1200px 600px at 12% -10%, rgba(59, 130, 246, .10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(139, 92, 246, .08), transparent 60%);
  --accent: #2563eb; --accent-strong: #1d4ed8; --accent-bg: rgba(37, 99, 235, .09); --accent-ring: rgba(37, 99, 235, .35);
  --shadow-1: 0 1px 2px rgba(15, 21, 32, .06);
  --shadow-2: 0 12px 32px -12px rgba(15, 21, 32, .18), 0 0 0 1px var(--line);
  --glow: 0 0 0 1px var(--accent-ring), 0 8px 24px -10px rgba(124, 58, 237, .35);
  --glow-hover: 0 0 0 1px var(--accent-ring), 0 8px 22px -12px rgba(37, 99, 235, .35);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: var(--fs)/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  background: var(--bg-mesh), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* animated focus ring on controls (zero specificity: page rules still win) */
:where(a, button, input, select, textarea, summary):focus-visible { animation: focus-ring-in var(--dur-slow) var(--ease-out); }
@keyframes focus-ring-in { from { outline-offset: 6px; outline-color: transparent; } }
::selection { background: var(--accent-bg); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }

/* cross-page navigation: the browser cross-fades same-origin pages (Chrome/Edge
 * 126+, Safari 18.2+); shell.css names the sidebar/topbar so only the content
 * moves. Older browsers get the CSS page-enter fallback from shell.css. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 160ms var(--ease-in) both; }
  ::view-transition-new(root) { animation: vt-in 320ms var(--ease-out) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(var(--enter-y)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
}

/* ---------- primitives (opt-in classes) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn:hover { border-color: var(--accent-ring); background: var(--surface-3); box-shadow: var(--glow-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { border-color: transparent; background: var(--brand-gradient); color: #fff; font-weight: 600; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.08); background: var(--brand-gradient); box-shadow: var(--glow), 0 10px 32px -10px rgba(99, 102, 241, .6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.btn-sm { padding: 4px 10px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }

.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
/* glass card: translucent navy over the page mesh */
.glass {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-highlight), var(--shadow-1);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent-ring); background: var(--accent-bg); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-sim { color: var(--sim); background: var(--sim-bg); }
.badge-pj { color: var(--pj); background: var(--pj-bg); }
.badge-new { color: var(--new); background: var(--new-bg); }
.badge-muted { color: var(--muted); background: var(--surface-3); }

.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.gradient-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img, .brand svg { width: 28px; height: 28px; flex: none; }
