/* Header: a full-width bar, clear over the film and solid once the page moves, with the
   Services mega menu opening as a full-width sheet. The tone follows the section under the bar
   (header.js sets data-tone="dark|light" on the nav). Alan picked this design on 2026-11-17. */

/* ---------- tone tokens ---------- */
.nav {
  --hd-fg: #fff;
  --hd-mute: rgba(255, 255, 255, .6);
  --hd-solid: #0c0c0c;
  --hd-line: rgba(255, 255, 255, .12);
  --hd-tile: rgba(255, 255, 255, .07);
  --hd-hl: rgba(255, 255, 255, .1);
  color: var(--hd-fg);
}
.nav[data-tone="light"] {
  --hd-fg: var(--ink);
  --hd-mute: var(--mute-l);
  --hd-solid: #fff;
  --hd-line: rgba(26, 26, 26, .08);
  --hd-tile: var(--paper);
  --hd-hl: rgba(26, 26, 26, .055);
}
.nav[data-tone="light"] .nav-logo img { filter: brightness(0) saturate(0); opacity: .9; }
.nav-logo img { transition: filter .35s, opacity .35s; }

/* clear over the film; solid (no blur) once the page moves or the menu is open */
.nav, .nav.is-solid { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.nav { transition: background-color .35s, box-shadow .35s, transform .5s var(--ease-out); }
.nav.is-solid, .nav:has(.nav-drop.is-open) { background: var(--hd-solid); box-shadow: 0 1px 0 var(--hd-line); }

/* ---------- top-level items ---------- */
.nav-in { position: relative; isolation: isolate; }
.nav-links { position: relative; margin-left: auto; gap: 2px; font-size: 14.5px; }
.nav-links > a, .nav-trigger {
  position: relative; z-index: 1;
  height: 36px; padding: 0 13px; border-radius: 10px;
  color: var(--hd-fg); opacity: .8;
  transition: opacity .2s, color .35s;
}
.nav-links > a:hover, .nav-trigger:hover, .nav-drop.is-open .nav-trigger { opacity: 1; }
.nav-links > a:focus-visible, .nav-trigger:focus-visible, .nav-cta:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* the highlight that slides to whichever item the pointer is on */
.nav-hl {
  position: absolute; z-index: 0; top: 50%; left: 0;
  width: var(--hl-w, 0px); height: 36px; margin-top: -18px;
  border-radius: 10px; background: var(--hd-hl);
  transform: translateX(var(--hl-x, 0px));
  opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease-out), width .35s var(--ease-out), opacity .2s, background-color .35s;
}
.nav-links.has-hl .nav-hl { opacity: 1; }
.nav-links.hl-fresh .nav-hl { transition: opacity .2s, background-color .35s; }
.nav-cta { height: 40px; margin-left: 8px; padding: 0 18px; font-size: 14px; }
.nav-links > .nav-cta-m { display: none; }
.nav-burger { color: var(--hd-fg); }

/* ---------- Services mega menu ---------- */
.nav-drop { position: static; }
.nav-mega {
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  min-width: 0;
  padding: 30px max(var(--side), calc((100vw - var(--max)) / 2 + var(--side))) 34px;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .85fr) minmax(0, .9fr); gap: 40px;
  border-radius: 0 0 24px 24px;
  background: var(--hd-solid); color: var(--hd-fg);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 1px 0 var(--hd-line) inset, 0 40px 80px -30px rgba(0, 0, 0, .5);
  transform: translateY(-8px);
}
.nav-drop.is-open .nav-mega { transform: none; }
.nav-mega a { padding: 0; white-space: normal; color: var(--hd-fg); }
.nav-mega a:hover { color: var(--hd-fg); }
.mm-h { margin: 2px 0 10px 10px; font-size: 12.5px; font-weight: 500; color: var(--hd-mute); }
/* both lists fill the column height, so the last service and the last industry end on the same line */
.mm-col { display: flex; flex-direction: column; }
.mm-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 2px 6px; }
.mm-item { display: grid !important; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 10px !important; border-radius: 12px; transition: background-color .2s; }
.mm-item b { display: block; margin-top: 1px; font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.mm-item small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.38; color: var(--hd-mute); }
.mm-item:hover, .mm-ind:hover { background: var(--hd-hl); }
.mm-tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--hd-tile); transition: background-color .25s; }
.mm-tile-s { width: 32px; height: 32px; border-radius: 9px; }
.mm-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.mm-tile-s .mm-ic { width: 17px; height: 17px; }
.mm-item:hover .mm-ic, .mm-ind:hover .mm-ic { stroke: var(--orange); }
.mm-list { flex: 1; display: grid; grid-auto-rows: 1fr; gap: 2px; }
.mm-ind { display: flex !important; align-items: center; gap: 12px; padding: 7px 10px !important; border-radius: 11px; font-size: 14.5px; font-weight: 500; transition: background-color .2s; }
.mm-case { display: grid !important; align-content: start; overflow: hidden; border-radius: 14px; background: var(--hd-tile); }
.mm-case img { width: 100%; height: auto; aspect-ratio: 16 / 8.5; object-fit: cover; transition: transform .6s var(--ease-out); }
.mm-case:hover img { transform: scale(1.04); }
.mm-case-k { padding: 14px 16px 0; font-size: 12.5px; color: var(--hd-mute); }
.mm-case b { padding: 6px 16px 0; font-size: 15px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }
.mm-case-go { padding: 10px 16px 16px; font-size: 13.5px; font-weight: 500; color: var(--orange); }
.mm-case:hover .mm-case-go { text-decoration: underline; text-underline-offset: 3px; }

/* =================== phones and tablets =================== */
@media (max-width: 1080px) {
  .nav-hl { display: none; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 0; margin: 0;
    background: var(--hd-solid) !important; color: var(--hd-fg); font-size: 20px;
    gap: 0; padding: 8px 20px 28px;
  }
  .nav.is-menu { background: var(--hd-solid); }
  .nav-links > a, .nav-trigger { height: auto; padding: 16px 0; border-radius: 0; border-bottom: 1px solid var(--hd-line); opacity: 1; color: var(--hd-fg); }
  .nav-links > .nav-cta-m { display: flex; margin-top: 28px; border-bottom: 0; color: var(--white); padding: 0; height: 54px; font-size: 16px; justify-content: center; border-radius: 14px; }
  .nav-mega {
    position: static; width: auto; transform: none !important;
    padding: 6px 0 18px; border-radius: 0; box-shadow: none; background: none;
    grid-template-columns: 1fr; gap: 14px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav-drop:not(.is-open) .nav-mega { display: none; }
  .mm-srv .mm-h { display: none; }
  .mm-grid, .mm-list { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .mm-h { margin-left: 0; }
  .mm-item { padding: 8px 0 !important; }
  .mm-ind { padding: 6px 0 !important; }
  .mm-case { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-hl, .mm-case img { transition: none; }
}
