/* ============================================================================
   Stratunex — STRATUNEX-SPECIFIC dark neon/glassmorphism theme.
   This deliberately DIVERGES from the shared joshuaaah.com white-dominant
   color bible (X:\WebSites\www.joshuaaah.com\styles.css /
   memory/feedback_joshuaaah_color_bible.md) used by the rest of the network
   (the hub, Phylonex, ...). Josh's explicit direction (2026-11-05): black
   background, neon purple primary accent with real CSS glow, silver as the
   glass-panel edge accent, white body text on glass, neon orange + neon teal
   as secondary/tertiary accents -- i.e. Colorado Rockies colors (purple /
   black / silver / white) reimagined as neon. Scope is UI CHROME ONLY:
   - The 3D anatomy render itself (.stage background, mesh materials) and all
     functional per-system/per-part colors (layer swatches, legend badges,
     marker-pin rings, active-highlight glow tint) are real anatomical data
     set inline by app.js via CSS custom properties (--marker-color,
     --legend-glow) or inline style.background -- NOT touched here. Only the
     surrounding frame (nav, panels, buttons, borders, typography) changed.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* ---- Rockies-neon base palette ---- */
  --jx-bg:             #000000; /* true black base */
  --jx-ink:            #FFFFFF; /* white body text, incl. on glass panels */
  --jx-ink-dim:        rgba(255,255,255,0.68);
  --jx-silver:         #C7C7D1; /* silver — glass-panel edge/border accent, not a fill */
  --jx-silver-soft:     rgba(199,199,209,0.34);
  --jx-silver-strong:   rgba(210,210,220,0.55);

  --jx-neon-purple:        #B026FF; /* PRIMARY accent */
  --jx-neon-purple-bright: #D34DFF;
  --jx-neon-purple-glow:   0 0 8px rgba(176,38,255,0.85), 0 0 22px rgba(176,38,255,0.55), 0 0 46px rgba(176,38,255,0.28);
  --jx-neon-purple-glow-sm: 0 0 5px rgba(176,38,255,0.8), 0 0 12px rgba(176,38,255,0.45);
  --jx-neon-purple-text-glow: 0 0 6px rgba(176,38,255,0.75), 0 0 16px rgba(176,38,255,0.4);

  --jx-neon-teal:          #00FFD1; /* secondary accent — interactive/hover states */
  --jx-neon-teal-bright:   #5CFFE4;
  --jx-neon-teal-glow:     0 0 6px rgba(0,255,209,0.75), 0 0 16px rgba(0,255,209,0.4);
  --jx-neon-teal-text-glow: 0 0 5px rgba(0,255,209,0.7), 0 0 12px rgba(0,255,209,0.35);

  --jx-neon-orange:        #FF7A00; /* tertiary accent — contextual-state flag (drilldown mode) */
  --jx-neon-orange-glow:   0 0 6px rgba(255,122,0,0.75), 0 0 18px rgba(255,122,0,0.4);
  --jx-neon-orange-text-glow: 0 0 5px rgba(255,122,0,0.7), 0 0 12px rgba(255,122,0,0.35);

  /* ---- glassmorphism panel tokens ---- */
  /* Translucent dark-purple-black base + blur, used for every "chunk of text"
     chrome panel (nav, layer-selector panel, legend panel, about panel). */
  --jx-glass-bg:        rgba(14,8,22,0.52);
  /* Fallback for browsers without backdrop-filter support (see @supports
     below): much more opaque so the panel still reads clearly as a panel
     instead of looking broken/transparent-over-render. */
  --jx-glass-bg-solid:  rgba(10,6,16,0.93);
  --jx-glass-border:    rgba(199,199,209,0.36); /* silver edge */
  --jx-glass-border-strong: rgba(210,210,220,0.58);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-sans: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;

  /* local aliases used throughout this file */
  --bg: var(--jx-bg);
  --ink: var(--jx-ink);
  --ink-dim: var(--jx-ink-dim);
  --rule: var(--jx-glass-border);
  --primary: var(--jx-neon-purple);
  --primary-hover: var(--jx-neon-purple-bright);
  --accent: var(--jx-neon-teal);
  --accent-text: var(--jx-neon-teal);
  --focus: var(--jx-neon-purple);
  --radius: var(--radius-md);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

input[type="checkbox"] { accent-color: var(--jx-neon-purple); }

/* ---------- sticky brand nav — glass bar over true black ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  flex-wrap: wrap;
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  background: var(--jx-glass-bg-solid);
  border-bottom: 1px solid var(--jx-glass-border);
  box-shadow: 0 1px 0 rgba(176,38,255,0.25), 0 4px 24px rgba(0,0,0,0.6);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-nav {
    background: var(--jx-glass-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
  }
}
.site-nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.site-nav__brand-dot { color: var(--jx-neon-purple); opacity: 0.95; text-shadow: var(--jx-neon-purple-text-glow); }
.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__links a,
.site-nav__current {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.site-nav__links a:hover,
.site-nav__links a:focus-visible {
  background: rgba(176,38,255,0.16);
  box-shadow: 0 0 0 1px rgba(176,38,255,0.45), 0 0 14px rgba(176,38,255,0.35);
  color: #ffffff;
}
.site-nav__current {
  font-weight: 600;
  color: var(--jx-neon-purple-bright);
  text-shadow: var(--jx-neon-purple-text-glow);
  opacity: 1;
  cursor: default;
}

/* ---------- hero (image header beneath the sticky nav) ---------- */
.site-header { position: relative; }
.site-hero {
  position: relative;
  min-height: 34vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--jx-glass-border);
}
.site-header__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 15%;
  filter: saturate(0.9) brightness(0.85);
  transform: scale(1.02);
}
.site-header__scrim {
  position: absolute; inset: 0;
  /* true-black scrim (matches the new base, instead of the old purple tint)
     -- still dark enough at the bottom for the overlaid white text to read */
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.62) 55%, rgba(0,0,0,0.95) 100%);
}
.site-header__content {
  position: relative;
  z-index: 1;
  padding: 2.5rem clamp(1rem, 4vw, 3rem) 1.75rem;
  max-width: 900px;
}
.site-header__kicker {
  margin: 0 0 0.25rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-family: var(--font-display);
  color: var(--jx-neon-teal); /* neon teal secondary accent, with real glow */
  text-shadow: var(--jx-neon-teal-text-glow);
}
.site-header__title {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
}
.site-header__sub {
  margin: 0;
  color: rgba(255,255,255,0.8);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  max-width: 48ch;
}

/* ---------- layout ---------- */
.viewer {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .viewer {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
  }
}

/* ---------- panel (layer-selector chrome) — glass panel #1 ----------
   Semi-transparent dark base + blur (real frosted-glass look), silver edge
   border, ambient neon-purple glow. @supports fallback below swaps in a
   near-opaque solid background on browsers without backdrop-filter, so the
   panel still reads cleanly instead of looking like broken transparency. */
.panel {
  background: var(--jx-glass-bg-solid);
  border: 1px solid var(--jx-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 0 32px rgba(176,38,255,0.14), 0 10px 34px rgba(0,0,0,0.55);
  padding: 1rem;
  display: grid;
  gap: 1.1rem;
  font-family: var(--font-sans);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .panel {
    background: var(--jx-glass-bg);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }
}
@media (min-width: 900px) {
  .panel { position: sticky; top: calc(1rem + 56px); }
}
.panel__section h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--jx-neon-purple-bright);
  text-shadow: var(--jx-neon-purple-text-glow);
}
.panel__section--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
}
.panel__hint { margin: 0 0 0.6rem; color: var(--ink-dim); font-size: 0.78rem; }

.layer-list, .drilldown-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.layer-item label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--jx-silver-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.layer-item label:hover {
  border-color: var(--jx-neon-teal);
  background: rgba(0,255,209,0.08);
  box-shadow: var(--jx-neon-teal-glow);
}
/* ring stays a neutral light tone (not a brand color) -- it exists purely so
   each swatch's real anatomical fill color stays legible against the new
   dark chrome; the swatch's own fill color is untouched functional data. */
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,0.3); }

.switch { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; user-select: none; color: var(--ink); }

.btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--jx-silver-soft);
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn:hover {
  border-color: var(--jx-neon-teal);
  background: rgba(0,255,209,0.08);
  color: #ffffff;
  box-shadow: var(--jx-neon-teal-glow);
}
.btn--ghost { background: transparent; }
.btn--small { padding: 0.3rem 0.6rem; font-size: 0.74rem; }
.btn--detail { width: 100%; text-align: left; }
.btn--active {
  background: var(--jx-neon-purple);
  border-color: var(--jx-neon-purple);
  color: #ffffff;
  box-shadow: var(--jx-neon-purple-glow-sm);
}
.btn--active:hover {
  background: var(--jx-neon-purple-bright);
  border-color: var(--jx-neon-purple-bright);
  color: #ffffff;
  box-shadow: var(--jx-neon-purple-glow);
}

.view-toggle { display: flex; gap: 0.5rem; }
.btn--view { flex: 1; text-align: center; }

.about-box[hidden] { display: none; }
/* nested glass card (info/about panel) inside the already-glass .panel --
   lighter translucency so it reads as its own card without double-blur. */
.about-box {
  margin-top: 0.6rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--jx-silver-soft);
  font-size: 0.76rem;
  color: var(--ink-dim);
  display: grid;
  gap: 0.5rem;
}
.about-box a { color: var(--jx-neon-teal); }
.about-box strong { color: var(--ink); }

/* ---------- 3D stage (the viewport itself stays its own dark frame — this
   frames the real 3D anatomy render, which is explicitly out of scope for
   the neon-glass chrome re-theme; aligned to the same true-black base so the
   frame blends seamlessly with the rest of the page) ---------- */
.stage {
  position: relative;
  background: #000000;
  border: 1px solid var(--jx-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 32px rgba(176,38,255,0.10), 0 10px 34px rgba(0,0,0,0.6);
  overflow: hidden;
  min-height: 70vh;
}
/* Absolutely positioned (not a flow child) so it can never inflate .stage's own
   height -- a plain `width:100%;height:100%` canvas inside a min-height-only parent
   resolves height:100% to the canvas's own attribute height (a replaced-element CSS
   quirk), which can ratchet the layout taller across repeated resizes. */
#canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.label-layer {
  position: absolute; inset: 0;
  pointer-events: none;
}

/* ---------- numbered pin markers (poster-style): small numbered dots sitting directly
   on the model at each structure's real screen-projected position. These still sit over
   the dark 3D render, so -- like the drilldown bar below -- they deliberately keep a dark
   chip/ring treatment for legibility against the mesh, not the page's glass chrome. The
   ring color itself (--marker-color) is real per-system anatomical data set by app.js,
   untouched here. ---------- */
.marker-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.82);
  border: 2px solid var(--marker-color, var(--focus));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  z-index: 3;
}
.marker-pin:hover { transform: translate(-50%, -50%) scale(1.2); }
.marker-pin--active {
  box-shadow: 0 0 0 2px var(--marker-color), 0 0 12px 2px var(--marker-color);
  transform: translate(-50%, -50%) scale(1.15);
}

/* ---------- legend panel: the PRIMARY labeling system on both desktop and mobile
   (the old leader-line system is retired entirely, not just hidden on mobile). Desktop
   = a real sidebar beside the model, matching the reference anatomy-poster layout;
   mobile = a bottom sheet over the stage, same grouped list and tap-to-glow behavior.
   Glass panel #2: frosted dark background + blur, silver edge border, white text --
   this is the main "chunk of text" surface the neon-glass spec targets. Per-part badge
   fill colors and the active-item glow tint (--legend-glow) are real anatomical data
   set inline by app.js and are NOT touched here; markers above keep their own dark-chip
   treatment since they still sit directly on the render itself. ---------- */
.legend-panel[hidden] { display: none; }
.legend-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--jx-glass-bg-solid);
  border: 1px solid var(--jx-glass-border);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 4px 28px rgba(176,38,255,0.18), 0 8px 30px rgba(0,0,0,0.55);
  z-index: 7;
  font-family: var(--font-sans);
  color: var(--ink);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .legend-panel {
    background: var(--jx-glass-bg);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }
}
.legend-panel__hint {
  margin: 0;
  padding: 0.55rem 0.9rem 0.35rem;
  font-size: 0.68rem;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: none;
  border-bottom: 1px solid var(--rule);
}
.legend-list {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0.6rem 0.8rem;
  overflow-y: auto;
  display: grid;
  gap: 0.28rem;
  -webkit-overflow-scrolling: touch;
}
.legend-group-header {
  margin: 0.55rem 0 0.1rem;
  padding: 0.2rem 0.3rem 0.3rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jx-neon-purple-bright);
  text-shadow: var(--jx-neon-purple-text-glow);
  border-bottom: 1px solid var(--rule);
}
.legend-group-header:first-child { margin-top: 0; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 42px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.legend-item:hover { background: rgba(255,255,255,0.08); }
.legend-item__badge {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: #0a0a0b;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}
.legend-item__name { flex: 1; }
.legend-item--active {
  border-color: var(--legend-glow, var(--focus));
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 1.5px var(--legend-glow, var(--focus)), 0 0 14px 1px var(--legend-glow, var(--focus));
}

@media (min-width: 900px) {
  .legend-panel {
    top: 0; right: 0; bottom: 0;
    width: 260px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  }
}
@media (max-width: 899px) {
  .legend-panel {
    left: 0; right: 0; bottom: 0;
    max-height: 48%;
    border-left: none; border-right: none; border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

.stage__loading[hidden] { display: none; }
.stage__loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.78);
  color: var(--ink-dim);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  z-index: 5;
}
.drilldown-bar[hidden] { display: none; }
/* Tertiary neon-orange accent flags the contextual-state change (you've left
   the full-body view for a focused drill-down) -- a real place for the
   orange accent to earn its keep, distinct from teal's general-interactive
   role and purple's primary-brand role. */
.drilldown-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--jx-glass-bg-solid);
  border-bottom: 1px solid rgba(255,122,0,0.5);
  box-shadow: 0 2px 22px rgba(255,122,0,0.22);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  z-index: 4;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .drilldown-bar {
    background: rgba(14,8,22,0.6);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }
}
#drilldown-title { color: var(--jx-neon-orange); text-shadow: var(--jx-neon-orange-text-glow); font-weight: 600; }
.drilldown-bar .btn {
  color: #ffffff;
  border-color: var(--jx-silver-strong);
  background: rgba(255,255,255,0.08);
}
.drilldown-bar .btn:hover {
  border-color: var(--jx-neon-teal);
  background: rgba(0,255,209,0.12);
  box-shadow: var(--jx-neon-teal-glow);
  color: #ffffff;
}
.site-footer {
  max-width: 1200px;
  margin: 1rem auto 2.5rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  color: var(--ink-dim);
  font-family: var(--font-sans);
  font-size: 0.78rem;
}
