/* EGOS Design Tokens — v1 */
:root {
  /* Colors — base */
  --bg-deep: #07090d;
  --bg-surface: #0f172a;
  --bg-raised: #1e293b;
  --bg-elevated: #273449;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --border-hover: rgba(56, 189, 248, 0.4);
  --border-accent: rgba(56, 189, 248, 0.55);

  /* Colors — text */
  --text-primary: #e2e8f0;
  --text-strong: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-faint: #475569;

  /* Colors — accents */
  --accent: #38bdf8;
  --accent-glow: #22d3ee;
  --accent-warm: #f5d76e;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-soft-hover: rgba(56, 189, 248, 0.18);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* Type */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Type scale */
  --fs-display-xl: clamp(40px, 5vw, 72px);
  --fs-display-l: clamp(32px, 3.5vw, 52px);
  --fs-h2: clamp(28px, 2.5vw, 40px);
  --fs-h3: 24px;
  --fs-body-l: 18px;
  --fs-body: 16px;
  --fs-micro: 14px;
  --fs-tiny: 12px;

  /* Spacing 8pt grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows / glows */
  --glow-accent: 0 0 0 1px var(--border-hover), 0 12px 40px rgba(56, 189, 248, 0.08);
  --glow-strong: 0 0 0 1px var(--border-accent), 0 16px 56px rgba(56, 189, 248, 0.18);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 0 0 1px var(--border);

  /* Breakpoints (referenced in CSS) */
  --bp-mobile: 480px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-wide: 1440px;
}

/* Resets */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-deep);
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text-strong); }

/* Utility classes */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
}
.display-xl { font-family: var(--font-display); font-size: var(--fs-display-xl); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); margin: 0; }
.display-l  { font-family: var(--font-display); font-size: var(--fs-display-l);  line-height: 1.1;  font-weight: 600; letter-spacing: -0.015em; color: var(--text-strong); margin: 0; }
.h2         { font-family: var(--font-display); font-size: var(--fs-h2);         line-height: 1.15; font-weight: 600; letter-spacing: -0.01em;  color: var(--text-strong); margin: 0; }
.h3         { font-family: var(--font-display); font-size: var(--fs-h3);         line-height: 1.3;  font-weight: 500; color: var(--text-strong); margin: 0; }
.body-l     { font-size: var(--fs-body-l); line-height: 1.55; color: var(--text-primary); }
.muted      { color: var(--text-muted); }
.dim        { color: var(--text-dim); }
.mono       { font-family: var(--font-mono); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: var(--r-md);
  font-weight: 500; font-size: 15px;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #052331; box-shadow: 0 0 0 1px rgba(56,189,248,0.6), 0 12px 32px rgba(56,189,248,0.25); }
.btn-primary:hover { background: var(--accent-glow); transform: translateY(-1px); }
.btn-ghost   { background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--border-hover); background: var(--accent-soft); }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--glow-accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-full);
  font-family: var(--font-mono); font-size: 12px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--border-hover);
}
.chip-success { background: var(--success-soft); color: var(--success); border-color: rgba(74,222,128,.4); }
.chip-warm { background: rgba(245,215,110,.10); color: var(--accent-warm); border-color: rgba(245,215,110,.35); }

.section { padding: var(--sp-24) var(--sp-8); }
.container { max-width: 1200px; margin: 0 auto; }

/* Mobile */
@media (max-width: 768px) {
  .section { padding: var(--sp-16) var(--sp-4); }
  .btn { height: 52px; padding: 0 20px; } /* 44+ touch target */
}


/* ======================================
   Acessibilidade — WCAG 2.1 AA
   ====================================== */

/* Skip link */
.skip-link {
  position: absolute;
  top: -60px; left: 16px;
  z-index: 9999;
  background: var(--accent);
  color: #052331;
  padding: 10px 18px;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 0;
}

/* Focus-visible ring — todos os elementos interativos */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Remove outline para clique (mouse), manter para teclado */
:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure --text-dim não cai abaixo de 4.5:1 em contextos de body text */
/* slate-500 #64748b sobre #07090d tem contraste ~5.1:1 — passa WCAG AA */
/* Para texto de 12px+ em peso 500+ é large text: basta 3:1 (sempre passa) */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cw-launcher.cw-pulse::before { animation: none; }
  .cw-typing span { animation: none; opacity: 0.6; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
