/* Shared shell: the slim platform switcher every page carries, plus the hub.
   Self-contained (vd- prefixes) so it can sit on top of each platform's own
   stylesheet without collisions. */

:root {
  --vd-accent: #8b5cf6;
  --vd-bar: #0b0d12;
  --vd-bar-2: #11141b;
  --vd-line: #232733;
  --vd-ink: #e8eaf0;
  --vd-dim: #9aa1b1;
}

/* The platform pages already size everything border-box; the hub ships the
   same geometry so both columns come out the same width. */
* { box-sizing: border-box; }

.vd-sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* `hidden` is a UA style of low specificity: a component rule that sets
   `display` (grid/flex) — a result panel, a player — would silently show it
   on first paint. Nothing in the shell or the platform stylesheets wants a
   hidden element visible, so the attribute always wins. */
[hidden] { display: none !important; }

.vd-nav {
  background: var(--vd-bar);
  border-bottom: 1px solid var(--vd-line);
  color: var(--vd-ink);
  font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  z-index: 50;
}

.vd-nav-in {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto;
  max-width: 1100px;
  min-height: 46px;
  padding: 0 16px;
}

.vd-nav-brand {
  align-items: center;
  color: var(--vd-ink);
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

/* The wordmark's accent half carries text, so it needs 4.5:1 - which a page's
 * own accent does not always clear once a tool theme darkens it (#7c3aed on
 * this bar is 3.4:1, and Lighthouse failed the brand for it). Lifting the hue
 * toward white keeps the brand colour and clears the bar on every page. */
.vd-nav-brand b { color: color-mix(in srgb, var(--vd-accent) 55%, #ffffff); }

.vd-nav-mark {
  background: var(--vd-accent);
  border-radius: 6px;
  display: inline-block;
  height: 18px;
  position: relative;
  width: 18px;
}

.vd-nav-mark::after {
  background: var(--vd-bar);
  border-radius: 2px;
  content: "";
  height: 6px;
  left: 6px;
  position: absolute;
  top: 6px;
  width: 6px;
}

.vd-nav-links {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 2px;
  list-style: none;
  margin: 0;
  min-width: 0;
  padding: 0;
}

/* The bar carries two triggers, one per tool family, and the panel behind each
 * one lists that whole family: twelve sites, seventeen converters. Nothing
 * here scrolls sideways any more, so the panels can hang below the bar. */
.vd-nav-item { position: relative; }

.vd-nav-trigger {
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--vd-dim);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  white-space: nowrap;
}

.vd-nav-trigger:hover,
.vd-nav-item[data-open] > .vd-nav-trigger { background: var(--vd-bar-2); color: var(--vd-ink); }

/* The trigger of the family the current page belongs to reads as current the
 * way the tool's own link did when every tool had one — by weight and colour
 * alone: the bar keeps its own background, no tint. */
.vd-nav-item[data-current] > .vd-nav-trigger { color: var(--vd-ink); font-weight: 700; }

.vd-nav-caret {
  border: 4px solid transparent;
  border-top-color: currentColor;
  display: inline-block;
  margin-inline-start: 6px;
  vertical-align: 2px;
}

.vd-nav-panel {
  background: var(--vd-bar-2);
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: none;
  inset-inline-start: 0;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 8px;
  position: absolute;
  top: calc(100% + 6px);
  width: min(380px, calc(100vw - 24px));
  z-index: 5;
}

/* A pointer travelling from the trigger to the panel must not leave the item,
 * or the menu closes under it: this bridge covers the gap between the two.
 * It is a real element, because anything drawn outside the panel's box - which
 * is scrollable - would be clipped out of the pointer's reach. */
.vd-nav-bridge {
  display: none;
  height: 10px;
  inset-inline: 0;
  position: absolute;
  top: 100%;
}
.vd-nav-item[data-open] > .vd-nav-bridge { display: block; }

.vd-nav-item[data-open] > .vd-nav-panel { display: block; }

.vd-nav-panel a {
  border-radius: 6px;
  color: var(--vd-dim);
  display: block;
  font-size: 13px;
  overflow: hidden;
  padding: 5px 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vd-nav-panel a:hover,
.vd-nav-panel a:focus-visible { background: var(--vd-bar); color: var(--vd-ink); }

.vd-nav-panel a[aria-current="page"] { color: var(--vd-ink); font-weight: 700; }

.vd-nav-head {
  border-bottom: 1px solid var(--vd-line);
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  margin-bottom: 6px;
  padding-bottom: 7px;
}

/* Two columns, the same shape for every menu: twelve platforms in one column
 * would leave the panel taller than the bar it hangs from, and the converters
 * need the width. The count is fixed rather than left to column-width, which
 * the panel's max-height can quietly collapse to a single column. */
.vd-nav-groups { column-count: 2; column-gap: 10px; }

/* A group is allowed to run on into the next column - keeping one unbreakable
 * would pin a single long group to a single column. Only the label is glued to
 * the first item under it. */

.vd-nav-group-label {
  break-after: avoid;
  color: var(--vd-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
  padding: 6px 8px 2px;
  text-transform: uppercase;
}

.vd-nav-list { list-style: none; margin: 0; padding: 0; }

.vd-nav-all {
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  color: var(--vd-ink);
  padding: 5px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.vd-nav-all:hover { border-color: var(--vd-accent); }

@media (max-width: 640px) {
  .vd-nav-in { gap: 8px; padding: 0 10px; }
  .vd-nav-brand span:not(.vd-nav-mark) { display: none; }
  /* The brand mark and the "all tools" link point at the same hub URL, so the
   * labelled button is the one to drop when the bar runs out of room: two
   * triggers and the language picker still fit, and nothing becomes a dead end. */
  .vd-nav-all { display: none; }
  .vd-lang select { max-width: 110px; }
  /* A panel anchored to its own trigger would run off the right edge here, so
   * on a phone it drops out of the item and spans the bar instead, one group
   * per row. */
  .vd-nav-item { position: static; }
  .vd-nav-panel { inset-inline: 10px; top: calc(100% - 4px); width: auto; }
  .vd-nav-groups { column-count: auto; }
  /* Touch has no pointer to bridge and the item is not positioned here, so
   * the strip would only sit in the wrong place. */
  .vd-nav-item[data-open] > .vd-nav-bridge { display: none; }
}

/* A coarse pointer never gets the hover preview, so the tap that opens a panel
 * is the same tap that has to land on a row: rows and triggers grow to the 44px
 * a thumb can hit. After the phone block, so it also covers a tablet, which
 * gets the two-column panel at a width where the pointer is still a finger. */
@media (pointer: coarse) {
  .vd-nav-trigger { padding: 13px 10px; }
  .vd-nav-all { padding: 13px 12px; }
  .vd-nav-list a { padding: 13px 10px; }
  .vd-nav-list li + li { margin-top: 2px; }
}

/* ------------------------------------------------------------------ hub */

.vd-hub {
  background: #0b0d12;
  color: var(--vd-ink);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* Same 760px column as every downloader page (.wrap in platform.css), so the
 * hub reads as the same site rather than a wider one. */
.vd-hub main {
  margin: 0 auto;
  max-width: 760px;
  padding: 48px 20px 64px;
}

.vd-hub h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}

.vd-hub .vd-lede {
  color: var(--vd-dim);
  font-size: 18px;
  margin: 0 0 28px;
  max-width: 62ch;
}

.vd-hub form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
}

.vd-hub input[type="text"] {
  background: #14171f;
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  color: var(--vd-ink);
  flex: 1 1 320px;
  font: inherit;
  min-width: 0;
  padding: 13px 14px;
}

.vd-hub input[type="text"]:focus {
  border-color: var(--vd-accent);
  /* Full accent, not a 35% tint: the tint lands at 1.05:1 on this bar, which is
   * not an indicator anyone can see. */
  outline: 2px solid var(--vd-accent);
  outline-offset: 1px;
}

/* main, not the whole body: the nav bar sits inside .vd-hub too, and its
 * triggers are buttons the shell styles itself. */
.vd-hub main button {
  background: var(--vd-accent);
  border: 0;
  border-radius: 10px;
  color: #07100a;
  cursor: pointer;
  font: 600 16px/1 inherit;
  padding: 14px 22px;
}

.vd-hub main button:hover { filter: brightness(1.08); }

.vd-hub .vd-note {
  color: var(--vd-dim);
  font-size: 14px;
  min-height: 20px;
  margin: 0 0 40px;
}

.vd-hub .vd-note[data-kind="error"] { color: #ff9d9d; }

.vd-hub h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.vd-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.vd-card {
  background: #12151d;
  border: 1px solid var(--vd-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  position: relative;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.vd-card:hover { border-color: var(--vd-card-accent, var(--vd-accent)); transform: translateY(-2px); }

.vd-card .vd-card-top {
  align-items: center;
  display: flex;
  gap: 10px;
}

.vd-card .vd-dot {
  background: var(--vd-card-accent, var(--vd-accent));
  border-radius: 7px;
  height: 26px;
  width: 26px;
}

.vd-card strong { font-size: 17px; }

.vd-card span { color: var(--vd-dim); font-size: 14px; }

/* Each card's CTA takes its own accent (the one in its dot), and with it the
 * ink derived per card — Kick green needs black text, LinkedIn blue white. */
.vd-card .vd-go { color: var(--vd-card-ink, var(--vd-accent)); font-weight: 600; margin-top: 6px; }

/* Full-bleed rule with the same 760px column the platform footers use. */
.vd-hub footer {
  border-top: 1px solid var(--vd-line);
  color: var(--vd-dim);
  font-size: 13px;
  margin: 48px 0 0;
  padding: 20px 0 40px;
}

.vd-hub .vd-foot-in {
  margin: 0 auto;
  max-width: 760px;
  padding: 0 20px;
}

/* The hub carries the same language list as every downloader footer, so the
 * reader who lands here can open a localized hub without the nav picker. */
.vd-hub .langnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 0;
}

.vd-hub .langnav a {
  color: var(--vd-dim);
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
}

.vd-hub .langnav a:hover { color: var(--vd-ink); text-decoration: underline; }
.vd-hub .langnav a.cur { color: var(--vd-ink); font-weight: 700; }

/* Off-screen with clip-path, not `left: -9999px`: a negative inline offset
 * stretches the document by ~10 000px in RTL locales, which put a horizontal
 * scrollbar under the hub. */
.vd-skip {
  background: var(--vd-accent);
  clip-path: inset(50%);
  color: var(--vd-btn-ink, #07100a);
  height: 1px;
  overflow: hidden;
  padding: 10px 14px;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.vd-skip:focus {
  clip-path: none;
  height: auto;
  left: 8px;
  top: 8px;
  width: auto;
  z-index: 60;
}

/* ------------------------------------------------------------------ picker */

.vd-lang { display: inline-flex; align-items: center; }

.vd-lang select {
  background: var(--vd-bar-2);
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  color: var(--vd-ink);
  font: inherit;
  font-size: 13px;
  max-width: 150px;
  padding: 4px 6px;
}

.vd-lang select:hover { border-color: var(--vd-accent); }

.vd-card-item { display: contents; }

a.vd-card { color: inherit; text-decoration: none; }

/* Honour the OS "reduce motion" setting: the nav underline, card lift and
 * progress bar all animate, and none of that is worth vestibular discomfort. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
