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

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

:root {
  --bg:        #07070d;
  --surface:   #0f0f18;
  --card:      #14141e;
  --border:    #252530;
  --blue:      #378ADD;
  --red:       #780606;
  --red-lt:    #b01010;
  --purple:    #9D00FF;
  --purple-lt: #b84dff;
  --gray:      #1e1e2a;
  --text:      #b8b6c8;
  --heading:   #f0eeff;
  --mono:      'Space Mono', monospace;
  --sans:      'Inter', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

.page { max-width: 900px; margin: 0 auto; }

/* HEADER */
header { text-align: center; padding: 3rem 0 2.5rem; }

header h1 {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--heading);
  letter-spacing: 0.08em;
  line-height: 1;
}

header h1 span { color: var(--purple-lt); }

header p {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 4px 14px;
  background: #150030;
  color: var(--purple-lt);
  border: 1px solid #5500aa;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

/* VISUALIZER CARD */
.viz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 1.25rem;
}

.controls label { font-size: 0.8rem; color: var(--text); opacity: 0.7; }

.controls select,
.controls input[type=range] {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
}

.controls input[type=range] { padding: 4px; width: 120px; cursor: pointer; }

.btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: #1e1e30; border-color: #38385a; }

.btn.primary {
  background: #150030;
  color: var(--purple-lt);
  border-color: #5500aa;
}
.btn.primary:hover { background: #1c0040; }

/* CANVAS */
#canvas-wrap {
  width: 100%;
  height: 220px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  gap: 0px;
  padding: 10px 10px 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  transition: height 0.12s ease, background 0.12s ease;
  min-width: 1px;
}

/* PROGRESS */
#progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 2px;
  transition: width 0.15s;
  width: 0%;
}

/* STATUS */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

#status-msg { font-size: 0.82rem; font-family: var(--mono); color: var(--text); opacity: 0.75; }
#stats-msg  { font-size: 0.78rem; font-family: var(--mono); color: var(--text); opacity: 0.5; }

/* LEGEND */
.legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; opacity: 0.7; }
.legend-dot  { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* SECTIONS */
.section { margin: 3rem 0; }

.section h2 {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* INFO CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.info-card .label {
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.info-card .value {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--blue);
  font-weight: 700;
}

.info-card .desc { font-size: 0.8rem; margin-top: 4px; opacity: 0.65; line-height: 1.5; }

/* STEPS */
.steps-list { list-style: none; counter-reset: steps; }

.steps-list li {
  counter-increment: steps;
  position: relative;
  padding: 0.75rem 0.75rem 0.75rem 3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--purple-lt);
  font-weight: 700;
}

/* CODE */
code {
  font-family: var(--mono);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15em 0.5em;
  font-size: 0.82em;
  color: var(--purple-lt);
}

pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text);
}

pre .kw  { color: var(--blue); }
pre .fn  { color: var(--purple-lt); }
pre .cm  { color: #44445a; }
pre .str { color: var(--red-lt); }
pre .num { color: var(--purple); }

/* FOOTER */
footer {
  text-align: center;
  margin-top: 4rem;
  font-size: 0.78rem;
  opacity: 0.35;
  font-family: var(--mono);
}
