/* Home-derived type roles, v1. Only non-home primary pages opt in.
   Typography only: existing grids, margins, controls, media and motion stay local.
   The narrow !important declarations resolve old service/campaign cascades. */
body[data-relacion-typography="home-v1"]{
 --rel-type-sans:Inter,'Segoe UI',Arial,sans-serif;
 --rel-type-serif:'Relacion Playfair',Georgia,serif;
 --rel-type-support:Arimo,'Segoe UI',Arial,sans-serif;
 --rel-type-hero-size:clamp(60px,6.1vw,88px);
 --rel-type-hero-leading:1.04;
 --rel-type-hero-em-size:.97em;
 --rel-type-hero-em-leading:1.15;
 --rel-type-hero-em-gap:2px;
 --rel-type-section-size:clamp(42px,4.5vw,68px);
 --rel-type-feature-size:clamp(30px,3.3vw,44px);
 --rel-type-reading-size:32px;
 --rel-type-closing-size:clamp(47px,4.8vw,72px);
 --rel-type-closing-leading:1.04;
 --rel-type-hero-lead-size:clamp(19px,1.7vw,25px);
 --rel-type-body-size:17px;
 --rel-type-signature-size:17px;
 --rel-type-action-size:16px;
 --rel-type-header-action-size:13px;
 --rel-type-header-action-leading:1.65;
}
body[data-relacion-typography="home-v1"] main{font-family:var(--rel-type-sans)!important}
/* @role hero */
body[data-relacion-typography="home-v1"] :is(.q-hero-copy>h1,.s-hero h1,.s-hero-image h1){
 font-family:var(--rel-type-sans)!important;font-weight:560!important;font-size:var(--rel-type-hero-size)!important;line-height:var(--rel-type-hero-leading)!important;letter-spacing:-.04em!important;font-style:normal!important;
}
/* @role hero_em */
body[data-relacion-typography="home-v1"] :is(.q-hero-copy>h1,.s-hero h1,.s-hero-image h1) em{
 font-family:var(--rel-type-serif)!important;font-weight:500!important;font-size:var(--rel-type-hero-em-size)!important;line-height:var(--rel-type-hero-em-leading)!important;letter-spacing:-.025em!important;font-style:italic!important;margin-top:var(--rel-type-hero-em-gap);
}
/* Major editorial section headings, not every h2 in a diagram or tool. */
/* @role section */
body[data-relacion-typography="home-v1"] :is(
 .q-section-heading>h2,.q-benefits-heading>h2,.q-start-layout>div>h2,.q-finish-copy>h2,
 .q-faq-layout>h2,.q-faq-layout>div>h2,.cro-enquiry-grid>div>h2,.cro-proof-grid>div>h2,
 .bl-section-intro>h2,.bl-setup-layout>div>h2,.bl-related>.q-wrap>h2,
 .lsf-split>h2,.lsf-split>div>h2,.lsf-photo>.q-wrap>h2,
 .rco-intro>h2,.rco-heading>h2,.rco-image-band>.q-wrap>h2,.rco-reading>h2,
 .gw-heading>h2,.rt-heading>h2,.rdemo-heading>h2,.rs-heading>h2,
 .rs-editorial>h2,.rs-editorial>div>h2,.rs-faq-tools>h2,.rt-faq>h2,
 .rpack-intro>h2,.rn-questions>h2,.rn-demo-next>h2,.rtv2-intro>h2,
 .rp-setup-grid>div>h2,.rp-examples>.q-wrap>h2,.ar-intake-intro>h2,.ar-standards-layout>div>h2,
 .s-heading>h2,.s-split>h2,.s-scope>h2
){font-family:var(--rel-type-sans)!important;font-weight:500!important;font-size:var(--rel-type-section-size)!important;line-height:1.1!important;letter-spacing:-.035em!important}
/* Repeated outcome rows have a smaller editorial role than section openings. */
/* @role feature */
body[data-relacion-typography="home-v1"] :is(.lsf-benefit>div>h2,.q-benefit-copy h3,.th-paths h3,#business-types>.q-wrap>article>div>h2,.rn-row h3,.cs-story-row h2,.rtv2-pack>div>h2,.rtv2-pack>h2){
 font-family:var(--rel-type-sans)!important;font-weight:500!important;font-size:var(--rel-type-feature-size)!important;line-height:1.16!important;letter-spacing:-.025em!important;
}
/* Read and Operate surfaces retain compact hierarchy and practical controls. */
/* @role reading */
body[data-relacion-typography="home-v1"] :is(.rn-prose h2,.cs-case-copy h2,.gw-result>h2,.rn-tool-grid h2,.rn-personalise h2,.rn-template h2,.rpack-explainer h2,.rpack-cash-result h2,.rt-takeaway h2){
 font-family:var(--rel-type-sans)!important;font-weight:500!important;font-size:var(--rel-type-reading-size)!important;line-height:1.2!important;letter-spacing:-.025em!important;
}
/* @role operating */
body[data-relacion-typography="home-v1"] :is(.sd-utility h1,.cro-inbox>h1,.cro-privacy>h1,.s-trades-review-intro h1,.s-section>.s-wrap>h1,.cro-enquiry-grid>div>h1){
 font-family:var(--rel-type-sans)!important;font-weight:500!important;font-size:clamp(34px,4vw,54px)!important;line-height:1.12!important;letter-spacing:-.035em!important;
}
/* The homepage deliberately uses Arimo for supporting headings and its close. */
/* @role support */
body[data-relacion-typography="home-v1"] :is(.rco-row>h3,.rco-form>h3,.rco-output>h3,.rt-editorial h3,.rs-help-index h3){
 font-family:var(--rel-type-support)!important;font-weight:500!important;font-size:23px!important;line-height:1.3!important;letter-spacing:-.025em!important;
}
/* @role closing */
body[data-relacion-typography="home-v1"] :is(.closing h2,.q-closing h2,.rn-closing h2,.s-close h2){
 font-family:var(--rel-type-support)!important;font-weight:700!important;font-size:var(--rel-type-closing-size)!important;line-height:var(--rel-type-closing-leading)!important;letter-spacing:-.04em!important;
}
/* @role hero_lead */
body[data-relacion-typography="home-v1"] :is(.q-hero-copy>p:not(.brand-signature):not(.q-signature):not(.cro-cta-note):not(.q-hero-note):not(.cro-hero-note),.s-hero .lead){
 font-family:var(--rel-type-sans)!important;font-weight:400!important;font-size:var(--rel-type-hero-lead-size)!important;line-height:1.6!important;letter-spacing:-.015em!important;
}
/* @role section_lead */
body[data-relacion-typography="home-v1"] :is(.q-section-heading>p,.q-benefits-heading>p,.bl-section-intro>p,.cro-enquiry-grid>div>p,.cro-proof-grid>div>p,.q-start-layout>div>p,.q-finish-copy>p,.gw-heading>p,.rt-heading>p,.rs-heading>p,.rdemo-heading>p){
 font-family:var(--rel-type-sans)!important;font-weight:400!important;font-size:17px!important;line-height:1.7!important;letter-spacing:normal!important;
}
/* @role body_copy */
body[data-relacion-typography="home-v1"] :is(.rco-intro>div>p,.rco-heading>p,.rco-row>p,.rco-editorial>div>p,.rn-prose p,.cs-case-copy p){
 font-family:var(--rel-type-sans)!important;font-weight:400!important;font-size:var(--rel-type-body-size)!important;line-height:1.7!important;letter-spacing:normal!important;
}
/* @role signature */
body[data-relacion-typography="home-v1"] :is(.brand-signature,.q-signature,.s-signature){
 font-family:var(--rel-type-sans)!important;font-weight:600!important;font-size:var(--rel-type-signature-size)!important;line-height:1.2!important;letter-spacing:-.035em!important;
}
/* @role signature_em */
body[data-relacion-typography="home-v1"] :is(.brand-signature,.q-signature,.s-signature) em{
 font-family:var(--rel-type-serif)!important;font-weight:500!important;font-size:1.42em!important;line-height:1!important;letter-spacing:-.025em!important;font-style:italic!important;
}
/* @role hero_cta */
body[data-relacion-typography="home-v1"] :is(.q-hero-actions>.button,.q-hero-copy>.button,.s-hero .button,.q-closing .button,.rn-closing .button,.s-close .button){
 font-family:var(--rel-type-support)!important;font-weight:500!important;font-size:var(--rel-type-action-size)!important;line-height:24px!important;letter-spacing:normal!important;
}
/* @role header_cta */
body[data-relacion-typography="home-v1"] :is(.site-header>.header-cta,.sd-campaign-header>.button){
 font-family:var(--rel-type-sans)!important;font-weight:500!important;font-size:var(--rel-type-header-action-size)!important;line-height:var(--rel-type-header-action-leading)!important;letter-spacing:normal!important;font-style:normal!important;
}
body[data-relacion-typography="home-v1"] :is(.q-hero-copy>h1,.s-hero h1,.s-hero-image h1,.q-section-heading>h2,.q-benefits-heading>h2,.q-start-layout>div>h2,.q-finish-copy>h2,.q-faq-layout>h2,.q-faq-layout>div>h2,.cro-enquiry-grid>div>h2,.cro-proof-grid>div>h2,.bl-section-intro>h2,.bl-setup-layout>div>h2,.bl-related>.q-wrap>h2,.lsf-split>h2,.lsf-split>div>h2,.lsf-photo>.q-wrap>h2,.rco-intro>h2,.rco-heading>h2,.rco-image-band>.q-wrap>h2,.rco-reading>h2,.gw-heading>h2,.rt-heading>h2,.rdemo-heading>h2,.rs-heading>h2,.rs-editorial>h2,.rs-editorial>div>h2,.rs-faq-tools>h2,.rt-faq>h2,.rpack-intro>h2,.rn-questions>h2,.rn-demo-next>h2,.rtv2-intro>h2,.rp-setup-grid>div>h2,.rp-examples>.q-wrap>h2,.ar-intake-intro>h2,.ar-standards-layout>div>h2,.s-heading>h2,.s-split>h2,.s-scope>h2,.lsf-benefit>div>h2,.q-benefit-copy h3,.th-paths h3,#business-types>.q-wrap>article>div>h2,.rn-row h3,.cs-story-row h2,.rtv2-pack>div>h2,.rtv2-pack>h2,.rn-prose h2,.cs-case-copy h2,.gw-result>h2,.rn-tool-grid h2,.rn-personalise h2,.rn-template h2,.rpack-explainer h2,.rpack-cash-result h2,.rt-takeaway h2,.sd-utility h1,.cro-inbox>h1,.cro-privacy>h1,.s-trades-review-intro h1,.s-section>.s-wrap>h1,.cro-enquiry-grid>div>h1,.rco-row>h3,.rco-form>h3,.rco-output>h3,.rt-editorial h3,.rs-help-index h3,.closing h2,.q-closing h2,.rn-closing h2,.s-close h2) em{
 font-family:var(--rel-type-serif)!important;font-weight:500!important;letter-spacing:-.025em!important;font-style:italic!important;
}
@media(min-width:1700px){body[data-relacion-typography="home-v1"]{--rel-type-hero-size:96px;--rel-type-hero-lead-size:26px}}
@media(max-width:900px){body[data-relacion-typography="home-v1"]{--rel-type-hero-size:clamp(54px,7.9vw,72px);--rel-type-section-size:clamp(42px,6vw,60px);--rel-type-hero-lead-size:21px}}
@media(max-width:600px){body[data-relacion-typography="home-v1"]{
 --rel-type-hero-size:clamp(37px,11.4vw,48px);--rel-type-hero-leading:1.06;
 --rel-type-hero-em-size:.82em;--rel-type-hero-em-leading:1.18;--rel-type-hero-em-gap:6px;
 --rel-type-section-size:44px;--rel-type-feature-size:30px;--rel-type-reading-size:28px;
 --rel-type-closing-size:clamp(39px,10.3vw,52px);--rel-type-closing-leading:1.1;
 --rel-type-hero-lead-size:18px;--rel-type-body-size:16px;--rel-type-signature-size:15px;--rel-type-action-size:15px;
 --rel-type-header-action-size:11px;--rel-type-header-action-leading:1.35;
}}
@media(max-width:360px){body[data-relacion-typography="home-v1"]{--rel-type-hero-size:37px;--rel-type-hero-em-size:.79em;--rel-type-section-size:40px;--rel-type-hero-lead-size:17px;--rel-type-header-action-size:10.5px;--rel-type-header-action-leading:1.3}body[data-relacion-typography="home-v1"] .q-hero .brand-signature{font-size:14px!important}}

/* Inner pages share the homepage's type roles and spacing. The .q-* and
   resource shells keep their composition; diagrams and native controls keep
   their own density. Values in rem respect the visitor's text settings. */
body[data-relacion-typography="home-v1"] {
  --rel-space-title: 1.875rem;
  --rel-space-action: 1.75rem;
  --rel-space-section: 7.5rem;
  --rel-space-section-head: 3.25rem;
  --rel-space-intro: 1.25rem;
  --rel-space-copy: 1rem;
  --rel-space-signature: 1.5rem;
  --rel-type-caption-size: .875rem;
  --rel-type-detail-size: 1.0625rem;
  --rel-type-utility-title: clamp(2rem, 4.1vw, 3.625rem);
  --rel-reading-measure: 68ch;
}

@media (max-width: 900px) {
  body[data-relacion-typography="home-v1"] {
    --rel-space-section: 5.5rem;
    --rel-space-section-head: 2.5rem;
  }
}

@media (max-width: 700px) {
  body[data-relacion-typography="home-v1"] {
    --rel-space-section: 4.625rem;
    --rel-space-section-head: 2rem;
    --rel-space-intro: 1rem;
    --rel-type-detail-size: 1rem;
  }
}

@media (max-width: 600px) {
  body[data-relacion-typography="home-v1"] {
    --rel-space-title: 1.6875rem;
    --rel-space-action: 1.6875rem;
  }
}

/* Direct copy, primary action, and signature are separate beats. The helpers
   under the conversion form and the controls beside a film are distinct roles. */
body[data-relacion-typography="home-v1"] .q-hero-copy > h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body[data-relacion-typography="home-v1"] .q-hero-copy > h1 em {
  margin-block-start: var(--rel-type-hero-em-gap) !important;
}

body[data-relacion-typography="home-v1"] .q-hero-copy > h1 + p:not(.brand-signature, .q-signature, .cro-hero-note, .q-hero-note) {
  margin-block: var(--rel-space-title) 0 !important;
  max-inline-size: min(56ch, 43.4375rem);
  text-wrap: pretty;
}

body[data-relacion-typography="home-v1"] .q-hero-copy > :is(.q-hero-actions, .button) {
  margin-block-start: var(--rel-space-action) !important;
}

body[data-relacion-typography="home-v1"] .q-hero-copy > :is(.brand-signature, .q-signature) {
  margin-block-start: var(--rel-space-signature) !important;
}

/* Space between chapters, between a chapter intro and its content, and
   between a heading and its own copy are three different distances. */
body[data-relacion-typography="home-v1"] main > .q-section:where(
  .q-action, .q-benefits, .q-start, .q-faq, .q-closing, .bl-benefits,
  .bl-setup, .bl-related, .lsf-scope, .lsf-faq, .lsf-next, .rp-setup,
  .rp-examples, .ar-standards, .rdemo-section, .rn-document, .rn-library,
  .rs-builder-section, .rs-commercial, .rs-follow-through, .rs-contact-help,
  .rco-soft, .rco-builder-section, .rco-faq, .rt-explanation, [class="q-section"]
) {
  padding-block: var(--rel-space-section);
}

body[data-relacion-typography="home-v1"] :is(
  .q-section-heading, .q-benefits-heading, .bl-section-intro, .rco-heading,
  .gw-heading, .rt-heading, .rdemo-heading, .rs-heading, .rtv2-intro, .rpack-intro
) {
  margin-block-end: var(--rel-space-section-head);
}

/* In split introductions, the grid already supplies the gap. */
body[data-relacion-typography="home-v1"] :is(
  .q-benefits-heading, .bl-section-intro, .q-start-layout > div, .q-finish-copy,
  .cro-proof-grid > div, .cro-enquiry-grid > div, .rco-heading, .gw-heading,
  .rt-heading, .rdemo-heading, .rs-heading, .rtv2-intro, .rpack-intro,
  .ar-intake-intro, .rp-setup-grid > div
) > :is(h1, h2):has(+ p) {
  margin-block-end: 0;
}

body[data-relacion-typography="home-v1"] :is(
  .q-benefits-heading, .bl-section-intro, .q-start-layout > div, .q-finish-copy,
  .cro-proof-grid > div, .cro-enquiry-grid > div, .rco-heading, .gw-heading,
  .rt-heading, .rdemo-heading, .rs-heading, .rtv2-intro, .rpack-intro,
  .ar-intake-intro, .rp-setup-grid > div
) > :is(h1, h2) + p {
  margin-block-start: var(--rel-space-intro);
}

@media (max-width: 900px) {
  body[data-relacion-typography="home-v1"] .q-section-heading {
    row-gap: var(--rel-space-intro);
  }
}

/* Marketing body, editorial rows, and reading pages use the same text role.
   Keep highlighted notes, example messages, status text and card UI local. */
body[data-relacion-typography="home-v1"] :is(
  .q-section-heading > p, .q-benefits-heading > p, .bl-section-intro > p,
  .q-start-layout > div > p, .q-finish-copy > p, .cro-enquiry-grid > div > p,
  .cro-proof-grid > div > p, .ar-intake-intro > p, .rpack-intro > p,
  .rtv2-intro > p, .gw-heading > p, .rt-heading > p, .rdemo-heading > p,
  .rs-heading > p
) {
  font: 400 1.0625rem/1.7 var(--rel-type-sans) !important;
  letter-spacing: normal !important;
  text-wrap: pretty;
}

body[data-relacion-typography="home-v1"] :is(
  .q-benefit-copy > div > p,
  .q-closing > :is(.q-wrap, .wrap) > p:not(.brand-signature, .q-signature, .q-kicker, .rn-kicker, .eyebrow),
  .lsf-split > p, .lsf-split > div > p, .lsf-benefit > div > p,
  .rn-row > div > p, .rco-intro > div > p, .rco-heading > p, .rco-row > p,
  .rco-editorial > div > p, .cs-story-row > div > p,
  .rn-prose :is(p, li), .cs-case-copy :is(p, li), .rs-editorial > div > p
) {
  font-family: var(--rel-type-sans) !important;
  font-size: var(--rel-type-detail-size) !important;
  line-height: 1.7 !important;
  letter-spacing: normal !important;
  text-wrap: pretty;
}

body[data-relacion-typography="home-v1"] :is(
  .q-benefit-copy > div, .lsf-benefit > div, .rn-row > div,
  .cs-story-row > div, .rco-row, .q-start-steps > li > div,
  .ar-deliverables > li > div, .rs-process > article > div
) > :is(h2, h3) + p {
  margin-block-start: var(--rel-space-copy);
}

body[data-relacion-typography="home-v1"] :is(
  .rn-prose, .cs-case-copy
) :is(p, ul, ol):not([class]) {
  max-inline-size: var(--rel-reading-measure);
}

/* The homepage's serif is an editorial accent; useful supporting titles
   use its smaller sans role. This avoids inheriting the old 700-weight h2. */
body[data-relacion-typography="home-v1"] :is(
  .q-start-steps h3, .ar-deliverables h3, .rs-process h3
) {
  font: 500 clamp(1.375rem, 2.15vw, 1.75rem)/1.25 var(--rel-type-serif) !important;
  letter-spacing: -.025em !important;
}

body[data-relacion-typography="home-v1"] :is(
  .bl-setup-details h3, .rs-commercial-rows h3, .ar-standard h3,
  .rs-route-result h3, .rs-output h3, .rt-result h3, .rtv2-message-heading h3,
  .rtv2-settings h3, .rtv2-review h3, .rdemo-grid > section > h3,
  .rpack-downloads h3, .gw-step h3
) {
  font: 500 1.4375rem/1.3 var(--rel-type-support) !important;
  letter-spacing: -.025em !important;
}

body[data-relacion-typography="home-v1"] :is(
  .rn-outline h2, .cs-case-outline h2
) {
  font: 600 1rem/1.4 var(--rel-type-sans) !important;
  letter-spacing: -.015em !important;
  margin-block: 0 var(--rel-space-copy);
}

body[data-relacion-typography="home-v1"] :is(
  .rn-outline nav a, .cs-case-outline nav a
) {
  font: 400 var(--rel-type-caption-size)/1.6 var(--rel-type-sans);
}

/* Task entry titles keep the signature pairing in a smaller scale. */
body[data-relacion-typography="home-v1"] main :is(.cro-enquiry > .cro-enquiry-grid > div, .s-section .cro-privacy, .error-page) > h1 {
  font: 560 var(--rel-type-utility-title)/1.1 var(--rel-type-sans) !important;
  letter-spacing: -.035em !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

body[data-relacion-typography="home-v1"] .cro-enquiry-grid > div > h1 em {
  font-size: .97em;
  line-height: 1.15;
}

body[data-relacion-typography="home-v1"] .error-page > p {
  font: 400 var(--rel-type-detail-size)/1.7 var(--rel-type-sans);
  max-inline-size: 48ch;
  margin-block: var(--rel-space-intro) var(--rel-space-action);
}
