:root {
    --primary-color: #269ccc; /* Optimism Blue */
    --secondary-color: #3d3d3f; /* Scuffed Dark Grey */
    --background-color: #f6f5f3; /* Vanilla Grey */
    --section-bg-color: #ffffff;
    --text-color: #3d3d3f; /* Using Scuffed Dark Grey for text */
    --heading-color: #3d3d3f; /* Using Scuffed Dark Grey for headings */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --max-width: 80rem;
    --container-padding: clamp(1rem, 5vw, 2rem);
  }

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

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

  body {
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.75;
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    padding: 0;
    margin: 0;
  }

  .container {
    width: min(var(--max-width), 100% - var(--container-padding) * 2);
    margin-inline: auto;
  }

  h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 1rem;
  }

  h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin-top: 1rem;
    color: var(--primary-color); /* Using Optimism Blue for section headings */
  }

  h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
  }

  p {
    margin-bottom: 1.5rem;
    max-width: 1100px;
  }

  section {
    padding: clamp(2rem, 5vw, 4rem) 0;
    background-color: var(--section-bg-color);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(61, 61, 63, 0.1); /* Subtle border using Scuffed Dark Grey */
    max-width: 97%;
  }

  .header {
    background: var(--secondary-color); /* Using Scuffed Dark Grey for header */
    color: white;
    padding: clamp(2rem, 5vw, 4rem) 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
  }

  .header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary-color) 0%, transparent 100%);
    opacity: 0.1;
  }

  .header h1, .header p {
    color: white;
    margin: 0;
    position: relative;
    z-index: 1;
  }

  .header a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
  }

  .header a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
  }

  figure {
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
  }

  figure:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }

figcaption {
  margin-top: 0.5rem; /* Reduced gap between figure and figcaption */
  font-size: 0.9rem;
  color: var(--secondary-color);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: bold; /* Changed font-weight to bold */
  letter-spacing: 0.02em;
  max-width: 90%;
  line-height: 1.5;
}


  img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1rem 0;
  }

  .chart-description {
    padding: 0 clamp(1rem, 5vw, 2rem);
  }

  #chartGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
  }

  a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
  }

  a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
  }

  @media (max-width: 768px) {
    section {
      margin: 1rem;
    }
    
    .header {
      text-align: center;
    }
    
    .header a {
      display: inline-block;
      margin: 0.5rem;
    }
  }
