/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --text-color: #1f2937;
  --text-light: #4b5563; /* WCAG AA: 7.56:1 contrast on white */
  --bg-color: #ffffff;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --success-color: #047857; /* WCAG AA: 5.48:1 contrast on white (was #10b981: 2.54:1) */
  --warning-color: #b45309; /* WCAG AA: 5.02:1 contrast on white (was #f59e0b: 2.15:1) */
  --code-bg: #f3f4f6;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

/* 
 * Color Contrast Compliance (WCAG 2.1 AA)
 * ========================================
 * All color combinations meet or exceed WCAG AA standards:
 * - Normal text: 4.5:1 minimum
 * - Large text (18pt+ or 14pt+ bold): 3:1 minimum
 * - UI components: 3:1 minimum
 * 
 * Verified combinations:
 * - --text-color (#1f2937) on white: 14.68:1 ✓
 * - --text-light (#4b5563) on white: 7.56:1 ✓
 * - --primary-color (#2563eb) on white: 5.17:1 ✓
 * - --success-color (#047857) on white: 5.48:1 ✓
 * - --warning-color (#b45309) on white: 5.02:1 ✓
 * - White text on hero gradient (#667eea): 3.66:1 ✓ (large text)
 * - Alert success text (#065f46) on light green (#d1fae5): 6.78:1 ✓
 * - Alert warning text (#92400e) on light yellow (#fef3c7): 6.37:1 ✓
 * - Alert info text (#1e40af) on light blue (#dbeafe): 7.15:1 ✓
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 16px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
nav {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.tagline {
  font-size: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0.95;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.stat {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.stat h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.stat p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Buttons */
.cta {
  background-color: white;
  color: var(--primary-color);
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  display: inline-block;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Main Content */
main {
  padding: 4rem 0;
}

section {
  margin-bottom: 4rem;
}

h1, h2, h3, h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  background-color: white;
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background-color: var(--bg-light);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-color);
}

tbody tr:hover {
  background-color: var(--bg-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Cards */
.card {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Value Props */
.value-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.value-prop {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.value-prop .icon {
  font-size: 1.5rem;
  color: var(--success-color);
  flex-shrink: 0;
}

/* Metrics Display */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.metric-card {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.metric-card h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
}

/* Lists */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  color: var(--text-light);
}

li {
  margin-bottom: 0.5rem;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background-color: #d1fae5;
  border-color: var(--success-color);
  color: #065f46;
}

.alert-warning {
  background-color: #fef3c7;
  border-color: var(--warning-color);
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border-color: var(--primary-color);
  color: #1e40af;
}

/* Footer */
footer {
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 1.125rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.875rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }
}

/* Accessibility */
/* Screen reader only content */
.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;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* Improved focus states for keyboard navigation */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Remove default focus outline when using mouse */
a:focus:not(:focus-visible), button:focus:not(:focus-visible) {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-light: #1f2937;
    --border-color: #000000;
  }
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}
