/* ===========================================================
   muhan.dev — dev-craft / dashboard / dark-neon / terminal-ui
   =========================================================== */

:root {
  --terminal-black: #080810;
  --panel-dark: #0E0E1A;
  --panel-bar: #141428;
  --neon-green: #40E080;
  --neon-blue: #4080E0;
  --neon-orange: #E08040;
  --neon-red: #E04060;
  --neon-yellow: #E0C040;
  --terminal-text: #A0B0C0;
  --terminal-text-dim: #607080;
  --border-soft: rgba(64, 224, 128, 0.20);
  --border-dim: rgba(64, 224, 128, 0.10);
}

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

html, body {
  background: var(--terminal-black);
  color: var(--terminal-text);
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: clamp(12px, 0.8vw, 14px);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Code-rain canvas pinned to viewport background */
#code-rain {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Topbar / logotype */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.logotype {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 32px);
  color: var(--neon-green);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logotype .cursor {
  display: inline-block;
  color: var(--neon-green);
  animation: blink 0.7s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.status-line {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--terminal-text-dim);
}

.status-item { display: inline-flex; align-items: center; gap: 6px; }

.dot-green, .dot-blue, .dot-orange {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green  { background: var(--neon-green);  box-shadow: 0 0 6px var(--neon-green); }
.dot-blue   { background: var(--neon-blue);   box-shadow: 0 0 6px var(--neon-blue);  }
.dot-orange { background: var(--neon-orange); box-shadow: 0 0 6px var(--neon-orange);}

/* ============================================================
   Dashboard grid
   ============================================================ */
.dashboard {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  grid-auto-rows: minmax(220px, auto);
}

.span-2-col { grid-column: span 2; }
.span-2-row { grid-row: span 2; }

@media (max-width: 1000px) {
  .dashboard { grid-template-columns: repeat(2, 1fr); }
  .span-2-col { grid-column: span 2; }
}

@media (max-width: 640px) {
  .dashboard { grid-template-columns: 1fr; }
  .span-2-col { grid-column: span 1; }
}

/* ============================================================
   Terminal panel chrome
   ============================================================ */
.terminal {
  background: var(--panel-dark);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.25s;
}

.terminal.is-live {
  opacity: 1;
  transform: translateY(0);
}

.terminal:hover {
  border-color: rgba(64, 224, 128, 0.45);
}

.terminal-bar {
  height: 28px;
  background: var(--panel-bar);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red    { background: var(--neon-red);    box-shadow: 0 0 4px rgba(224, 64, 96, 0.6); }
.dot-yellow { background: var(--neon-yellow); box-shadow: 0 0 4px rgba(224, 192, 64, 0.6); }
.dot-green  { background: var(--neon-green);  box-shadow: 0 0 4px rgba(64, 224, 128, 0.6); }

.terminal-title {
  margin-left: 10px;
  font-family: "Fira Code", "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--terminal-text-dim);
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  flex: 1;
  font-family: "IBM Plex Mono", monospace;
}

.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(64, 224, 128, 0.18); border-radius: 3px; }

/* Command lines and feeds */
.cmd {
  color: var(--neon-green);
  font-family: "Fira Code", monospace;
  font-size: 13px;
  margin: 6px 0 4px;
  letter-spacing: 0.01em;
}

.cmd.prompt-line { margin-top: 10px; }

.data-feed {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.data-feed li {
  font-size: 12.5px;
  padding: 1px 0;
  color: var(--terminal-text);
  white-space: pre-wrap;
}

.prompt {
  color: var(--neon-green);
  margin-right: 6px;
}

.ok    { color: var(--neon-green); }
.warn  { color: var(--neon-orange); }
.info  { color: var(--neon-blue); }
.error { color: var(--neon-red); }

/* CI panel timestamps */
.ts {
  color: var(--terminal-text-dim);
  margin-right: 8px;
  font-size: 11.5px;
}

/* Commits */
.commit-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(96, 112, 128, 0.15);
}
.commit-list li:last-child { border-bottom: none; }

.hash {
  color: var(--neon-orange);
  font-family: "Fira Code", monospace;
  font-size: 12px;
  flex-shrink: 0;
}

.msg { color: var(--terminal-text); font-size: 12.5px; }

/* Tools */
.tool-list { list-style: none; }
.tool-list li {
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--terminal-text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.tool-icon {
  color: var(--neon-green);
  font-family: "Fira Code", monospace;
}
.tool-meta {
  margin-left: auto;
  color: var(--terminal-text-dim);
  font-size: 11.5px;
}

/* Docs preview */
.doc-block {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--terminal-text);
  white-space: pre-wrap;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(8, 8, 16, 0.55);
  border-left: 2px solid var(--border-soft);
}

/* Telemetry bars */
.metric-list { list-style: none; }
.metric-list li {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.metric-label {
  color: var(--terminal-text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bar {
  height: 8px;
  background: rgba(160, 176, 192, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.bar-fill.ok   { background: var(--neon-green);  box-shadow: 0 0 8px rgba(64, 224, 128, 0.5); }
.bar-fill.info { background: var(--neon-blue);   box-shadow: 0 0 8px rgba(64, 128, 224, 0.5); }
.bar-fill.warn { background: var(--neon-orange); box-shadow: 0 0 8px rgba(224, 128, 64, 0.5); }
.bar-fill.err  { background: var(--neon-red);    box-shadow: 0 0 8px rgba(224, 64, 96, 0.5); }

.metric-val {
  text-align: right;
  font-family: "Fira Code", monospace;
  font-size: 12px;
  color: var(--terminal-text);
}

/* Command palette */
.kbd {
  display: inline-block;
  font-family: "Fira Code", monospace;
  font-size: 12px;
  color: var(--neon-blue);
  background: rgba(64, 128, 224, 0.10);
  padding: 0 6px;
  margin-right: 6px;
  border: 1px solid rgba(64, 128, 224, 0.30);
  border-radius: 3px;
  min-width: 64px;
  text-align: center;
}

#live-input { color: var(--terminal-text); }

.caret {
  display: inline-block;
  color: var(--neon-green);
  animation: blink 0.7s step-end infinite;
  margin-left: 1px;
}

/* Typewriter cursor effect target */
[data-typewriter] {
  position: relative;
}

.typing-cursor::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: -2px;
  margin-left: 2px;
  background: var(--neon-green);
  animation: blink 0.7s step-end infinite;
}

/* Footbar */
.footbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  border-top: 1px solid var(--border-soft);
  background: rgba(8, 8, 16, 0.78);
  font-size: 11.5px;
  color: var(--terminal-text-dim);
  letter-spacing: 0.04em;
}

#clock {
  font-family: "Fira Code", monospace;
  color: var(--neon-green);
}

/* Active panel state — first in viewport gets a stronger glow */
.terminal.is-live .dot-green {
  animation: pulse-glow 2.4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(64, 224, 128, 0.6); }
  50%      { box-shadow: 0 0 10px rgba(64, 224, 128, 0.95); }
}
