/* ==========================================================================
   ROBOTICMINDS - DESIGN SYSTEM & TOKENS
   Based on guidelines: color-theory, modern-css, web-design-fundamentals, a11y
   ========================================================================== */

:root {
  /* ---------------- Brand Colors (Extraídas do Isotipo, Lettering e Mockups) ---------------- */
  --brand-cyan-vibrant: #38bdf8;
  --brand-cyan: #0284c7;
  --brand-cyan-dark: #0369a1;
  --brand-blue: #2563eb;
  --brand-blue-deep: #1d4ed8;
  --brand-blue-dark: #1e3a8a;
  --brand-charcoal: #2d2c31;     /* Tom oficial do Lettering */
  --brand-slate-dark: #1e293b;
  --brand-slate-deep: #0f172a;
  
  /* ---------------- Light Theme Semantic Colors (WCAG 2.1 AAA Contrast) ---------------- */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #0f172a;       /* 15.6:1 ratio vs white (AAA) */
  --text-secondary: #334155;     /* 8.9:1 ratio vs white (AAA) */
  --text-muted: #64748b;         /* 4.5:1+ ratio vs white (AA) */
  --text-inverse: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-default: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #0284c7;

  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-primary-light: #e0f2fe;
  
  --color-accent: #1d4ed8;
  --color-accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 45%, #1d4ed8 100%);
  --color-hero-glow: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(2, 132, 199, 0.08) 50%, transparent 80%);

  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  --color-info: #0284c7;

  /* ---------------- 8px Grid Spatial Tokens ---------------- */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */

  /* ---------------- Typography Tokens ---------------- */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --fs-sm: clamp(0.875rem, 0.8rem + 0.35vw, 0.9375rem);
  --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --fs-md: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --fs-lg: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --fs-2xl: clamp(1.875rem, 1.5rem + 1.8vw, 2.75rem);
  --fs-3xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
  --fs-hero: clamp(2.5rem, 1.8rem + 3.5vw, 4.25rem);

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.6;
  --lh-loose: 1.75;

  /* ---------------- Shadows & Elevations ---------------- */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.35);
  --shadow-card-hover: 0 20px 30px -10px rgba(2, 132, 199, 0.18);

  /* ---------------- Radii ---------------- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ---------------- Transitions ---------------- */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---------------- Layout Max Width ---------------- */
  --container-max: 1280px;
  --container-narrow: 960px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* ==========================================================================
   Dark Theme Overrides (Inspirado no Cartão de Visita e Camiseta Preta)
   ========================================================================== */
[data-theme="dark"] {
  --bg-page: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #26334a;
  --bg-surface-subtle: #131d30;
  --bg-surface-glass: rgba(30, 41, 59, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-subtle: #243044;
  --border-default: #334155;
  --border-strong: #475569;
  --border-focus: #38bdf8;

  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;
  --color-primary-light: rgba(56, 189, 248, 0.15);

  --color-accent: #0284c7;
  --color-accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 45%, #2563eb 100%);
  --color-hero-glow: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(37, 99, 235, 0.12) 50%, transparent 80%);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 24px -3px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 35px rgba(56, 189, 248, 0.45);
  --shadow-card-hover: 0 20px 30px -10px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: light dark;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Accessibility & Focus-Visible Styles
   ========================================================================== */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}

@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;
  }
}

/* ==========================================================================
   Base Layout Helpers
   ========================================================================== */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container-max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - (var(--gutter) * 2), var(--container-narrow));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-header__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.section-header__title {
  font-size: var(--fs-2xl);
  margin-bottom: 1rem;
}

.section-header__subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

/* Gradient Text Helper */
.text-gradient {
  background: var(--color-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ==========================================================================
   Accessible Skip Link (Keyboard Navigation)
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1.5rem;
  background: var(--color-primary);
  color: #ffffff !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  z-index: 99999;
  text-decoration: none;
  box-shadow: var(--shadow-xl);
  transition: top var(--transition-fast);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1.5rem;
  outline: 3px solid var(--brand-cyan-vibrant);
  outline-offset: 3px;
}

