/* Pack D: visual-only refinements derived from the approved production palette. */
:root {
  --visual-surface-cool: #f2f5f5;
  --visual-surface-blue: #dceaf0;
  --visual-surface-warm: #f5f3ee;
  --visual-text-secondary: #4b6068;
}

/* Shared overlay improves white navigation on bright Heroes; brand colors,
   Logo assets and the existing 0 / 24 / 25px behavior remain unchanged. */
.site-header:not(.is-scrolled) {
  background-image: linear-gradient(rgba(39, 67, 82, .72), rgba(39, 67, 82, .72));
}

/* The legacy decorative polygon must end at its own Hero, not 15vw beyond it. */
.article-header::before {
  right: 0;
  width: 40vw;
  clip-path: polygon(52.25% 0, 100% 0, 100% 100%, 0 100%);
}

/* Products and Accessories do not receive the page-body visual modifier. */
.visual-pack-d-page main :is(h1, h2, h3) { text-wrap: balance; }
.visual-pack-d-page main :is(h1, h2, h3) > span { text-wrap: balance; }

/* White technical introductions share a scale distinct from photographic Heroes. */
.visual-pack-d-page :is(.dml-detail, .ai-detail, .mf-detail, .ip-detail) h1 {
}
.visual-pack-d-page :is(.dml-detail, .ai-detail, .mf-detail, .ip-detail) h2 {
}
.visual-pack-d-page :is(.bh-detail, .cc-detail) #hero,
.visual-pack-d-page :is(.nw-master-hero, .nw-article-intro, .dml-hero, .ai-hero, .mf-hero, .ip-hero) {
  padding-top: clamp(64px, 7.5vw, 108px);
}

/* Remove legacy DML poster-copy styling leaking into the clean technical grid. */
.dml-detail .dml-hero-copy {
  width: min(1280px, calc(100% - 2 * clamp(24px, 5vw, 72px)));
  margin: 0 auto;
  padding: 0;
  background: transparent;
  text-align: left;
  align-items: start;
  gap: 24px clamp(32px, 6vw, 86px);
}
.dml-detail .dml-hero-visual {
  width: min(100%, 1080px);
  margin-top: clamp(40px, 5vw, 72px);
}
.dml-detail .dml-hero-visual img {
  max-height: 640px;
  object-fit: contain;
}

/* Secondary text uses an existing readable blue-grey, without tinting imagery. */
.cm-page { --cm-muted: var(--visual-text-secondary); }
.ac-page { --ac-muted: var(--visual-text-secondary); }
.project-case-page { --case-muted: var(--visual-text-secondary); }
.projects-page { --pj-muted: var(--visual-text-secondary); }
.technology-page { --tech-muted: var(--visual-text-secondary); }
.technology-dml-page { --dml-muted: var(--visual-text-secondary); }
.architectural-integration-page { --ai-muted: var(--visual-text-secondary); }
.materials-finishes-page { --mf-muted: var(--visual-text-secondary); }
.case-location { color: var(--visual-text-secondary); }
.ap-section-index, .ap-principle-number, .ap-hero-figure figcaption,
.ap-system-kicker, .ap-project-support .ap-kicker { color: var(--visual-text-secondary); }

/* Keep warm surfaces where they contribute to the story, not as a default. */
.applications-overview { --ap-warm: var(--visual-surface-cool); --ap-copy: #fff; }
.ap-principles { background: var(--visual-surface-cool); }
.ss-detail .ss-warm { background: var(--visual-surface-cool); }
.bh-detail, .cc-detail { background: #fff; }
.bh-detail #the-beginning { background: var(--visual-surface-warm); }

/* Same-role headings and grid CTAs share a consistent rhythm. */
.cm-page .cm-section-heading h2, .cm-page .cm-support h2 {
}
.cm-project, .ap-project-info, .tech-project-grid > a, .nw-story-copy {
  display: flex;
  flex-direction: column;
}
.cm-project > a:last-child, .ap-project-link,
.tech-project-grid > a > span:last-child, .nw-story-copy > .nw-link:last-child {
  margin-top: auto;
  align-self: flex-start;
}
.cm-project > p:not(.cm-project-type), .tech-project-grid p { min-height: 0; }
.tech-project-grid > a { gap: 16px; }
.nw-story { display: flex; flex-direction: column; }
.nw-story-copy { flex: 1; gap: 16px; }

/* Retain horizontal grouping rules; remove redundant internal vertical rails. */
.tech-trio > div, .tech-trio > div + div { border-right: 0; }
.tech-terms span { border-right: 0; }
.case-amplifier { border-left: 0; border-right: 0; }
.tech-dml figure img { mix-blend-mode: normal; }

@media (max-width: 900px) {
  .dml-detail .dml-hero-copy { gap: 24px; }
  .dml-detail .dml-hero-copy .dml-lead { margin-top: 0; }
}

/* Preserve authored clauses while balancing each phrase independently. */
.visual-pack-d-page main .visual-line { display: inline-block; max-width: 100%; text-wrap: balance; }
.article-content a { overflow-wrap: anywhere; }

/* Keep the project-condition phrase intact; readable secondary labels. */
.visual-pack-d-page .visual-phrase { display: inline; white-space: nowrap; }
.pj-information-kicker, .pj-information li small,
.avalon-page .case-detail small, .tech-doc-action.is-contact small { color: var(--visual-text-secondary); }

/* Pack D.1: only the six installation-path labels on /products. */
.product-range-page #installation-paths .pr-heading > .pr-eyebrow,
.product-range-page #installation-paths .pr-path-label,
.product-range-page #installation-paths .pr-path-guidance a {
  color: var(--visual-text-secondary);
}
