/* ===== Header nav + mega-menus =====
   Light panels that continue the white header; purple is used only for state
   (active tab, hover arrow, banner). Structure mirrors the wireframes. */

.nav-item { position: relative; display: flex; align-items: center; }
.nav-trigger, .nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 400; white-space: nowrap;
  color: var(--ink); text-decoration: none;
}
.nav-trigger::after, .nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--purple);
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s ease;
}
.nav-link:hover::after, .nav-item.is-open .nav-trigger::after,
.nav-trigger:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-item.is-open .nav-trigger, .nav-item.is-current > .nav-trigger { color: var(--purple); }
.nav-chev {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s ease;
}
.nav-item.is-open .nav-chev { transform: rotate(180deg); }
.nav-trigger:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; border-radius: 4px; }

/* Header goes solid while a menu is open so the panel reads as one surface with it */

/* ---------- Panel ---------- */
.mm-panel {
  --pw: 580px;
  position: absolute; top: calc(100% + 10px); left: 50%;
  width: var(--pw);
  padding: 10px;
  border-radius: 22px;
  /* Frosted glass, same recipe as the header bar */
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(171, 36, 242, .10), transparent 55%), radial-gradient(120% 160% at 100% 100%, rgba(98, 29, 208, .10), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 243, 255, .86));
  -webkit-backdrop-filter: blur(26px) saturate(200%);
          backdrop-filter: blur(26px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(171, 36, 242, .10), 0 30px 60px -12px rgba(0, 0, 0, .5), 0 12px 24px -8px rgba(0, 0, 0, .25);
  color: var(--ink);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 8px) scale(.985);
  transform-origin: top center;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s;
  z-index: 30;
}
.mm-panel--cols { --pw: 1000px; }
.mm-panel--split { --pw: 700px; }
/* Invisible bridge over the gap so the pointer can travel from trigger to panel */
.mm-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; }
.nav-item.is-open .mm-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

/* Segmented tabs with a sliding thumb */
.mm-tabs {
  --i: 0;
  position: relative;
  display: grid; grid-template-columns: repeat(var(--n), 1fr);
  padding: 4px; border-radius: 14px;
  background: rgba(98, 29, 208, .09);
}
.mm-tab-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / var(--n));
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .10), inset 0 0 0 1px rgba(171, 36, 242, .14);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.mm-tab {
  position: relative; z-index: 1;
  height: 40px; padding: 0 12px;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: #3d3654;
  white-space: nowrap;
  transition: color .2s ease;
}
.mm-tab:hover { color: var(--ink); }
.mm-tab[aria-selected="true"] { color: var(--purple); }
.mm-tab:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }

.mm-pane { margin-top: 10px; animation: mm-in .3s ease both; }
@keyframes mm-in { from { opacity: 0; transform: translateY(4px); } }

/* Services columns: heading link per sub-category, then its services as plain links.
   One column (Branding) flows its links into two columns instead. */
.mm-cols { display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: 8px; }
.mm-col { padding: 14px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(98, 29, 208, .10); }
.mm-col-head {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--purple); text-decoration: none;
}
.mm-col-head:hover svg, .mm-col-head:focus-visible svg { translate: 2px 0; }
.mm-links { list-style: none; }
.mm-cols--one .mm-links { columns: 2; column-gap: 8px; }
/* Digital Marketing: the Paid column carries a keyword line per item, so it gets more of the width */
.mm-cols:has(.mm-link-rich) { grid-template-columns: 1fr .8fr 1.3fr; }
.mm-links li { break-inside: avoid; }
.mm-links a {
  position: relative; display: block; padding: 7px 8px 7px 12px; border-radius: 8px;
  font-size: 13.5px; line-height: 1.3; color: var(--ink); text-decoration: none;
}
/* Hover: purple text and a short bar on the left, as in the reference list */
.mm-links a::before { content: ""; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--brand-gradient); opacity: 0; }
.mm-links a:hover, .mm-links a:focus-visible { background: #fff; color: var(--purple); }
.mm-links a:hover::before, .mm-links a:focus-visible::before { opacity: 1; }
.mm-links a:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }
/* Grouped item (Paid Marketing): the title reads like any other link, with what it covers
   in a small line underneath — kept tight so the column ends close to its neighbours */
.mm-links .mm-link-rich { display: grid; gap: 1px; padding-top: 5px; padding-bottom: 5px; }
.mm-link-rich b { font-weight: 400; font-size: 13.5px; }
.mm-link-rich span { font-size: 11px; line-height: 1.35; color: #7a7690; white-space: nowrap; }
.mm-link-rich:hover span, .mm-link-rich:focus-visible span { color: #5c4a85; }

/* Arrow icons in the column heads and the banner button */
.mm-banner-cta svg, .mm-col-head svg {
  width: 12px; height: 12px; fill: none; stroke: var(--purple); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Full-width promo banner */
.mm-banner {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 10px; min-height: 72px;
  padding: 14px 14px 14px 20px;
  border-radius: 14px;
  background: linear-gradient(110deg, #3b0f82 0%, #621dd0 45%, #ab24f2 100%);
  color: #fff; text-decoration: none;
}
.mm-banner::before { /* grain + glow, same finish as the site's purple surfaces */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(255, 255, 255, .22), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: .7;
}
.mm-banner-copy { display: flex; flex-direction: column; gap: 2px; }
.mm-banner-kicker { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #e3d0ff; }
.mm-banner-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.mm-banner-cta {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  background: #fff; color: var(--purple);
  font-size: 13px; font-weight: 600;
  transition: transform .2s ease;
}
.mm-banner:hover .mm-banner-cta { transform: translateX(2px); }
.mm-banner:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* Insights split layout */
.mm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.mm-split-copy { display: flex; flex-direction: column; padding: 8px 6px 0; }
.mm-split-copy h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.mm-split-copy p { margin: 8px 0 16px; font-size: 13.5px; line-height: 1.55; color: #6b6878; }
.mm-split-copy .mm-banner { margin-top: auto; flex-direction: column; align-items: flex-start; gap: 10px; }
.mm-split-media { border-radius: 14px; overflow: hidden; background: #111; min-height: 220px; }
.mm-split-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.mm-panel--split:hover .mm-split-media img { transform: scale(1.03); }

/* ---------- Mobile sheet: nav items become accordions ---------- */
@media (max-width: 1080px) {
  .nav-item { display: block; border-bottom: 1px solid #f1f1f3; }
  .nav-trigger, .nav-link { width: 100%; justify-content: space-between; padding: 16px 2px; font-size: 17px; }
  .nav-trigger::after, .nav-link::after { display: none; }
  .mm-panel, .mm-panel--split, .mm-panel--cols {
    position: static; width: auto;
    padding: 0 0 16px; border: 0; border-radius: 0; box-shadow: none; background: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    transform: none; opacity: 1; visibility: visible;
    display: none;
  }
  .mm-panel::before { display: none; }
  .nav-item.is-open .mm-panel { display: block; transform: none; }
  .mm-tabs { overflow-x: auto; scrollbar-width: none; }
  .mm-tab { font-size: 13px; padding: 0 10px; }
  .mm-cols, .mm-cols:has(.mm-link-rich) { grid-template-columns: 1fr; }
  .mm-link-rich span { white-space: normal; }
  .mm-cols--one .mm-links { columns: 1; }
  .mm-split { grid-template-columns: 1fr; }
  .mm-split-media { display: none; }
  .mm-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-panel, .mm-tab-thumb, .mm-pane { transition: none; animation: none; }
}
