/**
 * v1.0.5 Design System
 * Foundational design tokens, variables, and utilities
 *
 * This file establishes the visual language for the entire v1.0.5 redesign.
 * All colors, typography, spacing, and animations are defined here for consistency.
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Brand Colors */
  --color-rust: #B5674E;
  --color-rust-light: #C77A61;
  --color-rust-dark: #9F5841;
  --color-teal: #3D5554;
  --color-teal-light: #4A6665;
  --color-teal-dark: #2F4443;
  --color-charcoal: #2B3331;
  --color-charcoal-light: #3A4442;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-off-white: #F5F7F6;
  --color-light-gray: #E8ECEB;
  --color-mid-gray: #A8AFAD;
  --color-dark-gray: #5A6562;

  /* Semantic Colors */
  --color-success: #48BB78;
  --color-warning: #ECC94B;
  --color-error: #F56565;
  --color-info: #4299E1;

  /* Typography Scale */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */

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

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Spacing Scale (8px base unit) */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */
  --space-4xl: 8rem;     /* 128px */

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);

  /* Elevation (colored shadows for brand elements) */
  --shadow-rust: 0 8px 24px rgba(181, 103, 78, 0.15);
  --shadow-rust-lg: 0 12px 32px rgba(181, 103, 78, 0.2);
  --shadow-teal: 0 8px 24px rgba(61, 85, 84, 0.15);

  /* 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: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Easing 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);
  --ease-sharp: cubic-bezier(0.4, 0, 0.6, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Container Max-Width */
  --container-max-width: 1400px;
  --container-padding: var(--space-lg);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'GT Planar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-charcoal);
  background-color: var(--color-white);
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.heading-display {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

.heading-1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
}

.heading-2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
}

.heading-3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
}

.heading-4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
}

.body-large {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.body-base {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.body-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.caption {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
  color: var(--color-dark-gray);
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

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

.section--large {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

.fade-in {
  animation: fadeIn var(--transition-slower) var(--ease-out);
}

.fade-in-up {
  animation: fadeInUp var(--transition-slower) var(--ease-out);
}

.fade-in-down {
  animation: fadeInDown var(--transition-slower) var(--ease-out);
}

.scale-in {
  animation: scaleIn var(--transition-base) var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger animation delay utility classes */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* ==========================================================================
   Glassmorphism Effect
   ========================================================================== */

.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass--dark {
  background: rgba(43, 51, 49, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Interactive States
   ========================================================================== */

.interactive {
  cursor: pointer;
  transition: all var(--transition-base);
}

.interactive:hover {
  transform: translateY(-2px);
}

.interactive:active {
  transform: translateY(0);
}

/* Focus visible (for keyboard navigation) */
*:focus-visible {
  outline: 2px solid var(--color-rust);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Mobile-first approach */
/* xs: 0-479px (default) */
/* sm: 480-767px */
/* md: 768-1023px */
/* lg: 1024-1279px */
/* xl: 1280+ px */

@media (max-width: 767px) {
  :root {
    --container-padding: var(--space-sm);
  }

  .section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }
}

/* ==========================================================================
   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-width: 0;
}

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

.color-rust { color: var(--color-rust); }
.color-teal { color: var(--color-teal); }
.color-charcoal { color: var(--color-charcoal); }
.color-white { color: var(--color-white); }

.bg-rust { background-color: var(--color-rust); }
.bg-teal { background-color: var(--color-teal); }
.bg-off-white { background-color: var(--color-off-white); }
.bg-light-gray { background-color: var(--color-light-gray); }

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
