/* worktrickle — terminal-noir stylesheet */

:root {
  --bg: #0d0d0d;
  --bg2: #111;
  --bg3: #161616;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #c8c8c8;
  --muted: #666;
  --accent: #39ff14;
  --accent-dim: #1a7a09;
  --amber: #ffb700;
  --mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }

/* hero */
.hero { padding: 72px 0 48px; text-align: center; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: #f0f0f0;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { max-width: 560px; margin: 0 auto 40px; color: var(--muted); font-size: 1.1rem; }
.hero-cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--accent);
  color: #000;
  padding: 10px 24px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}
.hero-cta:hover { opacity: 0.85; }

/* terminal */
.terminal-wrap { position: relative; margin: 0 auto; max-width: 800px; }
.terminal {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px);
  pointer-events: none;
  z-index: 10;
}
.terminal::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(57,255,20,0.08), 0 0 60px rgba(57,255,20,0.04);
  pointer-events: none;
  z-index: 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #141414;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.terminal-title { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0 auto; }
.terminal-body {
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2f2a transparent;
  position: relative;
  z-index: 1;
}
#term-output { white-space: pre; word-break: normal; overflow-x: auto; }

.term-prompt { color: var(--accent); }
.term-wt { color: #666; }
.term-box { color: var(--accent); }
.term-budget { color: var(--amber); }
.term-approve { color: #ff8c42; }
.term-done { color: var(--accent); }
.term-table { color: #8fbc8f; }
.term-muted { color: #444; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.replay-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 10px;
  cursor: pointer;
  z-index: 20;
  transition: color 0.15s, border-color 0.15s;
}
.replay-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

/* token compare */
.token-compare { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.compare-title {
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  text-align: center;
}
.bars-wrap { display: flex; flex-direction: column; gap: 20px; max-width: 640px; margin: 0 auto; }
.bar-row { display: grid; grid-template-columns: 220px 1fr 100px; align-items: center; gap: 16px; }
.bar-label { font-family: var(--mono); font-size: 12px; color: var(--text); text-align: right; }
.bar-track { height: 28px; background: #1c1c1c; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; transition: width 1.8s cubic-bezier(0.22,1,0.36,1); }
.bar-fill-naive { background: #3a1a1a; border-right: 2px solid #c0392b; }
.bar-fill-wt { background: var(--accent-dim); border-right: 2px solid var(--accent); }
.bar-count { font-family: var(--mono); font-size: 13px; }
.bar-count.red { color: #e74c3c; }
.bar-count.green { color: var(--accent); }

/* effort dial */
.effort-section { background: var(--bg3); }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f0f0f0;
  margin-bottom: 8px;
}
.section-sub { color: var(--muted); margin-bottom: 40px; max-width: 540px; }
.dial-control {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 28px;
  width: fit-content;
}
.dial-btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 20px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dial-btn:last-child { border-right: none; }
.dial-btn:hover { background: #1f1f1f; color: var(--text); }
.dial-btn.active { background: var(--accent); color: #000; font-weight: 700; }
.dial-readout {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  width: 100%;
}
@media (max-width: 980px) { .dial-readout { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .dial-readout { grid-template-columns: repeat(2, 1fr); } }
.readout-card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; }
.readout-label { font-size: 10px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.readout-val { font-family: var(--mono); font-size: 15px; color: var(--accent); font-weight: 600; }
.readout-val span { color: var(--muted); font-size: 11px; }

/* pipeline */
.pipeline-section { background: var(--bg2); }
.phases { display: flex; flex-direction: column; gap: 0; position: relative; max-width: 640px; }
.phase { display: grid; grid-template-columns: 40px 1fr; gap: 0 20px; opacity: 0; transform: translateX(-16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.phase.visible { opacity: 1; transform: none; }
.phase-connector { display: flex; flex-direction: column; align-items: center; }
.phase-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-dim); border: 2px solid var(--accent); flex-shrink: 0; margin-top: 6px; }
.phase.visible .phase-dot { background: var(--accent); }
.phase-line { width: 2px; flex: 1; background: var(--border); min-height: 24px; }
.phase:last-child .phase-line { display: none; }
.phase-body { padding-bottom: 32px; }
.phase-name { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.phase-desc { font-size: 14px; color: var(--text); max-width: 500px; }
.phase-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }

/* tiering */
.tiering-section { background: var(--bg3); }
.tier-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 48px; }
@media (max-width: 980px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
.tier-card { border: 1px solid var(--border); border-radius: 4px; padding: 20px; background: var(--surface); }
.tier-card-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tier-card-name { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.tier-card-name.haiku { color: #7dd3fc; }
.tier-card-name.sonnet { color: var(--accent); }
.tier-card-name.fable { color: var(--amber); }
.tier-card-name.inline { color: #c084fc; }
.tier-card-name.opus { color: #f472b6; }
.tier-card-desc { font-size: 13px; color: var(--muted); }

/* install */
.install-section { background: var(--bg2); }
.install-box {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
.install-alt { font-size: 13px; color: var(--muted); margin-top: 12px; }
.install-alt a, a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

footer { border-top: 1px solid var(--border); padding: 32px 0; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); }
footer a { color: var(--muted); }

@media (max-width: 600px) {
  .bar-row { grid-template-columns: 130px 1fr 80px; }
  .dial-btn { padding: 8px 12px; font-size: 12px; }
  .terminal-body { font-size: 11px; padding: 14px 16px; }
}
