@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Literal Tokens */
  --color-black: #050507;
  --color-obsidian: #0c0c0e;
  --color-charcoal: #121217;
  --color-slate-100: #f8fafc;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-800: #1e293b;
  
  /* Cyber Gothic Neon Accent Tokens */
  --color-neon-green: #00ff66;
  --color-neon-cyan: #00f0ff;
  --color-neon-purple: #bc34fa;
  --color-neon-amber: #ffaa00;
  --color-neon-rose: #ff0055;
  
  /* Semantic Tokens */
  --bg-main: var(--color-black);
  --bg-panel: rgba(18, 18, 23, 0.7);
  --bg-panel-solid: var(--color-charcoal);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-neon: rgba(0, 255, 102, 0.25);
  
  --text-primary: var(--color-slate-100);
  --text-secondary: var(--color-slate-300);
  --text-muted: var(--color-slate-400);
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
  
  --glow-green: 0 0 10px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.15);
  --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.35);
  --glow-purple: 0 0 10px rgba(188, 52, 250, 0.35);
  --glow-amber: 0 0 10px rgba(255, 170, 0, 0.35);
  --glow-rose: 0 0 10px rgba(255, 0, 85, 0.35);
}

/* Core Settings & Reset */
html {
  color-scheme: dark;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% 0%, rgba(20, 20, 30, 0.8), var(--bg-main) 70%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 2rem;
  background-color: rgba(5, 5, 7, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.brand .subhead {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-neon-green);
  margin-top: 0.2rem;
}

.header-links a {
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid transparent;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.header-links a:hover {
  color: var(--color-neon-green);
  border-color: var(--border-neon);
  background-color: rgba(0, 255, 102, 0.05);
}

.header-links a.glow-link-discord {
  color: var(--color-neon-cyan);
}

.header-links a.glow-link-discord:hover {
  color: var(--color-neon-cyan);
  border-color: rgba(0, 240, 255, 0.25);
  background-color: rgba(0, 240, 255, 0.05);
  box-shadow: var(--glow-cyan);
}


main {
  max-width: 1400px;
  width: 90%;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  main {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--color-slate-800);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate-400);
}

/* Glassmorphism Panel styles */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px) saturate(185%);
  -webkit-backdrop-filter: blur(12px) saturate(185%);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Visualizer Theater Component */
.visualizer-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 750px;
}

.visualizer-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background-color: #030304;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Playback & Controls */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 10, 14, 0.6);
  border-radius: 8px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-width: 45px;
  color: var(--text-muted);
}

.progress-bar-wrapper {
  flex-grow: 1;
  height: 6px;
  background: var(--color-slate-800);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-neon-green), var(--color-neon-cyan));
  width: 0%;
  border-radius: 3px;
  position: relative;
}

.progress-knob {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border: 2px solid var(--color-neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-neon-green);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.progress-bar-wrapper:hover .progress-knob {
  opacity: 1;
}

.btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-play {
  background: transparent;
  border: 1px solid var(--color-neon-green);
  color: var(--color-neon-green);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--glow-green);
}

.btn-play:hover {
  background-color: var(--color-neon-green);
  color: var(--color-black);
  box-shadow: 0 0 15px var(--color-neon-green);
}

.btn-play:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
}

/* Audio Stem Mixers */
.mixer-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.mixer-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}

.mixer-strip {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 1rem;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.strip-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mixer-strip.overtones2 .strip-label { color: var(--color-neon-cyan); }
.mixer-strip.overtones2 .strip-label::before { background: var(--color-neon-cyan); box-shadow: var(--glow-cyan); }

.mixer-strip.overtones6 .strip-label { color: var(--color-neon-purple); }
.mixer-strip.overtones6 .strip-label::before { background: var(--color-neon-purple); box-shadow: var(--glow-purple); }

.mixer-strip.rhythmic .strip-label { color: var(--color-neon-green); }
.mixer-strip.rhythmic .strip-label::before { background: var(--color-neon-green); box-shadow: var(--glow-green); }

.mixer-strip.arp .strip-label { color: var(--color-neon-amber); }
.mixer-strip.arp .strip-label::before { background: var(--color-neon-amber); box-shadow: var(--glow-amber); }

.mixer-strip.whistle .strip-label { color: var(--color-neon-rose); }
.mixer-strip.whistle .strip-label::before { background: var(--color-neon-rose); box-shadow: var(--glow-rose); }

/* Custom Sliders */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-slate-800);
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 1px solid var(--color-slate-300);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.mixer-strip.overtones2 input[type="range"]::-webkit-slider-thumb { border-color: var(--color-neon-cyan); box-shadow: var(--glow-cyan); }
.mixer-strip.overtones6 input[type="range"]::-webkit-slider-thumb { border-color: var(--color-neon-purple); box-shadow: var(--glow-purple); }
.mixer-strip.rhythmic input[type="range"]::-webkit-slider-thumb { border-color: var(--color-neon-green); box-shadow: var(--glow-green); }
.mixer-strip.arp input[type="range"]::-webkit-slider-thumb { border-color: var(--color-neon-amber); box-shadow: var(--glow-amber); }
.mixer-strip.whistle input[type="range"]::-webkit-slider-thumb { border-color: var(--color-neon-rose); box-shadow: var(--glow-rose); }

.strip-value {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}

/* HUD Overlay Info */
.canvas-hud-overlays {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-mono);
}

.hud-panel {
  background: rgba(8, 8, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hud-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.6rem;
}

.hud-val {
  color: var(--color-neon-green);
  font-weight: bold;
}

/* Journal Post (The Analytical Dive) */
.journal-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.article-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-neon-green);
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
}

.article-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.article-content p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-left: 3px solid var(--color-neon-green);
  padding-left: 0.8rem;
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

.article-content blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 4px solid var(--color-neon-purple);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-primary);
}

.article-content blockquote p {
  margin: 0;
}

/* Table Style */
.data-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

th, td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

/* Alert Boxes (GitHub style) */
.alert-box {
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-box.important {
  background-color: rgba(188, 52, 250, 0.08);
  border: 1px solid rgba(188, 52, 250, 0.25);
  color: var(--color-slate-100);
}

.alert-box.note {
  background-color: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--color-slate-100);
}

.alert-title {
  font-family: var(--font-mono);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.alert-box.important .alert-title { color: var(--color-neon-purple); }
.alert-box.note .alert-title { color: var(--color-neon-cyan); }

/* Retro Terminal */
.terminal-section {
  grid-column: 1 / -1;
  margin-top: 2rem;
}

.terminal {
  background-color: #050508;
  border: 1px solid var(--border-neon);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.1);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-neon-green);
}

.terminal-header {
  background-color: #0c0c12;
  border-bottom: 1px solid rgba(0, 255, 102, 0.15);
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-dots {
  display: flex;
  gap: 0.4rem;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-slate-800);
}

.terminal-dot.red { background: var(--color-neon-rose); }
.terminal-dot.yellow { background: var(--color-neon-amber); }
.terminal-dot.green { background: var(--color-neon-green); }

.terminal-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 350px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.terminal-line {
  line-height: 1.5;
  white-space: pre-wrap;
}

.terminal-line.success {
  color: var(--color-neon-green);
}

.terminal-line.info {
  color: var(--color-neon-cyan);
}

.terminal-line.warning {
  color: var(--color-neon-amber);
}

.terminal-line.input {
  color: var(--text-primary);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  background-color: var(--color-neon-green);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

/* Animations */
@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); }
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem;
  margin-top: auto;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer a {
  color: var(--color-neon-green);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Latent Telemetry Archive styles */
.archive-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.archive-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.3rem;
}

.archive-list::-webkit-scrollbar {
  width: 4px;
}
.archive-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.archive-list::-webkit-scrollbar-thumb {
  background: var(--color-neon-cyan);
  border-radius: 2px;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.archive-item:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.1);
}

.archive-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--color-neon-cyan);
  box-shadow: var(--glow-cyan);
  color: var(--color-neon-cyan);
}

.archive-item .track-author {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.archive-item.active .track-author {
  color: rgba(0, 240, 255, 0.7);
}

.archive-critique {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-neon-amber);
  border-top: 1px dashed rgba(255, 170, 0, 0.2);
  padding-top: 0.6rem;
  margin-top: 0.4rem;
  line-height: 1.4;
}

