/* ============================================================================
   PLAYWEBAI · Design Tokens (CSS variables)
   ----------------------------------------------------------------------------
   Dark-first · hi-tech AI marketplace
   v1.0 · 2026-05-21 · Tâmires (Squad Magenta)
   Mantém paridade com tokens definidos em DESIGN.md
   ============================================================================ */

/* -------- FONTS -------- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Lato:wght@100;300;400;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* -------- DARK THEME (default) -------- */
:root,
:root[data-theme="dark"] {
  /* Brand · PlayCenter heritage blue */
  --brand-pc-blue: #1DA0F1;
  --brand-pc-blue-deep: #0E7BC4;
  --brand-pc-blue-soft: #A8DAF6;

  /* Surfaces · dark hierarchy */
  --bg: #080B12;
  --surface-0: #11151F;
  --surface-1: #1A1F2C;
  --surface-2: #242A38;
  --surface-3: #2F3645;
  --border: #2A3142;
  --border-strong: #3A4254;

  /* Text */
  --text: #F4F6FA;
  --text-soft: #C8CFDC;
  --text-muted: #969EB0; /* era #7A8294 (4.27:1, reprova WCAG AA nos cards); #969EB0 dá ≥4.5:1 em todas as surfaces */
  --text-dim: #525968;

  /* Accent · cyan neon hi-tech */
  --accent-cyan: #00E5FF;
  --accent-cyan-dim: #0095A8;
  --accent-cyan-glow: rgba(0, 229, 255, 0.18);

  /* Semantic */
  --success: #3ECF8E;
  --warning: #F5A524;
  --danger: #F31260;
  --info: #3294F9;

  /* Logo helpers */
  --pw-symbol-color: #FFFFFF;
  --pw-play-fill: #333333;

  /* Chrome · topbar translúcida (pareado claro/escuro — SL-T-HDR1: fundo era hardcoded
     rgba(8,11,18,.7) e no tema claro deixava logo/nav ilegíveis) */
  --nav-bg: rgba(8, 11, 18, 0.7);
}

/* -------- LIGHT THEME (optional toggle) -------- */
:root[data-theme="light"] {
  --bg: #FAFBFC;
  --surface-0: #FFFFFF;
  --surface-1: #F4F6FA;
  --surface-2: #ECEFF4;
  --surface-3: #DDE2EB;
  --border: #E5E8EE;
  --border-strong: #D0D5DD;

  --text: #0F1320;
  --text-soft: #3A4254;
  --text-muted: #5A616E; /* era #6B7280 (4.04:1, reprova AA no light); #5A616E dá ≥5:1 */
  --text-dim: #9CA3AF;

  --brand-pc-blue: #0E7BC4;
  --brand-pc-blue-deep: #075F9B;

  --accent-cyan: #0095A8;
  --accent-cyan-dim: #00E5FF;
  --accent-cyan-glow: rgba(0, 149, 168, 0.15);

  --pw-symbol-color: #1A1A1A;
  --pw-play-fill: #C15F3C;

  --nav-bg: rgba(250, 251, 252, 0.82);
}

/* -------- TYPOGRAPHY SCALE -------- */
:root {
  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-wordmark: 'Lato', sans-serif;

  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.875rem;    /* 14 */
  --text-base: 1rem;      /* 16 */
  --text-lg: 1.125rem;    /* 18 */
  --text-xl: 1.25rem;     /* 20 */
  --text-2xl: 1.5rem;     /* 24 */
  --text-3xl: 1.875rem;   /* 30 */
  --text-4xl: 2.25rem;    /* 36 */
  --text-5xl: 3rem;       /* 48 */
  --text-6xl: 3.75rem;    /* 60 */
  --text-7xl: 4.5rem;     /* 72 */

  --tracking-mono-tight: -0.04em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-mono-loose: 0.05em;
  --tracking-wordmark: 0.2em;

  --leading-mono-tight: 1.1;
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-body: 1.55;
  --leading-relaxed: 1.7;
}

/* -------- SPACING (4/8 grid) -------- */
:root {
  --space-0: 0;
  --space-px: 1px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
}

/* -------- RADIUS -------- */
:root {
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* -------- ELEVATION (dark-aware) -------- */
:root {
  --shadow-sm: 0 0 0 1px var(--border);
  --shadow-md: 0 0 0 1px var(--border-strong), 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 0 0 1px var(--border-strong), 0 16px 48px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 2px var(--accent-cyan-glow), 0 0 24px var(--accent-cyan-glow);
  --shadow-neon-blue: 0 0 24px rgba(29, 160, 241, 0.35);
}

/* -------- MOTION -------- */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --dur-instant: 80ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 360ms;
  --dur-hero: 800ms;
}

/* -------- RESET / BASE -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-cyan); text-decoration: none; }
a:hover { color: var(--accent-cyan-dim); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* -------- HEADINGS -------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-mono-tight);
  line-height: var(--leading-mono-tight);
  color: var(--text);
}
h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }

/* -------- LANG HELPERS -------- */
[data-lang-only] { display: none; }
[data-lang="pt"] [data-lang-only="pt"],
[data-lang="en"] [data-lang-only="en"],
[data-lang="es"] [data-lang-only="es"] { display: inline; }
[data-lang="pt"] [data-lang-only="pt"].block,
[data-lang="en"] [data-lang-only="en"].block,
[data-lang="es"] [data-lang-only="es"].block { display: block; }

/* -------- A11Y -------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface-2); color: var(--text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 9999;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
