/* === BASE STYLES === */
/* CSS Custom Properties, Reset, Fonts, Colors, Typography */

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Typography Scale - Unified across all pages */
  --font-size-xs: clamp(0.75rem, 0.5vw + 0.65rem, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.75vw + 0.75rem, 1rem);
  --font-size-base: clamp(1rem, 1vw + 0.85rem, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1.5vw + 0.9rem, 1.375rem);
  --font-size-xl: clamp(1.25rem, 2vw + 1rem, 1.75rem);
  --font-size-2xl: clamp(1.5rem, 3vw + 1.2rem, 2.25rem);
  --font-size-3xl: clamp(2rem, 4vw + 1.5rem, 3rem);
  --font-size-4xl: clamp(2.5rem, 6vw + 2rem, 4rem);
  --font-size-5xl: clamp(3rem, 8vw + 2.5rem, 6rem);
  --font-size-6xl: clamp(4rem, 12vw + 3rem, 8rem);

  /* Spacing Scale - Consistent fluid spacing */
  --space-xs: clamp(0.25rem, 0.5vw + 0.125rem, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw + 0.25rem, 1rem);

  /* Colors - Sentinel Peak Brand Palette (from logo) */
  --color-bg: #0f0f0f;
  --color-surface: #1a1a1a;
  --color-primary: #2c8b8b;
  --color-primary-light: #3fa5a5;
  --color-primary-dark: #1f6a6a;
  --color-accent: #2c8b8b;
  --color-warning: #d97706;
  --color-text: #ffffff;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #888888;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-divider: rgba(255, 255, 255, 0.05);
  --space-md: clamp(1rem, 2vw + 0.5rem, 2rem);
  --space-lg: clamp(1.5rem, 3vw + 0.75rem, 3rem);
  --space-xl: clamp(2rem, 4vw + 1rem, 4rem);
  --space-2xl: clamp(3rem, 6vw + 1.5rem, 6rem);
  --space-3xl: clamp(4rem, 8vw + 2rem, 8rem);
  --space-4xl: clamp(6rem, 12vw + 3rem, 12rem);

  /* Grid System */
  --grid-max-width: 1200px;
  --grid-max-width-large: 1400px;
  --grid-gutter: clamp(1rem, 4vw, 2rem);
  --grid-margin: clamp(1rem, 5vw, 3rem);

  /* Colors - Harmonized Sentinel Peak Brand Palette */
  --color-bg: #0c0c0c;
  --color-surface: rgba(255, 255, 255, 0.02);
  --color-primary: #2c8b8b;
  --color-primary-light: #3fa5a5;
  --color-primary-dark: #1f6a6a;
  --color-accent: #44c3c3;
  --color-warning: #d97706;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-text-secondary: #e5e5e5;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-light: rgba(255, 255, 255, 0.05);

  /* Glassmorphism Properties */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(44, 139, 139, 0.4);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --glass-shadow-hover: 0 15px 40px rgba(44, 139, 139, 0.2);

  /* Transitions - Enhanced for smooth interactions */
  --transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-medium: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Border Radius - Consistent rounded corners */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Animation Timing Functions */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* === GLOBAL RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-base);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  font-feature-settings:
    'kern' 1,
    'liga' 1;
  text-rendering: optimizeLegibility;
}

/* === FLUID TYPOGRAPHY === */
h1,
.h1 {
  font-size: var(--font-size-6xl);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h2,
.h2 {
  font-size: var(--font-size-4xl);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3,
.h3 {
  font-size: var(--font-size-2xl);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h4,
.h4 {
  font-size: var(--font-size-xl);
  font-weight: 400;
  line-height: 1.3;
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-xs {
  font-size: var(--font-size-xs);
}

/* === GLASSMORPHISM UTILITIES === */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary-light),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-5px) translateZ(10px);
  box-shadow: var(--glass-shadow-hover);
}

.glass-card:hover::before {
  opacity: 1;
}

/* === SCROLL-TRIGGERED ANIMATIONS === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all var(--transition-slow);
}

.animate-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all var(--transition-slow);
}

.animate-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition-slow);
}

.animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* === ANIMATION DELAYS === */
.delay-100 {
  transition-delay: 0.1s;
}
.delay-200 {
  transition-delay: 0.2s;
}
.delay-300 {
  transition-delay: 0.3s;
}
.delay-400 {
  transition-delay: 0.4s;
}
.delay-500 {
  transition-delay: 0.5s;
}

/* === ENHANCED ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale,
  .glass-card {
    transition: none;
    transform: none;
    opacity: 1;
  }

  /* Disable stat-number animations for reduced motion users */
  .stat-number[data-no-animation] {
    animation: none !important;
    background: var(--color-primary-light) !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: var(--color-primary-light) !important;
  }

  /* Simplify hover effects */
  .stat-item:hover .stat-number[data-no-animation] {
    transform: none !important;
    animation: none !important;
  }
}

/* === ENHANCED COLOR CONTRAST FOR ACCESSIBILITY === */
@media (prefers-contrast: high) {
  .stat-number {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) !important;
  }

  .stat-number[data-no-animation] {
    background: #ffffff !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #ffffff !important;
    animation: none !important;
  }

  .stat-label {
    color: rgba(255, 255, 255, 0.95) !important;
  }

  .stat-item {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(0, 0, 0, 0.3) !important;
  }

  .stat-item:hover {
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(0, 0, 0, 0.5) !important;
  }
}

/* === FOCUS MANAGEMENT FOR STAT ELEMENTS === */
.stat-item:focus-within {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
  border-color: rgba(44, 139, 139, 0.6);
}

/* === PRINT STYLES FOR STAT ELEMENTS === */
@media print {
  .stat-number {
    color: #000000 !important;
    text-shadow: none !important;
    filter: none !important;
    background: transparent !important;
    -webkit-text-fill-color: #000000 !important;
  }

  .stat-number[data-no-animation] {
    background: transparent !important;
    color: #000000 !important;
    animation: none !important;
  }

  .stat-item {
    background: transparent !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .stat-label {
    color: #666666 !important;
  }
}

/* === UTILITY CLASSES === */
.story-highlight {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  /* Improve touch targets */
  .btn {
    min-height: 44px;
    padding: var(--space-md) var(--space-lg);
  }

  /* Optimize text size for mobile */
  h1,
  .h1 {
    font-size: var(--font-size-3xl);
  }

  h2,
  .h2 {
    font-size: var(--font-size-2xl);
  }

  /* Better spacing on mobile */
  .section {
    padding: var(--space-3xl) 0;
  }

  /* Glass effects simplified for performance */
  .glass-card {
    backdrop-filter: blur(10px);
  }

  /* Reduce animations on mobile for performance */
  .animate-on-scroll,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale {
    transition-duration: 0.3s;
  }
}

@media (max-width: 480px) {
  .btn {
    font-size: var(--font-size-sm);
    padding: var(--space-sm) var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }
}
