/*
 * style.css — AICC-SOF & CognEn Project Showcase
 * Sections: reset · tokens · layout · nav · hero · overview ·
 *           project-section · architecture · technical · metrics ·
 *           stack · context · footer · animations · responsive
 */

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, a { cursor: pointer; }

/* ── Design Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:          #0f0f0f;
  --surface:     #161616;
  --card:        #1c1c1c;
  --card-hover:  #222;
  --border:      #2a2a2a;
  --border-dim:  #1f1f1f;
  --accent:      #8b7cf8;
  --accent-dim:  rgba(139, 124, 248, 0.12);
  --accent-glow: rgba(139, 124, 248, 0.25);
  --green:       #4ade80;
  --amber:       #fbbf24;
  --red:         #f87171;
  --text:        #e2e2e2;
  --text-muted:  #777;
  --text-dim:    #555;
  --mono:        'JetBrains Mono', 'Fira Code', monospace;
  --sans:        'Inter', system-ui, -apple-system, sans-serif;
  --max-w:       1100px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --shadow:      0 2px 16px rgba(0,0,0,0.4);
  --transition:  0.2s ease;
}

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

/* ── Skip Link ───────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
}
.nav.scrolled {
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
}
.nav__logo {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav__logo span { color: var(--accent); }
.nav__links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}
.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav__links a:hover, .nav__links a:focus-visible {
  color: var(--text);
  background: var(--accent-dim);
}
.nav__links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.4rem;
}
.nav__mobile {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  z-index: 99;
}
.nav__mobile.open { display: block; }
.nav__mobile a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: 0.9rem;
}
.nav__mobile a:last-child { border-bottom: none; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 80px 0; }

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */
#hero {
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,124,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,124,248,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 70%);
  pointer-events: none;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.hero__title {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero__title mark {
  background: none;
  color: var(--accent);
}
.hero__tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.hero__context {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.hero__context-sep { color: var(--border); }
.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-card__value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.04em;
}
.stat-card__value.green { color: var(--green); }
.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.hero__callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  max-width: 760px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.hero__callout cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-style: normal;
  font-size: 0.75rem;
}
.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  font-family: var(--sans);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: #7c6de0; border-color: #7c6de0; }
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.btn svg { flex-shrink: 0; }

/* ── Project Section Headers ─────────────────────────────────────────────────── */
.project-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.project-number {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-dim);
  line-height: 1;
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.04em;
  flex-shrink: 0;
  background: var(--surface);
}
.project-header__text { flex: 1; }
.project-header__title {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.project-header__subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.project-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 2rem;
}

/* ── Overview ────────────────────────────────────────────────────────────────── */
#overview { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.overview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.overview-card h3 {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}
.overview-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.75rem; }
.overview-card p:last-child { margin-bottom: 0; }

/* ── Architecture ────────────────────────────────────────────────────────────── */
.arch-diagram {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.arch-diagram svg { min-width: 600px; }
.arch-components {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.arch-component {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition);
}
.arch-component:hover { border-color: var(--accent); }
.arch-component h4 {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.arch-component p { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }

/* ── Sub-section headings ────────────────────────────────────────────────────── */
.sub-section { margin-bottom: 3rem; }
.sub-section:last-child { margin-bottom: 0; }
.sub-title {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sub-title::before {
  content: '//';
  color: var(--accent);
  font-size: 0.85rem;
}
.sub-section p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; line-height: 1.7; }
.sub-section p:last-child { margin-bottom: 0; }

/* ── Latency table / code-block style ───────────────────────────────────────── */
.latency-block {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.8;
}
.latency-block .dim { color: var(--text-dim); }
.latency-block .accent { color: var(--accent); }
.latency-block .green { color: var(--green); }
.latency-block .amber { color: var(--amber); }

/* ── Hedge-pattern diagram ───────────────────────────────────────────────────── */
.hedge-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
}
.hedge-path {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}
.hedge-path h5 { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); margin-bottom: 0.4rem; }
.hedge-vs { text-align: center; font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); }

/* ── Algorithm cards ─────────────────────────────────────────────────────────── */
.algo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.algo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.algo-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.algo-card__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.algo-card__title {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.algo-card__desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.75rem; }
.algo-card__proof {
  font-family: var(--mono);
  font-size: 0.77rem;
  color: var(--green);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* ── Metrics grid ────────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color var(--transition);
}
.metric-card:hover { border-color: var(--accent); }
.metric-card__value {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
.metric-card__value.green { color: var(--green); }
.metric-card__value.amber { color: var(--amber); }
.metric-card__name { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.metric-card__desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* ── Metrics table ───────────────────────────────────────────────────────────── */
.metrics-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.metrics-table th {
  background: var(--surface);
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.metrics-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text-muted);
}
.metrics-table tr:last-child td { border-bottom: none; }
.metrics-table tbody tr:hover td { background: var(--card); color: var(--text); }
.metrics-table .val { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.metrics-table .val.green { color: var(--green); }
.metrics-table .pass { color: var(--green); }

/* ── Tech Stack ──────────────────────────────────────────────────────────────── */
.stack-section { margin-bottom: 2rem; }
.stack-category {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Context / Ack ───────────────────────────────────────────────────────────── */
#context { background: var(--surface); border-top: 1px solid var(--border); }
.context-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.context-card p { margin-bottom: 0.75rem; }
.context-card p:last-child { margin-bottom: 0; }

/* ── CognEn v1/v2 side-by-side ───────────────────────────────────────────────── */
.cognen-versions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.version-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.version-card h4 {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── CNN Architecture Visual ─────────────────────────────────────────────────── */
.cnn-layers {
  display: flex;
  gap: 0;
  align-items: center;
  overflow-x: auto;
  padding: 1.5rem 0;
}
.cnn-layer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.cnn-block {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}
.cnn-arrow {
  padding: 0 0.4rem;
  color: var(--border);
  font-size: 1rem;
  flex: 0 0 auto;
}
.cnn-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 90px;
  line-height: 1.3;
}

/* ── Behavior Classes ────────────────────────────────────────────────────────── */
.behavior-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.behavior-class {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.behavior-score {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 30px;
}
.behavior-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Footnote / Note ─────────────────────────────────────────────────────────── */
.note {
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.note strong { color: var(--amber); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer__brand {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer__brand a { color: var(--accent); text-decoration: none; }
.footer__brand a:hover { text-decoration: underline; }
.footer__links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.footer__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--accent); }
.footer__links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ── Fade-in scroll animation ────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced motion ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* ── Responsive — tablet ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .cognen-versions { grid-template-columns: 1fr; }
  .project-section { padding: 2rem; }
}

/* ── Responsive — mobile ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  section { padding: 60px 0; }
  .container { padding: 0 1.25rem; }
  .nav { padding: 0 1.25rem; }
  .nav__links { display: none; }
  .nav__hamburger { display: block; }
  #hero { padding: 100px 0 60px; }
  .hero__title { font-size: 2rem; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-card__value { font-size: 1.5rem; }
  .project-header { flex-direction: column; gap: 0.75rem; }
  .project-number { font-size: 2.5rem; }
  .project-section { padding: 1.5rem; }
  .algo-cards { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer__links { flex-wrap: wrap; justify-content: center; }
  .hedge-diagram { grid-template-columns: 1fr; }
}

/* ── Pipeline Flow Diagram ───────────────────────────────────────────────────── */
.pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.pipeline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}
.pipeline-arrow { color: var(--text-dim); font-size: 1.1rem; flex-shrink: 0; }
.pipeline-down {
  color: var(--text-dim);
  font-size: 1.25rem;
  line-height: 1.2;
  text-align: center;
  padding: 0.15rem 0;
}
.pipeline-box {
  padding: 0.65rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  min-width: 120px;
  line-height: 1.3;
}
.pipeline-box small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-top: 0.2rem;
}
.pipeline-box.data  { border-color: rgba(74,222,128,0.4);   background: rgba(74,222,128,0.05); }
.pipeline-box.intel { border-color: rgba(139,124,248,0.4);  background: rgba(139,124,248,0.07); }
.pipeline-box.tel   { border-color: rgba(96,165,250,0.4);   background: rgba(96,165,250,0.05); }
.pipeline-box.ai    { border-color: rgba(251,191,36,0.4);   background: rgba(251,191,36,0.05); }
.pipeline-box.post  { border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.04); }
.pipeline-box.cyan  { border-color: rgba(34,211,238,0.4);   background: rgba(34,211,238,0.05); }

/* ── Image placeholder ───────────────────────────────────────────────────────── */
.img-placeholder {
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--transition);
}
.img-placeholder:hover { border-color: var(--accent); }
.img-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder__inner { text-align: center; padding: 2rem; }
.img-placeholder__inner svg { margin: 0 auto 0.75rem; color: var(--text-dim); }
.img-placeholder__inner p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.img-placeholder__inner span { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
.screenshots-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ── Conversation state machine ──────────────────────────────────────────────── */
.state-flow { display: grid; gap: 0.75rem; }
.state-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.state-item:hover { border-color: var(--accent); }
.state-name { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.state-num  { font-size: 0.68rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.state-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.state-exit { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.35rem; font-family: var(--mono); }
.state-exit span { color: var(--amber); }

/* ── Intent table ────────────────────────────────────────────────────────────── */
.intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.intent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.intent-card h5 { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); margin-bottom: 0.4rem; }
.intent-card p  { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ── CI jobs row ─────────────────────────────────────────────────────────────── */
.ci-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.ci-job {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.ci-job__num { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--accent-dim); flex-shrink: 0; }
.ci-job__body h5 { font-family: var(--mono); font-size: 0.8rem; color: var(--text); margin-bottom: 0.25rem; }
.ci-job__body p  { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* ── Grafana panels ──────────────────────────────────────────────────────────── */
.panels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
}
.panel-card h5 { font-family: var(--mono); font-size: 0.78rem; color: var(--green); margin-bottom: 0.3rem; }
.panel-card p  { font-size: 0.78rem; color: var(--text-muted); }

/* ── Version badge ───────────────────────────────────────────────────────────── */
.version-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.version-badge.v1 { border-color: rgba(139,124,248,0.4); color: var(--accent); }
.version-badge.v2 { border-color: rgba(74,222,128,0.4); color: var(--green); }

/* ── Focus visible ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Private GitHub popover ──────────────────────────────────────────────────── */
.gh-private-wrap { position: relative; display: inline-block; }
.gh-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  min-width: 270px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.gh-private-wrap:hover .gh-popover,
.gh-popover.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.gh-popover::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 1.25rem;
  width: 10px;
  height: 10px;
  background: var(--card);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: rotate(45deg);
}
.gh-popover__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.gh-popover p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
  line-height: 1.5;
}
.gh-popover__links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gh-popover__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 100px;
  transition: background var(--transition);
}
.gh-popover__links a:hover { background: var(--accent-dim); }
.gh-popover__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 3px;
  transition: color var(--transition);
}
.gh-popover__close:hover { color: var(--text); }

/* ── Screenshots responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .screenshots-grid { grid-template-columns: 1fr; }
  .state-item { grid-template-columns: 1fr; }
  .ci-jobs { grid-template-columns: 1fr 1fr; }
  .gh-popover { left: auto; right: 0; }
  .gh-popover::after { left: auto; right: 1.25rem; }
}
