/* ==========================================================================
   Site header
   Utility bar (ink) + main bar (paper), a Services dropdown and a mobile menu.
   Full width, mobile first. Breakpoints: 640 utility text · 768 tablet ·
   1024 full nav · 1280 roomy.

   Sticky: the header sticks at top: -utility height, so the utility bar
   scrolls away and the main bar stays. No JS is needed for that. header.js
   only adds .is-stuck (utility fades, bar gets its shadow).
   ========================================================================== */

.hdr-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: var(--util-h);
  pointer-events: none;
  visibility: hidden;
}

/* Full width at every size: both bars run edge to edge; their content is capped at --hdr-max. */
.hdr {
  position: sticky;
  top: calc(-1 * var(--util-h));
  z-index: var(--z-header);
}

/* ---- Utility bar -------------------------------------------------------- */

.util {
  height: var(--util-h);
  background: var(--ink-900);
  color: var(--slate-300);
  font-size: 0.8125rem;
  transition: opacity var(--t-base) var(--ease-out), visibility 0s linear;
}

.hdr.is-stuck .util {
  opacity: 0;
  visibility: hidden; /* also takes its links out of the tab order while off-screen */
  transition: opacity var(--t-base) var(--ease-out), visibility 0s linear var(--t-base);
}

.util :focus-visible { outline-color: var(--color-focus-on-ink); }

.util__inner {
  max-width: var(--hdr-max);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 4px;
}

.util__contact,
.util__social {
  display: flex;
  align-items: center;
}

.util__contact { min-width: 0; }

.util__contact > li {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Location from 1024px, the "worldwide" line from 1280px. */
.util__contact > .util__meta { display: none; }

.util__link,
.util__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-sm);
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}

.util__link { gap: 8px; }
.util__link .icon,
.util__meta .icon { flex-shrink: 0; color: var(--slate-400); transition: color var(--t-fast) var(--ease-out); }

.util__link:hover,
a.util__icon:hover { color: var(--paper); }
.util__link:hover .icon { color: var(--paper); }

.util__icon.is-pending { opacity: 0.45; cursor: default; }

/* Phones: icons only (phone + email left, profiles right). */
@media (max-width: 639.98px) {
  .util__text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .util__social-mail { display: none; }
}

@media (min-width: 640px) {
  .util__inner { padding-inline: var(--hdr-pad) calc(var(--hdr-pad) - 10px); }
  .util__link { min-width: 0; min-height: var(--util-h); justify-content: flex-start; }
  .util__icon { min-width: 36px; min-height: var(--util-h); }
  .util__contact > li + li::before {
    content: "";
    width: 1px;
    height: 14px;
    margin-inline: 16px 8px;
    background: rgb(203 213 225 / 0.22);
  }
}

@media (min-width: 1024px) { .util__contact > .util__meta--place { display: flex; } }
@media (min-width: 1280px) { .util__contact > .util__meta--reach { display: flex; } }

/* ---- Main bar ----------------------------------------------------------- */

.bar {
  position: relative;
  height: var(--bar-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* Stuck shadow lives on a pseudo-element so only its opacity animates. */
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  box-shadow: var(--shadow-stuck);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
  pointer-events: none;
}

.hdr.is-stuck .bar::after { opacity: 1; }

.bar__inner {
  max-width: var(--hdr-max);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: var(--hdr-pad);
}

/* ---- Brand -------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  margin-right: auto;
  border-radius: var(--r-sm);
  color: var(--ink-900);
  text-decoration: none;
}

.brand__mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}

.brand__mark img { width: 100%; height: 100%; object-fit: contain; }

.brand__monogram {
  font-size: 1.5rem;
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: -0.06em;
  line-height: 1;
}

.brand__rule {
  flex-shrink: 0;
  width: 1px;
  height: 28px;
  background: var(--slate-300);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand__name {
  font-size: 0.875rem;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__role {
  font-size: 0.71875rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Safety net: never run under the CTA, whatever the font does. */
.brand__name,
.brand__role {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small phones (360–399): tighten so name + role + CTA + menu fit on one row. */
@media (max-width: 399.98px) {
  .bar__inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__monogram { font-size: 1.3125rem; }
  .brand__name { font-size: 0.84375rem; font-stretch: 80%; }
  .brand__role { font-size: 0.6875rem; font-stretch: 88%; }
}

/* Under 360 (old 320px phones): the name alone. */
@media (max-width: 359.98px) {
  .brand__mark,
  .brand__rule,
  .brand__role { display: none; }
}

@media (min-width: 768px) {
  .brand { gap: 14px; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__monogram { font-size: 1.75rem; }
  .brand__rule { height: 34px; }
  .brand__name { font-size: 1rem; }
  .brand__role { font-size: 0.8125rem; }
}

@media (min-width: 1024px) {
  .brand { margin-right: 0; }
}

@media (min-width: 1280px) {
  .brand { gap: 16px; }
  .brand__mark { width: 46px; height: 46px; }
  .brand__monogram { font-size: 2rem; }
  .brand__rule { height: 40px; }
  .brand__name { font-size: 1.125rem; font-stretch: 90%; letter-spacing: 0.05em; }
  .brand__role { font-size: 0.875rem; }
}

/* ---- Primary nav (desktop) ---------------------------------------------- */

.pnav { display: none; }

@media (min-width: 1024px) {
  .pnav {
    display: block;
    align-self: stretch;
    margin-inline: auto;
  }
  .pnav__list {
    display: flex;
    align-items: stretch;
    height: 100%;
  }
  .pnav__item {
    position: relative;
    display: flex;
    align-items: center;
  }
}

.pnav__link {
  --pad: 10px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding-inline: var(--pad);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--slate-800);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out);
}

/* Underline under the word only (not the chevron). */
.pnav__link::after {
  content: "";
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--slate-300);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-base) var(--ease-out);
}

.pnav__trigger::after { right: calc(var(--pad) + 20px); }

.pnav__link:hover,
.pnav__trigger[aria-expanded="true"] { color: var(--ink-900); }
.pnav__link:hover::after { transform: scaleX(1); }

.pnav__link.is-active { color: var(--blue-600); }
.pnav__link.is-active::after { background: var(--blue-600); transform: scaleX(1); }

.pnav__chev { transition: transform var(--t-base) var(--ease-out); }
.pnav__trigger[aria-expanded="true"] .pnav__chev { transform: rotate(180deg); }

@media (min-width: 1280px) {
  .pnav__link { --pad: 14px; font-size: 1rem; }
}

/* ---- Services dropdown -------------------------------------------------- */

.dd {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 8px;
  width: 680px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px);
  transition:
    opacity var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out),
    visibility 0s linear var(--t-base);
}

/* Hover bridge across the gap between the bar and the panel. */
.dd::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.pnav__trigger[aria-expanded="true"] + .dd,
html:not(.js) .pnav__item--dd:is(:hover, :focus-within) .dd {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.dd__list {
  display: grid;
  gap: 2px;
}

.dd__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--ink-900);
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out);
}

.dd__link:hover,
.dd__link:focus-visible { background: var(--color-primary-soft); }
.dd__link:focus-visible { outline-offset: -2px; }

.dd__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--slate-100);
  color: var(--blue-600);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.dd__link:hover .dd__icon,
.dd__link.is-current .dd__icon {
  background: var(--blue-600);
  color: var(--paper);
}

.dd__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dd__label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.dd__link.is-current .dd__label { color: var(--blue-700); }

.dd__desc {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.dd__note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 18px 12px;
  border-radius: var(--r-md);
  background: var(--ink-900);
}

.dd__note-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--paper);
}

.dd__note-link {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 44px;
  border-radius: var(--r-sm);
  color: var(--teal-500);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.dd__note-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dd__note-link .icon { transition: transform var(--t-base) var(--ease-out); }
.dd__note-link:hover .icon { transform: translateX(3px); }
.dd__note :focus-visible { outline-color: var(--color-focus-on-ink); }

/* ---- Actions: Book a Call + menu button --------------------------------- */

.bar__actions {
  display: flex;
  align-items: center;
  gap: 8px; /* ≥8px clearance between the two tap targets */
  flex-shrink: 0;
}

.btn-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 14px;
  border-radius: var(--r-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.btn-call:hover { background: var(--color-primary-hover); }
.btn-call:active { background: var(--color-primary-active); transform: translateY(1px); }
.btn-call:focus-visible { outline-offset: 3px; }

.btn-call__arrow {
  display: none;
  transition: transform var(--t-base) var(--ease-out);
}
.btn-call:hover .btn-call__arrow { transform: translateX(3px); }

@media (max-width: 399.98px) {
  .btn-call { padding-inline: 8px; } /* pays for the 8px action gap at 360 */
  .btn-call__icon { display: none; }
}

@media (min-width: 768px) {
  .btn-call { height: 48px; padding-inline: 18px; font-size: 0.9375rem; }
}

@media (min-width: 1280px) {
  .btn-call { height: 52px; padding-inline: 22px; font-size: 1rem; }
  .btn-call__arrow { display: block; }
}

.burger {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-900);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out);
}

@media (hover: hover) {
  .burger:hover { background: var(--slate-100); }
}
.burger__close { display: none; }
.burger[aria-expanded="true"] .burger__open { display: none; }
.burger[aria-expanded="true"] .burger__close { display: block; }

@media (min-width: 1024px) { .burger { display: none; } }

/* ---- Mobile menu -------------------------------------------------------- */

.mnav { display: none; }

@media (max-width: 1023.98px) {
  /* Opens under the bar and fills the rest of the screen. */
  .js .mnav.is-mounted {
    display: block;
    position: fixed;
    inset: var(--menu-top, 108px) 0 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-surface);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  }

  .js .mnav.is-open {
    opacity: 1;
    transform: none;
  }

  /* Without JS: the header scrolls normally and the menu sits open under it. */
  html:not(.js) .hdr { position: relative; top: auto; }
  html:not(.js) .mnav {
    display: block;
    pointer-events: auto;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  html:not(.js) .burger { display: none; }
}

.mnav__inner {
  max-width: 640px;
  margin-inline: auto;
  padding: 12px var(--hdr-pad) 32px;
}

.mnav__list {
  display: grid;
  gap: 2px;
}

.mnav__link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding-inline: 14px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink-900);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out);
}

/* Hover tints only where hover exists; on phones a tap would leave them stuck. */
@media (hover: hover) {
  .mnav__link:hover { background: var(--slate-100); }
  .mnav__sublink:hover { background: var(--slate-100); color: var(--ink-900); }
  a.mnav__contact:hover { color: var(--blue-700); }
}

.mnav__icon {
  flex-shrink: 0;
  color: var(--slate-500);
}

.mnav__link.is-active {
  background: var(--color-primary-soft);
  color: var(--blue-700);
  font-weight: 600;
}

.mnav__link.is-active .mnav__icon { color: var(--blue-600); }

.mnav__chev {
  margin-left: auto;
  color: var(--slate-500);
  transform: rotate(-90deg);
  transition: transform var(--t-base) var(--ease-out);
}

.mnav__link[aria-expanded="true"] .mnav__chev { transform: rotate(0deg); }

.mnav__sub {
  display: grid;
  gap: 2px;
  padding: 4px 0 8px 36px; /* sub-link text lines up with the "Services" label */
}

.mnav__sub[hidden] { display: none; }

.mnav__sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  border-radius: var(--r-sm);
  color: var(--slate-700);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}

.mnav__sublink.is-current {
  background: var(--color-primary-soft);
  color: var(--blue-700);
  font-weight: 600;
}

.mnav__direct {
  margin-top: 16px;
  padding: 20px 14px 0;
  border-top: 1px solid var(--color-border);
}

.mnav__label {
  margin-bottom: 4px;
  color: var(--slate-500);
  font-size: 0.8125rem;
  font-weight: 600;
}

.mnav__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink-900);
  font-size: 0.9375rem;
  text-decoration: none;
}

.mnav__contact .icon {
  flex-shrink: 0;
  color: var(--slate-500);
}

.mnav__contact--static {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

@media (max-width: 639.98px) {
  .util { display: none; }
}
