/* Subpage editorial type follows the landing page's 40px section / 20px card
   hierarchy. Limits keep large monitors from producing billboard-sized copy. */
body[data-subpage-type] {
  --subpage-hero-size: clamp(34px, 4.375vw, 60px);
  --subpage-section-size: clamp(28px, 3.125vw, 44px);
  --subpage-card-size: clamp(21px, 1.875vw, 26px);
  --subpage-lead-size: clamp(17px, 1.4vw, 20px);
  --subpage-body-size: clamp(16px, 1.3vw, 18px);
}

/* Industry pages. Product scene labels and controls are deliberately excluded. */
body[data-subpage-type="industry"].industry-overview .industry-hero-copy {
  container-type: inline-size;
}
body[data-subpage-type="industry"].industry-overview .industry-hero h1 {
  font-size: min(var(--subpage-hero-size), 7cqi);
  white-space: nowrap;
  line-height: 1.1;
  letter-spacing: -.045em;
  text-wrap: balance;
}
body[data-subpage-type="industry"].industry-overview .industry-hero-copy > p {
  font-size: var(--subpage-lead-size);
  line-height: 1.6;
  margin-top: 24px;
}
body[data-subpage-type="industry"].industry-overview :is(.industry-section > h2, .industry-addition-intro > h2, .industry-cta > h2) {
  font-size: var(--subpage-section-size);
  line-height: 1.18;
  letter-spacing: -.035em;
  text-wrap: balance;
}
body[data-subpage-type="industry"].industry-overview :is(.industry-benefits h3, .workflow-section h3, .industry-feature-copy h3, .industry-team-card h3, .industry-rollout h3) {
  font-size: var(--subpage-card-size);
  line-height: 1.28;
  letter-spacing: -.025em;
}
body[data-subpage-type="industry"].industry-overview .industry-statement {
  font-size: clamp(24px, 2.25vw, 32px);
  line-height: 1.4;
  text-wrap: pretty;
}

/* Architecture and service overviews. */
body[data-subpage-type].service-editorial :is(.arch-hero h1, .page-hero h1),
body[data-subpage-type="architecture"].architecture-overview .arch-detail-title h1 {
  font-size: var(--subpage-hero-size);
  line-height: 1.1;
  letter-spacing: -.045em;
  text-wrap: balance;
}
body[data-subpage-type].service-editorial :is(.arch-hero-description, .page-hero__lead),
body[data-subpage-type="architecture"].architecture-overview .arch-detail-title > p {
  font-size: var(--subpage-lead-size);
  line-height: 1.6;
  margin-top: 24px;
}
body[data-subpage-type].service-editorial.service-editorial :is(.section-heading, .arch-section-intro h2, .arch-governance h2, .arch-closer h2, .page-closer h2),
body[data-subpage-type="architecture"].architecture-overview :is(.arch-feature-intro > h2, .arch-section-intro h2, .arch-closer h2) {
  font-size: var(--subpage-section-size);
  line-height: 1.18;
  letter-spacing: -.035em;
  text-wrap: balance;
}
body[data-subpage-type].service-editorial :is(.arch-context-panel h3, .arch-feature-copy h3, .arch-principle-grid h3, .deployment-detail-grid h3, .deployment-steps h3, .deployment-role h3, .deployment-outcome-grid h3, .deployment-fit-grid h3, .related-card h3),
body[data-subpage-type="architecture"].architecture-overview :is(.arch-steps h3, .arch-related-card h3) {
  font-size: var(--subpage-card-size);
  line-height: 1.28;
  letter-spacing: -.025em;
}
body[data-subpage-type].service-editorial :is(.section-lead, .arch-section-intro > p, .arch-governance > div > p:not(.arch-kicker)) {
  font-size: var(--subpage-lead-size);
  line-height: 1.6;
}
body[data-subpage-type="service"].transformation-overview .principle summary {
  font-size: var(--subpage-card-size);
  line-height: 1.3;
}
body[data-subpage-type="service"].deployment-overview .deployment-handoff .section-heading {
  font-size: var(--subpage-section-size);
}
body[data-subpage-type="service"].deployment-overview #when-to-involve-people .deployment-detail-grid h3 {
  font-size: var(--subpage-card-size);
  line-height: 1.28;
}

/* Editorial case studies keep the financial results and product UI intact. */
body[data-subpage-type="case-study"] .story-hero-copy h1,
body[data-subpage-type="story"] .story-header h1 {
  font-size: clamp(32px, 3.75vw, 52px);
  line-height: 1.14;
  letter-spacing: -.04em;
  text-wrap: balance;
}
body[data-subpage-type="case-study"] :is(.story-cta h2, .story-related > h2),
body[data-subpage-type="story"] :is(.story-more__heading h2, .story-cta h2) {
  font-size: var(--subpage-section-size);
  line-height: 1.2;
  text-wrap: balance;
}
body[data-subpage-type="case-study"] :is(.story-body-viz > h3, .related-story > h3),
body[data-subpage-type="story"] .praxis-story-card__head > h3 {
  font-size: var(--subpage-card-size);
  line-height: 1.3;
}
body[data-subpage-type="case-study"] .story-prose {
  font-size: 17px;
  line-height: 1.7;
}
body[data-subpage-type="story"] :is(.story-dek, .story-lead) {
  font-size: var(--subpage-lead-size);
  line-height: 1.65;
}
body[data-subpage-type="story"] .story-pullquote > p {
  font-size: clamp(22px, 1.875vw, 26px);
  line-height: 1.45;
}

/* Product overview: only the marketing headings, not its portal previews. */
body[data-subpage-type="product"] .product-hero__copy h1 {
  font-size: var(--subpage-hero-size);
  line-height: 1.1;
  letter-spacing: -.045em;
}
body[data-subpage-type="product"] :is(.product-heading h2, .product-cta h2) {
  font-size: var(--subpage-section-size);
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}

/* Work challenge and resource pages used separate display scales. Unify their
   page and section titles, while preserving document and app-preview headings. */
body[data-subpage-type="work"] {
  --subpage-hero-size: clamp(32px, 4vw, 56px);
}
body[data-subpage-type="work"] main h1 {
  font-size: var(--subpage-hero-size);
  line-height: 1.1;
  letter-spacing: -.045em;
  text-wrap: balance;
}
body[data-subpage-type="work"] main h2[id]:not(#cr-ledger-title, #sample-packet-title, #qc-sheet-title, #sample-ledger-title),
body[data-subpage-type="work"] :is(.cc-why h2, .pwr-use h2, .pwr-rules h2, .cr-fit__col h2, .wca-fit__col h2) {
  font-size: var(--subpage-section-size);
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}
body[data-subpage-type="work"] :is(.pwr-artifact > h2, .pwc-directory__identity > h2, .ob-proof__outcome > h2, .cc-primitive__copy > h3, .ob-three__grid h3, .hl-blank__intro h3, .hl-panel > h3) {
  font-size: var(--subpage-card-size);
  line-height: 1.3;
  letter-spacing: -.025em;
}
body[data-subpage-type="work"] :is(.ar-hero__copy > p:not(.mirror-eyebrow), .sr-hero__copy > p:not(.mirror-eyebrow), .gc-hero__lede, .hs-hero__lead, .pr-hero__lede, .sq-hero__lede, .pwr-dek, .cc-hero__lede, .pwc-hero__question, .qc-close__ask) {
  font-size: var(--subpage-lead-size);
  line-height: 1.6;
}

@media (max-width: 760px) {
  body[data-subpage-type] {
    --subpage-hero-size: clamp(32px, 6vw, 42px);
    --subpage-section-size: clamp(27px, 4.5vw, 32px);
    --subpage-card-size: 21px;
    --subpage-lead-size: 17px;
  }
  body[data-subpage-type="case-study"] .story-hero-copy h1,
  body[data-subpage-type="story"] .story-header h1 {
    font-size: clamp(30px, 5.4vw, 38px);
  }
}
