:root {
  --brand: #39d353;
  --accent: #e3b341;
  --radius: 2px;
  --font: "JetBrains Mono";
  --paper: #0b0f0c;
  --ink: #cfe0d2;
  --rule: #1f2c22;
  --panel: #0f1511;
}

html { scroll-padding-top: 5rem; }

body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

#site {
  font-family: var(--font), "JetBrains Mono", ui-monospace, monospace;
  background-color: var(--paper);
  color: var(--ink);
}
#site.theme-light {
  --paper: #f3f5f1;
  --ink: #0f2318;
  --rule: #d8ded4;
  --panel: #ffffff;
}

.font-display { font-family: var(--font), "JetBrains Mono", monospace; font-weight: 700; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.mono-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* Brand utilities (runtime theme colour) */
.brand-text { color: var(--brand); }
.brand-bg { background-color: var(--brand); }
.brand-border { border-color: var(--brand); }
.hover\:brand-text:hover { color: var(--brand); }
.hover\:brand-bg:hover { background-color: var(--brand); }
.group:hover .group-hover\:brand-text { color: var(--brand); }

/* Terminal chrome */
.scanlines::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
}
.cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.02em;
  background: var(--brand);
  margin-left: 3px;
  vertical-align: -0.14em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-btn {
  display: inline-block;
  border: 1px solid var(--brand);
  color: var(--brand);
  padding: 0.55rem 1.1rem;
  transition: background 0.18s ease, color 0.18s ease;
  border-radius: var(--radius);
}
.term-btn:hover { background: var(--brand); color: var(--paper); }
.term-btn-ghost {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 0.55rem 1.1rem;
  transition: border-color 0.18s ease, color 0.18s ease;
  border-radius: var(--radius);
}
.term-btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.term-panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.term-row { transition: background 0.15s ease, border-color 0.15s ease; }
.term-row:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }
.term-row:hover .term-arrow { transform: translateX(4px); color: var(--brand); }
.term-arrow { transition: transform 0.15s ease, color 0.15s ease; }

.term-link { color: var(--ink); }
.term-link:hover { color: var(--brand); }

/* Nav shadow on scroll */
#nav.scrolled .nav-inner { box-shadow: 0 1px 0 var(--rule); backdrop-filter: blur(8px); }

.faq-sign { transition: transform 0.2s ease; display: inline-block; }
.faq-item[open] .faq-sign { transform: rotate(90deg); color: var(--brand); }

/* Typing reveal (runs once on load) */
.typing-on .term-content {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.typing-on .term-content.is-visible { opacity: 1; transform: none; }
.type-caret {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--brand);
  margin-left: 2px;
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
.term-cmd.is-done .type-caret { display: none; }

/* Ticker */
.marquee { overflow: hidden; }
.marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 40s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ------------------------------------------------------------------ Builder */
.builder-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
}
.builder-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.builder-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}
.repeat-card {
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.9rem;
  background: #0b1220;
}
.card {
  border: 1px solid #1e293b;
  border-radius: 1rem;
  padding: 1.25rem;
  background: #0b1220;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.9rem; }
.tab-btn {
  text-align: left;
  white-space: nowrap;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  border: 1px solid transparent;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.05); }
.tab-btn.active { background: #4f46e5; color: #fff; }
.add-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background: #4f46e5;
  color: #fff;
}
.add-btn:hover { filter: brightness(1.1); }
.remove-btn {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
}
.remove-btn:hover { background: rgba(127, 29, 29, 0.25); }
.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #334155;
  color: #e2e8f0;
}
.preset-btn:hover { background: rgba(255, 255, 255, 0.05); }
.preset-btn span { width: 0.9rem; height: 0.9rem; border-radius: 999px; display: inline-block; }
