/* === Base Styles & Design Token System === */

/* 7-Layer Design Token System */
:root {
  /* LAYER 1 - Color Primitives & Semantic Aliases */
  /* Raw primitives */
  --raw-primary: #FF7F00;
  --raw-primary-light: #FF9933;
  --raw-primary-dark: #E6600A;
  --raw-secondary: #040030;
  --raw-secondary-light: #1A1A4A;
  --raw-secondary-dark: #000015;
  --raw-accent: #a855f7;
  --raw-neutral-50: #fafafa;
  --raw-neutral-100: #f5f5f5;
  --raw-neutral-200: #e5e5e5;
  --raw-neutral-300: #d4d4d4;
  --raw-neutral-400: #a3a3a3;
  --raw-neutral-500: #737373;
  --raw-neutral-600: #525252;
  --raw-neutral-700: #404040;
  --raw-neutral-800: #262626;
  --raw-neutral-900: #171717;
  --raw-neutral-950: #0a0a0a;

  /* Semantic aliases (components use ONLY these) */
  --color-primary: var(--raw-primary);
  --color-primary-light: var(--raw-primary-light);
  --color-primary-dark: var(--raw-primary-dark);
  --color-secondary: var(--raw-secondary);
  --color-secondary-light: var(--raw-secondary-light);
  --color-secondary-dark: var(--raw-secondary-dark);
  --color-accent: var(--raw-accent);
  
  /* Dark mode background system */
  --color-bg: var(--raw-secondary);
  --color-bg-secondary: var(--raw-secondary-light);
  --color-bg-surface: rgba(26, 26, 74, 0.6);
  --color-bg-elevated: rgba(26, 26, 74, 0.8);
  --color-bg-overlay: rgba(4, 0, 48, 0.85);
  --color-bg-rgb: 4, 0, 48;
  
  /* Text colors for dark theme */
  --color-text: #ffffff;
  --color-text-secondary: #e5e5e5;
  --color-text-muted: #a3a3a3;
  --color-text-on-dark: #ffffff;
  --color-text-on-light: #1a1a1a;
  --color-text-on-primary: #ffffff;
  --color-text-link: var(--color-primary);
  --color-text-link-hover: var(--color-primary-light);
  
  /* Border and focus */
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-strong: rgba(255, 255, 255, 0.3);
  --color-focus-ring: var(--color-primary);
  
  /* Status colors */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Neutral system for dark theme */
  --color-neutral-50: var(--raw-neutral-950);
  --color-neutral-100: var(--raw-neutral-900);
  --color-neutral-200: var(--raw-neutral-800);
  --color-neutral-300: var(--raw-neutral-700);
  --color-neutral-400: var(--raw-neutral-600);
  --color-neutral-500: var(--raw-neutral-500);
  --color-neutral-600: var(--raw-neutral-400);
  --color-neutral-700: var(--raw-neutral-300);
  --color-neutral-800: var(--raw-neutral-200);
  --color-neutral-900: var(--raw-neutral-100);
  --color-neutral-950: var(--raw-neutral-50);

  /* LAYER 2 - Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  --font-size-7xl: 4.5rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  --line-height-none: 1;
  --line-height-tight: 1.15;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  --letter-spacing-tighter: -0.05em;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;

  /* LAYER 3 - Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* LAYER 4 - Layout */
  --container-max-width: 1200px;
  --container-padding: var(--space-6);
  --navbar-height: 80px;
  --grid-gutter: var(--space-8);
  --sidebar-width: 320px;
  
  --z-base: 1;
  --z-sticky: 50;
  --z-backdrop: 80;
  --z-drawer: 90;
  --z-dropdown: 100;
  --z-modal-backdrop: 190;
  --z-modal: 200;
  --z-toast: 300;

  /* LAYER 5 - Shape */
  --radius-none: 0;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.2), 0 2px 4px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.3), 0 10px 10px -5px rgba(0,0,0,0.1);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.1);
  --shadow-focus-ring: 0 0 0 3px color-mix(in srgb, var(--color-focus-ring) 40%, transparent);
  
  --shadow-neon: 0 0 20px var(--color-primary), 0 0 40px var(--color-primary), 0 0 60px var(--color-primary);
  --shadow-neon-accent: 0 0 20px var(--color-accent), 0 0 40px var(--color-accent);
  
  --border-width: 1px;
  --border-color: var(--color-border);

  /* LAYER 6 - Motion */
  --duration-instant: 75ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-moderate: 350ms;
  --duration-slow: 500ms;
  --duration-slower: 700ms;
  
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.19, 1, 0.22, 1);

  /* LAYER 7 - Component Tokens */
  /* Buttons */
  --btn-padding-y: var(--space-3);
  --btn-padding-x: var(--space-8);
  --btn-radius: var(--radius-lg);
  --btn-font-size: var(--font-size-base);
  --btn-font-weight: var(--font-weight-semibold);
  --btn-sm-padding-y: var(--space-2);
  --btn-sm-padding-x: var(--space-6);
  --btn-lg-padding-y: var(--space-4);
  --btn-lg-padding-x: var(--space-10);
  
  /* Cards */
  --card-padding: var(--space-8);
  --card-radius: var(--radius-xl);
  --card-shadow: var(--shadow-lg);
  --card-shadow-hover: var(--shadow-xl);
  --card-bg: var(--color-bg-surface);
  --card-border: var(--border-width) solid var(--color-border);
  
  /* Glassmorphism cards */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-backdrop: blur(12px);
  
  /* Badges */
  --badge-padding-y: var(--space-1);
  --badge-padding-x: var(--space-3);
  --badge-radius: var(--radius-full);
  --badge-font-size: var(--font-size-xs);
  --badge-font-weight: var(--font-weight-semibold);
  
  /* Inputs */
  --input-height: 3rem;
  --input-padding-x: var(--space-4);
  --input-radius: var(--radius-lg);
  --input-border: var(--border-width) solid var(--color-border);
  --input-bg: var(--color-bg-surface);
  --input-focus-ring: var(--shadow-focus-ring);
  
  /* Sections */
  --section-padding-y: var(--space-20);
  --section-padding-x: var(--space-6);
  
  /* Navigation */
  --nav-link-padding: var(--space-3) var(--space-5);
  --nav-link-font-size: var(--font-size-base);
  
  /* Section Dividers */
  --divider-height: 80px;
  --divider-color: var(--color-bg);
  --divider-accent-color: var(--color-bg-secondary);
  
  /* Accent Elements */
  --accent-line-width: 80px;
  --accent-line-height: 4px;
  --accent-line-color: var(--color-primary);
  --accent-line-radius: var(--radius-full);
  
  /* Image Presentation */
  --img-radius: var(--radius-xl);
  --img-radius-avatar: var(--radius-full);
  
  /* Floating Decorative Elements */
  --blob-opacity: 0.15;
  --blob-size: 500px;
  --blob-color-1: var(--color-primary);
  --blob-color-2: var(--color-accent);
  --orb-size: 300px;
  --orb-glow: var(--shadow-neon);
}

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

html, body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: 0;
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
  color: var(--color-text-link-hover);
}

/* Lists */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Form elements */
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

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

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

::-webkit-scrollbar-track {
  background: var(--color-neutral-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-neutral-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-500);
}

/* Selection */
::selection {
  background: color-mix(in srgb, var(--color-primary) 30%, transparent);
  color: var(--color-text);
}

/* Utility Classes */
.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;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }

.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-x-hidden { overflow-x: hidden !important; }
.overflow-y-hidden { overflow-y: hidden !important; }

.pointer-events-none { pointer-events: none !important; }
.pointer-events-auto { pointer-events: auto !important; }

/* Focus styles */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus-ring);
}