/*
 * DivyGfx, site header + navigation (shared by every page).
 *
 *   >= 1024px  floating bar with the full nav; mega menus open on hover / click.
 *   <  1024px  bar with logo, CTA and a menu button; the nav lives in a drawer
 *              (accordion sections, pinned CTA + contact row, page scroll locked).
 *
 * Markup: <header class="dgh" data-dgh> … see any page. Behaviour: /assets/js/site-header.js.
 * The Services / Products / Industries / Resources / Company items are injected into
 * [data-dg-nav] by services-menu.js, products-menu.js and company-menu.js; this file
 * owns how they look inside the header (their panels keep their own styles).
 */

.dgh {
  --dgh-ink: #0f1115;
  --dgh-ink-2: #323745;
  --dgh-muted: #50576b;
  --dgh-faint: #8a92a4;
  --dgh-line: #eef1f5;
  --dgh-soft: #f3f4f6;
  --dgh-accent: #ff5147;
  --dgh-ease: cubic-bezier(.2, .8, .2, 1);
  --dgh-top: 16px;      /* gap above the bar */
  --dgh-gutter: 24px;   /* gap left / right of the bar */
  --dgh-h: 60px;        /* bar height */
  --dgh-item: 40px;     /* nav item height */

  position: fixed;
  inset: 0 0 auto;
  z-index: 2147482000;  /* mega-menu panels sit just above (2147483000) */
  padding: var(--dgh-top) var(--dgh-gutter) 0;
  pointer-events: none; /* only the bar and drawer take clicks */
  font-family: Inter, "Inter Placeholder", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.4;
  letter-spacing: -.02em;
  color: var(--dgh-ink);
  -webkit-font-smoothing: antialiased;
  transition: transform .45s var(--dgh-ease);
}
.dgh *, .dgh *::before, .dgh *::after { box-sizing: border-box; }
.dgh a { text-decoration: none; -webkit-tap-highlight-color: transparent; }
.dgh :is(a, button):focus-visible { outline: 2px solid var(--dgh-ink); outline-offset: 2px; }

/* The Framer-rendered header this one replaces (it stays in the React tree, unused). */
header.framer-nMRRQ { display: none !important; }
#main header:has(nav[data-framer-name="Nav Menu"]) { display: none !important; }

/* small screens: slide away on scroll down, come back on scroll up */
.dgh.is-hidden { transform: translateY(calc(-100% - 12px)); }

/* ------------------------------------------------------------------------ bar */
.dgh-bar {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 1200px; height: var(--dgh-h);
  margin: 0 auto;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 17, 21, .06), 0 8px 28px -12px rgba(15, 17, 21, .18);
  transition: box-shadow .3s ease, background-color .3s ease;
}
.dgh.is-scrolled .dgh-bar,
.dgh.is-open .dgh-bar {
  background: rgba(255, 255, 255, .96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(15, 17, 21, .07), 0 16px 40px -16px rgba(15, 17, 21, .3);
}

.dgh-brand { flex: none; display: block; width: 124px; margin-right: auto; border-radius: 8px; transition: opacity .2s ease; }
.dgh-brand:hover { opacity: .72; }
.dgh-brand img { display: block; width: 100%; height: auto; }

.dgh-actions { flex: none; display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ------------------------------------------------------------ desktop nav items */
.dgh-nav { position: relative; display: flex; align-items: center; gap: 2px; }
.dgh-nav > *:not(.dgh-hl) { position: relative; z-index: 1; }

.dgh-link,
.dgh .dgh-nav :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger) {
  display: inline-flex; align-items: center; gap: 5px;
  height: var(--dgh-item); padding: 0 13px;
  border-radius: 99px;
  font: inherit; font-weight: 500; letter-spacing: -.02em; line-height: 1;
  color: var(--dgh-muted);
  white-space: nowrap; cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.dgh .dgh-nav :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger) { padding-right: 9px; }

/* hover / open / current */
.dgh .dgh-nav .dgh-link:hover,
.dgh .dgh-nav :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger):hover,
.dgh .dgh-nav .is-open > button,
.dgh .dgh-nav .dgh-cur,
.dgh .dgh-nav .dgh-cur > button { color: var(--dgh-ink); background: var(--dgh-soft); }

/* with a mouse, one pill slides between items instead of each item lighting up */
.dgh .dgh-nav.has-hl .dgh-link,
.dgh .dgh-nav.has-hl .dgh-link:hover,
.dgh .dgh-nav.has-hl :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger),
.dgh .dgh-nav.has-hl :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger):hover,
.dgh .dgh-nav.has-hl .is-open > button,
.dgh .dgh-nav.has-hl .dgh-cur,
.dgh .dgh-nav.has-hl .dgh-cur > button { background: transparent; }
.dgh-hl {
  position: absolute; z-index: 0; left: 0; top: 50%;
  width: 0; height: var(--dgh-item); margin-top: calc(var(--dgh-item) / -2);
  border-radius: 99px;
  background: #f1f2f5;
  box-shadow: inset 0 0 0 1px rgba(15, 17, 21, .04);
  opacity: 0; pointer-events: none;
  transition: transform .38s var(--dgh-ease), width .38s var(--dgh-ease), opacity .25s ease;
}
.dgh-hl.is-on { opacity: 1; }

/* ------------------------------------------------------------------------ CTA */
.dgh-cta {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 40px; padding: 0 6px 0 16px;
  border-radius: 99px;
  background: var(--dgh-ink); color: #fff !important;
  font-size: 14px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap;
  transition: transform .3s var(--dgh-ease), box-shadow .3s ease;
}
.dgh-cta-ic {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: transform .35s var(--dgh-ease), background-color .25s ease;
}
.dgh-cta::after { /* one light sweep on hover */
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
@media (hover: hover) {
  .dgh-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(255, 81, 71, .7), 0 0 0 3px rgba(255, 81, 71, .12); }
  .dgh-cta:hover .dgh-cta-ic { background: var(--dgh-accent); transform: rotate(45deg); }
  .dgh-cta:hover::after { left: 130%; transition: left .7s var(--dgh-ease); }
}
.dgh-cta:active { transform: scale(.98); }
.dgh-cta--block { display: flex; width: 100%; height: 52px; padding: 0 8px 0 20px; font-size: 15.5px; }
.dgh-cta--block .dgh-cta-ic { width: 36px; height: 36px; background: var(--dgh-accent); }

/* ---------------------------------------------------------------- menu button */
.dgh-toggle {
  display: none; position: relative; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--dgh-soft); color: var(--dgh-ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, transform .2s ease;
}
.dgh-toggle:hover { background: #e9ebef; }
.dgh-toggle:active { transform: scale(.94); }
.dgh-toggle span {
  position: absolute; left: 13px; width: 18px; height: 1.75px; border-radius: 2px;
  background: currentColor;
  transition: transform .4s var(--dgh-ease);
}
.dgh-toggle span:nth-child(1) { top: 17.5px; }
.dgh-toggle span:nth-child(2) { top: 24.75px; }
.dgh.is-open .dgh-toggle span:nth-child(1) { transform: translateY(3.625px) rotate(45deg); }
.dgh.is-open .dgh-toggle span:nth-child(2) { transform: translateY(-3.625px) rotate(-45deg); }

/* ---------------------------------------------------- drawer (below 1024px only) */
.dgh-drawer { display: none; }
.dgh-scrim {
  position: fixed; inset: 0; z-index: 2147481990;
  background: rgba(15, 17, 21, .36);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.dgh-scrim.is-on { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
html.dgh-lock, html.dgh-lock body { overflow: hidden !important; }
html.dgh-lock { padding-right: var(--dgh-sb, 0px); }
html.dgh-lock .dgh { padding-right: calc(var(--dgh-gutter) + var(--dgh-sb, 0px)); }

/* reading progress line */
.dgh-prog {
  position: fixed; left: 0; top: 0; z-index: 2147483001;
  width: 100%; height: 2px;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #ff5147, #ff8a7f);
  pointer-events: none;
}

/* ---------------------------------------------------------------- laptop: tighten */
@media (min-width: 1024px) and (max-width: 1239.98px) {
  .dgh { --dgh-gutter: 16px; font-size: 14px; }
  .dgh-bar { padding-left: 18px; gap: 8px; }
  .dgh-brand { width: 112px; }
  .dgh-nav { gap: 0; }
  .dgh-link, .dgh .dgh-nav :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger) { padding: 0 10px; gap: 3px; }
  .dgh .dgh-nav :is(.dgsm-trigger, .dgpm-trigger, .dgcm-trigger) { padding-right: 6px; }
  .dgh .dgh-nav :is(.dgsm-count, .dgpm-new) { display: none; } /* badges are a nice-to-have */
  .dgh-cta { padding-left: 14px; gap: 8px; }
}

/* --------------------------------------------------------- tablet + phone: drawer */
@media (max-width: 1023.98px) {
  .dgh { --dgh-top: 12px; --dgh-gutter: 20px; --dgh-h: 60px; }
  .dgh-nav { display: none; }
  .dgh-toggle { display: block; }
  .dgh-bar { padding: 0 8px 0 20px; }

  .dgh-drawer {
    pointer-events: auto;
    position: absolute; left: var(--dgh-gutter); right: var(--dgh-gutter);
    top: calc(var(--dgh-top) + var(--dgh-h) + 8px);
    display: flex; flex-direction: column;
    max-width: 1200px; margin: 0 auto;
    max-height: calc(100vh - var(--dgh-top) - var(--dgh-h) - 20px);
    max-height: calc(100dvh - var(--dgh-top) - var(--dgh-h) - 20px);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 17, 21, .06), 0 24px 64px -16px rgba(15, 17, 21, .3);
    overflow: hidden;
    opacity: 0; visibility: hidden;
    transform: translateY(-10px) scale(.985); transform-origin: 50% 0;
    transition: opacity .22s ease, transform .34s var(--dgh-ease), visibility 0s linear .34s;
  }
  .dgh.is-open .dgh-drawer {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .22s ease, transform .34s var(--dgh-ease), visibility 0s;
  }
  .dgh-scroll {
    flex: 1 1 auto; min-height: 0;
    padding: 10px;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .dgh-foot {
    flex: none;
    display: grid; gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--dgh-line);
    background: #fff;
  }
  .dgh-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dgh-contact a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; border-radius: 14px;
    background: var(--dgh-soft); color: var(--dgh-ink);
    font-size: 14.5px; font-weight: 500;
    transition: background-color .2s ease;
  }
  .dgh-contact a:hover { background: #e9ebef; }
  .dgh-contact svg { flex: none; color: var(--dgh-accent); }

  /* rows: plain links and accordion buttons share one look */
  .dgh-mnav { display: flex; flex-direction: column; gap: 2px; }
  .dgh-mnav > .dgh-link,
  .dgh .dgh-mnav :is(.dgsm-m-btn, .dgpm-m-btn, .dgcm-m-btn) {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 52px; padding: 0 14px 0 16px;
    border-radius: 16px;
    font: inherit; font-size: 16.5px; font-weight: 500; letter-spacing: -.025em; line-height: 1;
    color: var(--dgh-ink);
    transition: background-color .2s ease;
  }
  .dgh-mnav > .dgh-link:hover,
  .dgh-mnav > .dgh-link:active,
  .dgh .dgh-mnav :is(.dgsm-m-btn, .dgpm-m-btn, .dgcm-m-btn):hover,
  .dgh .dgh-mnav .is-open > button { background: #f5f6f8; }
  .dgh .dgh-mnav :is(.dgsm-m-btn, .dgpm-m-btn, .dgcm-m-btn) > svg { width: 18px; height: 18px; color: var(--dgh-faint); }
  .dgh-mnav > .dgh-link::after { /* plain links get a quiet "go" arrow where sections have a chevron */
    content: ""; width: 7px; height: 7px; margin-right: 5px;
    border: solid var(--dgh-faint); border-width: 1.75px 1.75px 0 0;
    transform: rotate(45deg); opacity: .7;
  }
  /* current page / section */
  .dgh .dgh-mnav .dgh-cur { font-weight: 600; }
  .dgh .dgh-mnav .dgh-cur::before {
    content: ""; position: absolute; left: 5px; top: 50%;
    width: 3px; height: 18px; margin-top: -9px; border-radius: 3px;
    background: var(--dgh-accent);
  }

  /* collapsed sections must not be reachable by keyboard or screen reader */
  .dgh .dgh-mnav :is(.dgsm-m-body, .dgpm-m-body, .dgcm-m-body) {
    visibility: hidden;
    transition: grid-template-rows .38s var(--dgh-ease), visibility 0s linear .38s;
  }
  .dgh .dgh-mnav .is-open > :is(.dgsm-m-body, .dgpm-m-body, .dgcm-m-body) {
    visibility: visible;
    transition: grid-template-rows .38s var(--dgh-ease), visibility 0s;
  }
  /* comfortable tap targets inside the sections */
  .dgh .dgh-mnav :is(.dgsm-link, .dgcm-link, .dgpm-link) { min-height: 48px; }

  /* rows ease in one after another when the drawer opens */
  .dgh.is-open .dgh-mnav > * { animation: dghRow .45s var(--dgh-ease) both; }
  .dgh.is-open .dgh-mnav > :nth-child(2) { animation-delay: .03s; }
  .dgh.is-open .dgh-mnav > :nth-child(3) { animation-delay: .06s; }
  .dgh.is-open .dgh-mnav > :nth-child(4) { animation-delay: .09s; }
  .dgh.is-open .dgh-mnav > :nth-child(5) { animation-delay: .12s; }
  .dgh.is-open .dgh-mnav > :nth-child(6) { animation-delay: .15s; }
  .dgh.is-open .dgh-mnav > :nth-child(n+7) { animation-delay: .18s; }
  @keyframes dghRow { from { opacity: 0; transform: translateY(8px); } }
}

/* tablet: the drawer is wide, so sections lay their links out in columns */
@media (min-width: 720px) and (max-width: 1023.98px) {
  .dgh .dgh-mnav .dgsm-m-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dgh .dgh-mnav .dgcm-m-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
  .dgh .dgh-mnav .dgcm-m-card .dgcm-eyebrow { grid-column: 1 / -1; }
  .dgh-foot { grid-template-columns: 1fr 1fr; align-items: center; }
  .dgh-contact a { height: 52px; }
}

/* phone */
@media (max-width: 767.98px) {
  .dgh { --dgh-top: 10px; --dgh-gutter: 12px; --dgh-h: 56px; }
  .dgh-bar { padding: 0 6px 0 16px; gap: 8px; }
  .dgh-brand { width: 112px; }
  .dgh-actions { gap: 6px; }
  .dgh-bar .dgh-cta { height: 38px; padding: 0 14px; font-size: 13.5px; }
  .dgh-bar .dgh-cta-ic { display: none; }
  .dgh-drawer { border-radius: 24px; }
  .dgh-scroll { padding: 8px; }
}
@media (max-width: 359.98px) {
  .dgh-brand { width: 104px; }
  .dgh-bar .dgh-cta { display: none; } /* too tight; the drawer keeps the CTA pinned */
}
/* short landscape phones: let the footer scroll with the list */
@media (max-width: 1023.98px) and (max-height: 520px) {
  .dgh-drawer { overflow-y: auto; overscroll-behavior: contain; }
  .dgh-scroll { flex: none; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .dgh, .dgh *, .dgh *::before, .dgh *::after, .dgh-scrim { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}
@media print { .dgh, .dgh-scrim, .dgh-prog { display: none !important; } }
