/* ModelBreeder.com — dependency-free publication system */
:root {
    --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --bg: #06141f;
    --bg-elevated: #0a1d2b;
    --bg-soft: #0d2637;
    --surface: #102d40;
    --surface-2: #14364b;
    --surface-3: #1a4158;
    --text: #eff9ff;
    --text-soft: #bed0dc;
    --muted: #89a2b3;
    --border: rgba(180, 222, 244, .17);
    --border-strong: rgba(180, 222, 244, .32);
    --accent: #51d6c3;
    --accent-strong: #25bfa8;
    --accent-soft: rgba(81, 214, 195, .14);
    --secondary: #78a9ff;
    --secondary-soft: rgba(120, 169, 255, .13);
    --warm: #f4bf67;
    --danger: #ff8f95;
    --success: #72e0a1;
    --shadow: 0 22px 60px rgba(0, 5, 12, .32);
    --shadow-soft: 0 12px 34px rgba(0, 5, 12, .19);
    --radius-sm: .55rem;
    --radius: .9rem;
    --radius-lg: 1.35rem;
    --radius-xl: 2rem;
    --shell: 82rem;
    --article: 48rem;
    --header-height: 4.6rem;
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f6fafc;
    --bg-elevated: #ffffff;
    --bg-soft: #eef5f8;
    --surface: #ffffff;
    --surface-2: #eaf4f6;
    --surface-3: #dcecef;
    --text: #102431;
    --text-soft: #425d6c;
    --muted: #657d8b;
    --border: rgba(27, 72, 92, .14);
    --border-strong: rgba(27, 72, 92, .26);
    --accent: #087d70;
    --accent-strong: #05695f;
    --accent-soft: rgba(8, 125, 112, .1);
    --secondary: #295ea8;
    --secondary-soft: rgba(41, 94, 168, .09);
    --warm: #9c6812;
    --danger: #bd3d48;
    --success: #147343;
    --shadow: 0 22px 60px rgba(31, 66, 83, .13);
    --shadow-soft: 0 12px 34px rgba(31, 66, 83, .09);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); }
body {
    margin: 0;
    min-width: 20rem;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 34rem;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 5%, rgba(81, 214, 195, .10), transparent 34%),
        radial-gradient(circle at 87% 8%, rgba(120, 169, 255, .11), transparent 38%);
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
code, pre { font-family: var(--font-mono); }
::selection { color: #04201b; background: #82f0db; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.skip-link {
    position: fixed;
    top: .7rem;
    left: .7rem;
    z-index: 1000;
    padding: .75rem 1rem;
    color: #05221d;
    background: #82f0db;
    border-radius: var(--radius-sm);
    transform: translateY(-160%);
    transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }
.shell { width: min(calc(100% - 2.4rem), var(--shell)); margin-inline: auto; }

/* Header and navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
}
.site-header__inner { min-height: var(--header-height); display: flex; align-items: center; gap: 1.2rem; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark { width: 2.15rem; height: 2.15rem; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.brand__text { display: flex; align-items: baseline; letter-spacing: -.02em; }
.brand__text strong { font-size: 1.02rem; }
.brand__text small { color: var(--muted); font-size: .78rem; }
.primary-nav { display: flex; align-items: center; gap: .08rem; margin-left: auto; }
.primary-nav a {
    padding: .55rem .62rem;
    border-radius: .5rem;
    color: var(--text-soft);
    font-size: .82rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}
.primary-nav a:hover { color: var(--text); background: var(--accent-soft); }
.primary-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-button {
    display: inline-grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: .68rem;
    color: var(--text-soft);
    background: var(--bg-elevated);
}
.icon-button:hover { color: var(--accent); border-color: var(--border-strong); }
.icon-button svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.nav-toggle { display: none; margin-left: auto; width: 2.6rem; height: 2.6rem; padding: .6rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--bg-elevated); }
.nav-toggle span:not(.sr-only) { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--text); }

/* Shared typography and buttons */
.eyebrow { display: inline-block; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .115em; line-height: 1.3; text-transform: uppercase; }
.button {
    display: inline-flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .72rem 1.08rem;
    border: 1px solid transparent;
    border-radius: .72rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button--primary { color: #04211d; background: var(--accent); box-shadow: 0 10px 30px rgba(37, 191, 168, .18); }
.button--primary:hover { color: #021b17; background: #7bead8; }
.button--secondary { color: var(--text); background: var(--bg-elevated); border-color: var(--border-strong); }
.button--secondary:hover { background: var(--surface); }
.button--ghost { color: var(--text-soft); background: transparent; border-color: var(--border); }
.text-link { font-weight: 750; text-decoration: none; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: .2rem .55rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--bg-soft);
    font-size: .68rem;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: .025em;
}
.privacy-chip { display: inline-flex; padding: .35rem .62rem; border: 1px solid rgba(114, 224, 161, .3); border-radius: 999px; color: var(--success); background: rgba(114, 224, 161, .08); font-size: .72rem; font-weight: 750; white-space: nowrap; }

/* Home */
.hero { overflow: hidden; }
.hero--home { padding: clamp(3.8rem, 8vw, 8rem) 0 4rem; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(24rem, .92fr); align-items: center; gap: clamp(2rem, 5vw, 5.5rem); }
.hero__copy h1 { max-width: 12ch; margin: .65rem 0 1.2rem; font-size: clamp(3.1rem, 7vw, 6.2rem); font-weight: 780; letter-spacing: -.065em; line-height: .96; }
.hero__copy h1 span { color: var(--accent); }
.hero__lede { max-width: 41rem; margin: 0; color: var(--text-soft); font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1rem 2.3rem; margin: 2.35rem 0 0; }
.hero-stats div { min-width: 7rem; }
.hero-stats dt { color: var(--text); font-size: 1.55rem; font-weight: 780; line-height: 1; }
.hero-stats dd { margin: .4rem 0 0; color: var(--muted); font-size: .77rem; }
.hero__visual { position: relative; isolation: isolate; }
.hero__visual::before { content: ""; position: absolute; inset: 12%; z-index: -1; border-radius: 50%; background: rgba(81, 214, 195, .09); filter: blur(55px); }
.hero__visual svg { display: block; width: 100%; }
.hero-orbit { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 5 9; }
.hero-orbit--2 { stroke: rgba(81, 214, 195, .35); }
.hero-glow { color: rgba(81, 214, 195, .18); }
.hero-lines path { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.hero-nodes circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.hero-nodes circle:first-child { fill: var(--accent-soft); stroke-width: 3; }
.hero__visual text { fill: var(--text-soft); font: 700 12px var(--font-sans); letter-spacing: .05em; }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.section--tight { padding: 0 0 2rem; }
.section--surface { border-block: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--bg-soft) 72%, transparent), color-mix(in srgb, var(--bg-elevated) 78%, transparent)); }
.principle-strip { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); box-shadow: var(--shadow-soft); overflow: hidden; }
.principle-strip div { padding: 1.2rem; border-right: 1px solid var(--border); }
.principle-strip div:last-child { border: 0; }
.principle-strip strong, .principle-strip span { display: block; }
.principle-strip strong { color: var(--accent); font-size: .82rem; }
.principle-strip span { margin-top: .32rem; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.section-heading { max-width: 49rem; margin-bottom: 2rem; }
.section-heading h2 { margin: .45rem 0 .7rem; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; line-height: 1.08; }
.section-heading p { margin: 0; color: var(--text-soft); font-size: 1.05rem; }
.section-heading--split { display: grid; max-width: none; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 2rem; }
.section-heading--split > p { max-width: 32rem; justify-self: end; }
.concept-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.concept-grid article, .track-card, .content-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); box-shadow: var(--shadow-soft); }
.concept-grid article { padding: 1.4rem; }
.concept-number { display: block; margin-bottom: 2.7rem; color: var(--accent); font: 700 .75rem var(--font-mono); }
.concept-grid h3 { margin: 0 0 .55rem; font-size: 1.12rem; }
.concept-grid p { margin: 0; color: var(--text-soft); font-size: .88rem; }
.track-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.track-card { display: flex; min-height: 18rem; flex-direction: column; padding: 1.45rem; }
.track-card > span { color: var(--accent); font: 700 .75rem var(--font-mono); }
.track-card h3 { margin: 2.1rem 0 .75rem; font-size: 1.35rem; line-height: 1.2; }
.track-card p { margin: 0 0 1.3rem; color: var(--text-soft); font-size: .88rem; }
.track-card a { margin-top: auto; font-weight: 760; text-decoration: none; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card-grid--compact { grid-template-columns: repeat(4, 1fr); }
.content-card { display: flex; min-height: 15rem; flex-direction: column; padding: 1.35rem; transition: transform .16s ease, border-color .16s ease; }
.content-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.content-card__meta, .research-card__top { display: flex; justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .72rem; }
.content-card h3 { margin: 2rem 0 .65rem; font-size: 1.2rem; line-height: 1.25; }
.content-card h3 a { color: var(--text); text-decoration: none; }
.content-card h3 a:hover { color: var(--accent); }
.content-card p { margin: 0; color: var(--text-soft); font-size: .84rem; }
.content-card__footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: 1.15rem; }
.callout-panel { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); background: linear-gradient(135deg, var(--accent-soft), var(--secondary-soft)); }
.callout-panel h2 { margin: .4rem 0 .5rem; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.035em; }
.callout-panel p { max-width: 48rem; margin: 0; color: var(--text-soft); }

/* Generic page and article */
.page-hero { padding: clamp(4rem, 8vw, 7.2rem) 0 3.5rem; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, transparent, var(--bg-elevated)); }
.page-hero--compact { padding-bottom: 2.3rem; }
.page-hero h1 { max-width: 13ch; margin: .55rem 0 .85rem; font-size: clamp(2.8rem, 6vw, 5.3rem); letter-spacing: -.06em; line-height: 1; }
.page-hero p { max-width: 47rem; margin: 0; color: var(--text-soft); font-size: 1.12rem; }
.hero-stats--inline { margin-top: 1.8rem; }
.article-shell { padding-bottom: 6rem; }
.breadcrumbs { padding: 1.05rem 0; color: var(--muted); font-size: .75rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .42rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .42rem; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.article-hero { max-width: 68rem; padding: clamp(3rem, 6vw, 5.2rem) 0 2.8rem; }
.article-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; color: var(--muted); font-size: .74rem; }
.article-hero h1 { max-width: 16ch; margin: .75rem 0 1rem; font-size: clamp(2.8rem, 6vw, 5.4rem); letter-spacing: -.06em; line-height: .99; }
.article-hero > p { max-width: 50rem; margin: 0; color: var(--text-soft); font-size: clamp(1.05rem, 2vw, 1.28rem); }
.evidence-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 52rem; margin-top: 2rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.evidence-bar span { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border-right: 1px solid var(--border); color: var(--text-soft); font-size: .78rem; }
.evidence-bar span:last-child { border-right: 0; }
.evidence-bar strong { color: var(--muted); font-size: .66rem; letter-spacing: .055em; text-transform: uppercase; }
.article-layout { display: grid; grid-template-columns: 15.5rem minmax(0, var(--article)); align-items: start; justify-content: space-between; gap: clamp(2rem, 6vw, 6rem); }
.article-sidebar { position: sticky; top: calc(var(--header-height) + 1.4rem); display: grid; max-height: calc(100vh - var(--header-height) - 2.8rem); gap: 1.2rem; overflow: auto; scrollbar-width: thin; }
.toc, .section-nav { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.toc__title, .section-nav__title { margin-bottom: .65rem; color: var(--text); font-size: .72rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { margin: .22rem 0; line-height: 1.35; }
.toc__level-3 { padding-left: .75rem; }
.toc__level-4 { padding-left: 1.4rem; }
.toc a, .section-nav a { display: block; padding: .28rem .35rem; border-radius: .35rem; color: var(--muted); font-size: .73rem; text-decoration: none; }
.toc a:hover, .section-nav a:hover { color: var(--text); background: var(--accent-soft); }
.toc a.is-active, .section-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.section-nav { max-height: 22rem; overflow: auto; }
.article-content { min-width: 0; }
.prose { color: var(--text-soft); }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); letter-spacing: -.028em; line-height: 1.2; }
.prose h2 { margin: 3.6rem 0 1rem; padding-top: .4rem; font-size: clamp(1.75rem, 3vw, 2.35rem); }
.prose h3 { margin: 2.5rem 0 .8rem; font-size: 1.42rem; }
.prose h4 { margin: 2rem 0 .65rem; font-size: 1.08rem; }
.prose p { margin: 0 0 1.18rem; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.35rem; padding-left: 1.35rem; }
.prose li { margin: .38rem 0; padding-left: .25rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.8rem 0; padding: 1rem 1.2rem; border-left: .24rem solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); background: var(--accent-soft); }
.prose blockquote p { margin: 0; }
.prose hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--border); }
.prose a { font-weight: 650; }
.prose :not(pre) > code { padding: .16em .38em; border: 1px solid var(--border); border-radius: .34rem; color: var(--warm); background: var(--bg-elevated); font-size: .86em; overflow-wrap: anywhere; }
.source-figure-placeholder { display: inline-flex; padding: .1rem .42rem; border: 1px dashed var(--border-strong); border-radius: .35rem; color: var(--muted); font-size: .78rem; }
.code-block { margin: 1.6rem 0 2rem; border: 1px solid var(--border); border-radius: var(--radius); background: #041019; box-shadow: var(--shadow-soft); overflow: hidden; }
html[data-theme="light"] .code-block { background: #132532; }
.code-block__bar { display: flex; align-items: center; justify-content: space-between; padding: .55rem .85rem; border-bottom: 1px solid rgba(200, 235, 250, .13); color: #9db6c4; font: 700 .69rem var(--font-mono); text-transform: uppercase; }
.copy-code { padding: .26rem .55rem; border: 1px solid rgba(200, 235, 250, .16); border-radius: .35rem; color: #cfe6f2; background: rgba(255, 255, 255, .04); font-size: .69rem; text-transform: none; }
.copy-code:hover { color: #82f0db; border-color: rgba(130, 240, 219, .4); }
.code-block pre { margin: 0; padding: 1.1rem; overflow: auto; color: #d7e8ef; font-size: .82rem; line-height: 1.65; tab-size: 4; }
.table-scroll { margin: 1.6rem 0 2rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.prose table { width: 100%; min-width: 38rem; border-collapse: collapse; background: var(--bg-elevated); font-size: .82rem; }
.prose th, .prose td { padding: .75rem .85rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { position: sticky; top: 0; color: var(--text); background: var(--surface); font-size: .72rem; letter-spacing: .025em; }
.prose tr:last-child td { border-bottom: 0; }
.source-panel { margin-top: 4rem; padding: 1.3rem; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--bg-elevated); }
.source-panel h2 { margin: 0 0 .5rem; padding: 0; font-size: 1.35rem; }
.source-panel > p { color: var(--muted); font-size: .82rem; }
.source-list { display: grid; gap: .65rem; margin-top: 1rem; }
.source-list a { display: grid; gap: .15rem; padding: .85rem; border: 1px solid var(--border); border-radius: .6rem; color: var(--text); background: var(--bg-soft); text-decoration: none; }
.source-list a:hover { border-color: var(--accent); }
.source-list span, .source-list small { color: var(--muted); font-size: .68rem; }
.article-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 4rem 0; padding-top: 2rem; border-top: 1px solid var(--border); }
.article-pagination a { display: flex; min-height: 6.5rem; flex-direction: column; justify-content: center; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--bg-elevated); text-decoration: none; }
.article-pagination a:hover { border-color: var(--accent); }
.article-pagination span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.article-pagination__next { align-items: flex-end; text-align: right; }
.related-guides { margin-top: 4rem; }

/* Diagrams */
.diagram-card { margin: 1.8rem 0 2.2rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); box-shadow: var(--shadow-soft); overflow: hidden; }
.diagram-card--wide { margin-inline: 0; }
.diagram-card figcaption { padding: .75rem .4rem .1rem; color: var(--muted); font-size: .75rem; text-align: center; }
.diagram-svg { display: block; width: 100%; height: auto; }
.diagram-node rect, .diagram-node circle { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2; }
.diagram-node--accent rect, .diagram-node--accent circle { fill: var(--accent-soft); stroke: var(--accent); }
.diagram-node--muted rect { fill: var(--bg-soft); }
.diagram-node text { fill: var(--text); font: 750 15px var(--font-sans); letter-spacing: .02em; }
.diagram-node .diagram-label { fill: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.diagram-arrow { fill: none; stroke: var(--border-strong); stroke-width: 2.2; }
.diagram-arrow--dashed { stroke-dasharray: 7 6; }
.diagram-arrow-head { fill: var(--accent); }
.layer-stack, .research-ladder { display: grid; gap: .65rem; padding: .2rem; }
.layer-stack__item, .research-ladder > div { display: grid; grid-template-columns: 10rem 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg-soft); }
.layer-stack__item strong, .research-ladder strong { color: var(--accent); }
.layer-stack__item span, .research-ladder span { color: var(--text-soft); font-size: .84rem; }
.layer-stack__item em { color: var(--muted); font-size: .72rem; }
.pipeline-diagram { display: grid; grid-template-columns: repeat(6, 1fr); gap: .55rem; margin: 0; padding: .4rem; list-style: none; }
.pipeline-diagram li { position: relative; min-height: 7rem; padding: 1rem .7rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg-soft); text-align: center; }
.pipeline-diagram li:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: -.48rem; z-index: 2; color: var(--accent); transform: translateY(-50%); }
.pipeline-diagram strong, .pipeline-diagram span { display: block; }
.pipeline-diagram strong { color: var(--text); font-size: .84rem; }
.pipeline-diagram span { margin-top: .45rem; color: var(--muted); font-size: .68rem; }

/* Search and research */
.search-form { display: flex; max-width: 48rem; gap: .7rem; margin-top: 1.5rem; }
.search-form input { min-width: 0; flex: 1; padding: .82rem 1rem; border: 1px solid var(--border-strong); border-radius: .72rem; color: var(--text); background: var(--bg-elevated); outline: none; }
.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results { padding-block: 3rem 6rem; }
.empty-state { max-width: 48rem; padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); }
.empty-state h2 { margin-top: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; }
.tag-cloud a { padding: .35rem .65rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--bg-soft); font-size: .75rem; text-decoration: none; }
.result-count { color: var(--muted); }
.search-list { display: grid; gap: .75rem; }
.search-list article { padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.search-list span { color: var(--muted); font-size: .7rem; }
.search-list h3 { margin: .25rem 0 .4rem; }
.search-list h3 a { color: var(--text); text-decoration: none; }
.search-list p { margin: 0; color: var(--text-soft); font-size: .85rem; }
.research-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); align-items: start; gap: 3rem; padding-block: 3.5rem 6rem; }
.research-filter { position: sticky; top: calc(var(--header-height) + 1.5rem); padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.research-filter h2 { margin: 0 0 .55rem; font-size: 1rem; }
.research-filter p { color: var(--muted); font-size: .78rem; }
.research-filter a { font-size: .78rem; font-weight: 700; text-decoration: none; }
.research-group + .research-group { margin-top: 4rem; }
.research-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.research-card { padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.research-card h3 { margin: 1.4rem 0 .55rem; font-size: 1.08rem; line-height: 1.3; }
.research-card h3 a { color: var(--text); text-decoration: none; }
.research-card p { color: var(--text-soft); font-size: .8rem; }
.research-card__actions { display: flex; gap: .9rem; margin: 1rem 0; }
.research-card__actions a { font-size: .75rem; font-weight: 750; text-decoration: none; }
.research-card > code { color: var(--muted); font-size: .64rem; }
.article-hero--report { max-width: 76rem; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.7rem; }
.report-actions > span { color: var(--muted); font-size: .68rem; }
.report-actions code { overflow-wrap: anywhere; }
.research-warning { max-width: 76rem; margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px solid rgba(244, 191, 103, .3); border-radius: var(--radius); background: rgba(244, 191, 103, .08); }
.research-warning strong { color: var(--warm); }
.research-warning p { margin: .25rem 0 0; color: var(--text-soft); font-size: .82rem; }
.report-content { max-width: none; }

/* Interactive tools */
.interactive-tool { margin: 1.8rem 0 2.4rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--bg-elevated), var(--bg-soft)); box-shadow: var(--shadow-soft); }
.interactive-tool__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.3rem; }
.interactive-tool__header h3 { margin: .35rem 0 .4rem; color: var(--text); font-size: 1.45rem; }
.interactive-tool__header p { max-width: 42rem; margin: 0; color: var(--muted); font-size: .82rem; }
.tool-form { display: grid; gap: 1rem; }
.tool-grid--two { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.tool-fieldset, .release-checklist fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--bg-elevated); }
.tool-fieldset legend, .release-checklist legend { padding: 0 .35rem; color: var(--text); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.range-field { display: grid; gap: .25rem; margin: .75rem 0; }
.range-field > span { display: flex; justify-content: space-between; color: var(--text-soft); font-size: .78rem; }
.range-field output { color: var(--accent); font-family: var(--font-mono); font-weight: 750; }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.tool-details { border: 1px solid var(--border); border-radius: .7rem; background: var(--bg-elevated); }
.tool-details summary { padding: .75rem 1rem; color: var(--text); font-size: .8rem; font-weight: 750; }
.weight-grid, .select-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; padding: 0 1rem 1rem; }
.weight-grid label, .select-grid label { display: grid; gap: .3rem; color: var(--muted); font-size: .72rem; }
.weight-grid input, .select-grid select { width: 100%; padding: .55rem .6rem; border: 1px solid var(--border); border-radius: .5rem; color: var(--text); background: var(--bg-soft); }
.select-grid { padding: 0; }
.check-row { display: flex; align-items: flex-start; gap: .7rem; padding: .62rem .7rem; border-radius: .5rem; color: var(--text-soft); font-size: .78rem; }
.check-row:hover { background: var(--accent-soft); }
.check-row input { flex: 0 0 auto; margin-top: .22rem; accent-color: var(--accent); }
.check-row span { display: grid; gap: .12rem; }
.check-row small { color: var(--muted); }
.check-row--critical { border: 1px solid var(--border); background: var(--bg-elevated); }
.tool-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; padding: .9rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--bg-elevated); }
.tool-result > div { display: grid; gap: .15rem; padding: .6rem; }
.tool-result span { color: var(--muted); font-size: .7rem; }
.tool-result strong { color: var(--text); font: 780 1.6rem var(--font-mono); }
.tool-result__primary { border-radius: .55rem; background: var(--accent-soft); }
.tool-result p { grid-column: 1 / -1; margin: .2rem .6rem 0; color: var(--text-soft); font-size: .8rem; }
.architecture-results { margin-top: .4rem; }
.architecture-rank { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: start; gap: .8rem; padding: .9rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg-elevated); }
.architecture-rank + .architecture-rank { margin-top: .55rem; }
.architecture-rank__number { display: grid; width: 2.1rem; height: 2.1rem; place-items: center; border-radius: 50%; color: #04211d; background: var(--accent); font-weight: 800; }
.architecture-rank h4 { margin: 0 0 .3rem; color: var(--text); font-size: .95rem; }
.architecture-rank p { margin: 0; color: var(--muted); font-size: .75rem; }
.architecture-rank strong { color: var(--accent); font: 750 .8rem var(--font-mono); }
.release-progress { margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg-elevated); }
.release-progress > div { display: flex; justify-content: space-between; margin-bottom: .45rem; color: var(--muted); font-size: .76rem; }
.release-progress strong { color: var(--danger); }
.release-progress strong.is-ready { color: var(--success); }
.release-progress progress { width: 100%; height: .55rem; accent-color: var(--accent); }
.release-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.release-checklist fieldset:last-of-type { grid-column: 1 / -1; }
.tool-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .55rem; }

/* Error and footer */
.error-page { min-height: 68vh; padding: 7rem 0; }
.error-code { display: block; color: var(--border-strong); font-size: clamp(5rem, 16vw, 12rem); font-weight: 850; letter-spacing: -.08em; line-height: .75; }
.error-page h1 { max-width: 14ch; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -.05em; }
.site-footer { border-top: 1px solid var(--border); background: #041019; }
html[data-theme="light"] .site-footer { background: #e9f2f5; }
.site-footer__grid { display: grid; grid-template-columns: 1.8fr repeat(3, 1fr); gap: 2.5rem; padding-block: 3.8rem; }
.site-footer__grid--with-creator { grid-template-columns: 1.55fr repeat(4, minmax(0, 1fr)); gap: 2rem; }
.brand--footer { margin-bottom: 1rem; }
.site-footer p { max-width: 24rem; color: var(--text-soft); font-size: .84rem; }
.site-footer .footer-note { color: var(--muted); font-size: .72rem; }
.footer-contact a { display: inline-flex; align-items: center; justify-content: center; margin-top: .35rem; padding: .62rem .8rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--accent) !important; font-weight: 780; }
.site-footer h2 { margin: 0 0 .8rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer__grid > div:not(:first-child) { display: flex; flex-direction: column; align-items: flex-start; gap: .48rem; }
.site-footer__grid a:not(.brand) { color: var(--text-soft); font-size: .78rem; text-decoration: none; }
.site-footer__grid a:hover { color: var(--accent); }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1rem 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .68rem; }
.site-footer__bottom a { color: var(--accent); text-decoration: none; }

/* Focus and motion */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, white); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Responsive */
@media (max-width: 73rem) {
    .primary-nav a { padding-inline: .46rem; font-size: .76rem; }
    .concept-grid, .track-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid--compact { grid-template-columns: repeat(2, 1fr); }
    .article-layout { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 2.5rem; }
}
@media (max-width: 61rem) {
    .nav-toggle { display: block; }
    .primary-nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        display: none;
        max-height: calc(100vh - var(--header-height));
        flex-direction: column;
        align-items: stretch;
        gap: .2rem;
        padding: .8rem 1.2rem 1.2rem;
        border-bottom: 1px solid var(--border);
        background: var(--bg-elevated);
        overflow: auto;
    }
    .primary-nav.is-open { display: flex; }
    .primary-nav a { padding: .72rem .8rem; font-size: .86rem; }
    .header-actions { margin-left: .1rem; }
    .hero__grid { grid-template-columns: 1fr; }
    .hero__copy h1 { max-width: 14ch; }
    .hero__visual { max-width: 34rem; margin-inline: auto; }
    .principle-strip { grid-template-columns: repeat(2, 1fr); }
    .principle-strip div { border-bottom: 1px solid var(--border); }
    .principle-strip div:nth-child(2n) { border-right: 0; }
    .principle-strip div:last-child { grid-column: 1 / -1; border-bottom: 0; }
    .section-heading--split { grid-template-columns: 1fr; }
    .section-heading--split > p { justify-self: start; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .article-layout { display: block; }
    .article-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; max-height: none; margin-bottom: 2.5rem; overflow: visible; }
    .article-sidebar .section-nav { max-height: 18rem; }
    .research-layout { grid-template-columns: 1fr; }
    .research-filter { position: static; }
    .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
    .site-footer__grid--with-creator { grid-template-columns: 1.5fr 1fr 1fr; }
    .site-footer__grid > div:last-child { grid-column: auto; }
    .pipeline-diagram { grid-template-columns: repeat(3, 1fr); }
    .pipeline-diagram li:nth-child(3)::after { display: none; }
}
@media (max-width: 44rem) {
    .shell { width: min(calc(100% - 1.3rem), var(--shell)); }
    .brand__text { display: none; }
    .hero--home { padding-top: 3rem; }
    .hero__copy h1 { font-size: clamp(2.8rem, 14vw, 4.5rem); }
    .principle-strip, .concept-grid, .track-grid, .card-grid, .card-grid--compact, .research-list { grid-template-columns: 1fr; }
    .principle-strip div, .principle-strip div:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--border); }
    .principle-strip div:last-child { grid-column: auto; }
    .callout-panel { align-items: flex-start; flex-direction: column; }
    .article-hero h1, .page-hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
    .evidence-bar { grid-template-columns: 1fr; }
    .evidence-bar span { border-right: 0; border-bottom: 1px solid var(--border); }
    .evidence-bar span:last-child { border-bottom: 0; }
    .article-sidebar { grid-template-columns: 1fr; }
    .article-pagination { grid-template-columns: 1fr; }
    .search-form { flex-direction: column; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
    .site-footer__grid--with-creator { grid-template-columns: 1fr 1fr; }
    .site-footer__grid > div:first-child { grid-column: 1 / -1; }
    .site-footer__grid > div:last-child { grid-column: auto; }
    .site-footer__bottom { flex-direction: column; }
    .layer-stack__item, .research-ladder > div { grid-template-columns: 1fr; gap: .25rem; }
    .pipeline-diagram { grid-template-columns: 1fr 1fr; }
    .pipeline-diagram li:nth-child(2n)::after { display: none; }
    .tool-grid--two, .release-checklist, .select-grid, .weight-grid, .tool-result { grid-template-columns: 1fr; }
    .release-checklist fieldset:last-of-type, .tool-actions { grid-column: auto; }
    .tool-result p { grid-column: auto; }
    .interactive-tool__header { flex-direction: column; }
    .architecture-rank { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .architecture-rank > strong { grid-column: 2; }
}
@media print {
    :root { --bg: #fff; --text: #111; --text-soft: #333; --muted: #555; --border: #bbb; --bg-elevated: #fff; --bg-soft: #f5f5f5; --surface: #eee; }
    .site-header, .site-footer, .article-sidebar, .hero__visual, .copy-code, .button, .tool-actions { display: none !important; }
    body { background: #fff; color: #111; font-size: 10.5pt; }
    .article-layout { display: block; }
    .article-content { max-width: none; }
    .code-block { break-inside: avoid; }
    a { color: #111; text-decoration: underline; }
}

.search-suggestions {
    position: relative;
    z-index: 10;
    display: grid;
    max-width: 48rem;
    margin-top: .55rem;
    padding: .45rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
}
.search-suggestions[hidden] { display: none; }
.search-suggestions a { display: grid; gap: .12rem; padding: .7rem .8rem; border-radius: .55rem; color: var(--text); text-decoration: none; }
.search-suggestions a:hover { background: var(--accent-soft); }
.search-suggestions span, .search-suggestions small { color: var(--muted); font-size: .68rem; }
.search-suggestions strong { font-size: .83rem; }
.tool-note { margin: .8rem 0 0; color: var(--muted); font-size: .74rem; }
