/* Keep the reading canvas light even when the device prefers dark mode. */
html {
  color-scheme:only light;
  background-color:var(--canvas, #ffffff);
}
body {
  background-color:var(--canvas, #ffffff);
}

/* Shared header geometry. Scoped specificity wins over both legacy page sheets. */
html:has(.site-header) {
  scrollbar-gutter:stable;
}

.site-header[class] {
  --site-header-gutter:40px;
  --site-header-height:100px;
  --site-header-first-row:76px;
  position:relative;
  z-index:30;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:24px;
  width:100%;
  max-width:none;
  height:var(--site-header-height);
  min-height:var(--site-header-height);
  margin:0;
  padding:0 var(--site-header-gutter);
  border:0;
  border-bottom:1px solid var(--border);
  background:var(--canvas);
  color:var(--text);
  font:400 16px/1.5 var(--sans);
}

.site-header .brand {
  display:flex;
  grid-column:1;
  grid-row:1;
  align-items:center;
  gap:18px;
  min-width:0;
  min-height:44px;
  margin:0;
  white-space:nowrap;
}

.site-header .brand img {
  display:block;
  flex:none;
  width:110px;
  height:auto;
  aspect-ratio:1299 / 441;
}

.site-header .brand span {
  display:block;
  padding:0 0 0 18px;
  border:0;
  border-left:1px solid var(--border);
  font:400 14px/24px var(--sans);
}

.site-header .desktop-nav {
  display:flex;
  grid-column:2;
  grid-row:1;
  justify-self:end;
  align-items:center;
  gap:20px;
  margin:0;
}

.site-header :is(.desktop-nav,.mobile-nav) a {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  min-height:44px;
  color:var(--text);
  font:400 16px/24px var(--sans);
  white-space:nowrap;
  text-decoration:none;
}

.site-header :is(.desktop-nav,.mobile-nav) a:hover,
.site-header :is(.desktop-nav,.mobile-nav) a[aria-current=page] {
  color:var(--action);
  text-decoration:underline;
  text-underline-offset:8px;
}

.site-header .header-contact {
  display:flex;
  grid-column:3;
  grid-row:1;
  align-self:center;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:0;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  white-space:nowrap;
}

.site-header .header-phone {
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  margin:0;
  color:var(--action);
  font:400 14px/24px var(--sans);
  white-space:nowrap;
}

.site-header .header-phone span {font:inherit}
.site-header .header-phone strong {
  font:600 21px/28px var(--sans);
  font-variant-numeric:tabular-nums;
}

.site-header .header-contact > p {
  margin:0;
  padding:0;
  color:var(--text-secondary);
  font:400 14px/22px var(--sans);
  text-align:left;
  overflow-wrap:normal;
}

.site-header .mobile-nav {display:none;margin:0}
.site-header .mobile-nav summary {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  list-style:none;
  cursor:pointer;
}
.site-header .mobile-nav summary::-webkit-details-marker {display:none}
.site-header .menu-icon {
  display:block;
  width:24px;
  height:24px;
  background:currentColor;
  mask:url('/media/icons/Menu.svg') center/contain no-repeat;
}
.site-header .mobile-nav[open] .menu-icon {mask-image:url('/media/icons/X.svg')}
.site-header .mobile-nav nav {
  position:absolute;
  top:100%;
  left:0;
  right:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px 20px;
  margin:0;
  padding:18px var(--site-header-gutter) 26px;
  border:0;
  border-bottom:1px solid var(--border);
  background:var(--canvas);
  box-shadow:none;
}
.site-header .mobile-nav nav a {justify-content:flex-start}
.site-header :is(a,summary):focus-visible {
  outline:2px solid var(--focus);
  outline-offset:4px;
}

@media(min-width:1440px) {
  .site-header[class] {--site-header-gutter:64px}
}
@media(min-width:1800px) {
  .site-header[class] {--site-header-gutter:80px}
}
@media(max-width:1199px) {
  .site-header[class] {
    --site-header-gutter:28px;
    --site-header-height:calc(var(--site-header-first-row) + 82px + 1px);
    grid-template-columns:minmax(0,1fr) 44px;
    grid-template-rows:var(--site-header-first-row) 82px;
    gap:0 12px;
  }
  .site-header .desktop-nav {display:none}
  .site-header .mobile-nav {display:block;grid-column:2;grid-row:1;justify-self:end}
  .site-header .header-contact {
    grid-column:1 / -1;
    grid-row:2;
    align-self:stretch;
    margin-inline:calc(-1 * var(--site-header-gutter));
    padding:6px var(--site-header-gutter) 10px;
    background:var(--subtle);
  }
}
@media(max-width:600px) {
  .site-header[class] {--site-header-gutter:24px;--site-header-first-row:68px}
  .site-header .brand {gap:12px}
  .site-header .brand img {width:84px}
  .site-header .brand span {padding-left:12px;font-size:12px}
}
@media(max-width:350px) {
  .site-header[class] {--site-header-gutter:18px}
}
@media print {
  .site-header[class] {display:none}
}

/* Shared fixed navigation wins over legacy page rules through scoped selectors. */
html:has(.site-header) {
  --site-header-fallback:100px;
  scroll-padding-top:calc(var(--site-header-measured, var(--site-header-fallback)) + 16px);
}
body:has(.site-header) {
  padding-top:var(--site-header-measured, var(--site-header-fallback, 100px));
}
.site-header[class] {
  position:fixed;
  inset:0 0 auto;
  z-index:100;
}
body:has(.site-header) :is(main,section,article,h1,h2,h3,[id]) {
  scroll-margin-top:8px;
}
.site-header .mobile-nav nav {
  max-height:calc(100vh - var(--site-header-measured, var(--site-header-fallback, 100px)));
  max-height:calc(100dvh - var(--site-header-measured, var(--site-header-fallback, 100px)));
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-bottom:max(26px, env(safe-area-inset-bottom));
}
button.site-back-to-top {
  position:fixed;
  right:max(16px, env(safe-area-inset-right));
  bottom:max(16px, env(safe-area-inset-bottom));
  z-index:80;
  display:grid;
  place-items:center;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  margin:0;
  padding:0;
  border:1px solid var(--border);
  border-radius:50%;
  background:var(--canvas);
  color:var(--action);
  font:400 24px/1 var(--sans);
  cursor:pointer;
  box-shadow:0 3px 12px rgb(0 0 0 / .12);
}
button.site-back-to-top[hidden],
html.intro-pending button.site-back-to-top,
body:has(.site-header .mobile-nav[open]) button.site-back-to-top {display:none}
button.site-back-to-top:hover {border-color:var(--action)}
button.site-back-to-top:focus-visible {outline:2px solid var(--focus);outline-offset:4px}
@media(max-width:1199px) {
  html:has(.site-header) {--site-header-fallback:159px}
}
@media(max-width:600px) {
  html:has(.site-header) {--site-header-fallback:151px}
}
@media(prefers-reduced-motion:reduce) {
  html:has(.site-header) {scroll-behavior:auto}
}
@media print {
  body:has(.site-header) {padding-top:0}
  html:has(.site-header) {scroll-padding-top:0}
  button.site-back-to-top {display:none}
}
