/* QDNU Math Concepts - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600&family=Syne:wght@300;400;700&display=swap');

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* CSS Variables */
:root {
  --bg-dark: #03060f;
  --bg-surface: #0a0a12;
  --bg-elevated: #111120;
  --bg-panel: #08081a;

  --border: rgba(100, 160, 255, 0.07);
  --border-accent: rgba(126, 184, 247, 0.25);

  --cyan: #7eb8f7;
  --cyan-glow: #4fc3f7;
  --teal: #00d4aa;
  --orange: #ff6b35;
  --red: #f05a7e;
  --yellow: #ffca28;

  --text-primary: #e0e0ff;
  --text-secondary: #c8d8f0;
  --text-muted: #8080aa;
  --text-dim: rgba(200, 216, 240, 0.35);

  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;
}

/* Base */
body {
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.math-header,
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(3, 6, 15, 0.97) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.math-header h1,
#header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan-glow);
}

.math-header .subtitle {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.math-header .breadcrumb,
#header .breadcrumb {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(220, 236, 255, 0.55);
}

.math-header .breadcrumb a,
#header .breadcrumb a {
  color: rgba(159, 203, 255, 0.7);
  text-decoration: none;
}

.math-header .breadcrumb a:hover,
#header .breadcrumb a:hover {
  text-decoration: underline;
  color: #fff;
}

/* Main Layout */
.math-page {
  padding: 80px 28px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.math-page-fullscreen {
  height: 100vh;
  overflow: hidden;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 20px;
}

.panel-elevated {
  background: var(--bg-elevated);
}

/* Status Bar */
.status-bar {
  border-left: 3px solid var(--cyan);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(220, 236, 255, 0.8);
}

.status-bar.positive { border-color: var(--teal); color: var(--teal); }
.status-bar.warning { border-color: var(--orange); color: var(--orange); }
.status-bar.error { border-color: var(--red); color: var(--red); }

/* Canvas Container */
.canvas-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.canvas-container canvas {
  display: block;
  width: 100%;
}

.canvas-label {
  font-size: 12px;
  color: rgba(220, 236, 255, 0.55);
  margin-bottom: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Sliders */
.slider-container,
.slider-panel {
  background: var(--bg-surface);
  border-radius: 4px;
  padding: 16px 20px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.slider-label,
.slider-panel label {
  font-size: 14px;
  color: rgba(220, 236, 255, 0.7);
}

.slider-value,
.slider-panel .value {
  font-size: 20px;
  color: var(--teal);
  min-width: 60px;
  text-align: right;
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.5);
  margin-top: 6px;
}

/* Eigenvalue Bars */
.eigenvalue-bar {
  background: var(--bg-surface);
  border-radius: 4px;
  padding: 12px 16px;
}

.eigenvalue-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.eigenvalue-label {
  font-size: 14px;
  color: rgba(220, 236, 255, 0.8);
}

.eigenvalue-axis {
  font-size: 12px;
  color: rgba(220, 236, 255, 0.5);
}

.eigenvalue-track {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.eigenvalue-fill {
  height: 100%;
  transition: width 0.08s, background 0.1s;
}

.eigenvalue-note {
  font-size: 12px;
  color: rgba(220, 236, 255, 0.55);
  margin-top: 4px;
}

/* Insight Box */
.insight-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.insight-box .arrow {
  color: var(--teal);
}

/* ============================================
   CONCEPT PAGE SCENE PANELS
   Applies to all 7 concept subpages
   ============================================ */

/* Scene panel container - shift up from center */
#scene-panel {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-60%);
  z-index: 100;
  width: 320px;
  pointer-events: none;
}

/* Scene number label e.g. "SCENE 01 / 04" */
#scene-num {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(220, 236, 255, 0.6);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Scene title */
#scene-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 16px;
}

/* Scene description body text */
#scene-desc {
  font-size: 15px;
  line-height: 1.85;
  color: rgba(220, 236, 240, 0.75);
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

/* Scene insight/callout box */
#scene-insight {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(159, 203, 255, 0.9);
  border-left: 2px solid rgba(159, 203, 255, 0.45);
  padding: 12px 16px;
  padding-left: 14px;
  background: rgba(159, 203, 255, 0.05);
  margin-top: 16px;
}

/* ============================================
   DATA DISPLAY ELEMENTS
   Matrix values, readouts, formulas
   ============================================ */

/* Matrix display values */
.matrix-display,
.matrix-value,
.covariance-matrix,
#matrix-display {
  font-size: 18px;
  font-family: var(--font-mono);
  color: var(--cyan-glow);
}

/* Correlation/stat readouts */
.readout,
.stat-value,
.formula-display,
#readout,
#stat-display {
  font-size: 20px;
  font-family: var(--font-mono);
  color: #ffffff;
  font-weight: 600;
}

/* Axis labels */
.axis-label {
  font-size: 13px;
  color: rgba(220, 236, 255, 0.6);
}

/* Matrix annotations */
.matrix-annotation,
.property-list {
  font-size: 14px;
  color: rgba(220, 236, 255, 0.75);
  line-height: 2.0;
}

/* Key Concepts Grid */
.concepts-grid {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}

.concept-box {
  flex: 1;
  background: var(--bg-panel);
  border-radius: 4px;
  padding: 12px 14px;
}

.concept-title {
  color: rgba(220, 236, 255, 0.6);
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.concept-content {
  line-height: 1.8;
  font-size: 13px;
  color: rgba(220, 236, 255, 0.7);
}

.concept-content .highlight {
  color: var(--text-primary);
  font-size: 15px;
}

.concept-content .accent {
  color: var(--teal);
}

/* Scene Navigation */
.scene-nav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.scene-nav-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scene-nav-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: transparent;
  text-align: right;
  transition: color 0.2s;
  margin-right: 14px;
}

.scene-nav-item:hover .scene-nav-label {
  color: rgba(220, 236, 255, 0.5);
}

.scene-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200, 216, 240, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.scene-nav-dot:hover {
  background: rgba(200, 216, 240, 0.5);
  transform: scale(1.3);
}

.scene-nav-dot.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(126, 184, 247, 0.5);
}

/* Progress Bar */
.progress-bar-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  width: 200px;
  height: 1px;
  background: rgba(200, 216, 240, 0.1);
  position: relative;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--cyan);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(126, 184, 247, 0.6);
}

.progress-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(220, 236, 255, 0.5);
}

/* Navigation Arrows */
.nav-arrows {
  position: fixed;
  bottom: 20px;
  right: 28px;
  z-index: 100;
  display: flex;
  gap: 8px;
}

.nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(200, 216, 240, 0.15);
  background: rgba(3, 6, 15, 0.8);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: var(--font-mono);
}

.nav-btn:hover {
  border-color: rgba(126, 184, 247, 0.4);
  color: var(--cyan);
}

/* Prev/Next Concept Links */
.concept-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.concept-nav a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.concept-nav a:hover {
  text-decoration: underline;
}

/* Gallery Cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-card {
  background: rgba(126, 184, 247, 0.03);
  border: 1px solid rgba(126, 184, 247, 0.15);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-card:hover {
  background: rgba(126, 184, 247, 0.08);
  border-color: rgba(126, 184, 247, 0.35);
  transform: translateY(-2px);
}

.gallery-card-number {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.gallery-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 10px;
}

.gallery-card-description {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.gallery-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-tag {
  font-size: 9px;
  padding: 3px 8px;
  background: rgba(126, 184, 247, 0.1);
  border-radius: 3px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
  .math-page {
    padding: 70px 16px 30px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .concepts-grid {
    flex-direction: column;
  }
}
