/* =========================================================
   BZ DEV WORKS — DESIGN SYSTEM
   Palette:  #0A0B0D bg / #131417 surface / #1C1E23 surface-raised
             #262931 border / #E8E9EC text / #8A8D96 muted
             #3B82F6 accent / #5B9BF5 accent-hover / #34D399 positive
   Type:     Space Grotesk (display) / Inter (body) / JetBrains Mono (data)
   ========================================================= */

:root {
  --bg: #0A0B0D;
  --surface: #131417;
  --surface-raised: #1B1D22;
  --border: #24262C;
  --border-strong: #34373F;
  --text: #E8E9EC;
  --muted: #8A8D96;
  --faint: #55585F;
  --accent: #3B82F6;
  --accent-hover: #5B9BF5;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --positive: #34D399;
  --warning: #F5B440;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1180px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* Background grid texture, applied per-section */
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { color: var(--muted); margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

code, pre, .mono {
  font-family: var(--font-mono);
}

::selection { background: var(--accent); color: #04070f; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ---------- NAV ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 11, 13, 0.78);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.brand-mark-img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color .15s ease, background .15s ease;
}

.nav-links a:hover { color: var(--text); background: var(--surface-raised); }
.nav-links a.active { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #04070f;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 108px 0 90px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::after {
  content: "";
  position: absolute;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 520px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 68%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 700px; }

.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  color: var(--text);
}

.hero .lede {
  font-size: 17px;
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-tagline-swap {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--faint);
  margin-top: 40px;
}

/* ---------- SECTIONS ---------- */
section { padding: 84px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.section-head h2 { font-size: 26px; margin: 0; }
.section-head .desc { margin: 8px 0 0; max-width: 460px; }

/* ---------- REPO CARDS ---------- */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.repo-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  transform: translateY(-2px);
}

.repo-card-image {
  margin: -22px -22px 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.repo-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.repo-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.repo-card-name { font-family: var(--font-display); font-size: 17px; color: var(--text); margin: 0; }
.repo-card-desc { font-size: 13.5px; margin: 0; }

.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  white-space: nowrap;
}
.badge.status-production { color: var(--positive); border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.06); }
.badge.status-experimental { color: var(--warning); border-color: rgba(245,180,64,0.35); background: rgba(245,180,64,0.06); }
.badge.status-archived { color: var(--faint); }

.repo-terminal {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.repo-terminal .line::before { content: "$ "; color: var(--accent); }

.repo-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.repo-meta-row span { display: flex; align-items: center; gap: 5px; }

.repo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 100px;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 64px 32px;
  text-align: center;
  background: var(--surface);
}
.empty-state .mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.empty-state h3 { font-size: 19px; margin-bottom: 8px; }
.empty-state p { max-width: 440px; margin: 0 auto 20px; }

/* ---------- FILTER BAR ---------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.search-input-wrap {
  position: relative;
  margin-left: auto;
  min-width: 220px;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 14px 8px 34px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.search-input:focus { border-color: var(--accent); outline: none; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* ---------- STAT / DATA STRIP ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.stat-cell {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.stat-cell:last-child { border-right: none; }
.stat-cell .num { font-family: var(--font-mono); font-size: 22px; color: var(--text); display: block; }
.stat-cell .num.accent { color: var(--accent); }
.stat-cell .label { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- CARDS / PANELS ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px;
}

.value-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  background: var(--surface);
}
.value-card h3 { font-size: 16px; margin-bottom: 8px; }
.value-card p { font-size: 13.5px; margin: 0; }

/* ---------- Repo banner + screenshot gallery ---------- */
.repo-banner {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 32px;
  background: var(--bg);
}
.repo-banner img { width: 100%; height: auto; object-fit: contain; display: block; }

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.screenshot-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.screenshot-item img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: contain;
  display: block;
}
.screenshot-caption {
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Profile photo (about page) ---------- */
.profile-photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  background: var(--bg);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- REPO DETAIL PAGE ---------- */
.repo-hero {
  border-bottom: 1px solid var(--border);
  padding: 56px 0 40px;
}
.repo-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.repo-hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.repo-hero .repo-desc { font-size: 15.5px; max-width: 620px; }
.repo-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}
.detail-toc {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.detail-toc a {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.detail-toc a:hover { color: var(--text); }
.detail-toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }

.detail-body h2 {
  font-size: 20px;
  margin-top: 52px;
  padding-top: 4px;
  scroll-margin-top: 90px;
}
.detail-body h2:first-child { margin-top: 0; }
.detail-body h3 { font-size: 16px; margin-top: 28px; }
.detail-body ul, .detail-body ol { color: var(--muted); font-size: 14.5px; padding-left: 20px; }
.detail-body li { margin-bottom: 6px; }

.code-block {
  background: #0D0E11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #C9CBD1;
  overflow-x: auto;
  position: relative;
  white-space: pre;
  line-height: 1.6;
  tab-size: 2;
}
.code-block code { white-space: pre; }
.code-block.tree-block { color: #9CA0AA; }
.code-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
}
.code-block .copy-btn:hover { color: var(--text); }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  margin: 20px 0;
  color: var(--text);
}
.callout p { margin: 0; color: var(--text); }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15.5px;
  padding: 18px 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-q .plus { color: var(--accent); font-family: var(--font-mono); transition: transform .2s ease; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  font-size: 13.5px;
  color: var(--muted);
}
.faq-a-inner { padding: 0 4px 20px; }
.faq-item.open .faq-a { max-height: 400px; }

/* Changelog timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}
.timeline-entry { position: relative; padding-bottom: 40px; }
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-version {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
}
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--faint); margin-bottom: 10px; }

/* Contact / form */
.form-row { margin-bottom: 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 13px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }

.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  transition: border-color .15s ease;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 60px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--muted); padding: 5px 0; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 18px;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: width .1s linear;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 90;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive */
@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-toc { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
  .detail-toc a { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .detail-toc a.active { border-left: none; border-bottom-color: var(--accent); }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 20px;
    gap: 4px;
  }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer-grid { flex-direction: column; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { border-bottom: 1px solid var(--border); }
}

/* ---------- Search overlay (Ctrl+K) ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 9, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 300;
}
.search-overlay.open { display: flex; }
.search-panel {
  width: min(560px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.search-panel-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-panel input {
  border: none;
  background: none;
  font-size: 15px;
  padding: 0;
}
.search-panel input:focus { outline: none; }
.search-panel-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
}
.search-result:hover { background: var(--surface-raised); }
.search-result-name { font-family: var(--font-display); font-size: 14px; color: var(--text); }
.search-result-desc { font-size: 12.5px; color: var(--muted); }
.search-empty { padding: 24px 12px; text-align: center; color: var(--faint); font-size: 13.5px; }
.search-hint { font-family: var(--font-mono); font-size: 11px; color: var(--faint); border: 1px solid var(--border-strong); border-radius: 4px; padding: 2px 6px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-raised) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
