/* ============================================================
   Brain Atlas - Luce design system
   Crisp white clinical cards · #0F172A pill buttons · #22C55E / #DCFCE7 emerald accents
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* --- Luce brand / chrome --- */
  --lime:          #22C55E;
  --lime-text:     #166534;
  --lime-soft:     #DCFCE7;
  --lime-border:   #86EFAC;
  --accent:        #166534;
  --accent-press:  #14532D;
  --accent-soft:   #DCFCE7;
  --accent-ring:   rgba(34, 197, 94, 0.55);

  /* --- Luce ink (on crisp white cards) --- */
  --ink:        #0F172A;
  --ink-soft:   #1E293B;
  --ink-faint:  #64748B;
  --ink-ghost:  #94A3B8;
  --hair:       #E2E8F0;
  --hair-2:     #F1F5F9;

  /* --- Luce crisp white cards --- */
  --glass:        #FFFFFF;
  --glass-solid:  #FFFFFF;
  --glass-hi:     #FFFFFF;
  --glass-edge:   #E2E8F0;
  --glass-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
  --field:        #F8FAFC;

  /* --- specimen stage (dark) --- */
  --stage-1: #1E293B;   /* center glow */
  --stage-2: #0F172A;   /* mid */
  --stage-3: #000000;   /* edge */
  --on-stage:        #0F172A;
  --on-stage-soft:   #475569;

  /* --- 11 subsystem colors (mirror of BRAIN.palette) --- */
  --c-cortex:        #D4847C;
  --c-white_matter:  #D7DDE8;
  --c-deep_grey:     #B57BE0;
  --c-diencephalon:  #7E8CF2;
  --c-brainstem:     #B86B62;
  --c-cerebellum:    #B5665D;
  --c-ventricles:    #3FC8D6;
  --c-arteries:      #F05068;
  --c-veins_sinuses: #5078E8;
  --c-cranial_nerves:#D9D24A;
  --c-meninges_dura: #CC63CC;

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
body { overflow: hidden; background: #000; color: var(--ink); }
#root { position: fixed; inset: 0; }

/* ---------- stage ---------- */
.stage {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 50% 38%, var(--stage-1) 0%, var(--stage-2) 46%, var(--stage-3) 100%);
}
@media (max-width: 640px) {
  .stage {
    background:
      radial-gradient(120% 85% at 50% 30%, var(--stage-1) 0%, var(--stage-2) 46%, var(--stage-3) 100%);
  }
}
.stage::after {  /* subtle vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(0,0,0,0.45) 100%);
}
canvas.three { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------- Luce crisp white card chrome ---------- */
.glass {
  background: #FFFFFF;
  border: 1.5px solid var(--hair);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-lg);
  color: var(--ink);
}
.glass-top-hi {
  background: #FFFFFF;
}

/* scrollbars inside panels */
.scroll { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: padding-box; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
button { font-family: inherit; cursor: pointer; }

/* ---------- helpers ---------- */
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.eyebrow {
  font-family: var(--font); font-weight: 700;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint);
}
.noselect { -webkit-user-select: none; user-select: none; }

@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pop { animation: popIn 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
.rise { animation: riseIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
.fade { animation: fadeIn 0.3s ease both; }

@media (prefers-reduced-motion: reduce) {
  .pop, .rise { animation: none; }
}

/* ---------- narration / lesson cards (Luce crisp white card style) ---------- */
.glass-dark {
  background: #FFFFFF;
  border: 1.5px solid var(--hair);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-lg);
  color: var(--ink);
}
.eyebrow-light { color: var(--lime-text); }

/* fade hint at the bottom of a scrollable panel body (Systems / Learn) */
.panel-fade {
  position: absolute; left: 1px; right: 1px; bottom: 0; height: 28px;
  pointer-events: none; border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: linear-gradient(to bottom, rgba(255,255,255,0), #FFFFFF);
}
.scroll-dark { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
.scroll-dark::-webkit-scrollbar { width: 8px; }
.scroll-dark::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 9px; }
