/* ─── Variables ─── */
:root {
  --bg:         #060d1e;
  --bg2:        #0b1630;
  --bg3:        #101e40;
  --accent:     #4a9eff;
  --accent-dim: #1f5cb0;
  --accent2:    #7cc4ff;
  --red:        #e05a5a;
  --text:       #c4d4f0;
  --muted:      #6a8ab4;
  --border:     #162244;
  --code-bg:    #07111f;
  --header-h:   52px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}

/* ─── Cosmic background glow ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 45% at 50% -5%, rgba(20, 70, 180, 0.4) 0%, transparent 65%),
    radial-gradient(ellipse 50% 30% at 90% 110%, rgba(10, 30, 90, 0.3) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

header, main, footer, section, .hero { position: relative; z-index: 1; }

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(6, 13, 30, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img-wrap {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-img { width: 100%; height: 100%; object-fit: contain; }

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}


/* ─── Hero (about.html) ─── */
.hero {
  text-align: center;
  padding: 56px 24px 56px;
}

.hero-logo-wrap {
  width: 148px;
  height: 148px;
  margin: 0 auto 36px;
  border-radius: 30px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(74, 158, 255, 0.25),
    0 0 50px rgba(74, 158, 255, 0.2),
    0 24px 48px rgba(0, 0, 0, 0.5);
}

.hero-logo { width: 100%; height: 100%; object-fit: contain; }

.hero-title {
  font-size: 3.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.hero-subtitle {
  margin: 14px auto 0;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}

/* ─── Page header ─── */
.page-header {
  padding: 60px 24px 44px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, transparent 100%);
}

.page-header h1 {
  font-size: 2.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.page-header .lead {
  color: var(--muted);
  margin-top: 10px;
  font-size: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Container ─── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 64px 28px 100px;
}

/* ─── Sections ─── */
.section { margin-bottom: 64px; }

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent2);
  margin: 28px 0 12px;
}

p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

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

ul, ol { padding-left: 22px; margin-bottom: 16px; }
li { margin-bottom: 6px; }

strong { color: #dde8ff; font-weight: 600; }

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.8;
}

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 52px 0;
}

/* ─── Feature grid ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 36px 0;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(74, 158, 255, 0.4);
  transform: translateY(-2px);
}

.feature-card .icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card h4 {
  font-size: 0.93rem;
  font-weight: 600;
  color: #dde8ff;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ─── Team cards ─── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.team-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
}

.team-card .name {
  font-weight: 700;
  color: #dde8ff;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.team-card .group {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.team-card .role {
  font-size: 0.85rem;
  color: var(--accent);
}

/* ─── Code blocks ─── */
pre {
  background: var(--code-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 14px 0 24px;
  font-size: 0.875rem;
  line-height: 1.65;
}

code {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

:not(pre) > code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.875em;
  color: var(--accent);
}

.code-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 4px;
}

/* ─── Callout ─── */
.callout {
  background: rgba(74, 158, 255, 0.07);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 8px 8px 0;
  padding: 14px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--text);
}

/* ─── Table ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg2);
}

tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ─── Pipeline / ASCII diagram ─── */
.pipeline {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-x: auto;
  margin: 20px 0;
  white-space: pre;
  line-height: 1.7;
}

/* ─── Pipeline visual (implementation.html) ─── */
.pipeline-visual {
  display: flex;
  align-items: stretch;
  margin: 28px 0 32px;
  overflow-x: auto;
  gap: 0;
}

.pipeline-node {
  flex: 1;
  min-width: 100px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 10px;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pipeline-node.pn-source { border-top-color: var(--muted); }
.pipeline-node.pn-lexer  { border-top-color: var(--accent); }
.pipeline-node.pn-parser { border-top-color: #7c4dff; }
.pipeline-node.pn-eval   { border-top-color: #2ec27e; }
.pipeline-node.pn-output { border-top-color: #e09a5a; }

.pn-file {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.71rem;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.3;
}

.pn-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #dde8ff;
}

.pn-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* ─── Impl card (grouped code/content, implementation.html) ─── */
.impl-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}

.impl-card-label {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.impl-card > pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.impl-card > ul {
  margin: 0;
  padding: 14px 20px 14px 40px;
}

.impl-card > ul li { margin-bottom: 6px; }
.impl-card > ul li:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
  .pipeline-visual { flex-direction: column; }
  .pipeline-arrow { padding: 6px 0; }
}

/* ─── Side-by-side comparison (examples.html) ─── */
.compare-block { margin-bottom: 48px; }

.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* ─── Code panels ─── */
.code-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.code-panel.rv { border-top: 2px solid var(--accent); }
.code-panel.fsh { border-top: 2px solid #7c4dff; }

.code-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.code-panel-header::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.code-panel.rv .code-panel-header { color: var(--accent); }
.code-panel.rv .code-panel-header::before { background: var(--accent); }

.code-panel.fsh .code-panel-header { color: #b58aff; }
.code-panel.fsh .code-panel-header::before { background: #7c4dff; }

.code-panel pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

@media (max-width: 680px) {
  .compare-cols { grid-template-columns: 1fr; }
}

/* ─── Feature list (extension.html) ─── */
.feature-list { list-style: none; padding: 0; }

.feature-list li {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Keyword group (extension.html) ─── */
.keyword-group {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 12px 0;
}

.keyword-group strong {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.keyword-group code { margin: 3px; }

/* ─── Install block ─── */
.install-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 26px;
  margin: 20px 0;
}

.install-block h4 {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-weight: 700;
}

/* ─── Steps (numbered) ─── */
.steps ol { list-style: none; padding: 0; counter-reset: step; }

.steps ol > li {
  counter-increment: step;
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.steps ol > li:last-child { border-bottom: none; margin-bottom: 0; }

.steps ol > li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 3px;
}

.steps ol > li > div { flex: 1; }
.steps ol > li ul { margin-top: 10px; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.83rem;
  position: relative;
  z-index: 1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-title { font-size: 2.6rem; }
  .container { padding: 44px 18px 80px; }
  .page-header h1 { font-size: 1.8rem; }
}

@media (max-width: 520px) {
  .logo-text { display: none; }
}

/* ─── Intro card (documentation.html) ─── */
.intro-card {
  background: linear-gradient(135deg, rgba(15, 32, 80, 0.85), rgba(8, 18, 48, 0.65));
  border: 1px solid rgba(74, 158, 255, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 40px;
}

.intro-card p {
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.8;
  margin: 0;
}

/* ─── CTA Buttons (index.html hero) ─── */
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 24px rgba(74, 158, 255, 0.35);
}

.btn-primary:hover {
  background: #6ab4ff;
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(74, 158, 255, 0.55);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 13px 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--accent-dim);
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.btn-secondary:hover {
  background: rgba(74, 158, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ─── Table of Contents ─── */
.toc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 28px;
  margin-bottom: 52px;
}

.toc-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 16px;
}

.toc ol {
  columns: 2;
  column-gap: 28px;
  padding-left: 20px;
  margin: 0;
}

.toc ol li {
  margin-bottom: 8px;
  break-inside: avoid;
}

.toc ol a {
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.15s;
}

.toc ol a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 600px) {
  .toc ol { columns: 1; }
}

/* ─── Doc layout with sidebar ─── */
.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: start;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

.doc-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 32px 20px 40px 0;
  border-right: 1px solid var(--border);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

.doc-sidebar .toc {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.doc-sidebar .toc ol {
  columns: 1;
  padding-left: 0;
  list-style: none;
}

.doc-sidebar .toc ol li { margin-bottom: 2px; }

.doc-sidebar .toc ol a {
  display: block;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.doc-sidebar .toc ol a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}

.doc-content {
  padding: 32px 0 0 48px;
}

/* ─── Sidebar section navigation ─── */
.sidebar-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.6;
  padding: 0 10px 8px;
  display: block;
}

.sidebar-section-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-section-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s, background 0.15s, transform 0.15s;
  box-shadow: inset 2px 0 0 transparent;
}

.sidebar-section-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
  text-decoration: none;
}

.sidebar-section-nav a.active {
  color: var(--accent2);
  background: rgba(74, 158, 255, 0.09);
  box-shadow: inset 2px 0 0 var(--accent);
  font-weight: 500;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
  opacity: 0.5;
}

.sidebar-toc-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.6;
  padding: 0 10px 8px;
  display: block;
}

/* ─── Feature list two-column (index.html) ─── */
.feature-list-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 28px 0;
  border-top: 1px solid var(--border);
}

a.feature-item {
  text-decoration: none;
  color: inherit;
  transition: background 0.18s;
}

a.feature-item:hover {
  background: rgba(74, 158, 255, 0.05);
  text-decoration: none;
}

a.feature-item:hover h4 { color: var(--accent); }

a.feature-item:hover .feature-item-hint { color: var(--accent); }

.feature-item {
  display: flex;
  gap: 14px;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.feature-item:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.feature-icon-box {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-item h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #dde8ff;
  margin-bottom: 4px;
  transition: color 0.18s;
}

.feature-item p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0 0 5px;
  line-height: 1.55;
}

.feature-item-hint {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  transition: color 0.18s, opacity 0.18s;
}

/* ─── Team strip (index.html) ─── */
.team-strip { margin: 20px 0; }

.team-strip-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.team-strip-item:last-child { border-bottom: none; }

.team-strip-item .name {
  font-weight: 600;
  color: #dde8ff;
  font-size: 0.95rem;
  min-width: 190px;
}

.team-strip-item .group {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 110px;
}

.team-strip-item .role {
  font-size: 0.85rem;
  color: var(--accent);
}

/* ─── Example category heading (examples.html) ─── */
.example-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 56px 0 28px;
  padding: 0 0 10px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
}

/* ─── Responsive additions ─── */
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    padding: 0 18px 80px;
  }

  .doc-sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 0 20px;
    max-height: none;
    overflow-y: visible;
  }

  .sidebar-section-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .sidebar-section-nav a {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    box-shadow: none;
    border: 1px solid transparent;
  }

  .sidebar-section-nav a:hover {
    transform: none;
    border-color: var(--border);
  }

  .sidebar-section-nav a.active {
    border-color: var(--accent-dim);
    box-shadow: none;
  }

  .sidebar-divider { display: none; }

  .doc-sidebar .toc { display: none; }

  .doc-content { padding: 28px 0 0; }

  .feature-list-2col { grid-template-columns: 1fr; }

  .feature-item:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }

  .team-strip-item { flex-wrap: wrap; gap: 4px; }
  .team-strip-item .name,
  .team-strip-item .group { min-width: unset; }
}

/* ─── Enhanced team card ─── */
.team-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  text-align: center;
  line-height: 44px;
}

.team-card .role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 3px 9px;
  display: inline-block;
  margin-bottom: 14px;
}

.team-contrib {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-contrib li {
  font-size: 0.84rem;
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.team-contrib li:last-child { border-bottom: none; }

/* ─── Design decisions list ─── */
.design-list {
  counter-reset: design;
  padding: 0;
  list-style: none;
  margin: 28px 0;
}

.design-list li {
  counter-increment: design;
  padding: 22px 0 22px 56px;
  position: relative;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.design-list li:first-child { border-top: 1px solid var(--border); }

.design-list li::before {
  content: counter(design);
  position: absolute;
  left: 0;
  top: 22px;
  width: 34px;
  height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  text-align: center;
  line-height: 34px;
}

.design-list li strong {
  display: block;
  color: #dde8ff;
  font-size: 0.97rem;
  margin-bottom: 6px;
}

.design-list li p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }

/* ─── Tech stack row ─── */
.tech-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 140px;
}

.tech-item strong {
  font-size: 0.93rem;
  color: #dde8ff;
}

.tech-item span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── Project file tree (implementation.html) ─── */
.project-tree {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.83rem;
  line-height: 1.9;
  color: var(--muted);
  overflow-x: auto;
  margin: 20px 0 28px;
  white-space: pre;
}

.pt-dir     { color: var(--accent2); font-weight: 600; }
.pt-file    { color: var(--text); }
.pt-comment { color: var(--muted); font-style: italic; opacity: 0.75; }
.pt-sep     { display: block; height: 8px; }

/* ─── Architecture layer grid (implementation.html) ─── */
.layer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.layer-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.layer-card.lc-core    { border-top-color: #e09a5a; }
.layer-card.lc-parser  { border-top-color: var(--accent); }
.layer-card.lc-runtime { border-top-color: #2ec27e; }
.layer-card.lc-cli     { border-top-color: #7c4dff; }

.layer-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.layer-card.lc-core    .layer-card-title { color: #e09a5a; }
.layer-card.lc-parser  .layer-card-title { color: var(--accent); }
.layer-card.lc-runtime .layer-card-title { color: #2ec27e; }
.layer-card.lc-cli     .layer-card-title { color: #b58aff; }

.layer-files {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.layer-files li {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.79rem;
  color: var(--accent2);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  background: var(--code-bg);
}

.layer-files li:last-child { border-bottom: none; }

.layer-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 680px) {
  .layer-grid { grid-template-columns: 1fr; }
}
