/* D&C motion v03: baseline stays readable; JS only adds finite animations. */
:root {
  --dc-header-height: 105px;
  --dc-admin-offset: 0px;
  --dc-motion-ease: cubic-bezier(.22,1,.36,1);
}

html {
  scroll-padding-top: calc(var(--dc-header-height) + var(--dc-admin-offset) + 20px);
}

body.admin-bar { --dc-admin-offset: 32px; }
html:has(body.admin-bar) { --dc-admin-offset: 32px; }

body > header {
  position: sticky;
  top: var(--dc-admin-offset);
  z-index: 20;
  background: var(--paper, #f3f0e8);
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

body > header.dc-scrolled {
  border-bottom-color: #c8d1cd;
  box-shadow: 0 6px 20px #102e430a;
}

body > header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--orange, #74521d);
  transform: scaleX(var(--dc-scroll-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

/* Retire the previous CSS entrance; the current script owns hero timing. */
.hero-copy h1, .motion-enter { animation: none !important; }
.hero-art { isolation: isolate; }
.hero-art .dc-hero-image { overflow: hidden; }

.skip:focus { z-index: 100001; }

.dc-back-to-top {
  position: fixed;
  z-index: 30;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid #536d76;
  border-radius: 0;
  background: var(--ink, #102e43);
  color: #fff;
  box-shadow: 0 5px 15px #102e4318;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.dc-back-to-top[hidden] { display: none; }
.dc-back-to-top:hover {
  background: #1d3f55;
  border-color: #1d3f55;
}
.dc-back-to-top:focus-visible {
  outline: 3px solid var(--orange, #74521d);
  outline-offset: 4px;
}
.dc-back-to-top svg { flex: none; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .office-feature > .wp-block-image { overflow: hidden; }
  .office-feature > .wp-block-image img {
    transition: transform 650ms var(--dc-motion-ease);
  }
  .office-feature:hover > .wp-block-image img,
  .office-feature:focus-within > .wp-block-image img {
    transform: scale(1.015);
  }
  #main .wp-block-button__link,
  .dc-service-link,
  .brand-main-link { transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
}

@media (max-width: 782px) {
  body.admin-bar { --dc-admin-offset: 46px; }
  html:has(body.admin-bar) { --dc-admin-offset: 46px; }
}

@media (max-width: 600px) {
  body.admin-bar { --dc-admin-offset: 0px; }
  html:has(body.admin-bar) { --dc-admin-offset: 0px; }
  .dc-back-to-top {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  body > header,
  .dc-back-to-top,
  .office-feature > .wp-block-image img { transition: none !important; }
  .office-feature:hover > .wp-block-image img,
  .office-feature:focus-within > .wp-block-image img,
  .button:hover .arrow-icon,
  .secondary-button:hover .arrow-icon,
  .contact:hover .arrow-icon { transform: none !important; }
  nav a::after { transform: none; opacity: 0; }
  nav a:hover::after, nav a:focus-visible::after { opacity: 1; }
}

@media print {
  body > header { position: static; box-shadow: none; }
  body > header::after, .dc-back-to-top { display: none !important; }
}
