/* ============================================================================
   MICROBIX HEADER — Minimalist Centered Scroll Collapse
   MICROBIX ↔ M::X — Anthropic / Mistral aesthetic

   Architecture:
     [Left Nav]  ——  [  MICROBIX → M::X  ]  ——  [Right Actions]
   Dead-center brand via absolute positioning. Zero hover animations.
   Inter font. Flat, matte, architectural.
   ============================================================================ */

/* --- Header Shell --- */
.mbx-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 240ms ease,
    border-color 240ms ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mbx-header.is-scrolled {
  background: rgba(7, 8, 12, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* --- Header Inner --- */
.mbx-header-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  transition: height 240ms ease;
}

.mbx-header.is-scrolled .mbx-header-inner {
  height: 48px;
}

/* --- Left Nav --- */
.mbx-nav-left {
  display: none;
  align-items: center;
  gap: 28px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 450;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: -0.01em;
  text-transform: none;
  z-index: 2;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .mbx-nav-left { display: flex; }
}

.mbx-nav-left a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  transition: color 140ms ease;
}

.mbx-nav-left a:hover {
  color: #ffffff;
  transform: none !important;
}

/* --- Dead-Center Brand (Absolute center of viewport/container) --- */
.mbx-brand-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  pointer-events: auto;
}

/* --- Wordmark --- */
.mbx-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

/* Middle letters: ICROBI — collapses on scroll */
.mbx-mid {
  display: inline-block;
  overflow: hidden;
  max-width: 120px;
  opacity: 1;
  transition:
    max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.18s ease;
  vertical-align: bottom;
}

.mbx-header.is-scrolled .mbx-mid {
  max-width: 0;
  opacity: 0;
}

/* :: separator — expands on scroll */
.mbx-sep {
  display: inline-block;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  letter-spacing: -0.04em;
  padding: 0;
  transition:
    max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.22s ease 0.04s,
    padding 0.22s ease;
  vertical-align: bottom;
  color: rgba(255, 255, 255, 0.9);
}

.mbx-header.is-scrolled .mbx-sep {
  max-width: 22px;
  opacity: 1;
  padding: 0 1.5px;
}

/* --- Right Actions --- */
.mbx-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 2;
  flex-shrink: 0;
}

.mbx-nav-right a.mbx-right-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.01em;
  text-transform: none;
  white-space: nowrap;
  transition: color 140ms ease;
}

.mbx-nav-right a.mbx-right-link:hover {
  color: #ffffff;
  transform: none !important;
}

/* Launch button — flat, solid, high-contrast, zero hover animation */
.mbx-launch-btn,
.mbx-nav-right a.mbx-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff !important;
  color: #07080c !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color 140ms ease, opacity 140ms ease !important;
}

.mbx-launch-btn span,
.mbx-nav-right a.mbx-launch-btn span {
  color: #07080c !important;
  display: inline-block !important;
  font-weight: 600 !important;
}

.mbx-launch-btn svg,
.mbx-nav-right a.mbx-launch-btn svg {
  color: #07080c !important;
  stroke: #07080c !important;
  flex-shrink: 0;
  transform: none !important;
}

.mbx-launch-btn:hover,
.mbx-nav-right a.mbx-launch-btn:hover {
  background-color: #e5e7eb !important;
  transform: none !important;
}

/* GitHub icon */
.mbx-github-link {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.5) !important;
  transition: color 140ms ease;
}

.mbx-github-link:hover {
  color: #ffffff !important;
  transform: none !important;
}

/* --- Platforms Dropdown (clean, functional, no hover animation) --- */
.mbx-dropdown-trigger {
  position: relative;
}

.mbx-dropdown-trigger button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 450;
  cursor: pointer;
  outline: none;
  transition: color 140ms ease;
}

.mbx-dropdown-trigger:hover button {
  color: #ffffff;
}

.mbx-dropdown-trigger .mbx-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.6;
  transform: none !important;
}

.mbx-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  transform: none;
  width: 260px;
  background: #0d0f17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease;
  z-index: 100;
}

/* Keep the pointer inside the dropdown while crossing the visual gap. */
.mbx-dropdown-panel::before { content: ''; position: absolute; inset: -12px 0 auto; height: 12px; }
.mbx-dropdown-trigger button:focus-visible { outline: 2px solid #21afff; outline-offset: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .mbx-dropdown-panel { translate: 0 6px; transition: opacity 180ms ease, visibility 180ms ease, translate 240ms cubic-bezier(.22,1,.36,1); }
  .mbx-dropdown-trigger:hover .mbx-dropdown-panel,
  .mbx-dropdown-trigger:focus-within .mbx-dropdown-panel { translate: 0 0; }
  .mbx-mobile-menu:not([hidden]) { animation: mbx-menu-enter 300ms cubic-bezier(.22,1,.36,1) both; }
  .mbx-mobile-menu:not([hidden]) .mbx-mobile-link { animation: mbx-link-enter 380ms cubic-bezier(.22,1,.36,1) both; animation-delay: calc(var(--nav-order, 0) * 25ms); }
  @keyframes mbx-menu-enter { from { clip-path: inset(0 0 100%); } to { clip-path: inset(0); } }
  @keyframes mbx-link-enter { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
}

.mbx-dropdown-trigger:hover .mbx-dropdown-panel {
  opacity: 1;
  visibility: visible;
}

.mbx-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  transform: none !important;
}

.mbx-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: none !important;
}

.mbx-dropdown-badge {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.mbx-dropdown-item-title {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #f3f4f6;
  text-transform: none;
  letter-spacing: -0.01em;
}

.mbx-dropdown-item-desc {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 1px;
}

/* --- Mobile --- */
.mbx-mobile-toggle {
  display: flex;
  padding: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

@media (min-width: 900px) {
  .mbx-mobile-toggle { display: none; }
}

/* Desktop-only right links */
.mbx-right-link {
  display: none;
}

@media (min-width: 900px) {
  .mbx-right-link { display: inline-flex; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .mbx-header,
  .mbx-header-inner,
  .mbx-mid,
  .mbx-sep,
  .mbx-dropdown-panel {
    transition: none !important;
  }
}

/* Responsive navigation: the brand and actions have distinct columns. */
.mbx-mobile-menu[hidden] { display: none !important; }
.mbx-mobile-menu { padding: 12px 24px 24px; background: #090b10; border-bottom: 1px solid #252830; max-height: 70dvh; overflow-y: auto; }
.mbx-mobile-link { display: block; padding: 13px 0; border-bottom: 1px solid #ffffff12; color: #e5e7eb; font-size: 14px; text-decoration: none; }
.mbx-mobile-link:focus-visible, .mbx-mobile-toggle:focus-visible { outline: 2px solid #21afff; outline-offset: 3px; }
.mbx-dropdown-trigger:focus-within .mbx-dropdown-panel { opacity: 1; visibility: visible; }
@media (max-width: 899px) {
 .mbx-header-inner { padding: 0 16px; }
 .mbx-brand-center { position: static; transform: none; margin-right: auto; }
 .mbx-nav-right { margin-left: auto; gap: 8px; }
 .mbx-mobile-toggle { display: inline-flex !important; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
 .mbx-nav-right a.mbx-launch-btn { padding: 8px 10px !important; font-size: 11px !important; }
 .mbx-header { background: rgba(7,8,12,.97); }
}
@media (min-width: 900px) { .mbx-mobile-menu { display: none; } }
