/* Shared reading hierarchy. Loaded last so page-specific display styles cannot
   enlarge headings independently. rem bounds preserve browser text scaling. */
:root {
  --type-title: clamp(2.125rem, 1.75rem + 1.25vw, 3.25rem);
  --type-section: clamp(1.625rem, 1.4rem + .55vw, 2.25rem);
  --type-card: clamp(1.125rem, 1.05rem + .2vw, 1.375rem);
  --type-body: 1rem;
  --type-small: .875rem;
  --type-label: .8125rem;
}

body { font-size: var(--type-body); line-height: 1.65; }

/* Legacy detail pages use !important; these scoped rules also cover those pages. */
body main h1,
body.homepage-content-restored .dm-opening #hero-title,
body.analyse-page main h1 {
  font-size: var(--type-title) !important;
  line-height: 1.2 !important;
  letter-spacing: -.03em !important;
  font-weight: 650;
}
body main h2,
body.analyse-page main h2 {
  font-size: var(--type-section) !important;
  line-height: 1.25 !important;
  letter-spacing: -.025em !important;
  font-weight: 650;
}
body main h3,
body.analyse-page main h3 {
  font-size: var(--type-card) !important;
  line-height: 1.4 !important;
  letter-spacing: -.015em !important;
  font-weight: 650;
}
body main :is(h1, h2, h3) { overflow-wrap: break-word; }
body main :is(h1, h2, h3) :is(span, em) {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

/* Keep cards, forms and FAQ questions subordinate to section headings. */
body main :is(.contact-form-card, .faq-project-card__heading) h2 {
  font-size: clamp(1.375rem, 1.2rem + .35vw, 1.625rem) !important;
}
body main :is(.faq-card, .hp-process, .care-process, .contact-next, .premium-care__contact, .hp-facts) h3 {
  font-size: 1.125rem !important;
  line-height: 1.5 !important;
}
body main .system-case h3 { font-size: clamp(1.375rem, 1.15rem + .5vw, 1.75rem) !important; }
body main .hp-service-information__slide h3 { font-size: var(--type-section) !important; }
body main .hp-process-panel h3 { font-size: 1rem !important; letter-spacing: 0 !important; }
body main .hp-service-information__slide h4 { font-size: 1.125rem; line-height: 1.5; }
body main .service-brief__steps h2 { font-size: 1.25rem !important; }

/* Comfortable body copy, with a modest increase for introductory paragraphs. */
body main :is(.hp-system-copy, .hp-service, .hp-process, .hp-project, .premium-care__contact,
  .premium-care__promise, .care-choice, .care-system__grid, .care-process, .contact-next,
  .contact-questions, .system-case, .fo-grid, .fo-split, .fo-lines, .fo-process,
  .ws-copy, .ws-process, .sm-copy, .sm-process, .chapter-copy) p,
body main :is(.hp-service-information__slide li p, .faq-answer > p,
  .hp-process-panel .hp-process-panel__summary, .system-case__flow li > span,
  .ws-path__steps span, .sm-path__steps span, .ws-system span, .sm-assurance span,
  .premium-care__benefits span, .care-technical details > div) {
  font-size: var(--type-body);
  line-height: 1.7;
}
body main :is(.dm-opening .dm-opening__lead, .contact-intro__bottom p,
  .care-hero .hp-shell > p:not(.eyebrow), .lead, .ws-front > p:not(.ws-kicker),
  .sm-front > p:not(.sm-kicker), .fo-hero-copy > p:not(.fo-kicker),
  .hp-service-information__intro) {
  font-size: 1.125rem;
  line-height: 1.7;
}
body main .hp-process-panel__promise {
  font-size: clamp(1.375rem, 1.1rem + .7vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -.025em;
  max-width: 16ch;
}
body main .premium-care__promise > strong {
  font-size: clamp(2.5rem, 2rem + 1vw, 3rem);
  line-height: 1.2;
  letter-spacing: -.035em;
}
body main .hp-fact-value { font-size: 3rem; line-height: 1.2; min-height: 3.75rem; }
body main .hp-fact-brand { font-size: 1.75rem; }
body main :is(.ws-path, .sm-path) header > span { font-size: 2.25rem; margin-bottom: 1.75rem; }
body main :is(.fo-source strong, .analyse-art-word) { font-size: 2rem; line-height: 1.3; }
body main .hero-service-symbols .hero-service-title { font-size: 1.125rem; line-height: 1.5; }
body main .hero-service-symbols span { font-size: .9375rem; }

/* Small text is intentionally limited to labels and secondary information. */
body main :is(.eyebrow, .dm-opening .dm-opening__eyebrow, .contact-kicker, .fo-kicker,
  .ws-kicker, .sm-kicker, .system-case__label, .system-case__process-title,
  .system-case__context > strong, .system-case__goal > strong,
  .chapter-service, .result-notes__label, .hp-process-panels__heading > .eyebrow) {
  font-size: var(--type-label);
  line-height: 1.6;
  letter-spacing: .06em;
}
body main :is(.hp-process-panel__step, .hp-process-panel .hp-process-panel__bullets li,
  .hp-process-panel .hp-process-panel__cue, .system-cases__tab small,
  .system-cases__tab > span:first-child, .system-case__service,
  .hp-service-information__slide li > span, .premium-care__contact a span,
  .premium-care__footer p, .premium-care__details summary, .premium-care__details ul,
  .hp-facts-note, .fine, .result-limit, .analyse-scroll, .analyse-art-caption,
  .analysis-signup__intro, .analysis-check, .analysis-choice, .analysis-field,
  .analysis-submit-note, .contact-field label, .contact-topics legend,
  .contact-topics legend span, .contact-topics label, .contact-extra summary,
  .contact-form-card header > p:last-child, .contact-consent, .contact-form-note,
  .contact-fallback, .contact-direct address span, .contact-analysis p,
  .contact-field-error, .faq-project-consent, .dm-opening__invitation,
  .system-cases__footer p, .fo-grid small, .fo-source small,
  .sm-compare small, .ws-process > li > span, .sm-process > li > span) {
  font-size: var(--type-small);
  line-height: 1.65;
}
body main :is(.system-cases__tab strong) { font-size: 1rem; line-height: 1.5; }
body main :is(.text-link, .fo-button, .sm-cta, .sm-text-link,
  .ws-text-link, .quality-cta, .premium-care__footer a,
  .hp-service-information__contact, .hp-service-information__full) { font-size: .9375rem; }
body main :is(.fo-button, .sm-cta) { letter-spacing: .02em; }
body.homepage-content-restored .dm-opening .dm-opening__eyebrow {
  font-size: var(--type-label);
  letter-spacing: .06em;
}
body main .cinematic-site-copy strong { font-size: 1.75rem; line-height: 1.4; }
body main .sales-story-philosophy blockquote {
  font-size: var(--type-section) !important;
  line-height: 1.4 !important;
  letter-spacing: -.025em;
}

/* Navigation uses important declarations in this named layer. Keep overrides in
   the same layer; a small-screen 2 x 2 menu gives every label room at 14px. */
@layer adaptive-navigation {
  body .cl-header .cl-mobile-menu[open] nav[aria-label] a {
    font-size: clamp(.9375rem, .8rem + .4vw, 1.125rem) !important;
  }
  @media (max-width: 800px) {
    body .cl-header > .dm-header-actions a { font-size: .875rem !important; }
  }
  @media (max-width: 540px) {
    body .cl-header > .dm-header-actions a:first-child {
      font-size: .8125rem !important;
      margin-right: 32px;
    }
    body .cl-header > .dm-header-actions a:last-child { font-size: .8125rem !important; }
    body .cl-header .header-analysis-free { font-size: .75rem; letter-spacing: .02em; }
    body .cl-header .cl-mobile-menu[open] nav[aria-label] {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      overflow: auto !important;
    }
    body .cl-header .cl-mobile-menu[open] nav[aria-label] a {
      width: 100%;
      min-height: 64px;
      font-size: .875rem !important;
      white-space: normal !important;
      overflow-wrap: break-word;
    }
  }
}

body :is(.site-footer-brand > small, .site-footer-column a, .site-footer-column > strong,
  .site-footer-bottom, .contact-footer p, .contact-footer small, .contact-footer nav,
  .fo-footer, .ws-footer, .sm-footer, .analyse-footer, .quality-breadcrumbs) {
  font-size: var(--type-small);
  line-height: 1.65;
}

@media (max-width: 600px) {
  body main .hero-service-symbols .hero-service-title { font-size: 1rem; }
  body main .hero-service-symbols span { font-size: .875rem; }
  body main .hp-process-panel__promise { font-size: 1.5rem; }
  /* Three short scenario tabs stay readable without squeezing long titles. */
  .system-cases__tabs { grid-template-columns: 1fr; gap: 0; }
  .system-cases__tab { grid-template-columns: 1.5rem minmax(0, 1fr); gap: .75rem; padding: .85rem 0; }
  .system-cases__tab small { display: block; }
}
