/* Shared hero measurements, based on the home-page opening.  Templates keep
   their own content, background, media and any breadcrumb or byline. */
body:not(.home-ambient) #main-content {
  --hero-heading-width: min(100%, 1500px);
  --hero-heading-size: 34px;
  --hero-heading-leading: 1.25;
  --hero-heading-tracking: -.035em;
  --hero-top: 108px;
  --hero-gutter: 12px;
  --hero-label-size: 11px;
  --hero-label-gap: 20px;
  --hero-action-gap: 26px;
  --hero-button-height: 60px;
}
@media (min-width: 993px) {
  body:not(.home-ambient) #main-content {
    --hero-heading-width: min(100%, 800px);
    --hero-top: 204px;
    --hero-gutter: clamp(24px, 2.2vw, 44px);
    --hero-label-size: 12px;
    --hero-label-gap: 30px;
    --hero-action-gap: 38px;
    --hero-button-height: 72px;
  }
}
@media (min-width: 1181px) {
  body:not(.home-ambient) #main-content {
    --hero-heading-width: min(100%, 1500px);
    --hero-heading-size: clamp(54px, 4.45vw, 86px);
    --hero-heading-leading: 1.08;
    --hero-heading-tracking: -.045em;
    --hero-top: 14.2vw;
    --hero-label-size: clamp(12px, .973vw, 18px);
    --hero-label-gap: clamp(30px, 2.1vw, 40px);
    --hero-button-height: clamp(64px, 5vw, 96px);
  }
}

/* Normalize the outer gutter without disturbing the hero's internal grid. */
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .industry-index-ref, .service-ref,
  .industry-ref, .b2b-ref, .utility-hero, .art-opening:not(.legal-index),
  .cs-hero, .case-reference__simple, .mc-case__hero, .contact-ref,
  .page-section--first:has(#work-title)
) {
  padding-top: var(--hero-top);
  padding-left: var(--hero-gutter);
  padding-right: var(--hero-gutter);
}
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .industry-index-ref, .service-ref,
  .industry-ref, .b2b-ref, .utility-hero, .art-opening:not(.legal-index),
  .cs-hero, .case-reference__simple, .mc-case__hero, .contact-ref,
  .page-section--first:has(#work-title)
) > :is(.page-inner, .hub-hero__inner, .mc-case__inner, .contact-ref__inner) {
  box-sizing: border-box;
  width: 100%;
  max-width: 1900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .industry-index-ref, .service-ref,
  .industry-ref, .b2b-ref, .utility-hero, .art-opening:not(.legal-index),
  .cs-hero, .case-reference__simple, .mc-case__hero, .contact-ref,
  .page-section--first:has(#work-title)
) h1 {
  box-sizing: border-box;
  width: var(--hero-heading-width);
  max-width: var(--hero-heading-width);
  min-width: 0;
  font-family: 'LER Display', sans-serif;
  font-size: var(--hero-heading-size);
  font-weight: 600;
  line-height: var(--hero-heading-leading);
  letter-spacing: var(--hero-heading-tracking);
  text-wrap: balance;
}

/* A span must not force an early line break in an otherwise fluid heading. */
body:not(.home-ambient) #main-content#main-content :is(.hub-hero, .b2b-ref, .art-opening:not(.legal-index)) h1 span.showcase-title-muted {
  display: inline;
}

/* Keep the page-specific badge treatment on case studies, while using the
   same font and distance between the label and the headline. */
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .industry-index-ref, .service-ref,
  .industry-ref, .b2b-ref, .utility-hero, .art-opening:not(.art-opening--index):not(.legal-index),
  .cs-hero, .case-reference__simple, .mc-case__hero, .contact-ref
) :is(.hub-hero__eyebrow, .about-ref__eyebrow, .svc-hero__eyebrow, .showcase-eyebrow, .mc-case__eyebrow, .contact-ref__eyebrow) {
  font-family: Matter, system-ui, sans-serif;
  font-size: var(--hero-label-size);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .13em;
  margin-bottom: var(--hero-label-gap);
}
body:not(.home-ambient) #main-content#main-content :is(.cs-hero, .case-reference__simple, .mc-case__hero) :is(.cs-hero__eyebrow, .showcase-eyebrow, .mc-case__eyebrow) {
  margin-bottom: 0;
}
body:not(.home-ambient) #main-content#main-content :is(.cs-hero, .case-reference__simple, .mc-case__hero) h1 {
  margin-top: var(--hero-label-gap);
}

/* Match the home action rhythm and button typography without changing links. */
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .service-ref, .industry-ref, .b2b-ref,
  .utility-hero, .art-opening:not(.legal-index), .case-reference__simple
) :is(.hub-hero__lead, .about-ref__lead, .svc-hero__lead, .page-head-lead) {
  margin-top: var(--hero-action-gap);
}
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .service-ref, .industry-ref, .b2b-ref,
  .utility-hero, .art-opening:not(.legal-index), .case-reference__simple
) :is(.hub-hero__actions, .about-ref__actions, .svc-hero__actions, .page-actions) {
  gap: 8px;
  margin-top: var(--hero-action-gap);
}
body:not(.home-ambient) #main-content#main-content :is(
  .hub-hero, .about-ref-hero, .service-ref, .industry-ref, .b2b-ref,
  .utility-hero, .art-opening:not(.legal-index), .case-reference__simple
) :is(.hub-hero__actions, .about-ref__actions, .svc-hero__actions, .page-actions) a,
body:not(.home-ambient) #main-content#main-content :is(.cs-hero, .mc-case__hero) a.case-reference__button {
  box-sizing: border-box;
  min-height: var(--hero-button-height);
  height: auto;
  gap: 16px;
  font-family: Matter, system-ui, sans-serif;
  font-size: clamp(12px, .973vw, 18.67px);
  font-weight: 400;
  letter-spacing: .15em;
  border-radius: 8px;
  padding-left: clamp(28px, 2.6vw, 50px);
  padding-right: clamp(28px, 2.6vw, 50px);
}
body:not(.home-ambient) #main-content#main-content :is(.cs-hero, .mc-case__hero) a.case-reference__button {
  margin-top: var(--hero-action-gap);
}
@media (max-width: 1060px) {
  body:not(.home-ambient) #main-content#main-content :is(
    .hub-hero, .about-ref-hero, .service-ref, .industry-ref, .b2b-ref,
    .utility-hero, .art-opening:not(.legal-index), .case-reference__simple
  ) :is(.hub-hero__actions, .about-ref__actions, .svc-hero__actions, .page-actions) a,
  body:not(.home-ambient) #main-content#main-content :is(.cs-hero, .mc-case__hero) a.case-reference__button {
    font-size: 13px;
  }
}

/* The About template has an older important weight override. */
body:not(.home-ambient) #main-content#main-content .about-ref-hero h1#about-title {
  font-weight: 600 !important;
}
