/* Transformer Pipeline Visualizer — original styles, Vibe Coding Agency theme */
:root {
  --bg: #0a0a0a;
  --panel: rgba(17, 17, 17, 0.82);
  --panel-border: rgba(64, 64, 64, 0.55);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --accent: #76b900;
  --accent-soft: rgba(118, 185, 0, 0.14);
  --blue: #60a5fa;
  --amber: #fbbf24;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

.hud-panel {
  position: fixed;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Header */
#hud {
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }

.hud-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-chip {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.9), rgba(118, 185, 0, 0.2) 70%),
    #171717;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.hud-titles h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.hud-titles p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-back {
  flex: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}
.hud-back:hover { color: var(--text); border-color: var(--accent); }

/* Controls */
#controls {
  left: 18px;
  bottom: 52px;
  width: 280px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctl-block { display: flex; flex-direction: column; gap: 8px; }
.ctl-row { display: flex; gap: 6px; }
.ctl-row .ctl-btn { flex: 1; }

.ctl-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

#speed-range { width: 100%; accent-color: var(--accent); cursor: pointer; }

#blocks-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  font: 500 12.5px 'Inter', sans-serif;
  padding: 7px 10px;
  cursor: pointer;
}
#blocks-select option { background: #111; }

.ctl-toggles { flex-direction: row; flex-wrap: wrap; gap: 6px; }

.ctl-btn {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 500 12px 'Inter', sans-serif;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ctl-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.ctl-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(118, 185, 0, 0.55);
  background: var(--accent-soft);
}

.ctl-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

/* Inspector */
#inspector {
  top: 96px;
  right: 18px;
  width: 320px;
  max-height: calc(100% - 190px);
  overflow-y: auto;
  padding: 18px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
#inspector.hidden {
  transform: translateX(24px);
  opacity: 0;
  pointer-events: none;
}

.inspector-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.inspector-close:hover { color: var(--text); }

.inspector-kicker {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

#inspector h2 {
  margin: 0 0 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 600;
}

.inspector-blurb {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.inspector-specs {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 12.5px;
}
.inspector-specs dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  align-self: start;
  padding-top: 1px;
}
.inspector-specs dd { margin: 0; color: var(--text); }

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
  transform: translate(14px, -30px);
}
.tooltip.hidden { display: none; }

/* Floating stage labels */
#labels {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.stage-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(14, 16, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.stage-label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 6px;
  vertical-align: 1px;
}

/* Footer */
#foot {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--dim);
  pointer-events: none;
}
#foot a { color: var(--muted); pointer-events: auto; }
.foot-keys { font-family: var(--mono); font-size: 10.5px; }

@media (max-width: 760px) {
  #hud { padding: 10px 12px; }
  .hud-titles p { display: none; }
  #controls { width: calc(100% - 36px); bottom: 44px; }
  #inspector { top: auto; bottom: 44px; left: 18px; right: 18px; width: auto; max-height: 46%; }
  #foot .foot-keys { display: none; }
}
