/*
 * Site header + mega menu. Tokens only.
 *
 * The bar is the prototype's .top (docs/prototypes/redesign-3/site.css): a
 * 72px glass strip over the page -- 78% page colour, saturate + blur behind --
 * edged with one hairline, the nav pushed right and the account actions split
 * off by a vertical rule. The mega panels are this site's own: the prototype
 * has no menus, so they are built from the same materials (surface-2, the
 * popover ring, tint tiles).
 *
 * Three states drive every panel, in increasing specificity:
 *   html:not(.vc-js) .vc-nav__item:focus-within   keyboard, no script
 *   @media (hover) html:not(.vc-js) …:hover        pointer, no script
 *   .vc-nav__trigger[aria-expanded="true"]         script running
 *
 * Once view.js adds .vc-js to <html> the first two rules stop matching, so the
 * script is the only thing opening panels and there is exactly one source of
 * truth for the open state. Without the scoping, clicking a trigger to close it
 * would leave the pointer hovering the trigger and CSS would reopen it.
 *
 * Breakpoint: 60rem (the prototype's 960px). view.js reads the same value.
 *
 * Selectors are qualified with .vc-header where they style an anchor: theme.json's
 * link hover prints as `:root :where(a…:hover)` after this file, and would beat a
 * single-class rule on hover (CLAUDE.md §3a).
 */

.vc-header {
  /* Panels hang this far below the bar; the hover bridge spans the same gap. */
  --vc-header-gap: 0.5rem;

  position: relative;
  border-block-end: 1px solid var(--vc-line);
  background: color-mix(in srgb, var(--vc-page) 78%, transparent);
  color: var(--vc-fg);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .vc-header {
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

/* Without a backdrop filter the glass would show page copy through it. */
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .vc-header {
    background: var(--vc-page);
  }
}

.vc-header__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  /* The prototype's .wrap, so the logo lines up with every content column. */
  width: min(var(--vc-chrome), 100% - 2 * var(--vc-gutter));
  block-size: var(--vc-header);
  margin-inline: auto;
}

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

/* The colour is the lettering's (currentColor in the SVG); the mark keeps its
   gradient. White on dark, the light fg on light: Figma binds the lettering to
   base/foreground. */
.vc-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  color: var(--vc-wordmark);
  text-decoration: none;
  border-radius: var(--vc-radius-sm);
}

.vc-brand svg,
.vc-brand__img {
  display: block;
  inline-size: 8.25rem;
  block-size: auto;
  max-inline-size: none;
}

/* The lettering's lowest stroke ends exactly on the viewBox's bottom edge (49 of 49), and an
   SVG clips at its box: at 29px tall that edge falls mid-pixel and the bottom of "CONNECT" was
   sliced off. The header and the footer both draw the mark through this class. */
.vc-brand svg {
  overflow: visible;
}

.vc-brand__text {
  font-family: var(--vc-font-display);
  font-size: var(--vc-text-lg);
  font-weight: var(--vc-weight-bold);
  letter-spacing: var(--vc-tracking-tight);
}

/* Kept for a custom logo uploaded as a single-colour mark. */
.vc-brand--mono {
  --vc-logo-knockout: var(--vc-page);

  color: var(--vc-wordmark);
}

/* ---------------------------------------------------------------------------
   Layout: drawer wrapper -- inline on desktop, a dropdown below 60rem
   --------------------------------------------------------------------------- */

.vc-header__drawer {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 1.75rem;
  min-inline-size: 0;
}

/* Bar-level "Get started", shown only below the breakpoint. Qualified: it is
   also a .vc-btn, and main.css (loaded after this file) sets its display. */
.vc-header .vc-header__cta-bar {
  display: none;
}

/* The prototype's .menu: a text pill, not a hamburger glyph. */
.vc-header__burger {
  display: none;
  flex: none;
  align-items: center;
  block-size: 2.125rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: var(--vc-radius-full);
  background: none;
  box-shadow: inset 0 0 0 1px var(--vc-edge);
  color: var(--vc-fg);
  font-family: var(--vc-font-body);
  font-size: var(--vc-text-sm);
  line-height: 1;
  cursor: pointer;
  transition: box-shadow var(--vc-fast) var(--vc-ease);
}

.vc-header__burger:hover,
.vc-header__burger[aria-expanded="true"] {
  box-shadow: inset 0 0 0 1px var(--vc-edge-hover);
}

/* ---------------------------------------------------------------------------
   Top-level items
   --------------------------------------------------------------------------- */

.vc-nav {
  margin-inline-start: auto;
}

.vc-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Panels are positioned against the bar, not the item, so every wide panel
   shares the bar's edges instead of hanging off its trigger. */
.vc-nav__item {
  position: static;
}

.vc-header .vc-nav__top {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--vc-radius-full);
  background: transparent;
  color: var(--vc-fg-2);
  font-family: var(--vc-font-body);
  font-size: 0.90625rem;
  font-weight: var(--vc-weight-regular);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--vc-fast) var(--vc-ease);
}

.vc-header .vc-nav__top:hover,
.vc-header .vc-nav__top[aria-current="page"],
.vc-header .vc-nav__trigger[aria-expanded="true"] {
  color: var(--vc-fg);
  text-decoration: none;
}

.vc-nav__chevron {
  flex: none;
  opacity: 0.6;
  transition: transform var(--vc-fast) var(--vc-ease);
}

.vc-nav__trigger[aria-expanded="true"] .vc-nav__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* ---------------------------------------------------------------------------
   Mega panel
   --------------------------------------------------------------------------- */

.vc-nav__panel {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  z-index: 10;
  padding-block-start: var(--vc-header-gap);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  pointer-events: none;
  transition:
    opacity var(--vc-fast) var(--vc-ease),
    transform var(--vc-fast) var(--vc-ease),
    visibility 0s linear var(--vc-fast);
}

/*
 * Hover bridge. The pointer travelling from the trigger to the panel crosses the
 * space under the trigger, which belongs to no menu item -- without this the
 * panel closes underneath the cursor before it arrives. Only matters when the
 * script is absent; view.js closes on a timer instead.
 *
 * Scoped to no-script on purpose. The bridge spans the panel's full width, so
 * with the script running it sat invisibly over the whole trigger row: moving
 * from Platform to Solutions did not switch panels and clicking Pricing did
 * nothing while a panel was open.
 */
html:not(.vc-js) .vc-nav__panel::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 100%;
  block-size: calc(var(--vc-header) / 2);
}

/*
 * A narrow panel hangs from its own trigger, right edges aligned, so it grows
 * leftwards into the bar and can never run off the viewport -- Company, the one
 * that uses it, is the right-most item.
 */
.vc-nav__item:has(> .vc-nav__panel--narrow) {
  position: relative;
}

.vc-nav__panel--narrow {
  inset-block-start: calc(100% + (var(--vc-header) - 2.125rem) / 2);
  inset-inline: auto 0;
  inline-size: min(24rem, calc(100vw - 2 * var(--vc-gutter)));
}

.vc-nav__panel-inner {
  display: grid;
  gap: var(--vc-space-lg);
  padding: var(--vc-space-md);
  border-radius: var(--vc-radius-lg);
  background: var(--vc-surface-2);
  box-shadow: var(--vc-shadow-popover);
}

.vc-nav__panel-inner--featured {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 60rem) {
  .vc-nav__panel-inner--featured {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
  }
}

.vc-nav__cols {
  display: grid;
  gap: var(--vc-space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

/* Sentence case, like the prototype's footer column heads: no tracked caps
   anywhere in the round-3 design. */
.vc-nav__col-title {
  margin: 0 0 var(--vc-space-xs);
  padding-inline: 0.5rem;
  font-family: var(--vc-font-body);
  font-size: var(--vc-text-xs);
  font-weight: var(--vc-weight-semibold);
  color: var(--vc-fg-3);
}

.vc-nav__rows {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vc-nav__col--dense .vc-nav__rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px var(--vc-space-2xs);
}

.vc-header .vc-nav__link-item {
  display: flex;
  align-items: flex-start;
  gap: var(--vc-space-xs);
  padding: 0.5rem;
  border-radius: var(--vc-radius-md);
  color: var(--vc-fg);
  text-decoration: none;
  transition: background-color var(--vc-fast) var(--vc-ease);
}

.vc-header .vc-nav__link-item:hover {
  background: var(--vc-surface-3);
  color: var(--vc-fg);
  text-decoration: none;
}

.vc-header .vc-nav__link-item--dense {
  padding: 0.4rem 0.5rem;
  align-items: center;
}

/*
 * A dense column is a two-up list of bare labels. The 36px tinted tile that
 * suits a described row would make every row taller than the single line of
 * text it labels, so the glyph carries on its own at label height.
 */
.vc-nav__link-item--dense .vc-nav__row-icon {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border-radius: 0;
  background: none;
  color: var(--vc-fg-2);
}

.vc-nav__row-icon {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: var(--vc-radius-md);
  background: var(--vc-tint);
  color: var(--vc-accent);
  transition: background-color var(--vc-fast) var(--vc-ease);
}

.vc-nav__link-item:hover .vc-nav__row-icon {
  background: var(--vc-tint-2);
}

.vc-nav__link-item--dense:hover .vc-nav__row-icon {
  background: none;
  color: var(--vc-accent);
}

.vc-nav__row-copy {
  display: grid;
  gap: 0.125rem;
  min-inline-size: 0;
}

.vc-nav__row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--vc-text-sm);
  font-weight: var(--vc-weight-emphasis);
  line-height: 1.35;
}

.vc-nav__row-desc {
  font-size: var(--vc-text-xs);
  line-height: 1.45;
  color: var(--vc-fg-2);
  text-wrap: pretty;
}

.vc-nav__ext {
  flex: none;
  opacity: 0.55;
}

/* ---- Featured card ----------------------------------------------------- */

.vc-header .vc-nav__feature {
  display: grid;
  align-self: start;
  align-content: start;
  gap: 0.4rem;
  padding: var(--vc-space-md);
  border-radius: var(--vc-radius-card);
  background: var(--vc-gradient-brand-wash);
  box-shadow: inset 0 0 0 1px var(--vc-line);
  color: var(--vc-fg);
  text-decoration: none;
  transition: box-shadow var(--vc-fast) var(--vc-ease);
}

.vc-header .vc-nav__feature:hover {
  box-shadow: inset 0 0 0 1px var(--vc-line-2);
  color: var(--vc-fg);
  text-decoration: none;
}

/* The site's one eyebrow treatment (main.css .vc-eyebrow). */
.vc-nav__feature-eyebrow {
  font-size: var(--vc-text-sm);
  font-weight: var(--vc-weight-medium);
  line-height: var(--vc-leading-snug);
  color: var(--vc-fg-2);
}

.vc-nav__feature-title {
  font-family: var(--vc-font-display);
  font-size: var(--vc-text-lg);
  font-weight: var(--vc-weight-semibold);
  line-height: var(--vc-leading-card);
  letter-spacing: var(--vc-tracking-snug);
  text-wrap: balance;
}

.vc-nav__feature-desc {
  font-size: var(--vc-text-xs);
  line-height: 1.5;
  color: var(--vc-fg-2);
  text-wrap: pretty;
}

.vc-nav__feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-block-start: 0.25rem;
  font-size: var(--vc-text-sm);
  font-weight: var(--vc-weight-emphasis);
  color: var(--vc-link);
}

.vc-nav__feature-cta svg {
  transition: transform var(--vc-base) var(--vc-ease);
}

.vc-nav__feature:hover .vc-nav__feature-cta svg {
  transform: translateX(3px);
}

/* ---------------------------------------------------------------------------
   Open states
   --------------------------------------------------------------------------- */

.vc-nav__trigger[aria-expanded="true"] + .vc-nav__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}

/* No script: keyboard focus opens the panel. Scoped away the moment view.js
   runs, so the script owns the state on its own. */
html:not(.vc-js) .vc-nav__item--mega:focus-within .vc-nav__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.vc-js) .vc-nav__item--mega:hover .vc-nav__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

/* ---------------------------------------------------------------------------
   Account actions -- split off from the nav by a vertical hairline
   --------------------------------------------------------------------------- */

.vc-header__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.625rem;
  padding-inline-start: 1.75rem;
  border-inline-start: 1px solid var(--vc-line);
}

.vc-header .vc-header__signin {
  padding-inline: 0.625rem;
  font-size: 0.90625rem;
  font-weight: var(--vc-weight-regular);
}

/* ---------------------------------------------------------------------------
   Colour-scheme switch -- a sun in a ring beside "Sign in"; in the drawer, a
   labelled row ending in a switch. Pressed means light.
   --------------------------------------------------------------------------- */

/* Shown only once the head script has run: it sets data-theme on <html> and
   is also what operates the button (inc/color-scheme.php). */
html:not([data-theme]) .vc-theme-toggle {
  display: none;
}

/* The burger's ring and size, so the two round controls read as one family. */
.vc-header .vc-theme-toggle {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 2.125rem;
  block-size: 2.125rem;
  padding: 0;
  border: 0;
  border-radius: var(--vc-radius-full);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--vc-edge);
  color: var(--vc-fg-2);
  font: inherit;
  cursor: pointer;
  transition:
    color var(--vc-fast) var(--vc-ease),
    background-color var(--vc-fast) var(--vc-ease),
    box-shadow var(--vc-fast) var(--vc-ease);
}

.vc-header .vc-theme-toggle:hover {
  box-shadow: inset 0 0 0 1px var(--vc-edge-hover);
  color: var(--vc-fg);
}

/* On: the tint tile and accent glyph of a selected item, and a filled sun. */
.vc-header .vc-theme-toggle[aria-pressed="true"] {
  background: var(--vc-tint);
  box-shadow: inset 0 0 0 1px var(--vc-tint-2);
  color: var(--vc-accent);
}

.vc-theme-toggle__icon {
  display: block;
}

.vc-theme-toggle__disc {
  fill: none;
  transition: fill var(--vc-fast) var(--vc-ease);
}

.vc-theme-toggle[aria-pressed="true"] .vc-theme-toggle__disc {
  fill: currentColor;
}

/* The name, read on a desktop rather than shown: the sun is the label there. */
.vc-theme-toggle__label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.vc-theme-toggle__switch {
  display: none;
}

/*
 * Just above the breakpoint the bar is tight: the prototype's nav is bare words,
 * ours carries chevrons and hit-area padding, and at 961px the actions ran ~20px
 * past the column edge. Close the gaps until there is room again.
 */
@media (min-width: 60rem) and (max-width: 71.999rem) {
  .vc-header__bar {
    gap: 1.5rem;
  }

  .vc-header__drawer {
    gap: 1rem;
  }

  .vc-header .vc-nav__top {
    padding-inline: 0.5rem;
  }

  .vc-header__actions {
    gap: 0.375rem;
    padding-inline-start: 1rem;
  }
}

/* ---------------------------------------------------------------------------
   Below 60rem: the drawer
   --------------------------------------------------------------------------- */

@media (max-width: 59.999rem) {
  .vc-header__bar {
    gap: 0.75rem;
  }

  .vc-header .vc-header__cta-bar {
    display: inline-flex;
    margin-inline-start: auto;
  }

  .vc-header__burger {
    display: inline-flex;
  }

  /*
   * Full-bleed under the bar. The bar is one gutter in from each viewport edge
   * (see .vc-header__bar), so stretching a gutter past it on both sides lands on
   * the viewport edges exactly.
   */
  .vc-header__drawer {
    position: absolute;
    inset-block-start: 100%;
    inset-inline: calc(-1 * var(--vc-gutter));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--vc-space-md);
    max-block-size: calc(
      100dvh - var(--vc-header) - var(--wp-admin--admin-bar--height, 0px)
    );
    margin-block-start: 1px;
    padding: var(--vc-space-2xs) var(--vc-gutter) var(--vc-space-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--vc-page);
    border-block-end: 1px solid var(--vc-line);
    box-shadow: var(--vc-shadow-lg);
  }

  .vc-header__burger[aria-expanded="true"] + .vc-header__drawer {
    display: flex;
  }

  .vc-nav {
    margin-inline-start: 0;
  }

  .vc-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .vc-nav__item {
    border-block-end: 1px solid var(--vc-line);
  }

  .vc-header .vc-nav__top {
    inline-size: 100%;
    justify-content: space-between;
    padding: 0.95rem 0.25rem;
    border-radius: 0;
    color: var(--vc-fg);
    font-size: var(--vc-text-base);
    font-weight: var(--vc-weight-medium);
  }

  /* Panels become accordion sections: in flow, no shadow, no card. */
  .vc-nav__panel,
  .vc-nav__panel--narrow {
    position: static;
    display: none;
    inline-size: auto;
    padding: 0 0 var(--vc-space-sm);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .vc-nav__item:has(> .vc-nav__panel--narrow) {
    position: static;
  }

  html:not(.vc-js) .vc-nav__panel::before {
    content: none;
  }

  .vc-nav__trigger[aria-expanded="true"] + .vc-nav__panel,
  html:not(.vc-js) .vc-nav__item--mega:focus-within .vc-nav__panel {
    display: block;
  }

  .vc-nav__panel-inner {
    gap: var(--vc-space-md);
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .vc-nav__panel-inner--featured,
  .vc-nav__cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .vc-nav__col-title {
    padding-inline: 0.25rem;
  }

  .vc-nav__col--dense .vc-nav__rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Sign in moves into the drawer as a full-width ring button; the drawer's
     own "Get started" is hidden because the bar already shows one. */
  .vc-header__actions {
    display: grid;
    padding: 0;
    border: 0;
  }

  .vc-header .vc-header__signin {
    inline-size: 100%;
    min-block-size: 2.75rem;
    color: var(--vc-fg);
    font-size: var(--vc-text-base);
    box-shadow: inset 0 0 0 1px var(--vc-edge);
  }

  .vc-header__actions .vc-header__cta {
    display: none;
  }

  /* The switch becomes a row like the nav's: sun, name, and a switch at the
     far end that shows the state at a glance. */
  .vc-header .vc-theme-toggle,
  .vc-header .vc-theme-toggle:hover,
  .vc-header .vc-theme-toggle[aria-pressed="true"] {
    display: flex;
    align-items: center;
    gap: var(--vc-space-xs);
    inline-size: 100%;
    block-size: auto;
    min-block-size: 2.75rem;
    padding: 0.5rem 0.25rem;
    border-radius: var(--vc-radius-md);
    background: transparent;
    box-shadow: none;
    color: var(--vc-fg);
    font-family: var(--vc-font-body);
    font-size: var(--vc-text-base);
    font-weight: var(--vc-weight-medium);
    text-align: start;
  }

  .vc-header .vc-theme-toggle .vc-theme-toggle__icon {
    color: var(--vc-fg-2);
  }

  .vc-theme-toggle__label {
    position: static;
    inline-size: auto;
    block-size: auto;
    overflow: visible;
    clip-path: none;
  }

  /* Track and knob. Off: a control-coloured outline, knob at the start. On:
     brand blue, white knob at the end -- position and fill both change. */
  .vc-theme-toggle__switch {
    position: relative;
    display: block;
    flex: none;
    inline-size: 2.5rem;
    block-size: 1.5rem;
    margin-inline-start: auto;
    border-radius: var(--vc-radius-full);
    box-shadow: inset 0 0 0 1px var(--vc-control);
    transition:
      background-color var(--vc-fast) var(--vc-ease),
      box-shadow var(--vc-fast) var(--vc-ease);
  }

  .vc-theme-toggle__switch::after {
    content: "";
    position: absolute;
    inset-block-start: 0.25rem;
    inset-inline-start: 0.25rem;
    inline-size: 1rem;
    block-size: 1rem;
    border-radius: 50%;
    background: var(--vc-fg-2);
    transition:
      transform var(--vc-fast) var(--vc-ease),
      background-color var(--vc-fast) var(--vc-ease);
  }

  .vc-theme-toggle[aria-pressed="true"] .vc-theme-toggle__switch {
    background: var(--vc-blue);
    box-shadow: none;
  }

  .vc-theme-toggle[aria-pressed="true"] .vc-theme-toggle__switch::after {
    background: var(--vc-white);
    transform: translateX(1rem);
  }
}

@media (max-width: 35rem) {
  .vc-brand svg,
  .vc-brand__img {
    inline-size: 7rem;
  }
}

/* On a touch screen the pointer never "leaves", so a hover rule would leave a
   panel stuck open behind the reader's finger. */
@media (hover: none) {
  html:not(.vc-js) .vc-nav__item--mega:hover .vc-nav__panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-nav__panel {
    transition: none;
  }
}

@media (forced-colors: active) {
  .vc-header__burger,
  .vc-header__actions,
  .vc-theme-toggle__switch {
    border: 1px solid CanvasText;
  }

  .vc-theme-toggle__switch::after {
    background: CanvasText;
  }
}
