/* Terminal Echo - Shared Design System */

/* ── Design Tokens ── */
:root {
  --bg: #0c160a;
  --primary: #00ff41;
  --primary-dim: #00e639;
  --secondary: #ffb000;
  --text: #dae6d2;
  --text-dim: #b9ccb2;
  --border: #2d382a;
  --font-mono: 'Space Mono', monospace;
  --font-code: 'JetBrains Mono', monospace;
}

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

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
  overflow-x: hidden;
}

/* ── CRT Scanline Overlay ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── CRT Flicker Overlay ── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 255, 65, 0.01);
  animation: flicker 0.15s infinite;
  pointer-events: none;
  z-index: 9998;
}

@keyframes flicker {
  0% { opacity: 0.27861; }
  5% { opacity: 0.34769; }
  10% { opacity: 0.23604; }
  15% { opacity: 0.90626; }
  20% { opacity: 0.18128; }
  25% { opacity: 0.83891; }
  30% { opacity: 0.65583; }
  35% { opacity: 0.67807; }
  40% { opacity: 0.20239; }
  45% { opacity: 0.86503; }
  50% { opacity: 0.24387; }
  55% { opacity: 0.85053; }
  60% { opacity: 0.36739; }
  65% { opacity: 0.80352; }
  70% { opacity: 0.47884; }
  75% { opacity: 0.04501; }
  80% { opacity: 0.52431; }
  85% { opacity: 0.89383; }
  90% { opacity: 0.94535; }
  95% { opacity: 0.67362; }
  100% { opacity: 0.27861; }
}

/* ── Container ── */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px;
}

/* ── ASCII Header ── */
.ascii-header {
  text-align: center;
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.1;
  color: var(--primary);
  white-space: pre;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
  animation: rainbow-shift 8s linear infinite;
}

@keyframes rainbow-shift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@media (min-width: 768px) {
  .ascii-art { font-size: 11px; }
}

/* ── System Status ── */
.sys-status {
  border: 1px solid var(--border);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(0, 255, 65, 0.02);
}

.sys-status .label { color: var(--secondary); }
.sys-status .value { color: var(--primary); }

/* ── Navigation ── */
nav {
  border: 1px solid var(--border);
  padding: 12px 16px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  color: var(--primary);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.15s ease;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
}

nav a:hover, nav a.active {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
}

nav a.active {
  border: 1px solid var(--primary);
}

/* ── Section Headers ── */
.section-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ── Terminal Window ── */
.terminal-window {
  border: 1px solid var(--border);
  margin-bottom: 32px;
  background: rgba(0, 255, 65, 0.02);
}

.terminal-titlebar {
  background: rgba(0, 255, 65, 0.05);
  padding: 6px 12px;
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  text-align: center;
  letter-spacing: 0.1em;
}

.terminal-body {
  padding: 16px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-code);
}

.prompt-footer {
  color: var(--primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dim); }

::selection {
  background: var(--primary);
  color: var(--bg);
}

/* ── Blink Animation ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
