/* ---------- bpftop.dev ---------- */

:root {
  --bg: #0b0c0a;
  --bg-2: #121310;
  --bg-3: #1a1c17;
  --panel: #161814;
  --line: #24271f;
  --line-2: #2e3127;
  --fg: #f2eedf;
  --fg-dim: #9a9686;
  --fg-dimmer: #6a6757;
  --accent: oklch(0.84 0.17 148);       /* phosphor green */
  --accent-ink: oklch(0.25 0.08 148);
  --warn: oklch(0.84 0.15 82);          /* amber */
  --danger: oklch(0.72 0.19 27);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --maxw: 1200px;
  --r: 6px;
  --density: 1;
}

[data-density="compact"] { --density: 0.85; }
[data-density="roomy"]   { --density: 1.18; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv02", "cv11";
  overflow-x: hidden;
}

/* subtle scanline / noise texture on body */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.012) 0 1px,
      transparent 1px 3px
    );
  mix-blend-mode: overlay;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; gap: 20px;
  height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand img {
  image-rendering: pixelated;
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 10px color-mix(in oklab, var(--accent) 40%, transparent));
}
.brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.nav-links {
  display: flex; gap: 22px;
  font-size: 13px;
  color: var(--fg-dim);
}
.nav-links a { transition: color 0.15s; }
.nav-spacer { flex: 1; }
.nav-badge {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-dim);
  display: inline-flex; gap: 6px; align-items: center;
}
.nav-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
}
.nav-stats {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  background: color-mix(in oklab, var(--bg-2) 60%, transparent);
}
.nav-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--fg-dim);
  display: inline-flex; gap: 6px; align-items: center;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
}
.nav-pill:hover { background: var(--bg-3); color: var(--fg); }
.nav-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  flex: none;
}
.nav-pill-icon {
  color: var(--fg-dimmer);
  transition: color 0.15s;
  flex: none;
}
.nav-pill:hover .nav-pill-icon { color: var(--accent); }
a[aria-label="Star on GitHub"]:hover .nav-pill-icon { color: #f2b84b; }
.nav-stars-count { font-variant-numeric: tabular-nums; font-weight: 500; }
.nav-stars-count[data-loading="1"] { opacity: 0.4; }
.nav-inner > .btn { margin-left: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg-2);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn-ghost { background: transparent; }

/* ---------- Hero ---------- */
.hero {
  padding: calc(72px * var(--density)) 0 calc(56px * var(--density));
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero-bee {
  position: absolute;
  image-rendering: pixelated;
  width: 88px;
  height: 88px;
  top: -46px;
  right: -18px;
  z-index: 3;
  pointer-events: none;
  filter:
    drop-shadow(0 0 10px color-mix(in oklab, var(--accent) 35%, transparent))
    drop-shadow(0 8px 12px rgba(0,0,0,0.5));
  animation: bee-perch 5s ease-in-out infinite;
  transform-origin: 30% 100%;
}
@keyframes bee-perch {
  0%, 100% { transform: rotate(10deg) translateY(0); }
  50%      { transform: rotate(14deg) translateY(-4px); }
}
@media (max-width: 900px) {
  .hero-bee {
    width: 64px; height: 64px;
    top: -34px; right: 8px;
  }
}
.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
  position: relative; z-index: 1;
}
.hero-copy { position: relative; z-index: 1; }
#hero-visual { position: relative; }
.hero-visual-wrap { position: relative; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  font-size: 15px;
  color: var(--fg-dim);
  max-width: 54ch;
  margin: 0 0 28px;
  line-height: 1.65;
}
.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center;
}
.install-copy {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--bg-2);
  padding: 0;
  font-size: 13px;
  overflow: hidden;
}
.install-copy .prompt { padding: 9px 10px 9px 14px; color: var(--accent); }
.install-copy code { color: var(--fg); padding: 9px 2px 9px 0; white-space: nowrap; }
.install-copy button {
  background: var(--bg-3);
  border: none;
  border-left: 1px solid var(--line-2);
  color: var(--fg-dim);
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.install-copy button:hover { color: var(--accent); }

/* hero-stats removed */

/* ---------- TUI window ---------- */
.tui {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow:
    0 30px 80px -30px rgba(0,0,0,0.8),
    0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow: hidden;
  position: relative;
}
.tui::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,0.12) 2px 3px);
  opacity: 0.5;
}
.tui-chrome {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.tui-dots { display: flex; gap: 6px; }
.tui-dots span { width: 11px; height: 11px; border-radius: 50%; }
.tui-title {
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--mono);
}
.tui-prompt { color: var(--accent); }
.tui-sep { color: var(--fg-dimmer); }
.tui-path { color: var(--fg); }
.tui-cmd { color: var(--fg); }
.tui-meta {
  font-size: 11px;
  color: var(--fg-dimmer);
  display: flex; gap: 8px; align-items: center;
}

.tui-headerbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.tui-brand { font-family: var(--display); font-weight: 600; color: var(--accent); font-size: 14px; margin-right: 10px; }
.tui-ver { color: var(--fg-dim); margin-right: 12px; }
.tui-kernel { color: var(--fg-dimmer); }
.tui-summary { display: flex; gap: 22px; }
.tui-summary .dim { color: var(--fg-dimmer); margin-right: 6px; }
.tui-summary .accent { color: var(--accent); }

.tui-table { padding: 8px 10px 4px; }
.tui-row {
  display: grid;
  grid-template-columns: 48px 118px 1fr 70px 90px 72px 130px;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  align-items: center;
  white-space: nowrap;
}
.tui-thead {
  color: var(--fg-dimmer);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.tui-row.is-selected {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--fg);
  outline: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
}
.tui-row.is-selected .c-id { color: var(--accent); font-weight: 600; }
.tui-row .c-id { color: var(--fg-dim); }
.tui-row .c-rt, .tui-row .c-eps, .tui-row .c-cpu { text-align: right; font-variant-numeric: tabular-nums; }
.tui-row .c-type .chip {
  font-size: 10.5px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--fg-dim);
  background: var(--bg-3);
}
.tui-row .c-name { color: var(--fg); }
.tui-row .accent { color: var(--accent); }
.dim { color: var(--fg-dim); }

.tui-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex; gap: 18px; align-items: center;
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--bg-3);
}
.tui-foot kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--fg);
  margin-right: 4px;
}
.tui-spacer { flex: 1; }
.tui-blink { color: var(--accent); animation: blink 1.2s step-end infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- Section ---------- */
.section {
  padding: calc(72px * var(--density)) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 36px;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.section-lede {
  color: var(--fg-dim);
  font-size: 14px;
  max-width: 44ch;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Install ---------- */
.install-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  overflow-x: auto;
}
.install-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex; gap: 10px; align-items: center;
  transition: all 0.15s;
  white-space: nowrap;
}
.install-tab:hover { color: var(--fg); }
.install-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.install-tab-num {
  font-size: 10px;
  color: var(--fg-dimmer);
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
}
.install-tab.active .install-tab-num { color: var(--accent); border-color: var(--accent); }

.install-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  padding: 28px 32px;
  font-size: 14px;
  line-height: 1.8;
  position: relative;
}
.install-panel pre {
  margin: 0;
  font-family: var(--mono);
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-all;
}
.install-panel .prompt { color: var(--accent); user-select: none; margin-right: 8px; }
.install-copy-btn {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--fg-dim);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.install-copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.install-note { color: var(--fg-dimmer); font-size: 12px; margin-top: 18px; }

/* ---------- Features list (calmer) ---------- */
.features-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.feature-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.feature-row dt {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.feature-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 62ch;
}

/* ---------- Flow list (calmer) ---------- */
.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.flow-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.flow-list .flow-n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dimmer);
  letter-spacing: 0.05em;
  padding-top: 2px;
}
.flow-list h4 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--fg);
}
.flow-list p {
  margin: 0;
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 62ch;
}
.flow-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
  border: 1px dashed color-mix(in oklab, var(--accent) 40%, transparent);
}

.flow-caption {
  margin-top: 32px;
  padding: 24px 28px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.7;
}
.flow-caption strong { color: var(--fg); font-weight: 500; }

/* ---------- Keys ---------- */
.keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
  margin-top: 16px;
}
.keys-group h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dimmer);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.key-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.key-row:last-child { border-bottom: none; }
.key-row .desc { color: var(--fg-dim); font-size: 13px; }
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--fg);
  min-width: 28px;
  text-align: center;
  display: inline-block;
}
.kbd + .kbd { margin-left: 4px; }

/* ---------- Press ---------- */
.press {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.press-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 26px 28px;
  transition: all 0.2s;
}
.press-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -15px color-mix(in oklab, var(--accent) 50%, transparent);
}
.press-src {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dimmer);
  margin-bottom: 14px;
}
.press-card:hover .press-src { color: var(--accent); }
.press-quote {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 16px;
  text-wrap: balance;
}
.press-link {
  font-size: 12px;
  color: var(--fg-dim);
  display: inline-flex; gap: 8px; align-items: center;
}
.press-card:hover .press-link { color: var(--accent); }

/* ---------- Footer ---------- */
.foot {
  padding: 60px 0 40px;
  color: var(--fg-dim);
  font-size: 12px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.foot h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dimmer);
  margin: 0 0 14px;
  font-weight: 500;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 8px; }
.foot .brand { margin-bottom: 14px; }
.foot .brand img {
  image-rendering: pixelated;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 12px;
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--accent) 30%, transparent));
}
.foot-about { max-width: 36ch; line-height: 1.6; }
.foot-bottom {
  display: flex; justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--fg-dimmer);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.foot-bottom-only {
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.foot-links { display: inline-flex; gap: 18px; }
.foot-links a { color: var(--fg-dim); transition: color 0.15s; }
.foot-links a:hover { color: var(--accent); }
@media (max-width: 640px) {
  .foot-bottom-only { justify-content: flex-start; }
}

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  padding: 16px 18px;
  z-index: 100;
  font-size: 12px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8);
  min-width: 240px;
  display: none;
}
.tweaks.is-open { display: block; }
.tweaks h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.tweak-row { margin-bottom: 12px; }
.tweak-row label { display: block; font-size: 11px; color: var(--fg-dimmer); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.tweak-seg { display: flex; gap: 4px; }
.tweak-seg button {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg-dim);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
}
.tweak-seg button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tweak-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.tweak-swatch {
  width: 22px; height: 22px; border-radius: 4px;
  border: 2px solid var(--line-2);
  cursor: pointer;
  padding: 0;
}
.tweak-swatch.active { border-color: var(--fg); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; gap: 6px; }
  .flow-list li { grid-template-columns: 32px 1fr; gap: 16px; }
  .keys-grid { grid-template-columns: 1fr; gap: 32px; }
  .press-list a { grid-template-columns: 1fr 60px; }
  .press-list .press-src { grid-column: 1 / -1; margin-bottom: -6px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* nav: tighten + hide secondary links on phones */
@media (max-width: 720px) {
  .nav-inner { gap: 10px; }
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .nav-inner { gap: 8px; }
  /* version pill is nice-to-have; drop it first when space is tight */
  .nav-stats .nav-pill[aria-label="Latest release"] { display: none; }
  .nav-inner > .btn { margin-left: 4px; padding-left: 10px; padding-right: 10px; }
  .nav-stats { gap: 6px; }
}
