/* ==========================================================================
   nuclide-research.com/split-system.css
   Global Navigation Bar, Mobile Sheet, Search Drawer & Subpage Harmonizer
   7 Focused Routes: Home, Zoe, Slides, Autonomy Lab, Ablation + GEM, Buy & Download, Values
   100% Zero-CDN Static CSS | Strict CSP 'self' | WCAG AA/AAA
   ========================================================================== */

html {
  scroll-padding-top: 68px;
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

section[id],
article[id],
div[id] {
  scroll-margin-top: 68px;
}

body.ns-split-ready {
  padding-top: 56px;
}

/* Accessible Skip-to-Content Link */
.skip-link {
  position: fixed;
  left: 16px;
  top: -120px;
  z-index: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #E11D48;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid #FBBF24;
  outline-offset: 2px;
}

/* ==========================================================================
   GLOBAL TOP NAVIGATION BAR (56PX FLUSH CHASSIS)
   ========================================================================== */
.ns-split-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 260;
  height: 56px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #F4F4F5;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body[data-theme="vellum"] .ns-split-bar {
  background: rgba(250, 249, 246, 0.92);
  border-bottom: 1px solid rgba(9, 9, 11, 0.1);
  color: #09090B;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

.ns-bar-inner {
  max-width: 1220px;
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ns-brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ns-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.ns-home-pill:hover {
  opacity: 0.85;
}

.ns-brand-emblem {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.ns-brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.ns-brand-core {
  font-weight: 700;
  color: #F4F4F5;
}

body[data-theme="vellum"] .ns-brand-core {
  color: #09090B;
}

.ns-brand-sub {
  font-weight: 500;
  font-size: 0.78rem;
  color: #A1A1AA;
}

body[data-theme="vellum"] .ns-brand-sub {
  color: #52525B;
}

.ns-desktop-nav {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}

.ns-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  min-width: 44px;
  padding: 0 13px;
  color: #A1A1AA;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

body[data-theme="vellum"] .ns-link {
  color: #52525B;
}

.ns-link:hover {
  color: #F4F4F5;
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="vellum"] .ns-link:hover {
  color: #09090B;
  background: rgba(9, 9, 11, 0.04);
}

.ns-link.is-current {
  color: #F4F4F5;
  font-weight: 600;
}

body[data-theme="vellum"] .ns-link.is-current {
  color: #09090B;
}

.ns-link.is-current::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: #E11D48;
}

body[data-theme="vellum"] .ns-link.is-current::after {
  background: #BE123C;
}

.ns-actions-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.ns-map-btn,
.ns-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 44px;
  padding: 6px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E4E4E7;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body[data-theme="vellum"] .ns-map-btn,
body[data-theme="vellum"] .ns-theme-toggle {
  background: rgba(9, 9, 11, 0.04);
  border-color: rgba(9, 9, 11, 0.14);
  color: #18181B;
}

.ns-map-btn:hover,
.ns-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

body[data-theme="vellum"] .ns-map-btn:hover,
body[data-theme="vellum"] .ns-theme-toggle:hover {
  background: rgba(9, 9, 11, 0.08);
  border-color: rgba(9, 9, 11, 0.25);
  color: #09090B;
}

/* Mobile Hamburger Trigger */
.ns-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  min-width: 44px;
  padding: 6px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F4F4F5;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

body[data-theme="vellum"] .ns-hamburger-btn {
  background: rgba(9, 9, 11, 0.04);
  border-color: rgba(9, 9, 11, 0.14);
  color: #09090B;
}

.ns-hamburger-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 15px;
  height: 14px;
}

.ns-hamburger-bars span {
  display: block;
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.ns-hamburger-btn.is-open .ns-hamburger-bars span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.ns-hamburger-btn.is-open .ns-hamburger-bars span:nth-child(2) {
  opacity: 0;
}

.ns-hamburger-btn.is-open .ns-hamburger-bars span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* Mobile Slide-Down Sheet */
.ns-mobile-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0F0F14;
  padding: 12px 16px 18px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

body[data-theme="vellum"] .ns-mobile-panel {
  background: #FAF9F6;
  border-top-color: rgba(9, 9, 11, 0.1);
  box-shadow: 0 18px 36px rgba(9, 9, 11, 0.12);
}

.ns-mobile-panel[hidden] {
  display: none;
}

.ns-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ns-mobile-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #F4F4F5;
  text-decoration: none;
}

body[data-theme="vellum"] .ns-mobile-item {
  background: #FFFFFF;
  border-color: rgba(9, 9, 11, 0.09);
  color: #09090B;
}

.ns-mobile-item:hover,
.ns-mobile-item.is-current {
  border-color: rgba(225, 29, 72, 0.45);
  background: rgba(225, 29, 72, 0.08);
}

body[data-theme="vellum"] .ns-mobile-item:hover,
body[data-theme="vellum"] .ns-mobile-item.is-current {
  border-color: rgba(190, 18, 60, 0.36);
  background: rgba(190, 18, 60, 0.06);
}

.ns-mobile-item strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.ns-mobile-item span {
  font-size: 0.78rem;
  color: #A1A1AA;
}

body[data-theme="vellum"] .ns-mobile-item span {
  color: #52525B;
}

.ns-mobile-utils {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="vellum"] .ns-mobile-utils {
  border-top-color: rgba(9, 9, 11, 0.1);
}

.ns-mobile-util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F4F4F5;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

body[data-theme="vellum"] .ns-mobile-util-btn {
  background: #FFFFFF;
  border-color: rgba(9, 9, 11, 0.14);
  color: #09090B;
}

/* ==========================================================================
   GLOBAL SEARCH DIRECTORY MODAL (#nuclideSplitDrawer)
   ========================================================================== */
.ns-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(6, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 68px 16px 24px;
  overflow-y: auto;
}

.ns-drawer-backdrop[hidden] {
  display: none;
}

.ns-drawer-dialog {
  width: min(1020px, 100%);
  background: #14141B;
  color: #F4F4F5;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.68);
  padding: 24px;
}

body[data-theme="vellum"] .ns-drawer-dialog {
  background: #FFFFFF;
  color: #09090B;
  border-color: rgba(9, 9, 11, 0.12);
  box-shadow: 0 24px 64px rgba(9, 9, 11, 0.18);
}

.ns-drawer-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

body[data-theme="vellum"] .ns-drawer-top {
  border-bottom-color: rgba(9, 9, 11, 0.1);
}

.ns-drawer-title {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #A1A1AA;
}

body[data-theme="vellum"] .ns-drawer-title {
  color: #52525B;
}

.ns-drawer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ns-drawer-search {
  flex: 1;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #09090B;
  color: #F4F4F5;
  font-family: inherit;
  font-size: 0.92rem;
}

.ns-drawer-search::placeholder {
  color: #A1A1AA;
  opacity: 1;
}

body[data-theme="vellum"] .ns-drawer-search {
  background: #FAF9F6;
  color: #09090B;
  border-color: rgba(9, 9, 11, 0.16);
}

body[data-theme="vellum"] .ns-drawer-search::placeholder {
  color: #52525B;
  opacity: 1;
}

.ns-drawer-close {
  min-height: 44px;
  min-width: 48px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #F4F4F5;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

body[data-theme="vellum"] .ns-drawer-close {
  background: #FAF9F6;
  border-color: rgba(9, 9, 11, 0.16);
  color: #09090B;
}

.ns-drawer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ns-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ns-area-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
}

body[data-theme="vellum"] .ns-area-group {
  background: #FAF9F6;
  border-color: rgba(9, 9, 11, 0.08);
}

.ns-area-group[hidden] {
  display: none;
}

.ns-col-kicker {
  margin: 0 0 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #FB7185;
  text-transform: uppercase;
}

body[data-theme="vellum"] .ns-col-kicker {
  color: #BE123C;
}

.ns-col-kicker-teal {
  color: #2DD4BF;
}

body[data-theme="vellum"] .ns-col-kicker-teal {
  color: #115E59;
}

.ns-col-heading {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 600;
  color: inherit;
}

.ns-col-lead {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #A1A1AA;
}

body[data-theme="vellum"] .ns-col-lead {
  color: #52525B;
}

.ns-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ns-dir-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.14s ease, background 0.14s ease;
}

body[data-theme="vellum"] .ns-dir-item {
  background: #FFFFFF;
  border-color: rgba(9, 9, 11, 0.08);
}

.ns-dir-item:hover,
.ns-dir-item.is-current {
  background: rgba(225, 29, 72, 0.09);
  border-color: rgba(251, 113, 133, 0.45);
}

.ns-area-ablation .ns-dir-item:hover,
.ns-area-ablation .ns-dir-item.is-current {
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(45, 212, 191, 0.45);
}

body[data-theme="vellum"] .ns-dir-item:hover,
body[data-theme="vellum"] .ns-dir-item.is-current {
  background: rgba(190, 18, 60, 0.06);
  border-color: rgba(190, 18, 60, 0.36);
}

body[data-theme="vellum"] .ns-area-ablation .ns-dir-item:hover,
body[data-theme="vellum"] .ns-area-ablation .ns-dir-item.is-current {
  background: rgba(15, 118, 110, 0.07);
  border-color: rgba(15, 118, 110, 0.38);
}

.ns-dir-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
}

.ns-dir-sub {
  display: block;
  font-size: 0.78rem;
  color: #A1A1AA;
  margin-top: 2px;
}

body[data-theme="vellum"] .ns-dir-sub {
  color: #52525B;
}

.ns-dir-badge {
  flex-shrink: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #D4D4D8;
}

body[data-theme="vellum"] .ns-dir-badge {
  background: rgba(9, 9, 11, 0.06);
  color: #3F3F46;
}

@media (max-width: 1140px) {
  .ns-bar-inner {
    padding: 0 14px;
    gap: 10px;
  }
  .ns-brand-sub {
    display: none;
  }
  .ns-desktop-nav {
    gap: 2px;
  }
  .ns-link {
    padding: 0 8px;
    font-size: 0.81rem;
  }
  .ns-map-btn,
  .ns-theme-toggle {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

@media (max-width: 960px) {
  .ns-bar-inner {
    padding: 0 14px;
    gap: 10px;
  }
  .ns-desktop-nav,
  .ns-desktop-only {
    display: none;
  }
  .ns-hamburger-btn {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .ns-drawer-backdrop {
    padding: 60px 10px 18px;
  }
  .ns-drawer-dialog {
    padding: 16px;
  }
  .ns-drawer-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .ns-drawer-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .ns-brand-sub {
    display: none;
  }
  .ns-mobile-utils {
    grid-template-columns: 1fr;
  }
}
