*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #1A1B1F;
  --surface:   #1A2231;
  --surface-2: #1E2D45;
  --border:    #1F2A3D;
  --border-hi: #253650;
  --text:      #E5E7EB;
  --muted:     #94A3B8;
  --accent:    #38BDF8;
  --green:     #22C55E;
  --yellow:    #F59E0B;
  --red:       #EF4444;
  --radius:    8px;
  --radius-sm: 4px;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Layout ─────────────────────────────────────────────── */
header { border-bottom: 1px solid var(--border); padding: 16px 0; }
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── Header ─────────────────────────────────────────────── */
.header-inner { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.logo span { color: var(--accent); }
.badge {
  font-size: 11px; font-family: var(--mono);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; color: var(--muted);
}
.sep { color: var(--border-hi); padding: 0 2px; font-size: 18px; }
.crumb { font-size: 14px; color: var(--muted); }

/* ─── Hero (homepage) ────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right,  rgba(56,189,248,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56,189,248,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 50%, transparent 100%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-family: var(--mono);
  color: var(--accent); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block; width: 20px; height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700; letter-spacing: -0.03em;
  color: #fff; margin-bottom: 14px; line-height: 1.15;
}
.hero p {
  font-size: 16px; color: var(--muted);
  max-width: 520px; line-height: 1.75; margin-bottom: 0;
}

/* ─── Section ────────────────────────────────────────────── */
section { padding: 40px 0; border-top: 1px solid var(--border); }
section h2 {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  font-family: var(--mono); color: var(--muted); margin-bottom: 20px;
}

/* ─── Products Grid ──────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

/* ─── Card ───────────────────────────────────────────────── */
.card-link { display: block; color: inherit; text-decoration: none !important; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: border-color 150ms ease, background 150ms ease;
  height: 100%;
}
.card-link:hover .card { border-color: var(--accent); background: var(--surface-2); }

.card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.card-icon {
  width: 52px; height: 52px; border-radius: 10px;
  flex-shrink: 0; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); padding: 9px;
}
.card-icon img { width: 100%; height: 100%; display: block; }
.card-meta { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 15px; color: #fff; margin-bottom: 4px; }
.card-desc {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.card-fields { display: flex; flex-direction: column; gap: 8px; }
.card-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.card-field-label {
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.card-field-value {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
}
.placeholder-text { color: var(--yellow) !important; }

/* ─── Pills ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-family: var(--mono);
  border-radius: 999px; padding: 2px 8px;
  border: 1px solid; white-space: nowrap;
}
.pill-green  { background: rgba(34,197,94,.10);  color: var(--green);  border-color: rgba(34,197,94,.30); }
.pill-blue   { background: rgba(56,189,248,.10); color: var(--accent); border-color: rgba(56,189,248,.30); }
.pill-muted  { background: transparent;          color: var(--muted);  border-color: var(--border); }
.pill-yellow { background: rgba(245,158,11,.10); color: var(--yellow); border-color: rgba(245,158,11,.30); }

/* legacy compat */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-family: var(--mono); background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.35); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.version-badge { font-size: 12px; font-family: var(--mono); background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.35); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }

/* ─── Product Hero ───────────────────────────────────────── */
.product-hero {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 44px 0 28px;
}
.product-hero-icon {
  width: 88px; height: 88px; border-radius: 18px;
  overflow: hidden; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border); padding: 14px;
}
.product-hero-icon img { width: 100%; height: 100%; display: block; }
.product-hero-body { flex: 1; min-width: 0; }
.product-hero-name {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 6px;
}
.product-hero-name h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.product-hero-tagline { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Hero meta row (por Echosistema · APT · Swarm) */
.product-hero-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.meta-sep { color: var(--border-hi); }

/* Hero install CTA */
.hero-install {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; flex-wrap: wrap;
}
.hero-install-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.hero-install-cmd {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  display: inline-block;
}
.hero-install-cmd::before { content: '$ '; color: var(--muted); }
.btn-copy {
  font-size: 11px; font-family: var(--mono);
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  padding: 8px 12px; cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.btn-copy:hover  { color: var(--accent); border-color: var(--accent); }
.btn-copy.copied { color: var(--green);  border-color: var(--green); }

/* Download button (WP plugin) */
.btn-download {
  display: inline-flex; align-items: center;
  background: var(--accent); color: #0a0a0f;
  font-weight: 600; font-size: 13px;
  border-radius: var(--radius-sm); padding: 8px 18px;
  text-decoration: none; transition: opacity 150ms; margin-top: 8px;
}
.btn-download:hover { opacity: 0.85; text-decoration: none; }

/* ─── Product Layout (main + sidebar) ───────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 32px;
  align-items: start;
  padding-bottom: 48px;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.product-sidebar { position: sticky; top: 24px; }

.sidebar-widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px;
}
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget-title {
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 10px;
}

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row-label { color: var(--muted); }
.info-row-value { color: var(--text); font-family: var(--mono); font-size: 11px; }

/* ─── Coverage Bar ───────────────────────────────────────── */
.coverage-bar {
  height: 5px; background: var(--border);
  border-radius: 999px; overflow: hidden; margin: 6px 0 4px;
}
.coverage-fill {
  height: 100%; border-radius: 999px; transition: width 0.4s ease;
}
.coverage-fill.high   { background: var(--green); }
.coverage-fill.medium { background: var(--yellow); }
.coverage-fill.low    { background: var(--red); }

/* ─── Release list in sidebar ────────────────────────────── */
.release-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.release-item:last-child { border-bottom: none; padding-bottom: 0; }
.release-item-ver { font-family: var(--mono); color: var(--text); }
.release-item-date { color: var(--muted); font-size: 11px; }

/* ─── Snippet ────────────────────────────────────────────── */
.snippet {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 10px; display: block; margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Code blocks ────────────────────────────────────────── */
pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  overflow-x: auto; font-size: 13px; margin-bottom: 12px;
}
code { font-family: var(--mono); letter-spacing: 0.01em; }
pre code { color: var(--text); }
p code, li code, td code {
  background: var(--bg); border: 1px solid var(--border);
  padding: 2px 5px; border-radius: 3px; color: var(--accent); white-space: nowrap;
}

/* ─── Tables ─────────────────────────────────────────────── */
.tbl { overflow-x: auto; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 360px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── MD Body ────────────────────────────────────────────── */
.md-body h2 { font-size: 16px; font-weight: 600; color: #fff; margin: 28px 0 10px; text-transform: none; letter-spacing: normal; font-family: var(--sans); }
.md-body h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.md-body p  { font-size: 14px; color: var(--muted); margin-bottom: 12px; line-height: 1.75; }
.md-body ul, .md-body ol { font-size: 14px; color: var(--muted); padding-left: 20px; margin-bottom: 12px; }
.md-body li { margin-bottom: 4px; }
.md-body a  { color: var(--accent); }
.md-body pre { margin: 12px 0; }

/* ─── Ntfy section ───────────────────────────────────────── */
.ntfy-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.ntfy-topic {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 10px; display: inline-block; margin: 10px 0 14px;
}
.ntfy-apps { display: flex; gap: 8px; flex-wrap: wrap; }
.ntfy-btn {
  font-size: 12px; font-family: var(--mono);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 12px; color: var(--muted); background: transparent;
  text-decoration: none;
  transition: border-color 150ms, color 150ms;
  display: inline-block;
}
.ntfy-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ─── Tabs (product page sections) ──────────────────────── */
.section-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.section-tab {
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 150ms, border-color 150ms;
  user-select: none;
}
.section-tab:hover { color: var(--text); }
.section-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Loading / Error ────────────────────────────────────── */
.loading { color: var(--muted); font-size: 14px; padding: 32px 0; }
.error   { color: #f87171; font-size: 14px; padding: 12px 0; }

/* ─── Filter Bar ─────────────────────────────────────────── */
.filter-bar { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label {
  font-size: 11px; font-family: var(--mono); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); min-width: 76px; flex-shrink: 0;
}
.filter-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-pill {
  font-size: 11px; font-family: var(--mono);
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px;
  color: var(--muted); cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
  white-space: nowrap;
}
.filter-pill:hover { color: var(--text); border-color: var(--border-hi); }
.filter-pill.active {
  background: rgba(56,189,248,.10);
  color: var(--accent);
  border-color: rgba(56,189,248,.35);
}
.filter-empty {
  color: var(--muted); font-size: 13px; padding: 24px 0;
  display: none;
}

/* ─── Install steps ──────────────────────────────────────── */
.install-steps { display: flex; flex-direction: column; gap: 24px; padding-top: 4px; }
.install-step  { display: flex; gap: 16px; align-items: flex-start; }
.install-step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: rgba(56,189,248,.10); border: 1px solid rgba(56,189,248,.25);
  color: var(--accent); font-size: 12px; font-weight: 600; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center;
}
.install-step-body { flex: 1; min-width: 0; }
.install-step-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.install-step-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 10px;
}

/* ─── Compat grid (WP plugin) ────────────────────────────── */
.compat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.compat-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.compat-item-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.compat-item-value { font-size: 12px; color: var(--text); font-family: var(--mono); font-weight: 500; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .products-grid { grid-template-columns: 1fr; }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .product-sidebar {
    position: static;
    order: -1;
    padding-bottom: 8px;
  }
  .product-hero { flex-direction: column; gap: 16px; }
  .product-hero-icon { width: 68px; height: 68px; padding: 11px; }
  .product-hero-name h1 { font-size: 22px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 28px; }
}
