:where(html[data-coase-design]) {
  scroll-padding-top: var(--coase-header-height, 0px);
}
:where(html[data-coase-design]) *,
:where(html[data-coase-design]) *::before,
:where(html[data-coase-design]) *::after { box-sizing: border-box; }
:where(html[data-coase-design]) body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
}
:where(html[data-coase-design]) :is(h1,h2,h3) {
  font-weight: 300;
  text-wrap: balance;
}
:where(b,strong,th,dt) { font-weight: 500; }
:where(code,kbd,pre,samp) { font-family: var(--mono); }
:where(html[data-coase-design]) :is(button,input,select,textarea) { font: inherit; }
:where(html[data-coase-design]) [hidden] { display: none; }
:where(html[data-coase-design]) a { color: inherit; }
:where(html[data-coase-design]) :is(a,button,input,summary,select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:where(html[data-coase-design]) .skip {
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: 12px;
  z-index: 1200;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(calc(-100% - 16px));
}
:where(html[data-coase-design]) .skip:focus { transform: none; }
@media (prefers-reduced-motion: reduce) {
  :where(html[data-coase-design]) { scroll-behavior: auto; }
}

/* Shared light surfaces for the established catalogue, articles and forms. */
/* Shared light presentation. Embedded previews and exported documents keep their own palettes. */






html:root[data-coase-page]:not([data-coase-page="home"]) {
  color-scheme: light;
  background: var(--coase-paper);
  color: var(--coase-ink);
  font-family: var(--coase-sans);
  --bg: var(--coase-paper);
  --fg: var(--coase-ink);
  --panel: var(--coase-white);
  --ink: var(--coase-ink);
  --soft: var(--coase-copy);
  --muted: var(--coase-muted);
  --line: var(--coase-line);
  --accent: var(--coase-signal);
  --copper: var(--coase-signal);
}

html:root[data-coase-page]:not([data-coase-page="home"]) body {
  background-color: var(--coase-paper);
  color: var(--coase-ink);
  font-family: var(--coase-sans);
}

html:root[data-coase-page]:not([data-coase-page="home"]) main h1 {
  font-family: var(--coase-sans);
  font-weight: 300;
  letter-spacing: -.02em;
}

html:root:is([data-coase-page="about"], [data-coase-page="access"], [data-coase-page="archive"], [data-coase-page="catalogue"], [data-coase-page="contact"], [data-coase-page="knowledge"], [data-coase-page="publication"], [data-coase-page="suite"], [data-coase-page="software"]) main h1 {
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.04;
}
html:root[data-coase-page]:not([data-coase-page="home"]) main h1 > span:last-child:not([class]) { color: var(--accent); }

html:root body :is(footer.footer, .coase-legal-footer) {
  border-color: var(--coase-line);
  background-color: var(--coase-paper);
  color: var(--coase-copy);
  font-family: var(--coase-sans);
}

html:root body footer.footer :is(a, .motion-toggle) { color: var(--coase-copy); }

/* Case study index and case reading surfaces. */
html:root body.credentials-page {
  --archive-bg: var(--coase-paper);
  --archive-panel: var(--coase-white);
  --archive-ink: var(--coase-ink);
  --archive-muted: var(--coase-copy);
  --archive-accent: var(--coase-signal);
  --archive-line: var(--coase-line);
  --archive-serif: var(--coase-sans);
  --archive-selected: var(--coase-graphite);
  --archive-selected-ink: var(--coase-white);
}

html:root .credentials-page::before {
  background: var(--coase-grid),
    linear-gradient(180deg, transparent, var(--coase-paper) 88%),
    linear-gradient(90deg, #ffffff 28%, #ffffffa6),
    url("/media/photos/coase-concrete-colonnade.jpg") right 45% / cover;
}

html:root .credentials-controls { background: #fffffff5; }
html:root .credentials :is(input, .credentials-formats button:not([aria-pressed="true"])) {
  border-color: var(--coase-control);
  border-radius: var(--coase-radius);
}
html:root .credential { border-radius: var(--coase-radius); }
html:root .credential-cover img { opacity: .58; filter: grayscale(1); }
html:root .credential-cover::after { background: linear-gradient(0deg, var(--coase-white), #ffffff42 52%, transparent); }
html:root .credential-report-cover { background: #e6e6e6; }
html:root .credential-report-cover img { opacity: 1; filter: none; }
html:root .credential-report-cover::after { background: linear-gradient(0deg, var(--coase-white), transparent 24%); }

html:root:is([data-coase-page="report"], [data-coase-page="background"]) #coase-report {
  --rp-bg: var(--coase-paper);
  --rp-panel: var(--coase-white);
  --rp-fg: var(--coase-ink);
  --rp-muted: var(--coase-muted);
  --rp-accent: var(--coase-signal);
  --rp-copper: var(--coase-signal);
  --rp-line: var(--coase-line);
  color-scheme: light;
  background-color: var(--coase-paper);
  color: var(--coase-ink);
  font-family: var(--coase-sans);
}

html:root .local-detail #coase-report .detail-previews > a {
  background: var(--coase-white);
  border-color: var(--coase-line);
}
html:root .local-detail #coase-report .detail-hero h1 { font-weight: 300; letter-spacing: -.02em; }

html:root .publication-handoff {
  background: var(--coase-grid),
    linear-gradient(90deg, #ffffff 30%, #ffffffab),
    url("/media/photos/coase-concrete-canopy.jpg") right center / cover;
  color: var(--coase-ink);
}

html:root .publication-handoff :is(p, a) { color: var(--coase-copy); }
html:root .publication-handoff :is(.eyebrow, h1 span) { color: var(--coase-signal); }
html:root .publication-handoff a { text-decoration: underline; text-underline-offset: 4px; }
html:root .publication-handoff :is(.publication-links a, .publication-back) {
  border-color: var(--coase-control);
  background: var(--coase-white);
  text-decoration: none;
}
html:root .publication-handoff :is(.publication-links a, .publication-back):hover { text-decoration: underline; }

/* Institutional and technical pages. */
html:root .about-page .about-hero::before {
  background: var(--coase-grid), linear-gradient(90deg, #ffffff 25%, #ffffffae),
    url("/media/photos/coase-concrete-overhang.jpg") right 43% / cover;
}

html:root .about-page .about-hero::after { background: linear-gradient(180deg, transparent 16%, var(--coase-paper)); }
html:root .about-page :is(.about-hero, .team-heading, .partner, .about-close) { border-color: var(--coase-line); }
html:root .about-page .about-position { color: var(--coase-signal); }
html:root .about-page :is(.about-copy p, .partner-detail > p:not(.partner-focus), .about-close > div > p) { color: var(--coase-copy); }
html:root .about-page .about-copy p:first-child { color: var(--coase-ink); }
html:root .about-page :is(.partner-identity p, .partner-focus, .about-close-actions a) { color: var(--coase-signal); }
html:root .about-page .about-close-actions a:hover { color: var(--coase-ink); }

html:root[data-coase-page="software"] {
  --surface: var(--coase-white);
  --text: var(--coase-ink);
  --brick: var(--coase-signal);
}
html:root[data-coase-page="software"] body a:hover { color: var(--coase-signal); }
html:root[data-coase-page="software"] .site-nav { background: var(--coase-white); }

html:root .software-page main { background: var(--coase-grid), linear-gradient(var(--coase-white), transparent 28rem); }
html:root .software-page .software-entry {
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid var(--coase-line);
  background: var(--coase-white);
}
html:root .software-page .software-name h2 { font-weight: 400; }
html:root .software-page .software-screen {
  justify-content: center;
  aspect-ratio: auto;
  padding: clamp(14px, 2vw, 28px);
  border-color: var(--coase-line);
  background: var(--coase-panel);
  box-shadow: none;
}
html:root .software-page .software-screen img {
  max-width: 360px;
  border: 1px solid var(--coase-line);
}
html:root .software-page .software-screen:hover { border-color: var(--coase-control); }
html:root .software-page .inline-link:hover { color: var(--coase-ink); }
html:root .release-page .release-preview { border-radius: var(--coase-radius); background: var(--coase-panel); }
html:root .software-page .software-cta {
  border-color: var(--coase-graphite);
  border-radius: var(--coase-radius);
  background: var(--coase-graphite);
  color: var(--coase-white);
}
html:root .software-page .software-cta:hover { background: var(--coase-white); color: var(--coase-ink); }

html:root[data-coase-page="knowledge"] {
  --stage: var(--coase-white);
  --dim: var(--coase-muted);
  --line2: var(--coase-control);
  --display: var(--coase-sans);
  --body: var(--coase-sans);
}
html:root[data-coase-page="knowledge"] body { background-image: var(--coase-grid); }
html:root[data-coase-page="knowledge"] :is(.hero h1 em, .sec-head h2 em) { font-style: normal; }
html:root[data-coase-page="knowledge"] .stratum { background: var(--coase-white); }
html:root[data-coase-page="knowledge"] .stratum.prop { background: var(--stone); border-color: var(--ash); }
html:root[data-coase-page="knowledge"] .klm {
  --klm-ink: #f1f1f1;
  --klm-ink-2: #ddd;
  --klm-muted: #c4c4c4;
  --klm-line: #8b8b8b;
  --klm-line-soft: #b3b3b348;
  --klm-line-strong: #b3b3b382;
  --klm-border: #a7a7a7;
  --klm-gold: #efb89e;
  --klm-panel: #242424;
  --klm-panel-strong: #303030;
  --klm-bg: #181818;
  --klm-sans: var(--coase-sans);
  padding-block: clamp(14px, 2vw, 28px);
  background: linear-gradient(135deg, #181818, #272727);
}

/* Catalogue, enquiry and access. */
html:root body.workflow-page {
  --fg: var(--coase-ink);
  --bg: var(--coase-paper);
  --muted: var(--coase-copy);
  --panel: var(--coase-white);
  --line: var(--coase-line);
  --copper: var(--coase-signal);
  --accent: var(--coase-signal);
}
html:root .local-library .library-atmosphere { background: var(--coase-paper); }
html:root .local-library .library-atmosphere::after {
  background: var(--coase-grid), linear-gradient(#ffffffb3, var(--coase-paper) 95%);
}
html:root .local-library .library-atmosphere img { filter: grayscale(1); opacity: .28; }
html:root body.services-page {
  --catalogue-line: var(--coase-line);
  --catalogue-amber: var(--coase-signal);
}
html:root .services-page :is(.catalogue-title h1, .catalogue-filter-details > summary, .filter-groups legend, .catalogue-card-head h2, .catalogue-case-link, .catalogue-card-actions button[aria-pressed="true"]) {
  color: var(--coase-ink);
}
html:root .services-page :is(.catalogue-title p, .catalogue-search-row label, #result-count, .catalogue-card-head > p, .catalogue-detail-body dd, .catalogue-detail-body ul, .catalogue-case > p, #empty p) {
  color: var(--coase-copy);
}
html:root .services-page :is(#filter-count, .catalogue-filter-plus, .catalogue-details > summary, .catalogue-detail-body dt, .catalogue-detail-body h3, .catalogue-card-resources > h3, .catalogue-card-actions a, .catalogue-card-actions button, .catalogue-case-link span, .catalogue-file-links a, .selection-head .pill) {
  color: var(--coase-signal);
}
html:root .services-page :is(.catalogue-card-actions a, .catalogue-card-actions button, .catalogue-case-link, .catalogue-file-links a):hover {
  color: var(--coase-ink);
  text-decoration: underline;
}
html:root .services-page .resource-filters button,
html:root .services-page :is(#catalogue-search, #more, #empty-reset) {
  background: var(--coase-white);
  border-color: var(--coase-control);
  color: var(--coase-ink);
}
html:root .services-page .catalogue-title > button {
  background: var(--coase-graphite);
  border-color: var(--coase-graphite);
  color: var(--coase-white);
}
html:root .services-page .catalogue-title > button:is(:hover, [aria-expanded="true"]) { background: var(--accent); }
html:root .services-page .catalogue-title > button #selection-count { color: inherit; }
html:root .services-page .catalogue-filter-details { padding-inline: 16px; }
html:root .services-page .catalogue-card-resources { background: var(--coase-panel); }
html:root .local-library.services-page :is(.filters, .service-row, .service-preview, #selection),
html:root .workflow-page :is(.direct-contact, #ct-enquiry, .ct-context) {
  border-color: var(--coase-line);
  border-radius: var(--coase-radius);
  background: var(--coase-white);
}
html:root .local-library.services-page .filters .filter-option {
  border-color: var(--coase-control);
  border-radius: var(--coase-radius);
  background: var(--coase-white);
  color: var(--coase-copy);
}
html:root .services-page .filters .filter-option input { background: var(--coase-white); border-color: var(--coase-control); }
html:root .services-page .filters .filter-option input:checked { background: var(--coase-white); border-color: var(--coase-signal); }
html:root .local-library.services-page .filters .filter-option:has(input:checked) { background: var(--stone); color: var(--coase-ink); }
html:root .local-library.services-page .resource-filters button[aria-pressed="true"] {
  border-color: var(--coase-graphite);
  background: var(--coase-graphite);
  color: var(--coase-white);
}
html:root .local-library .library-motion-control {
  background: var(--coase-white);
  border-color: var(--coase-control);
  color: var(--coase-copy);
}
html:root .workflow-page :is(#ct-form input, #ct-form textarea, .ct-review textarea) {
  background: var(--coase-white);
  border-color: var(--coase-control);
}
html:root .contact-page .direct-contact { padding: clamp(18px, 2vw, 28px); border: 1px solid var(--coase-line); }
html:root .contact-page :is(.direct-contact h2, .ct-form-heading h2, .ct-review h2) { color: var(--coase-ink); }
html:root .contact-page :is(.contact-offer-intro, .contact-route, .direct-contact p, .ct-form-heading p, .ct-form-heading .ct-required-note, #ct-form label, .ct-review label, .ct-review .ct-review-note) {
  color: var(--coase-copy);
}
html:root .contact-page .contact-route { border-color: var(--coase-line); }
html:root .contact-page :is(.contact-offer-intro a, .contact-route a, .contact-email, .ct-optional summary, #ct-status) { color: var(--coase-signal); }
html:root .contact-page :is(.ct-field-error, .ct-errors, .ct-errors button) { color: #9d231d; }
html:root .contact-page .ct-errors { background: #faecea; border-color: #9d231d; }
html:root .contact-page #ct-form [aria-invalid="true"] { border-color: #9d231d; outline-color: #9d231d; }
html:root :is(.workflow-page .ct-button, .access-page .preview-cta, .access-page .access-form > button) {
  border-color: var(--coase-graphite);
  border-radius: var(--coase-radius);
  background: var(--coase-graphite);
  color: var(--coase-white);
}
html:root :is(.workflow-page .ct-button, .access-page .preview-cta, .access-page .access-form > button):hover { background: var(--accent); color: var(--coase-white); }

html:root body.access-page {
  --access-bg: var(--coase-paper);
  --access-fg: var(--coase-ink);
  --access-muted: var(--coase-copy);
  --access-line: var(--coase-line);
  --access-accent: var(--coase-signal);
}
html:root .access-page :is(.access-form, .preview-pages figure) { background: var(--coase-white); }
html:root .access-page .access-form input { color: var(--coase-ink); background: var(--coase-white); border-color: var(--coase-control); }
html:root .access-page :is(.access-back:hover, .access-preview:hover) { color: var(--coase-ink); }
html:root .access-page :is(.access-status, .access-field-error, .access-errors, .access-errors button) { color: #9d231d; }
html:root .access-page :is(.access-errors, .access-form input[aria-invalid="true"]) { border-color: #9d231d; outline-color: #9d231d; }
html:root .access-page .preview-lightbox button { background: var(--coase-graphite); color: var(--coase-white); }
html:root .access-page .privacy-copy { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  html:root .legal-page .access-shell { padding-inline: 16px; }
}

/* The engagement form and the live blueprint have independent typography tokens. */
html:root:is([data-coase-page="configuration"], [data-coase-page="pilot"]) {
  --paper: var(--coase-paper);
  --accent-hover: var(--ink);
}
html:root[data-coase-page="configuration"] :is(.bar, .pilot-bar) { background: var(--coase-white); }
html:root[data-coase-page="configuration"] :is(.config-title, .step h2) { font-family: var(--coase-sans); }
html:root[data-coase-page="configuration"] .step h2 { font-weight: 500; letter-spacing: -.04em; }
html:root[data-coase-page="configuration"] :is(.option-group legend, .option-grid label, .notes) { color: var(--coase-ink); }
html:root[data-coase-page="configuration"] .option-grid label:has(:disabled) { color: var(--coase-muted); }
html:root[data-coase-page="configuration"] .step .option-grid label:has(:checked) { background: var(--stone); }
html:root[data-coase-page="configuration"] :is(.option-grid label, button, textarea) { border-radius: var(--coase-radius); }
html:root[data-coase-page="configuration"] :is(#step-next, #pdf) {
  border-color: var(--coase-graphite);
  background: var(--coase-graphite);
  color: var(--coase-white);
}
html:root[data-coase-page="configuration"] :is(#step-next, #pdf):hover { background: var(--accent); }
html:root[data-coase-page="configuration"] .proposal-cover {
  --ink: #f4f4f4;
  --accent: #efb89e;
  background: linear-gradient(135deg, #181818, #383838);
}

html:root .pilot-bar { background: var(--coase-white); border-color: var(--coase-line); }
html:root .pilot-bar :is(span, button) { color: var(--coase-copy); border-color: var(--coase-control); }
html:root .ccfg {
  --ccfg-bg: var(--coase-paper);
  --ccfg-paper: var(--coase-white);
  --ccfg-ink: var(--coase-ink);
  --ccfg-ink-strong: var(--coase-ink);
  --ccfg-body: var(--coase-copy);
  --ccfg-soft: var(--coase-copy);
  --ccfg-label: var(--coase-muted);
  --ccfg-faint: var(--coase-muted);
  --ccfg-line: var(--coase-line);
  --ccfg-line-2: var(--coase-line);
  --ccfg-line-3: var(--coase-control);
  --ccfg-select-bg: var(--stone);
  --ccfg-select-line: var(--accent);
  --ccfg-accent: var(--coase-signal);
  --ccfg-accent-hover: var(--ink);
  --ccfg-sans: var(--coase-sans);
  --ccfg-serif: var(--coase-sans);
}
html:root .ccfg :is(.ccfg__opt-label, .pilot-next p) { color: var(--coase-copy); }
html:root .ccfg :is(.ccfg__select, .ccfg__btn-outline, .ccfg__opt) { border-radius: var(--coase-radius); }
html:root .ccfg :is(.ccfg__bp-title, .ccfg__h) { font-weight: 500; letter-spacing: -.035em; }

html:root[data-coase-page="pilot"] .cwwd {
  --cwwd-bg: var(--coase-paper);
  --cwwd-surface: var(--stone);
  --cwwd-card: var(--coase-white);
  --cwwd-ink: var(--coase-ink);
  --cwwd-ink-strong: var(--coase-ink);
  --cwwd-muted: var(--coase-muted);
  --cwwd-soft: var(--coase-copy);
  --cwwd-label: var(--coase-muted);
  --cwwd-line: var(--coase-line);
  --cwwd-line-strong: var(--coase-control);
  --cwwd-accent: var(--coase-signal);
  --cwwd-sans: var(--coase-sans);
  --cwwd-serif: var(--coase-sans);
}
