/* Balanced enterprise typography scale
   Reduces oversized display text while preserving clear hierarchy and readability.
*/

:root {
  --type-display: clamp(2.35rem, 3.75vw, 3.5rem);
  --type-page-title: clamp(2.15rem, 3.3vw, 3.25rem);
  --type-section: clamp(1.6rem, 2.15vw, 2.35rem);
  --type-section-emphasis: clamp(1.7rem, 2.3vw, 2.5rem);
  --type-feature-title: clamp(1.5rem, 2vw, 2rem);
  --type-card-title: clamp(1.08rem, 1.2vw, 1.22rem);
  --type-small-title: clamp(1rem, 1.1vw, 1.16rem);
}

/* Core hierarchy */
h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2 {
  line-height: 1.13;
  letter-spacing: -.042em;
}

h1 {
  font-size: var(--type-page-title);
}

h2 {
  font-size: var(--type-section);
}

h3 {
  font-size: var(--type-card-title);
  line-height: 1.24;
  letter-spacing: -.025em;
}

/* Main portfolio */
.hero h1 {
  max-width: 760px;
  font-size: var(--type-display);
  line-height: 1.08;
  letter-spacing: -.052em;
}

.hero-lead {
  max-width: 690px;
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.72;
}

.console-heading h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.18;
}

.metrics strong {
  font-size: clamp(1.55rem, 2.3vw, 2.2rem);
  line-height: 1.06;
}

.section-heading h2,
.gallery-section-heading h2 {
  max-width: 780px;
  font-size: var(--type-section);
  line-height: 1.16;
}

.section-heading > p,
.gallery-section-heading > p {
  font-size: clamp(.91rem, 1vw, .98rem);
  line-height: 1.72;
}

.expertise-card h3,
.capability-group h3,
.case-card h3,
.timeline-content h3,
.role-heading h3,
.credentials-panel h3 {
  font-size: var(--type-card-title);
  line-height: 1.25;
}

.protocol-research-card h3 {
  font-size: clamp(1.45rem, 2vw, 1.95rem);
  line-height: 1.18;
}

.methodology-copy h2 {
  font-size: var(--type-section-emphasis);
  line-height: 1.14;
}

.methodology-steps h3 {
  font-size: var(--type-small-title);
  line-height: 1.28;
}

.case-study h3 {
  font-size: var(--type-feature-title);
  line-height: 1.16;
}

.recognition-summary h3 {
  font-size: clamp(1.65rem, 2.45vw, 2.3rem);
  line-height: 1.18;
}

.recognition-numbers strong,
.gallery-stats strong {
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
}

.contact-copy h2 {
  max-width: 740px;
  font-size: var(--type-section-emphasis);
  line-height: 1.14;
}

/* Recognition gallery */
.gallery-hero h1 {
  max-width: 820px;
  font-size: var(--type-page-title);
  line-height: 1.1;
  letter-spacing: -.048em;
}

.gallery-hero-copy > p:not(.eyebrow) {
  font-size: clamp(.98rem, 1.15vw, 1.08rem);
  line-height: 1.72;
}

.gallery-overview h2 {
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  line-height: 1.22;
}

.gallery-card h3 {
  font-size: clamp(1.02rem, 1.15vw, 1.15rem);
  line-height: 1.28;
}

/* Defensive case-study hub */
.technical-hero h1 {
  max-width: 850px;
  font-size: var(--type-page-title);
  line-height: 1.1;
  letter-spacing: -.048em;
}

.technical-hero-copy > p:not(.eyebrow) {
  font-size: clamp(.96rem, 1.1vw, 1.06rem);
  line-height: 1.72;
}

.technical-overview h2 {
  font-size: clamp(1.3rem, 1.8vw, 1.55rem);
  line-height: 1.22;
}

.technical-case h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.05rem);
  line-height: 1.18;
}

.technical-case-grid h3 {
  font-size: .92rem;
  line-height: 1.3;
  letter-spacing: -.012em;
}

/* 404 page */
.error-panel h1 {
  font-size: clamp(2.2rem, 4vw, 3.45rem);
  line-height: 1.1;
}

/* Long headings should remain readable rather than visually dominant. */
.section-heading h2,
.methodology-copy h2,
.contact-copy h2,
.recognition-summary h3,
.case-study h3,
.gallery-hero h1,
.technical-hero h1 {
  text-wrap: pretty;
}

@media (max-width: 920px) {
  .hero h1 {
    max-width: 800px;
  }

  .section-heading h2,
  .gallery-section-heading h2,
  .contact-copy h2 {
    max-width: 820px;
  }
}

@media (max-width: 680px) {
  :root {
    --type-display: clamp(2.1rem, 7.4vw, 2.35rem);
    --type-page-title: clamp(1.95rem, 7vw, 2.15rem);
    --type-section: clamp(1.45rem, 5.8vw, 1.6rem);
    --type-section-emphasis: clamp(1.5rem, 6vw, 1.7rem);
    --type-feature-title: clamp(1.35rem, 5.4vw, 1.5rem);
    --type-card-title: clamp(1.02rem, 4.4vw, 1.08rem);
  }

  h1,
  h2 {
    letter-spacing: -.036em;
  }

  .hero h1,
  .gallery-hero h1,
  .technical-hero h1 {
    line-height: 1.1;
    letter-spacing: -.042em;
  }

  .hero-lead,
  .gallery-hero-copy > p:not(.eyebrow),
  .technical-hero-copy > p:not(.eyebrow) {
    font-size: .98rem;
    line-height: 1.68;
  }

  .section-heading > p,
  .gallery-section-heading > p {
    font-size: .92rem;
    line-height: 1.68;
  }

  .methodology-copy h2,
  .contact-copy h2,
  .recognition-summary h3,
  .case-study h3 {
    line-height: 1.18;
  }

  .metrics strong {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .technical-case h2 {
    font-size: clamp(1.4rem, 6.2vw, 1.8rem);
  }
}
