@layer base {
  :root {
    /* Color System - Warm Ivory Theme */
    --color-bg-primary: #faf8f5;
    --color-bg-secondary: #f5f2ed;
    --color-bg-tertiary: #efeae3;

    --color-surface: #ffffff;
    --color-surface-hover: #f5f2ed;
    --color-surface-elevated: #ffffff;
    --color-surface-muted: #f5f2ed;

    --color-text-primary: #1a1a18;
    --color-text-secondary: #4a4844;
    --color-text-tertiary: #7a7873;
    --color-text-muted: #a8a6a1;

    --color-border: #e8e4dd;
    --color-border-hover: #dcd8d1;

    --color-accent: #c47a3a;
    --color-accent-hover: #b06a2e;
    --color-accent-muted: #f5e6d3;
    --color-accent-light: #fdf6ef;

    --color-error: #dc2626;
    --color-error-muted: #fef2f2;
    --color-success: #16a34a;
    --color-success-muted: #f0fdf4;

    /* Spacing Scale */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-1-5: 0.375rem; /* 6px */
    --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 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-normal: 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;

    /* Container */
    --container-max: 1400px;
    --container-padding: var(--space-6);

    /* Navigation */
    --nav-height: 72px;
    --nav-height-scrolled: 64px;

    /* Button */
    --btn-height-sm: 40px;
    --btn-height-md: 48px;
    --btn-height-lg: 56px;
    --btn-padding-x-sm: 20px;
    --btn-padding-x-md: 28px;
    --btn-padding-x-lg: 36px;
    --btn-radius: 12px;
    --btn-font-size: 0.9375rem;
    --btn-font-weight: 500;

    /* Form */
    --form-input-height: 48px;
    --form-input-padding: 0 var(--space-4);
    --form-input-radius: 10px;
    --form-input-border: 1px solid var(--color-border);
    --form-input-bg: var(--color-surface);
    --form-input-text: var(--color-text-primary);
    --form-input-placeholder: var(--color-text-muted);
    --form-input-focus-border: var(--color-accent);
    --form-input-focus-ring: 0 0 0 3px var(--color-accent-muted);
    --form-label-gap: var(--space-2);
    --form-error-color: var(--color-error);
    --form-transition: 200ms ease;

    /* Card */
    --card-radius: 16px;
    --card-padding: var(--space-6);
    --card-border: 1px solid var(--color-border);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.06), 0 8px 32px rgba(0, 0, 0, 0.04);
    --card-transition: 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Timeline */
    --timeline-line-width: 2px;
    --timeline-line-color: var(--color-border);
    --timeline-marker-size: 16px;
    --timeline-marker-border: 3px;
    --timeline-gap: var(--space-10);
    --timeline-content-gap: var(--space-6);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg-primary: #1a1a18;
      --color-bg-secondary: #22201d;
      --color-bg-tertiary: #2a2825;

      --color-surface: #22201d;
      --color-surface-hover: #2a2825;
      --color-surface-elevated: #2a2825;
      --color-surface-muted: #2a2825;

      --color-text-primary: #faf8f5;
      --color-text-secondary: #dcd8d1;
      --color-text-tertiary: #a8a6a1;
      --color-text-muted: #7a7873;

      --color-border: #3a3834;
      --color-border-hover: #4a4844;

      --color-accent: #d49050;
      --color-accent-hover: #e8a86a;
      --color-accent-muted: #3d2f1f;
      --color-accent-light: #2d2215;

      --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
      --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
      --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.25);
      --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.3);
    }
  }

  /* Light theme forced (default for this project) */
  :root {
    --theme: light;
  }
}

@layer components {
  /* Section Header - Consistent across all sections */
  .section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-12);
  }

  .section-header__label {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
  }

  .section-header__title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 4vw, var(--text-6xl));
    font-weight: 500;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4);
  }

  .section-header__subtitle {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    margin: 0;
  }

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

  /* Visually hidden utility */
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Focus visible */
  .focus-visible:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  /* Skip link */
  .skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-toast);
    padding: var(--space-2) var(--space-4);
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: top var(--transition-fast);
  }

  .skip-link:focus {
    top: var(--space-4);
  }
}