/* ===================================================
   GLOBAL DESIGN TOKENS - UNIFORMITY KERNEL COMPLIANT
   ===================================================
   Single source of truth for all visual styling.
   No component may override these tokens.
   =================================================== */

:root {
  /* ===================================================
     COLOR SYSTEM - HARMONIOUS PALETTE
     ===================================================
     Sophisticated dark theme with elegant accent colors
     that complement rather than compete with each other
     =================================================== */

  /* Primary Colors - Deep, luxurious blacks */
  --color-primary-bg: #0a0a0a;    /* Pure black */
  --color-secondary-bg: #1a1a1a;  /* Off-black */
  --color-tertiary-bg: #2a2a2a;   /* Elevated surface */

  /* Accent Colors - Sophisticated and complementary */
  --color-accent-primary: #6366f1;    /* Indigo - professional, trustworthy */
  --color-accent-secondary: #8b5cf6;  /* Purple - creative, innovative */
  --color-accent-tertiary: #06b6d4;   /* Cyan - modern, tech-forward */

  /* Hover States - Subtle brightening */
  --color-accent-primary-hover: #7c3aed;   /* Rich purple on hover */
  --color-accent-secondary-hover: #a855f7; /* Brighter purple */
  --color-accent-tertiary-hover: #0891b2;  /* Deeper cyan */

  /* Legacy support - map old gold to new indigo */
  --color-accent-gold: var(--color-accent-primary);
  --color-accent-blue: var(--color-accent-secondary);

  /* Text Colors - Clean hierarchy */
  --color-text-primary: #ffffff;    /* Pure white on dark */
  --color-text-secondary: #e2e8f0;  /* Soft white */
  --color-text-muted: #94a3b8;      /* Muted slate */
  --color-text-accent: var(--color-accent-primary); /* Indigo accent */

  /* Semantic Colors - Harmonious with dark theme */
  --color-success: #22c55e;    /* Green that pops on dark */
  --color-warning: #f59e0b;    /* Warm amber */
  --color-error: #ef4444;      /* Clean red */
  --color-info: var(--color-accent-secondary); /* Purple info */

  /* Interactive States - Subtle and sophisticated */
  --color-hover-overlay: rgba(255, 255, 255, 0.04);  /* Very subtle */
  --color-active-overlay: rgba(255, 255, 255, 0.06); /* Slightly more */
  --color-focus-ring: var(--color-accent-primary);    /* Indigo focus */

  /* ===================================================
     TYPOGRAPHY SCALE - STRICT HIERARCHY
     =================================================== */

  /* Font Families */
  --font-primary: 'Crimson Text', serif;
  --font-heading: 'Calistoga', serif;

  /* Font Sizes - Clamp-based responsive scale */
  --text-xs: clamp(0.75rem, 2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2.5vw, 1rem);
  --text-base: clamp(1rem, 3vw, 1.125rem);
  --text-lg: clamp(1.125rem, 3.5vw, 1.25rem);
  --text-xl: clamp(1.25rem, 4vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 5vw, 2rem);
  --text-3xl: clamp(2rem, 6vw, 2.5rem);
  --text-4xl: clamp(2.5rem, 7vw, 3rem);
  --text-5xl: clamp(3rem, 8vw, 4rem);
  --text-6xl: clamp(4rem, 10vw, 5rem);

  /* Line Heights - Mathematically consistent */
  --leading-tight: 1.2;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
  --leading-loose: 1.8;

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ===================================================
     SPACING SCALE - CONSISTENT RHYTHM
     =================================================== */

  /* Spacing Units - Base 0.25rem (4px) scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ===================================================
     BORDER RADIUS - UNIFORM CORNERS
     =================================================== */

  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 0.25rem;  /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-full: 9999px;

  /* ===================================================
     SHADOWS - CONSISTENT DEPTH
     =================================================== */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ===================================================
     OPACITY & TRANSITIONS - UNIFORM MOTION
     =================================================== */

  /* Opacity Levels */
  --opacity-25: 0.25;
  --opacity-50: 0.5;
  --opacity-75: 0.75;

  /* Transition Timing */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;

  /* Easing Curves */
  --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);

  /* ===================================================
     BREAKPOINTS - RESPONSIVE LOGIC
     =================================================== */

  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ===================================================
     CONTAINER WIDTHS - CONSISTENT LAYOUT
     =================================================== */

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* ===================================================
     SECTION STYLING - UNIFORM WIDTH & CORNERS
     =================================================== */

  --section-max-width: 1200px;
  --section-padding-x: var(--space-4);
  --section-padding-y: var(--space-12);
  --section-border-radius: var(--radius-xl);
  --section-bg: var(--color-secondary-bg);
  --section-border: 1px solid rgba(255, 255, 255, var(--opacity-25));
}

/* ===================================================
   SEMANTIC UTILITY CLASSES - TOKEN-BASED
   =================================================== */

/* Typography Classes */
.text-xs { font-size: var(--text-xs); line-height: var(--leading-snug); }
.text-sm { font-size: var(--text-sm); line-height: var(--leading-normal); }
.text-base { font-size: var(--text-base); line-height: var(--leading-normal); }
.text-lg { font-size: var(--text-lg); line-height: var(--leading-relaxed); }
.text-xl { font-size: var(--text-xl); line-height: var(--leading-relaxed); }
.text-2xl { font-size: var(--text-2xl); line-height: var(--leading-tight); }
.text-3xl { font-size: var(--text-3xl); line-height: var(--leading-tight); }
.text-4xl { font-size: var(--text-4xl); line-height: var(--leading-tight); }
.text-5xl { font-size: var(--text-5xl); line-height: var(--leading-tight); }
.text-6xl { font-size: var(--text-6xl); line-height: var(--leading-tight); }

/* Font Families */
.font-primary { font-family: var(--font-primary); }
.font-heading { font-family: var(--font-heading); }

/* Font Weights */
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

/* Spacing Utilities */
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }
.m-10 { margin: var(--space-10); }
.m-12 { margin: var(--space-12); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }

/* Border Radius */
.rounded-none { border-radius: var(--radius-none); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

/* Transitions */
.transition-fast { transition-duration: var(--transition-fast); transition-timing-function: var(--ease-out); }
.transition-base { transition-duration: var(--transition-base); transition-timing-function: var(--ease-out); }
.transition-slow { transition-duration: var(--transition-slow); transition-timing-function: var(--ease-out); }

/* ===================================================
   SECTION COMPONENTS - UNIFORM STYLING
   =================================================== */

/* Base Section Class - Apply to all sections for consistent width & corners */
.section-uniform {
  max-width: var(--section-max-width);
  margin: 0 auto var(--space-8);
  padding: var(--section-padding-y) var(--section-padding-x);
  background: var(--section-bg);
  border: var(--section-border);
  border-radius: var(--section-border-radius);
  box-shadow: var(--shadow-lg);
}

/* Hero Section - Special case, often full width */
.section-hero {
  max-width: var(--section-max-width);
  margin: 0 auto;
  padding: var(--space-20) var(--section-padding-x);
  background: transparent;
  border: none;
  border-radius: var(--section-border-radius);
}

/* Content Section - For regular content blocks */
.section-content-block {
  max-width: var(--section-max-width);
  margin: 0 auto var(--space-8);
  padding: var(--section-padding-y) var(--section-padding-x);
  background: var(--section-bg);
  border: var(--section-border);
  border-radius: var(--section-border-radius);
  box-shadow: var(--shadow-md);
}

/* Card Section - For card-based layouts */
.section-cards {
  max-width: var(--section-max-width);
  margin: 0 auto var(--space-8);
  padding: var(--section-padding-y) var(--section-padding-x);
  background: transparent;
  border: none;
  border-radius: var(--section-border-radius);
}

/* Force all sections to use uniform styling */
section, .section, [class*="section"] {
  border-radius: var(--section-border-radius) !important;
}

section:not(.section-full-width),
.section:not(.section-full-width),
[class*="section"]:not(.section-full-width) {
  max-width: var(--section-max-width) !important;
  margin: 0 auto var(--space-8) !important;
}

/* ===================================================
   VIEWPORT INTEGRITY - PREVENT STRETCHING
   =================================================== */

/* Prevent horizontal scrolling - this is the key */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
}

/* Box sizing for consistent layout */
*, *::before, *::after {
  box-sizing: border-box !important;
}

/* SVG and media bounding - prevent overflow */
svg, img, video, iframe, embed, object {
  max-width: 100% !important;
  height: auto !important;
}

.container, .container-fluid, [class*="container"] {
  max-width: 70vw !important;
  overflow-x: hidden !important;
}

/* Ensure main content areas don't overflow */
main, section, article {
  overflow-x: hidden !important;
}

/* Prevent positioned elements from extending beyond viewport */
*[style*="position: absolute"], *[style*="position: fixed"] {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Footer integrity - center and prevent stretching */
footer, .footer {
  max-width: 100vw !important;
  overflow-x: hidden !important;
  margin: 0 auto !important;
}

footer *, .footer * {
  max-width: 100% !important;
}

/* Emergency: Any element that might cause horizontal overflow */
.wide-content, .overflow-element, .stretching-element {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Transform safety - prevent bounding box expansion */
*[style*="transform"], *[class*="transform"] {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Negative margin safety */
*[style*="margin-left: -"], *[style*="margin-right: -"] {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ===================================================
   RESPONSIVE BREAKPOINT INTEGRITY - REASONABLE CONSTRAINTS
   =================================================== */

/* Mobile-first responsive design */
@media (max-width: 767px) {
  .container, section, .section {
    padding-left: var(--space-4) !important;
    padding-right: var(--space-4) !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .container, section, .section {
    padding-left: var(--space-6) !important;
    padding-right: var(--space-6) !important;
  }
}

@media (min-width: 1024px) {
  .container, section, .section {
    padding-left: var(--space-8) !important;
    padding-right: var(--space-8) !important;
  }
}

/* Minimal styling only */
