/* ===== ESP32 Family Guide — styles ===== */
:root {
  --accent: #e7352c;
  --accent-2: #ff6a3d;
  --accent-soft: rgba(231, 53, 44, 0.12);
  --bg-primary: #f7f8fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f6;
  --bg-elevated: #ffffff;
  --text-primary: #14161c;
  --text-secondary: #566072;
  --text-muted: #8a93a6;
  --border: #e2e6ee;
  --border-strong: #ccd3e0;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06), 0 2px 8px rgba(20, 22, 28, 0.05);
  --shadow-md: 0 8px 30px rgba(20, 22, 28, 0.10);
  --shadow-lg: 0 20px 60px rgba(20, 22, 28, 0.16);
  --yes: #18a558;
  --no: #b6bdca;
  --hero-grid: rgba(20, 22, 28, 0.05);
  --pro: #18a558;
  --con: #e0533d;
  --glass: rgba(255, 255, 255, 0.72);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0c0e14;
    --bg-secondary: #12151d;
    --bg-tertiary: #1a1e29;
    --bg-elevated: #161a24;
    --text-primary: #eef1f7;
    --text-secondary: #a7b0c2;
    --text-muted: #707a8e;
    --border: #232838;
    --border-strong: #313850;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
    --hero-grid: rgba(255, 255, 255, 0.05);
    --accent-soft: rgba(255, 106, 61, 0.14);
    --no: #495066;
    --glass: rgba(18, 21, 29, 0.72);
  }
}

:root[data-theme="light"] {
  --accent: #e7352c; --accent-2: #ff6a3d; --accent-soft: rgba(231, 53, 44, 0.12);
  --bg-primary: #f7f8fb; --bg-secondary: #ffffff; --bg-tertiary: #eef1f6; --bg-elevated: #ffffff;
  --text-primary: #14161c; --text-secondary: #566072; --text-muted: #8a93a6;
  --border: #e2e6ee; --border-strong: #ccd3e0;
  --shadow-sm: 0 1px 2px rgba(20,22,28,0.06), 0 2px 8px rgba(20,22,28,0.05);
  --shadow-md: 0 8px 30px rgba(20,22,28,0.10); --shadow-lg: 0 20px 60px rgba(20,22,28,0.16);
  --yes: #18a558; --no: #b6bdca; --hero-grid: rgba(20,22,28,0.05);
  --pro: #18a558; --con: #e0533d; --glass: rgba(255,255,255,0.72);
}

:root[data-theme="dark"] {
  --accent: #ff6a3d; --accent-2: #ff8a5c; --accent-soft: rgba(255,106,61,0.14);
  --bg-primary: #0c0e14; --bg-secondary: #12151d; --bg-tertiary: #1a1e29; --bg-elevated: #161a24;
  --text-primary: #eef1f7; --text-secondary: #a7b0c2; --text-muted: #707a8e;
  --border: #232838; --border-strong: #313850;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 2px 10px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 34px rgba(0,0,0,0.45); --shadow-lg: 0 24px 70px rgba(0,0,0,0.6);
  --yes: #2ec76f; --no: #495066; --hero-grid: rgba(255,255,255,0.05);
  --pro: #2ec76f; --con: #ff7a63; --glass: rgba(18,21,29,0.72);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}
a { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 200; transition: width 0.1s linear; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.3s, background-color 0.4s; }
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { max-width: var(--maxw); margin: 0 auto; padding: 0.7rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--accent); font-weight: 800; }
.brand-mark { display: inline-flex; }
.brand-text { font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text-primary); display: flex; align-items: baseline; gap: 0.25rem; }
.brand-dot { color: var(--accent); }
.brand-sub { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.main-nav { display: flex; gap: 0.25rem; margin-left: auto; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; padding: 0.45rem 0.7rem; border-radius: 8px; transition: color 0.2s, background-color 0.2s; }
.main-nav a:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; }

.lang-toggle { display: inline-flex; align-items: center; gap: 0.15rem; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.6rem; cursor: pointer; font-weight: 700; font-size: 0.8rem; color: var(--text-muted); transition: all 0.2s; }
.lang-toggle:hover { border-color: var(--border-strong); }
.lang-opt { transition: color 0.2s; }
.lang-opt.active { color: var(--accent); }
.lang-sep { opacity: 0.4; }

.theme-toggle { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 0.28rem 0.6rem 0.28rem 0.35rem; cursor: pointer; color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; transition: all 0.2s; }
.theme-toggle:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.theme-icon { width: 24px; height: 24px; transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.theme-toggle:hover .theme-icon { transform: rotate(180deg); }
.theme-label { min-width: 2.4em; text-align: left; }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 5.5rem 1.25rem 4rem; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-grid { position: absolute; inset: -2px; background-image: linear-gradient(var(--hero-grid) 1px, transparent 1px), linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%); -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%); }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.glow-1 { width: 460px; height: 460px; background: var(--accent); top: -160px; left: -80px; }
.glow-2 { width: 420px; height: 420px; background: var(--accent-2); top: -120px; right: -60px; opacity: 0.35; }
.hero-content { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; text-align: center; }
.hero-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.8rem; padding: 0.35rem 0.9rem; border-radius: 999px; margin-bottom: 1.25rem; letter-spacing: 0.02em; }
.hero-title { font-size: clamp(2rem, 5.5vw, 3.6rem); font-weight: 900; line-height: 1.08; letter-spacing: -0.03em; background: linear-gradient(180deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary); margin: 1.25rem auto 0; max-width: 720px; }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 3rem; }
.stat { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 0.5rem; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 2rem; font-weight: 900; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.35rem; }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; padding: 0.8rem 1.5rem; border-radius: 999px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px var(--accent-soft); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(231,53,44,0.35); }
.btn-ghost { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); font-size: 0.9rem; padding: 0.6rem 1.2rem; }
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ===== Sections ===== */
.section { max-width: var(--maxw); margin: 0 auto; padding: 4.5rem 1.25rem; }
.section-alt { max-width: none; background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.section-kicker { display: inline-block; color: var(--accent); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.6rem; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 850; letter-spacing: -0.02em; line-height: 1.15; }
.section-desc { color: var(--text-secondary); margin-top: 0.9rem; font-size: 1.02rem; }
.subsection-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; margin: 2.5rem auto 0.5rem; width: 100%; }
.subsection-desc { color: var(--text-secondary); margin-bottom: 1.4rem; max-width: 760px; }

/* ===== Lineage ===== */
.lineage { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.lineage-lane { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; box-shadow: var(--shadow-sm); }
.lineage-head { font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; padding-bottom: 0.6rem; border-bottom: 1px dashed var(--border); }
.lineage-pills { display: flex; flex-direction: column; gap: 0.45rem; }
.lineage-pill { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; font-weight: 700; font-size: 0.9rem; color: var(--text-primary); padding: 0.4rem 0.6rem; border-radius: 8px; border-left: 3px solid var(--c); background: var(--bg-tertiary); transition: transform 0.15s, background-color 0.2s; }
.lineage-pill:hover { transform: translateX(3px); background: var(--accent-soft); }
.mini-new { font-size: 0.62rem; font-weight: 800; background: var(--accent); color: #fff; padding: 0.05rem 0.3rem; border-radius: 4px; }

/* ===== Overview chip cards ===== */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.chip-card { text-decoration: none; color: inherit; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; display: flex; flex-direction: column; }
.chip-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.chip-card-top { position: relative; background: radial-gradient(circle at 50% 30%, var(--accent-soft), transparent 70%); padding: 1.2rem; display: flex; justify-content: center; }
.chip-visual { width: 108px; }
.badge-new { position: absolute; top: 0.7rem; right: 0.7rem; background: var(--accent); color: #fff; font-size: 0.68rem; font-weight: 800; padding: 0.15rem 0.45rem; border-radius: 6px; text-transform: uppercase; }
.chip-card-body { padding: 0 1.1rem 1.2rem; }
.chip-card-series { font-size: 0.74rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.chip-card-name { font-size: 1.25rem; font-weight: 850; margin: 0.2rem 0; }
.chip-card-tag { font-size: 0.88rem; color: var(--text-secondary); min-height: 2.4em; }
.chip-card-specs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; }
.chip-card-specs span { font-size: 0.72rem; font-weight: 600; background: var(--bg-tertiary); color: var(--text-secondary); padding: 0.2rem 0.5rem; border-radius: 6px; }

/* chip svg text */
.chip-svg .chip-name { font: 800 15px "JetBrains Mono", monospace; fill: #fff; }
.chip-svg .chip-arch { font: 600 8px "JetBrains Mono", monospace; fill: rgba(255,255,255,0.75); letter-spacing: 0.05em; }

/* ===== Compare / tables ===== */
.compare-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chip-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-pill { font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-secondary); color: var(--text-muted); cursor: pointer; transition: all 0.18s; }
.filter-pill.on { color: #fff; background: var(--c); border-color: var(--c); }
.filter-pill:hover { transform: translateY(-1px); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--bg-secondary); }
.compare-table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 0.84rem; }
.compare-table th, .compare-table td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.35; }
.compare-table thead th { position: sticky; top: 0; background: var(--bg-tertiary); font-weight: 800; z-index: 2; border-bottom: 2px solid var(--border-strong); }
.compare-table thead th a { text-decoration: none; color: var(--text-primary); border-bottom: 3px solid var(--c); padding-bottom: 2px; }
.compare-table thead th a:hover { color: var(--accent); }
.compare-table .row-label { position: sticky; left: 0; background: var(--bg-secondary); font-weight: 700; color: var(--text-secondary); z-index: 1; min-width: 130px; }
.compare-table thead .row-label { background: var(--bg-tertiary); z-index: 3; }
.compare-table tbody tr:hover td, .compare-table tbody tr:hover .row-label { background: var(--accent-soft); }
.compare-table .yes { color: var(--yes); font-weight: 800; }
.compare-table .no { color: var(--no); font-weight: 800; }
.detail-row td, .detail-row .row-label { background: var(--bg-tertiary); font-size: 0.8rem; }
.table-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.9rem; text-align: center; }

/* ===== Common features ===== */
.common-block { margin-bottom: 3rem; }
.common-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1rem; }
.common-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem; box-shadow: var(--shadow-sm); transition: transform 0.2s, border-color 0.2s; }
.common-note { margin-top: 0.7rem; display: inline-block; font-size: 0.76rem; font-weight: 700; color: var(--text-muted); background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.6rem; }
.common-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.common-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.common-card h4 { font-size: 1.02rem; font-weight: 800; margin-bottom: 0.35rem; }
.common-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* ===== Variants ===== */
.variant-list { display: flex; flex-direction: column; gap: 2rem; }
.variant { display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; position: relative; overflow: hidden; }
.variant::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--accent), transparent); }
.variant-aside { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.variant-visual { width: 150px; }
.variant-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.vb { font-size: 0.72rem; font-weight: 700; background: var(--bg-tertiary); color: var(--text-secondary); padding: 0.22rem 0.55rem; border-radius: 6px; }
.vb-new { background: var(--accent); color: #fff; }
.variant-name { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; }
.variant-tag { color: var(--accent); font-weight: 700; margin-top: 0.15rem; }
.variant-highlight { font-size: 1.02rem; margin-top: 0.9rem; padding: 0.85rem 1rem; background: var(--accent-soft); border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
.variant-desc { margin-top: 1rem; color: var(--text-secondary); }
.variant-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.vcol h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem; }
.vcol ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.vcol li { font-size: 0.9rem; padding-left: 1.2rem; position: relative; color: var(--text-secondary); }
.vcol-pros li::before { content: "+"; position: absolute; left: 0; color: var(--pro); font-weight: 900; }
.vcol-cons li::before { content: "–"; position: absolute; left: 0; color: var(--con); font-weight: 900; }
.vcol li::before { content: "•"; position: absolute; left: 0.15rem; color: var(--accent); }
.board-list li { padding-left: 0; }
.board-list li a { color: var(--text-primary); font-weight: 700; text-decoration: none; }
.board-list li a:hover { color: var(--accent); }
.board-list li span { display: block; font-size: 0.82rem; color: var(--text-muted); }

/* Revisions (advanced) */
.rev-details { margin-top: 1.4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-tertiary); overflow: hidden; }
.rev-details summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 700; font-size: 0.92rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); }
.rev-details summary::-webkit-details-marker { display: none; }
.rev-summary-icon { display: inline-flex; transition: transform 0.3s; color: var(--accent); }
.rev-details[open] .rev-summary-icon { transform: rotate(90deg); }
.rev-intro { padding: 0 1rem; font-size: 0.85rem; color: var(--text-muted); }
.rev-list { padding: 0.6rem 1rem 0; display: flex; flex-direction: column; gap: 0.7rem; }
.rev-item { border-left: 3px solid var(--accent); padding: 0.5rem 0.85rem; background: var(--bg-secondary); border-radius: 0 8px 8px 0; }
.rev-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }
.rev-tag { font: 700 0.85rem "JetBrains Mono", monospace; color: var(--accent); }
.rev-date { font-size: 0.78rem; color: var(--text-muted); }
.rev-fix { font-size: 0.88rem; color: var(--text-secondary); }
.rev-errata { display: inline-block; margin: 0.8rem 1rem 1rem; font-size: 0.85rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.rev-errata:hover { text-decoration: underline; }

/* ===== Programming ===== */
.prog-pyramid { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-bottom: 2.5rem; }
.pyr-row { width: var(--w); min-width: 220px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-decoration: none; color: #fff; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); padding: 0.7rem 1.2rem; border-radius: 10px; font-weight: 700; transition: transform 0.18s, filter 0.18s; box-shadow: var(--shadow-sm); }
.pyr-row:hover { transform: scale(1.02); filter: brightness(1.08); }
.pyr-name { font-size: 0.98rem; }
.pyr-level { font-size: 0.78rem; opacity: 0.85; text-align: right; }
.prog-detail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.prog-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; border-top: 4px solid var(--accent); }
.prog-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.prog-card-head h4 { font-size: 1.25rem; font-weight: 850; }
.prog-level { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.prog-lang { font: 700 0.78rem "JetBrains Mono", monospace; background: var(--accent-soft); color: var(--accent); padding: 0.25rem 0.55rem; border-radius: 6px; white-space: nowrap; }
.prog-tag { color: var(--accent); font-weight: 700; font-size: 0.92rem; margin: 0.5rem 0; }
.prog-card > p.rich { font-size: 0.92rem; color: var(--text-secondary); }
.prog-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.prog-links a, .ai-links a, .mcp-server a, .mcp-registry a, .project-links a { font-size: 0.85rem; font-weight: 700; color: var(--accent); text-decoration: none; padding: 0.3rem 0.7rem; border: 1px solid var(--border-strong); border-radius: 999px; transition: all 0.18s; }
.prog-links a:hover, .ai-links a:hover, .mcp-server a:hover, .mcp-registry a:hover, .project-links a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== AI ===== */
.ai-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.ai-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); border-top: 4px solid var(--accent); }
.ai-card h4 { font-size: 1.2rem; font-weight: 850; display: inline; }
.ai-by { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-left: 0.5rem; }
.ai-card p { margin: 0.7rem 0; color: var(--text-secondary); font-size: 0.92rem; }
.ai-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mcp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.mcp-server { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.mcp-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.mcp-head h4 { font-size: 1.05rem; font-weight: 800; }
.mcp-badge { font: 600 0.7rem "JetBrains Mono", monospace; background: var(--accent-soft); color: var(--accent); padding: 0.2rem 0.5rem; border-radius: 6px; white-space: nowrap; }
.mcp-server p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.8rem; }
.mcp-registry { margin-top: 1.1rem; background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.mcp-registry h4 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.4rem; }
.mcp-registry p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.8rem; }
.benefit-box { margin-top: 2rem; background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.benefit-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.2rem; }
.benefit-point { display: flex; gap: 0.7rem; }
.benefit-icon { font-size: 1.5rem; }
.benefit-point strong { display: block; font-size: 1rem; margin-bottom: 0.15rem; }
.benefit-point p { font-size: 0.88rem; color: var(--text-secondary); }

/* ===== Protocols / projects / ideas ===== */
.proto-grid, .projects-grid, .ideas-grid { display: grid; gap: 1.1rem; }
.proto-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.projects-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.ideas-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.proto-card, .project-card, .idea-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); border-top: 4px solid var(--accent); transition: transform 0.2s; }
.proto-card:hover, .project-card:hover, .idea-card:hover { transform: translateY(-3px); }
.proto-card h4 { font-size: 1.25rem; font-weight: 850; margin-bottom: 0.6rem; }
.proto-block { margin-bottom: 0.7rem; }
.proto-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.15rem; }
.proto-block p { font-size: 0.9rem; color: var(--text-secondary); }
.proto-chips div { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.proto-chip { font: 600 0.72rem "JetBrains Mono", monospace; background: var(--bg-tertiary); color: var(--text-secondary); padding: 0.15rem 0.45rem; border-radius: 5px; }
.project-card h4 { font-size: 1.15rem; font-weight: 850; }
.project-tag { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0.25rem 0 0.5rem; }
.project-card p { font-size: 0.88rem; color: var(--text-secondary); min-height: 3.5em; }
.project-links { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.idea-card { border-top-color: var(--accent-2); }
.idea-icon { font-size: 1.8rem; }
.idea-card h4 { font-size: 1.05rem; font-weight: 800; margin: 0.4rem 0 0.15rem; }
.idea-chip { font: 600 0.72rem "JetBrains Mono", monospace; color: var(--accent); }
.idea-card p { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.4rem; }

/* ===== Glossary ===== */
.gloss-search { width: 100%; max-width: 420px; margin: 0 auto 1.75rem; display: block; padding: 0.75rem 1.1rem; font-size: 1rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-secondary); color: var(--text-primary); transition: border-color 0.2s; }
.gloss-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.gloss-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; transition: border-color 0.3s, box-shadow 0.3s; }
.gloss-card h4 { font-size: 1.05rem; font-weight: 800; color: var(--accent); margin-bottom: 0.35rem; }
.gloss-card p { font-size: 0.9rem; color: var(--text-secondary); }
.gloss-links { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.7rem; }
.gloss-links a { font-size: 0.82rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.gloss-links a:hover { text-decoration: underline; }
.gloss-card.flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gloss-empty { text-align: center; color: var(--text-muted); grid-column: 1 / -1; padding: 2rem; }

/* ===== Inline term + tooltip ===== */
.term { color: var(--accent); font-weight: 600; cursor: help; border-bottom: 1.5px dotted var(--accent); text-decoration: none; outline: none; }
.term:hover, .term:focus { background: var(--accent-soft); border-radius: 3px; }
.tooltip { position: absolute; z-index: 300; max-width: 340px; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 12px; padding: 0.9rem 1rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.16s, transform 0.16s, visibility 0.16s; pointer-events: none; }
.tooltip.show { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.tip-title { font-weight: 800; color: var(--accent); margin-bottom: 0.3rem; }
.tip-def { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }
.tip-links { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.tip-links a { font-size: 0.8rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.tip-links a:hover { text-decoration: underline; }

/* ===== Footer + to-top ===== */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 2.5rem 1.25rem; margin-top: 2rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; color: var(--text-secondary); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; margin: 1rem 0; }
.footer-links a { color: var(--accent); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.footer-links a:hover { text-decoration: underline; }
.footer-disclaimer { font-size: 0.8rem; color: var(--text-muted); }
.to-top { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.25s; z-index: 90; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-3px); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-secondary); flex-direction: column; padding: 0.75rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.7rem 0.9rem; }
  .nav-burger { display: flex; }
  .brand-sub { display: none; }
  .variant { grid-template-columns: 1fr; }
  .variant-aside { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .variant-visual { width: 96px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .section { padding: 3rem 1rem; }
  .hero { padding: 3.5rem 1rem 3rem; }
  .variant-cols { grid-template-columns: 1fr; }
  .header-inner { padding: 0.6rem 0.85rem; }
  .theme-label { display: none; }
  .hero-stats { gap: 0.6rem; }
  .stat-num { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }


/* Wide chip comparison uses the browser scrollbar, not a nested scroll area. */
html { overflow-x: auto; }
body { overflow-x: visible; }
#compare > .table-wrap { overflow: visible; width: max-content; max-width: none; margin-left: 0; margin-right: 0; }
#compareTable { width: max-content; }
#compareTable th, #compareTable td { min-width: 160px; max-width: 220px; overflow-wrap: anywhere; }
#compareTable thead th { top: 76px; }

.chip-card-revision { font-size: .78rem; color: var(--text-secondary); margin: .35rem 0; }
.variant-current-revision { margin: .75rem 0; font-size: .85rem; line-height: 1.5; color: var(--text-secondary); }
