.theme-b {
  --type-h1: clamp(3.25rem, 4vw, 3.625rem);
  --type-h2: clamp(2.125rem, 2.65vw, 2.5rem);
  --type-h3: clamp(1.4375rem, 1.8vw, 1.6875rem);
  --type-h4: clamp(1.125rem, 1.35vw, 1.3125rem);
}

.theme-b h1,
.theme-b .article-title,
.theme-b .service-hero h1,
.theme-b .catalog-hero h1,
.theme-b .ai-hero-copy h1 {
  max-width: min(100%, 22ch);
  font-size: var(--type-h1) !important;
  font-weight: 800;
  line-height: 1.08 !important;
}

.theme-b h2 {
  max-width: min(100%, 26ch);
  font-size: var(--type-h2) !important;
  font-weight: 750;
  line-height: 1.17 !important;
}

.theme-b h3 {
  font-size: var(--type-h3) !important;
  font-weight: 700;
  line-height: 1.24 !important;
}

.theme-b h4 {
  font-size: var(--type-h4) !important;
  font-weight: 700;
  line-height: 1.3 !important;
}

.theme-b h1,
.theme-b h2,
.theme-b h3,
.theme-b h4 {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.theme-b .section-heading {
  max-width: 900px;
}

.theme-b .section-heading h2 {
  max-width: min(100%, 26ch);
}

.theme-b .catalog-section .section-heading h2 {
  max-width: min(100%, 30ch);
}

.theme-b .portfolio-summary h3,
.theme-b .publication-card h3 {
  margin: 9px 0 11px;
}

.theme-b .portfolio-details h4 {
  margin: 0 0 8px;
  color: var(--purple-deep);
}

@media (max-width: 900px) {
  .theme-b {
    --type-h1: clamp(2.75rem, 6vw, 3.25rem);
    --type-h2: clamp(1.95rem, 4.5vw, 2.25rem);
    --type-h3: clamp(1.375rem, 3vw, 1.5625rem);
    --type-h4: clamp(1.1rem, 2.5vw, 1.25rem);
  }
}

@media (max-width: 640px) {
  .theme-b {
    --type-h1: clamp(2.125rem, 9.5vw, 2.5rem);
    --type-h2: clamp(1.6875rem, 7.3vw, 1.9375rem);
    --type-h3: clamp(1.3125rem, 5.6vw, 1.5rem);
    --type-h4: clamp(1.0625rem, 4.7vw, 1.1875rem);
  }

  .theme-b h1,
  .theme-b .article-title,
  .theme-b h2,
  .theme-b h3,
  .theme-b h4 {
    max-width: 100%;
  }
}
