/* ================================================================ */
/*  Vertex — Chrome (global, header, footer)                        */
/*  Loaded after vendor styles; content styles load after this.     */
/* ================================================================ */

/* ---------------------------------------------------------------- */
/*  Custom properties (design tokens)                               */
/* ---------------------------------------------------------------- */
:root {
  --bg:         #050913;
  --bg-2:       #0A1022;
  --panel:      #0E1630;
  --panel-hi:   #152041;
  --ink:        #E4EAF5;
  --ink-2:      #B6C0D4;
  --muted:      #6C7B97;
  --dim:        #3E4A66;
  --rule:       rgba(180, 200, 240, 0.09);
  --rule-hi:    rgba(180, 200, 240, 0.22);
  --accent:     #5BA8FF;
  --accent-hi:  #8FC4FF;
  --accent-dim: #1E3A7A;
  --signal:     #22D3EE;

  --sans:          "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:          "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif-italic:  "IBM Plex Serif", Georgia, serif;

  --wrap:   1320px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ---------------------------------------------------------------- */
/*  Google Fonts                                                     */
/* ---------------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Serif:ital,wght@1,300;1,400&display=swap");

/* ---------------------------------------------------------------- */
/*  Global reset / base                                              */
/* ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv08";
}

/* Subtle technical grid — deep blue atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 168, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(34, 211, 238, 0.05), transparent 70%),
    linear-gradient(transparent 98%, rgba(180, 200, 240, 0.035) 98%) 0 0 / 100% 56px,
    linear-gradient(90deg, transparent 98%, rgba(180, 200, 240, 0.03) 98%) 0 0 / 56px 100%;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.02em;
}

::selection { background: var(--accent); color: var(--bg); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- */
/*  Typography utilities (used in chrome)                           */
/* ---------------------------------------------------------------- */
.vrtx-mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.vrtx-accent {
  color: var(--accent);
  font-family: var(--serif-italic);
  font-style: italic;
}

.vrtx-signal {
  color: var(--signal);
}

/* ---------------------------------------------------------------- */
/*  Max-width wrapper                                               */
/* ---------------------------------------------------------------- */
.vrtx-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

/* ---------------------------------------------------------------- */
/*  Skip link (accessibility)                                       */
/* ---------------------------------------------------------------- */
.vrtx-skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 180ms ease;
  z-index: 100;
}
.vrtx-skip-link:focus-visible { transform: translateY(0); }

/* ---------------------------------------------------------------- */
/*  Status bar                                                      */
/* ---------------------------------------------------------------- */
.vrtx-status {
  border-bottom: 1px solid var(--rule);
  background: rgba(5, 9, 19, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 25;
}

.vrtx-status-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.vrtx-status .dot {
  width: 6px;
  height: 6px;
  background: var(--signal);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
  animation: vrtx-pulse 2.2s ease-in-out infinite;
}

.vrtx-status .sep {
  color: var(--dim);
  margin: 0 14px;
}

@keyframes vrtx-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.3); }
}

@media (max-width: 680px) {
  .vrtx-status-hide-mobile { display: none; }
}

/* ---------------------------------------------------------------- */
/*  Page loader splash                                              */
/* ---------------------------------------------------------------- */
.vrtx-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--accent);
  transition: opacity 400ms ease;
}
.vrtx-splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}
html.vrtx-splash-seen .vrtx-splash {
  display: none;
}
.vrtx-splash-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
.vrtx-splash-mark {
  width: 44px;
  height: 44px;
  animation: vrtx-splash-breathe 1.6s ease-in-out infinite;
}
.vrtx-splash-text {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: var(--ink);
}
@keyframes vrtx-splash-breathe {
  0%, 100% { opacity: 0.5; transform: scale(0.96); }
  50%      { opacity: 1;   transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .vrtx-splash-mark { animation: none; opacity: 0.9; }
}

/* ---------------------------------------------------------------- */
/*  Header / topbar                                                 */
/* ---------------------------------------------------------------- */
.vrtx-topbar {
  position: sticky;
  top: 32px;
  z-index: 20;
  background: rgba(5, 9, 19, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.vrtx-topbar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 68px;
  gap: 12px;
}

/* Non-nav children shouldn't grow vertically — only the nav + cta stretch. */
.vrtx-topbar-inner > .vrtx-brand,
.vrtx-topbar-inner > [data-vrtx-lang],
.vrtx-topbar-inner > .vrtx-menu-toggle {
  align-self: center;
}

/* Brand / logo — V-RTX nodes mark + mono wordmark */
.vrtx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 16px;
  color: var(--ink);
}
.vrtx-brand svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex: 0 0 auto;
}

/* Nav links */
.vrtx-nav {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.vrtx-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
}
.vrtx-nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 14px 18px;
  position: relative;
  transition: color 140ms ease;
  min-height: 44px;
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.vrtx-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  background: var(--rule);
  transform: translateY(-50%);
}
.vrtx-nav a:hover { color: var(--accent-hi); }

.vrtx-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(var(--vrtx-nav-underline, 0));
  transform-origin: center;
}
.vrtx-nav a.is-active { color: var(--accent-hi); }
.vrtx-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 2px;
  height: 1px;
  background: var(--accent);
}

/* CTA button in header */
.vrtx-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 14px 18px;
  border: 1px solid var(--accent);
  margin-left: 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  line-height: 1.3;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.vrtx-cta > span[aria-hidden] {
  flex: 0 0 auto;
}
.vrtx-cta:hover {
  background: transparent;
  color: var(--accent-hi);
  box-shadow: 0 0 0 1px var(--accent-hi), 0 0 24px rgba(91, 168, 255, 0.25);
}
.vrtx-cta:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--bg), 0 0 0 4px var(--accent-hi);
}
.vrtx-cta:active { transform: scale(0.98); }

/* Mobile menu toggle */
.vrtx-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule-hi);
  color: var(--ink);
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: border-color 160ms ease, color 160ms ease;
}
.vrtx-menu-toggle:hover { border-color: var(--accent); color: var(--accent); }
.vrtx-menu-toggle svg { width: 18px; height: 18px; }

.vrtx-menu-toggle .bar {
  stroke: currentColor;
  stroke-width: 1.6;
  transition: transform 240ms ease, opacity 160ms ease;
  transform-origin: center;
}
.vrtx-menu-toggle[aria-expanded="true"] .bar-1 { transform: translateY(5px) rotate(45deg); }
.vrtx-menu-toggle[aria-expanded="true"] .bar-2 { opacity: 0; }
.vrtx-menu-toggle[aria-expanded="true"] .bar-3 { transform: translateY(-5px) rotate(-45deg); }

/* ---- Tight desktop widths: tighten padding before the mobile cutoff ---- */
@media (max-width: 1200px) and (min-width: 981px) {
  .vrtx-nav a { padding: 14px 12px; letter-spacing: 0.1em; }
  .vrtx-cta   { padding: 14px 14px; letter-spacing: 0.1em; }
  .vrtx-topbar-inner { gap: 8px; }
}

/* ---- Responsive nav ---- */
@media (max-width: 980px) {
  .vrtx-nav { display: none; }
  .vrtx-menu-toggle { display: inline-flex; }
  .vrtx-cta { display: none; }

  /* Mobile nav flydown */
  .vrtx-nav[data-open="true"] {
    position: fixed;
    top: 100px; /* status(32) + topbar(68) */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-2);
    border-top: 1px solid var(--rule-hi);
    border-bottom: 1px solid var(--rule-hi);
    padding: 12px var(--gutter);
    gap: 0;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    display: flex;
    z-index: 20;
  }
  .vrtx-nav a {
    padding: 16px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--rule);
  }
  .vrtx-nav a + a::before { display: none; }
  .vrtx-nav a.is-active::after { display: none; }
  .vrtx-nav a.is-active {
    color: var(--accent-hi);
    border-left: 2px solid var(--accent);
    padding-left: 12px;
  }
}

/* ---------------------------------------------------------------- */
/*  Footer                                                          */
/* ---------------------------------------------------------------- */
.vrtx-footer {
  padding: 88px 0 32px;
  background: var(--bg);
  color: var(--ink);
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule-hi);
}

.vrtx-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}

.vrtx-footer-brand h3 {
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.15;
  max-width: 18ch;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  font-weight: 300;
  color: var(--ink);
}

.vrtx-footer-brand p {
  color: var(--muted);
  font-size: 14px;
  max-width: 40ch;
  line-height: 1.55;
  margin: 0;
}

.vrtx-footer-col .vrtx-mono {
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}
.vrtx-footer-col a {
  display: block;
  padding: 5px 0;
  color: var(--ink-2);
  font-size: 14px;
  transition: color 140ms ease;
}
.vrtx-footer-col a:hover { color: var(--accent-hi); }

.vrtx-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 16px;
  font-variant-numeric: tabular-nums;
}

.vrtx-footer-bottom .vrtx-signal { color: var(--signal); }

@media (max-width: 880px) { .vrtx-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .vrtx-footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- */
/*  Feedback banner (fixed corner prototype notice)                 */
/* ---------------------------------------------------------------- */
.feedback-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--rule-hi);
  padding: 12px 16px 12px 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  max-width: 360px;
}
.feedback-banner .dot-live {
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  animation: vrtx-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}
.feedback-banner button {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
  padding: 0 0 0 8px;
  line-height: 1;
}
.feedback-banner button:hover { color: var(--ink); }

@media (max-width: 560px) { .feedback-banner { display: none; } }

/* ---------------------------------------------------------------- */
/*  Forced-colors (Windows high contrast)                           */
/* ---------------------------------------------------------------- */
@media (forced-colors: active) {
  .vrtx-cta { border: 1px solid CanvasText; }
  :focus-visible { outline: 2px solid Highlight; }
}

/* ---------------------------------------------------------------- */
/*  Reduced motion                                                  */
/* ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vrtx-status .dot,
  .feedback-banner .dot-live { animation: none; }
}

/* ─────────────────────────────────────────────────────────────────
   Language picker
   ───────────────────────────────────────────────────────────────── */
.vrtx-lang { position: relative; margin-left: 8px; }

.vrtx-lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: inherit; font: inherit;
  padding: 6px 10px; border-radius: 3px;
  cursor: pointer; line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: 0.04em;
}
.vrtx-lang-toggle:hover,
.vrtx-lang-toggle[aria-expanded="true"] { border-color: rgba(255,255,255,0.45); }
.vrtx-lang-caret { transition: transform 120ms ease; }
.vrtx-lang-toggle[aria-expanded="true"] .vrtx-lang-caret { transform: rotate(180deg); }

.vrtx-lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; margin: 0; padding: 4px; list-style: none;
  background: #0d0d0f; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px; box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 200;
}
.vrtx-lang-menu[hidden] { display: none; }
.vrtx-lang-menu li { margin: 0; }
.vrtx-lang-menu a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; text-decoration: none; color: inherit;
  border-radius: 2px;
}
.vrtx-lang-menu a:hover,
.vrtx-lang-menu a:focus-visible { background: rgba(255,255,255,0.06); outline: none; }
.vrtx-lang-menu li[aria-selected="true"] a { background: rgba(255,255,255,0.08); }
.vrtx-lang-menu .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: 0.06em; opacity: 0.65; min-width: 22px;
}
.vrtx-lang-menu .name { font-size: 14px; }

/* Mobile: picker lives at top of drawer, laid out as a row */
@media (max-width: 980px) {
  .vrtx-lang { margin: 0 0 12px; }
  .vrtx-lang-toggle { display: none; }
  .vrtx-lang-menu {
    position: static; display: flex !important; gap: 4px;
    background: transparent; border: none; box-shadow: none;
    padding: 0; min-width: 0;
  }
  .vrtx-lang-menu[hidden] { display: flex !important; }
  .vrtx-lang-menu li { flex: 1; }
  .vrtx-lang-menu a { justify-content: center; padding: 10px 4px; }
  .vrtx-lang-menu .name { display: none; }
}
