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

/* CSS Variables - Matched to health-samurai.io */
:root {
  /* Colors - WCAG AA compliant (4.5:1 contrast ratio) */
  --color-primary: #c9362b;           /* Darkened from #EA4A35 for 4.5:1 contrast on white */
  --color-primary-dark: #a82d24;
  --color-primary-light: #fef2f0;
  --color-primary-vibrant: #EA4A35;   /* Original brand color for decorative use only */
  --color-secondary: #0066FF;
  --color-text: #1a1a1a;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f7;
  --color-bg-light: #f5f5f5;
  --color-border: #ebebeb;
  --color-border-dark: #e0e0e0;

  /* Typography - Gotham Pro style */
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'Monaco', monospace;

  /* Font sizes - from original */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 48px;
  --text-5xl: 64px;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Container */
  --container-max: 1200px;
  --container-padding: 32px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 21px;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Typography - matched to original */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--color-text);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-5xl);
  line-height: 80px;
}

h2 {
  font-size: var(--text-4xl);
  line-height: 1.2;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 700;
}

p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Links in text blocks should have underline for accessibility */
p a, .text-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

p a:hover, .text-link:hover {
  text-decoration: underline;
}

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

ul, ol {
  list-style: none;
}

strong {
  font-weight: 700;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Buttons - matched to original */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: white;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid rgba(53, 59, 80, 0.1);
  font-weight: 400;
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-lg {
  padding: 16px 32px;
  font-size: var(--text-base);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition-fast);
}

.btn-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Cards - matched to original */
.card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 40px;
  border: 1px solid var(--color-border);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: 4px;
  background-color: var(--color-bg-alt);
  color: var(--color-text-light);
}

/* Section */
.section {
  padding: 80px 0;
}

.section-alt {
  background-color: var(--color-bg-alt);
}

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

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  margin-bottom: var(--space-4);
}

.section-title p {
  color: var(--color-text-light);
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex */
.flex { display: flex; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Form */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

.text-muted { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-white { color: white; }

.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* Screen reader only - visually hidden but accessible */
.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;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 48px;
    --text-4xl: 36px;
  }

  h1 { line-height: 1.2; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --text-5xl: 36px;
    --text-4xl: 28px;
    --container-padding: 20px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }
}
