/* Stiensgate // World Line Multiverse Design System
   Two-font system: Space Grotesk (display/headings) + Inter (body/UI with tabular-nums)
   Three body font sizes: --text-heading (1.25rem), --text-body (0.95rem), --text-sm (0.84rem)
   Explicit transitions only, prefers-reduced-motion honored, full 1-page print stylesheet. */

:root {
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-heading: 1.25rem;
  --text-body: 0.95rem;
  --text-sm: 0.84rem;

  --bg-obsidian: #05070b;
  --bg-surface: rgba(13, 18, 28, 0.88);
  --bg-surface-strong: rgba(16, 22, 34, 0.96);
  --border-subtle: rgba(204, 184, 152, 0.18);
  --border-bright: rgba(255, 168, 86, 0.56);

  --ink-primary: #f2efe9;
  --ink-muted: #b4beca;
  --accent-amber: #f59a3d;
  --accent-teal: #2dd4bf;
  --accent-coral: #f05d3b;
  --accent-cobalt: #3b8ef0;
  --accent-gold: #e2b254;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-obsidian);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage-wrap {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-obsidian);
}

#clockCanvas,
#glCanvas,
#hudCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

#clockCanvas { z-index: 1; }
#glCanvas    { z-index: 2; pointer-events: none; }
#hudCanvas   { z-index: 3; }

/* ============================================================================
   CLOCK ROOM PROGRESS RAIL (Docked cleanly along lower edge of Nixie Room)
   ============================================================================ */
.clock-dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.84);
  border: 1px solid rgba(214, 162, 104, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.72);
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.clock-dock.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

.clock-dock-brand {
  display: flex;
  flex-direction: column;
  padding-right: 10px;
  border-right: 1px solid rgba(214, 162, 104, 0.22);
  min-width: 126px;
}

.clock-dock-title {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f6e7d4;
  white-space: nowrap;
}

.clock-dock-sub {
  font-size: var(--text-sm);
  color: #c7b69f;
  white-space: nowrap;
}

.clock-wl-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.clock-wl-rail::-webkit-scrollbar { display: none; }

.clock-wl-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid rgba(214, 162, 104, 0.22);
  background: rgba(18, 20, 26, 0.76);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out, transform 140ms ease-out;
}

.clock-wl-btn:hover {
  border-color: rgba(255, 166, 82, 0.68);
  color: var(--ink-primary);
  background: rgba(34, 28, 24, 0.9);
}

.clock-wl-btn.is-next {
  border-color: rgba(255, 152, 56, 0.85);
  color: #fff3e0;
  background: rgba(68, 36, 16, 0.76);
  box-shadow: 0 0 18px rgba(255, 128, 36, 0.22);
}

.clock-wl-btn.is-done {
  border-color: rgba(45, 212, 191, 0.45);
  color: #ddf8f4;
}

.clock-wl-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(180, 190, 202, 0.34);
  flex-shrink: 0;
}

.clock-wl-btn.is-next .clock-wl-pip {
  background: #ff9c42;
  box-shadow: 0 0 8px rgba(255, 146, 48, 0.9);
}

.clock-wl-btn.is-done .clock-wl-pip {
  background: #2dd4bf;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.8);
}

.clock-summary-btn {
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid rgba(45, 212, 191, 0.5);
  background: rgba(16, 52, 52, 0.72);
  color: #d6faf5;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.clock-summary-btn:hover {
  background: rgba(22, 74, 74, 0.9);
  border-color: rgba(45, 212, 191, 0.85);
}

/* ============================================================================
   REALM SHELL (Worldlines 2, 3, 4, 5 & Worldline 1 Quiz Overlay)
   ============================================================================ */
.realm-stage {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.realm-stage.active {
  display: flex;
  opacity: 1;
}

.realm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 11, 18, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 4;
}

.realm-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.realm-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  white-space: nowrap;
}

.realm-code {
  color: var(--accent-amber);
  font-weight: 700;
  margin-right: 8px;
}

.realm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.realm-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Shared Clean Controls */
.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 140ms ease-out;
}

.sg-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.34);
}

.sg-btn:active {
  transform: translateY(1px);
}

.sg-btn-primary {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #0b0d12;
}

.sg-btn-primary:hover {
  background: #ffad56;
  border-color: #ffad56;
}

.sg-btn-teal {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #05161a;
}

.sg-btn-teal:hover {
  background: #52e5d2;
  border-color: #52e5d2;
}

.sg-btn-return {
  padding: 8px 14px;
  font-size: var(--text-sm);
  border-color: rgba(245, 154, 61, 0.48);
  background: rgba(245, 154, 61, 0.14);
  color: #ffd7aa;
}

.sg-btn-return:hover {
  background: rgba(245, 154, 61, 0.26);
  border-color: rgba(245, 154, 61, 0.85);
}

.sg-segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.sg-seg-opt {
  padding: 7px 13px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.sg-seg-opt.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--ink-primary);
}

/* ============================================================================
   WORLDLINE 1: ELEMENTAL DISCOVERY OVERLAY (Floats cleanly over live WebGL star)
   ============================================================================ */
.el-quiz-fab {
  position: absolute;
  left: 122px;
  top: 12px;
  z-index: 14;
  display: none;
  align-items: center;
  gap: 8px;
}

.el-quiz-fab.visible {
  display: flex;
}

.el-quiz-fab.sheet-open {
  display: none;
}

.el-quiz-sheet {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  z-index: 16;
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(8, 11, 18, 0.90);
  border: 1px solid rgba(255, 174, 96, 0.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
}

.el-quiz-sheet.open {
  display: flex;
}

.el-quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.el-quiz-head h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.el-quiz-prog {
  height: 4px;
  width: 100%;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.el-quiz-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9c42, #38bdf8);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.el-quiz-q {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-primary);
}

.el-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.el-opt-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, transform 140ms ease-out;
}

.el-opt-btn:hover {
  border-color: rgba(255, 168, 86, 0.72);
  background: rgba(255, 154, 61, 0.12);
  transform: translateX(3px);
}

.el-opt-title {
  display: block;
  font-weight: 600;
  color: var(--ink-primary);
}

.el-opt-desc {
  display: block;
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.el-result-hero {
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.el-result-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.el-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.el-stat-label {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.el-stat-val {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-primary);
}

/* ============================================================================
   WORLDLINE 2: THE CEREBRUM (CORTEX COMPASS & SUPERHERO STUDIO)
   ============================================================================ */
.cerebrum-shell {
  background:
    radial-gradient(85% 60% at 15% 0%, rgba(45, 212, 191, 0.11), transparent 60%),
    radial-gradient(70% 55% at 88% 12%, rgba(245, 154, 61, 0.10), transparent 55%),
    #07131e;
}

.cerebrum-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.cerebrum-intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  min-height: calc(100dvh - 140px);
}

.cerebrum-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: #f6f4ef;
  margin-bottom: 16px;
}

.cerebrum-lead {
  font-size: var(--text-body);
  color: #c2d0dc;
  max-width: 56ch;
  margin-bottom: 24px;
}

.cerebrum-quiz-box {
  max-width: 780px;
  margin: 12px auto 0;
  padding: 28px;
  border-radius: 16px;
  background: rgba(11, 23, 36, 0.86);
  border: 1px solid rgba(148, 194, 224, 0.2);
}

.cc-q-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.cc-q-bar {
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

.cc-q-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #f59a3d);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-q-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.22;
  margin-bottom: 10px;
}

.cc-q-help {
  font-size: var(--text-body);
  color: var(--ink-muted);
  max-width: 62ch;
  margin-bottom: 22px;
}

.cc-intensity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.cc-choice {
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, transform 140ms ease-out;
}

.cc-choice:hover {
  border-color: rgba(45, 212, 191, 0.65);
  background: rgba(45, 212, 191, 0.1);
}

.cc-choice.selected {
  border-color: #f59a3d;
  background: rgba(245, 154, 61, 0.18);
}

.cc-choice strong {
  display: block;
  font-size: var(--text-body);
  font-weight: 600;
}

.cc-choice span {
  display: block;
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.cc-window-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.cc-window-label {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.cc-q-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* Cerebrum Results Studio */
.cc-results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 24px;
}

.cc-results-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.cc-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cc-studio-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.cc-hero-card {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #0d1d2d 0%, #09131e 100%);
  border: 1px solid rgba(245, 154, 61, 0.42);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.56);
}

.cc-hero-art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0a1622;
  overflow: hidden;
}

.cc-hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cc-hero-caption {
  padding: 18px 20px 20px;
}

.cc-hero-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff6e8;
}

.cc-hero-tier {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #f59a3d;
  margin-top: 3px;
}

.cc-hero-tagline {
  font-size: var(--text-body);
  color: #c8d6e2;
  margin-top: 10px;
}

.cc-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cc-visual-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cc-panel {
  border-radius: 14px;
  padding: 20px;
  background: rgba(11, 22, 34, 0.84);
  border: 1px solid rgba(154, 198, 228, 0.16);
}

.cc-panel h3 {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cc-panel-sub {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.cc-brain-stage {
  position: relative;
  width: 100%;
  height: 310px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #12283d 0%, #061019 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-brain-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cc-spider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cc-spider-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
}

.cc-spider-legend {
  display: flex;
  gap: 18px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: 8px;
}

.cc-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.cc-principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cc-list li {
  font-size: var(--text-body);
  color: #dce6ef;
  padding-left: 14px;
  border-left: 2px solid rgba(45, 212, 191, 0.6);
}

.cc-list.kryptonite li {
  border-left-color: rgba(240, 93, 59, 0.72);
}

.cc-region-bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  margin-top: 12px;
}

.cc-bar-item {
  cursor: pointer;
}

.cc-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.cc-bar-track {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease-out;
}

.cc-archetype-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-top: 20px;
}

/* ============================================================================
   WORLDLINE 3: CHAKRAS & MAP OF CONSCIOUSNESS
   ============================================================================ */
.chakra-shell {
  background:
    radial-gradient(60% 55% at 32% 45%, rgba(92, 66, 196, 0.16), transparent 70%),
    radial-gradient(50% 45% at 80% 15%, rgba(45, 212, 191, 0.10), transparent 60%),
    #090b15;
}

.chakra-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  height: calc(100dvh - 60px);
  overflow: hidden;
}

.chakra-3d-pane {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.chakra-hud-bottom {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(9, 12, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.chakra-right-pane {
  height: 100%;
  overflow-y: auto;
  padding: 22px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chakra-tuner-box {
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(16, 20, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chakra-wave-canvas {
  width: 100%;
  height: 92px;
  display: block;
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.8);
  margin: 10px 0 12px;
}

.hawkins-tower {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hawkins-row {
  display: grid;
  grid-template-columns: 54px 118px 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.hawkins-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hawkins-row.active {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.hawkins-threshold {
  padding: 5px 10px;
  margin: 4px 0;
  border-top: 1px dashed rgba(245, 154, 61, 0.72);
  border-bottom: 1px dashed rgba(45, 212, 191, 0.72);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #ffd9a8;
  text-align: center;
}

/* ============================================================================
   WORLDLINE 4: LAWS OF HERMETICS
   ============================================================================ */
.hermetic-shell {
  background:
    radial-gradient(65% 55% at 22% 18%, rgba(226, 178, 84, 0.12), transparent 62%),
    radial-gradient(50% 45% at 85% 80%, rgba(196, 109, 59, 0.10), transparent 60%),
    #0d0b09;
}

.hermetic-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  height: calc(100dvh - 60px);
  overflow: hidden;
}

.hermetic-nav {
  border-right: 1px solid rgba(226, 178, 84, 0.18);
  padding: 18px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(16, 13, 10, 0.72);
}

.hermetic-law-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(226, 178, 84, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}

.hermetic-law-btn:hover {
  border-color: rgba(226, 178, 84, 0.5);
  color: var(--ink-primary);
}

.hermetic-law-btn.active {
  border-color: #e2b254;
  background: rgba(226, 178, 84, 0.14);
  color: #fff6e4;
}

.hermetic-law-btn.mastered .hermetic-seal-dot {
  background: #e2b254;
  box-shadow: 0 0 8px rgba(226, 178, 84, 0.85);
}

.hermetic-seal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(226, 178, 84, 0.25);
  margin-right: 8px;
}

.hermetic-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow-y: auto;
  padding: 22px 26px;
  gap: 18px;
}

.hermetic-lab-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  min-height: 400px;
}

.hermetic-canvas-box {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(226, 178, 84, 0.28);
  background: #080706;
  min-height: 360px;
}

.hermetic-astrolabe-box {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(226, 178, 84, 0.2);
  background: radial-gradient(circle at 50% 50%, #1d1710 0%, #090706 100%);
  min-height: 360px;
}

.hermetic-controls-bar {
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(20, 17, 13, 0.9);
  border: 1px solid rgba(226, 178, 84, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================================
   WORLDLINE 5: KAHNEMAN FAST & SLOW 3D LAB
   ============================================================================ */
.kahneman-shell {
  background:
    radial-gradient(60% 55% at 15% 12%, rgba(240, 93, 59, 0.12), transparent 60%),
    radial-gradient(55% 50% at 85% 20%, rgba(59, 142, 240, 0.12), transparent 60%),
    #090e15;
}

.kahneman-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  height: calc(100dvh - 60px);
  overflow: hidden;
}

.kahneman-3d-pane {
  position: relative;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.kahneman-right-pane {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kahneman-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.kahneman-tab {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out, color 140ms ease-out;
}

.kahneman-tab.active {
  border-color: #3b8ef0;
  background: rgba(59, 142, 240, 0.18);
  color: #eef5ff;
}

.kahneman-tab.done {
  border-color: rgba(45, 212, 191, 0.52);
}

.kahneman-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(14, 21, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sys-meter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sys-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--text-sm);
}

.sys-box.s1 { border-color: rgba(240, 93, 59, 0.42); }
.sys-box.s2 { border-color: rgba(59, 142, 240, 0.42); }

/* Range inputs */
input[type="range"].sg-range {
  width: 100%;
  accent-color: #f59a3d;
  cursor: pointer;
}

/* ============================================================================
   MULTIVERSE SYNTHESIS MODAL (From Nixie Clock Room)
   ============================================================================ */
.synthesis-modal {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.84);
  backdrop-filter: blur(12px);
}

.synthesis-modal.open {
  display: flex;
}

.synthesis-sheet {
  width: min(760px, 100%);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 16px;
  background: #0d121c;
  border: 1px solid rgba(245, 154, 61, 0.36);
}

.synthesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.synthesis-item {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   DEDICATED 1-PAGE PRINTABLE PDF SHEET (Hidden on screen, crisp 1-page in print)
   ============================================================================ */
#printSheet {
  display: none;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.38in;
  }

  html, body {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  .stage-wrap {
    display: none !important;
  }

  #printSheet {
    display: block !important;
    width: 100%;
    font-family: var(--font-body);
    color: #111827;
    background: #ffffff;
  }

  .ps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .ps-title {
    font-family: var(--font-display);
    font-size: 22pt;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.05;
  }

  .ps-meta {
    text-align: right;
    font-size: 8.5pt;
    color: #475569;
  }

  .ps-top-grid {
    display: grid;
    grid-template-columns: 195px 1fr 220px;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 12px;
  }

  .ps-portrait {
    width: 195px;
    height: 256px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid #0f172a;
    display: block;
  }

  .ps-card-box {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fafc;
  }

  .ps-card-box h3 {
    font-family: var(--font-display);
    font-size: 11pt;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
  }

  .ps-card-box p {
    font-size: 9pt;
    line-height: 1.42;
    color: #1e293b;
  }

  .ps-brain-img {
    width: 100%;
    height: 155px;
    object-fit: contain;
    background: #0a1622;
    border-radius: 6px;
    display: block;
    margin-bottom: 6px;
  }

  .ps-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
  }

  .ps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .ps-list li {
    font-size: 8.8pt;
    line-height: 1.38;
    padding-left: 8px;
    border-left: 2.5px solid #0d9488;
  }

  .ps-list.krypto li {
    border-left-color: #dc2626;
  }

  .ps-footer {
    border-top: 1px solid #cbd5e1;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 7.8pt;
    color: #64748b;
  }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (Mobile 390x844 & Tablet)
   ============================================================================ */
@media (max-width: 980px) {
  .cerebrum-intro,
  .cc-studio-grid,
  .cc-visual-pair,
  .cc-principles-grid,
  .cc-region-bars,
  .chakra-layout,
  .hermetic-layout,
  .hermetic-lab-grid,
  .kahneman-layout,
  .synthesis-grid {
    grid-template-columns: 1fr;
  }

  .chakra-layout,
  .hermetic-layout,
  .kahneman-layout {
    height: auto;
    overflow-y: auto;
  }

  .chakra-3d-pane,
  .kahneman-3d-pane {
    height: 360px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .hermetic-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(226, 178, 84, 0.18);
  }

  .hermetic-law-btn {
    min-width: 155px;
  }

  .cc-intensity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .realm-topbar {
    height: auto;
    min-height: 52px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .realm-topbar-left {
    width: 100%;
    justify-content: space-between;
  }

  .realm-brand {
    font-size: 0.98rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .realm-topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .clock-dock {
    bottom: 10px;
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .clock-dock-brand {
    border-right: none;
    padding-right: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(214, 162, 104, 0.2);
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .clock-dock-sub {
    white-space: normal;
  }

  .el-quiz-sheet {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: 12px;
    transform: none;
    max-height: 74dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
