/* ==========================================================================
   CSS BASE & DESIGN SYSTEM - Manuel Zacarias
   ========================================================================== */

/* Color Space Interpolation Support */
:root {
  --in-oklch: ;
  --in-oklab: ;
}

@supports (linear-gradient(in oklch, white, black)) {
  :root {
    --in-oklch: in oklch;
    --in-oklab: in oklab;
  }
}

:root {
  /* Brand Colors (Tier 1 Literal Tokens) */
  --indigo-50: #f5f3ff;
  --indigo-100: #ede9fe;
  --indigo-200: #ddd6fe;
  --indigo-300: #c084fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1; /* Primary Brand */
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;

  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4; /* Secondary Brand Accent */
  --cyan-600: #0891b2;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #0a0f1c; /* Refined Dark BG */

  /* Semantic UI Tokens (Tier 2/3) */
  --color-primary: var(--indigo-500);
  --color-primary-hover: var(--indigo-600);
  --color-accent: var(--cyan-500);
  --color-accent-hover: var(--cyan-600);

  --bg-primary: var(--slate-950);
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  
  --text-primary: var(--slate-50);
  --text-secondary: var(--slate-400);
  --text-muted: var(--slate-500);

  --card-bg: rgba(31, 41, 55, 0.4);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --card-shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.15);

  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-base: clamp(0.95rem, 0.91rem + 0.13vw, 1.1rem); /* Fluid base text size */

  --fs-h1: clamp(2rem, 1.57rem + 2.14vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 1.34rem + 0.8vw, 2.5rem);
  --fs-h3: clamp(1.3rem, 1.14rem + 0.49vw, 1.85rem);
  --fs-p: clamp(0.95rem, 0.91rem + 0.13vw, 1.1rem);

  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --container-max-width: 87.5rem; /* 1400px for Ultra-wide containment */
}

/* Modern Reset & Base Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--slate-800);
  border-radius: var(--border-radius-full);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-700);
}

/* Typographical hierarchy with Fluid Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  font-size: var(--fs-p);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

ul {
  list-style: none;
}

/* Screen readers helper */
.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;
}
