/* Blue picked from the original MZHBI logotype, with a deeper shade for the footer. */
body[data-ui-refresh][data-dx] {
  --mzhbi-brand-blue: #164066;
  --mzhbi-brand-deep: #162f46;
  --mzhbi-brand-tint: #e2ebf3;
  --navy: var(--mzhbi-brand-blue);
  --deep: var(--mzhbi-brand-deep);
  --ink: var(--mzhbi-brand-blue);
  --ui-ink: var(--mzhbi-brand-blue);
  --dx-ink: var(--mzhbi-brand-blue);
  --ui-soft: #f0f4f8;
  --dx-paper: #f2f5f8;
  --mist: #eef3f7;
  --mist2: #e3ebf2;
}

body[data-ui-refresh][data-dx] :is(.contact-band, .region-hero + .stats, main#main section.cta),
body[data-ui-refresh][data-dx] > main#main :is(.mzd-detail, .dx-object-detail, .ui-bulk) {
  background-color: var(--mzhbi-brand-blue);
}

body.mzhbi-site.mzhbi-2026[data-dx] > .site-footer {
  background-color: var(--mzhbi-brand-deep);
}

body[data-ui-refresh][data-dx] > main#main .mzd {
  --ink: var(--mzhbi-brand-blue);
  --green: var(--mzhbi-brand-tint);
}

body[data-ui-refresh][data-dx] > main#main .mzd :is(
  .mzd-section-nav a[aria-current],
  .mzd-display-modes button[aria-pressed="true"],
  .mzd-motion-control button[aria-pressed="true"],
  .mzd-tools button[aria-pressed="true"],
  .mzd-models button[aria-pressed="true"],
  .mzd-object-picker button[aria-expanded="true"]
) {
  background-color: var(--mzhbi-brand-blue);
  border-color: var(--mzhbi-brand-blue);
}

body[data-ui-refresh][data-dx] > main#main .mzd .mzd-row[aria-pressed="true"] {
  background-color: var(--mzhbi-brand-tint);
}

body[data-ui-refresh][data-dx] > main#main :is(
  .b2b-paths, .b2b-callout, .b2b-request-guide, .project-order-note, .request-email-direct,
  .supply-case, .resource-card, .dx-compare-table th, .mzd-notice, .mzd-model, .mzd-tools, .mzd-object-picker
) {
  background-color: #eef3f7;
}

body[data-ui-refresh][data-dx] > main#main :is(.photo-watermark, .photo-domain-watermark) {
  color: #fff;
  background-color: rgb(22 47 70 / 86%);
}

@property --mzhbi-halo-opacity {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body[data-ui-refresh][data-dx] > main#main.mzhbi-halo-ready {
    --mzhbi-halo-opacity: 0;
    background-image:
      radial-gradient(
        ellipse 460px 385px at var(--mzhbi-halo-x, 50%) var(--mzhbi-halo-y, 50%),
        rgb(22 64 102 / var(--mzhbi-halo-opacity)) 0%,
        rgb(22 64 102 / calc(var(--mzhbi-halo-opacity) * 0.48)) 42%,
        transparent 100%
      ),
      url("./mzhbi-concrete-neutral-v1.jpg");
    background-attachment: fixed, scroll;
    background-position: center, center top;
    background-repeat: no-repeat, repeat;
    background-size: auto, clamp(720px, 100vw, 1000px) auto;
    transition: --mzhbi-halo-opacity 210ms ease-out;
  }

  body[data-ui-refresh][data-dx] > main#main.mzhbi-halo-active {
    --mzhbi-halo-opacity: 0.16;
  }
}

@media (prefers-reduced-motion: no-preference) {
  body[data-ui-refresh][data-dx] .site-header :is(.brand, .logo) img.brand-logo-stage01 {
    animation: mzhbi-logo-turn 22s linear infinite;
    transform-origin: center center;
  }

  body[data-ui-refresh][data-dx] .site-header :is(.brand, .logo):focus-visible img.brand-logo-stage01 {
    animation: none;
  }
}

/* Flip the image only while it is edge-on so the lettering stays legible. */
@keyframes mzhbi-logo-turn {
  0% { transform: perspective(600px) rotateY(0deg) scaleX(1); }
  24.99% { transform: perspective(600px) rotateY(90deg) scaleX(1); }
  25% { transform: perspective(600px) rotateY(90deg) scaleX(-1); }
  74.99% { transform: perspective(600px) rotateY(270deg) scaleX(-1); }
  75% { transform: perspective(600px) rotateY(270deg) scaleX(1); }
  100% { transform: perspective(600px) rotateY(360deg) scaleX(1); }
}
