:root {
    --bg: #0f0e0d;
    --surface: #141210;
    --surface-strong: #1e1c19;
    --surface-raised: #2a2723;
    --text: #f4efe7;
    --muted: #aaa196;
    --line: rgba(255, 244, 230, 0.11);
    --line-strong: rgba(255, 244, 230, 0.2);
    --amber: #e8a550;
    --amber-strong: #f2be79;
    --amber-ink: #211609;
    --teal: #7fb5a4;
    --wine: #c66a76;
    --focus: #f2be79;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    --header: rgba(15, 14, 13, 0.86);
    --grid: rgba(255, 244, 230, 0.025);
    --display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f6f1e9;
    --surface: #fffdf9;
    --surface-strong: #eee6dc;
    --surface-raised: #e4d9cc;
    --text: #241f1a;
    --muted: #665e55;
    --line: rgba(36, 31, 26, 0.15);
    --line-strong: rgba(36, 31, 26, 0.26);
    --amber: #a95f11;
    --amber-strong: #814500;
    --amber-ink: #fffaf4;
    --teal: #2f7162;
    --wine: #994452;
    --focus: #814500;
    --shadow: 0 24px 70px rgba(70, 50, 30, 0.12);
    --header: rgba(246, 241, 233, 0.88);
    --grid: rgba(36, 31, 26, 0.035);
    color-scheme: light;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #f6f1e9;
        --surface: #fffdf9;
        --surface-strong: #eee6dc;
        --surface-raised: #e4d9cc;
        --text: #241f1a;
        --muted: #665e55;
        --line: rgba(36, 31, 26, 0.15);
        --line-strong: rgba(36, 31, 26, 0.26);
        --amber: #a95f11;
        --amber-strong: #814500;
        --amber-ink: #fffaf4;
        --teal: #2f7162;
        --wine: #994452;
        --focus: #814500;
        --shadow: 0 24px 70px rgba(70, 50, 30, 0.12);
        --header: rgba(246, 241, 233, 0.88);
        --grid: rgba(36, 31, 26, 0.035);
        color-scheme: light;
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
}

body {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at 9% 4%,
            color-mix(in srgb, var(--amber) 12%, transparent) 0,
            transparent 30rem
        ),
        radial-gradient(
            circle at 92% 14%,
            color-mix(in srgb, var(--teal) 7%, transparent) 0,
            transparent 34rem
        ),
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px), var(--bg);
    background-size:
        auto,
        auto,
        72px 72px,
        72px 72px,
        auto;
    color: var(--text);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, transparent 0, var(--bg) 42rem);
    content: "";
    pointer-events: none;
}

button,
a,
summary {
    -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, var(--amber) 55%, transparent);
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-color: var(--amber);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

::selection {
    background: var(--amber);
    color: var(--amber-ink);
}

h1,
h2,
h3,
p,
blockquote,
dl,
dd,
ol,
ul {
    margin-top: 0;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 500;
    letter-spacing: -0.045em;
}

h3 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.15rem, 1.5vw, 1.45rem);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

code,
pre {
    font-family: var(--mono);
}

.shell {
    width: min(100% - 3rem, 1240px);
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: 0.75rem;
    background: var(--amber);
    color: var(--amber-ink);
    font-weight: 800;
    transform: translateY(-150%);
    transition: transform 150ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.reading-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 90;
    height: 3px;
    background: transparent;
}

.reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--amber-strong), var(--teal));
    box-shadow: 0 0 18px color-mix(in srgb, var(--amber) 45%, transparent);
    transform-origin: left;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid transparent;
    background: transparent;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.site-header.is-scrolled {
    border-color: var(--line);
    background: var(--header);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(18px) saturate(125%);
}

.header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
    width: min(100% - 2rem, 1380px);
    min-height: 72px;
    margin-inline: auto;
}

.brand {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
}

.brand-dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--amber);
    box-shadow: 0 0 18px color-mix(in srgb, var(--amber) 72%, transparent);
}

.brand-name {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-context {
    padding-left: 0.65rem;
    border-left: 1px solid var(--line-strong);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}

.site-nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0 0.65rem;
    border-radius: 0.65rem;
    color: var(--muted);
    font-size: 0.81rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        color 150ms ease,
        background-color 150ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="location"] {
    background: color-mix(in srgb, var(--amber) 9%, transparent);
    color: var(--text);
}

.site-nav a[aria-current="location"]::before {
    width: 0.32rem;
    height: 0.32rem;
    margin-right: 0.45rem;
    border-radius: 999px;
    background: var(--amber);
    content: "";
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle,
.source-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        color 150ms ease,
        background-color 150ms ease;
}

.theme-toggle:hover,
.source-link:hover {
    border-color: var(--line-strong);
    background: var(--surface-strong);
    color: var(--text);
}

.theme-mark {
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid var(--amber);
    border-radius: 999px;
    box-shadow: inset 0.2rem 0 0 var(--amber);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
    width: 17px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
    transition:
        transform 150ms ease,
        opacity 150ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-of-type(2) {
    transform: translateY(5.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-of-type(3) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-of-type(4) {
    transform: translateY(-5.5px) rotate(-45deg);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
    gap: 3rem 4rem;
    align-items: center;
    min-height: calc(100vh - 72px);
    min-height: calc(100svh - 72px);
    padding-block: clamp(5rem, 10vw, 8.5rem) 4rem;
}

.hero-copy {
    min-width: 0;
}

.eyebrow {
    margin-bottom: 1.15rem;
    color: var(--amber);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow span {
    margin-left: 0.65rem;
    color: var(--muted);
}

.hero h1 {
    max-width: 900px;
    margin-bottom: 1.5rem;
    font-size: clamp(3.35rem, 7.2vw, 6.8rem);
    line-height: 0.91;
}

.hero h1 em {
    color: var(--amber-strong);
    font-weight: inherit;
}

.hero-lede {
    max-width: 72ch;
    margin-bottom: 2rem;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    font-size: 0.9rem;
    font-weight: 850;
    text-decoration: none;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--amber);
    color: var(--amber-ink);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--amber) 17%, transparent);
}

.button-primary:hover {
    background: var(--amber-strong);
}

.button-secondary {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--surface-strong);
}

.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 0;
    list-style: none;
}

.stack-list li,
.token-row span {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 65%, transparent);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.verification-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.15rem);
    border: 1px solid var(--line-strong);
    border-radius: 1.25rem;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--surface-raised) 88%, transparent),
            var(--surface)
        ),
        var(--surface);
    box-shadow: var(--shadow);
}

.verification-card::before {
    position: absolute;
    top: -5rem;
    right: -4rem;
    width: 13rem;
    height: 13rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--amber) 11%, transparent);
    filter: blur(2px);
    content: "";
    pointer-events: none;
}

.card-kicker {
    margin-bottom: 0.75rem;
    color: var(--amber);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.verification-card .card-kicker {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.status-pulse {
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal) 12%, transparent);
}

.verification-card h2 {
    max-width: 12ch;
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1;
}

.verification-list {
    margin-bottom: 1.5rem;
}

.verification-list div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.verification-list dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.verification-list dd {
    margin: 0;
    color: var(--teal);
    font-family: var(--mono);
    font-size: 0.77rem;
    font-weight: 800;
    text-align: right;
}

.commit-stamp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.commit-stamp code {
    color: var(--amber-strong);
}

.hero-metrics {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding-top: 1rem;
}

.hero-metrics div {
    padding: 1.3rem 1.4rem;
    border-top: 1px solid var(--line-strong);
}

.hero-metrics strong {
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--display);
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    font-weight: 500;
    line-height: 1;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section {
    padding-block: clamp(5.5rem, 10vw, 9rem);
}

.section-tinted,
.evidence-section,
.decisions-section {
    border-block: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.section-heading {
    max-width: 850px;
    margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.section-heading h2,
.closing h2 {
    margin-bottom: 1.25rem;
    font-size: clamp(2.55rem, 5vw, 4.75rem);
    line-height: 0.98;
}

.section-heading > p:last-child,
.section-heading-split > p,
.closing > p:not(.eyebrow) {
    max-width: 72ch;
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.3vw, 1.15rem);
}

.section-heading-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 2rem 5rem;
    max-width: none;
    align-items: end;
}

.section-heading-split h2 {
    margin-bottom: 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.comparison-card,
.feature-card,
.module-map,
.architecture-notes,
.capacity-card,
.trust-grid article,
.evidence-grid article,
.operations-grid article {
    min-width: 0;
    padding: clamp(1.35rem, 2.5vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.comparison-card {
    position: relative;
    overflow: hidden;
}

.comparison-card::after {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    content: "";
}

.friction-card::after {
    background: var(--wine);
}

.response-card::after {
    background: var(--teal);
}

.comparison-card h3 {
    max-width: 18ch;
    font-family: var(--display);
    font-size: clamp(1.7rem, 2.7vw, 2.5rem);
    font-weight: 500;
}

.issue-list {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.issue-list li {
    position: relative;
    padding: 0.75rem 0 0.75rem 1.4rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.issue-list li:last-child {
    border-bottom: 0;
}

.issue-list li::before {
    position: absolute;
    top: 1.45rem;
    left: 0;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: var(--amber);
    content: "";
}

.friction-card .issue-list li::before {
    background: var(--wine);
}

.response-card .issue-list li::before {
    background: var(--teal);
}

.principle-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem 3rem;
    align-items: center;
    margin-top: 1.25rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid color-mix(in srgb, var(--amber) 34%, var(--line));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--amber) 7%, transparent);
}

.principle-strip > p {
    margin-bottom: 0;
    color: var(--amber);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.principle-strip blockquote {
    margin-bottom: 0;
    font-family: var(--display);
    font-size: clamp(1.3rem, 2.3vw, 2rem);
    line-height: 1.3;
}

.journey {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 0;
    margin: 0 0 2rem;
    list-style: none;
}

.journey::before {
    position: absolute;
    top: 1.35rem;
    right: 10%;
    left: 10%;
    height: 1px;
    background: var(--line-strong);
    content: "";
}

.journey li {
    position: relative;
    z-index: 1;
    padding: 0 0.75rem;
    text-align: center;
}

.journey li > span {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    margin: 0 auto 0.8rem;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 800;
}

.journey strong,
.journey small {
    display: block;
}

.journey strong {
    margin-bottom: 0.1rem;
    font-size: 0.9rem;
}

.journey small {
    color: var(--muted);
    font-size: 0.7rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(280px, 0.72fr);
    gap: 1.25rem 2rem;
    align-items: center;
}

.feature-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: color-mix(in srgb, var(--text) 9%, transparent);
    font-family: var(--display);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.feature-card-wide .feature-number {
    position: static;
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.feature-card h3 {
    max-width: 24ch;
    font-family: var(--display);
    font-size: clamp(1.6rem, 2.4vw, 2.15rem);
    font-weight: 500;
}

.feature-card > p:not(.card-kicker),
.feature-card-wide > div > p:not(.card-kicker),
.architecture-notes,
.module-map,
.trust-grid p,
.evidence-grid p,
.operations-grid p,
.honesty-grid p {
    color: var(--muted);
}

.mini-ui {
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: var(--bg);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 3%, transparent);
}

.readiness-preview {
    padding: 0.5rem;
}

.readiness-preview div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.73rem;
}

.readiness-preview div:last-child {
    border-bottom: 0;
}

.readiness-preview b {
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--teal) 12%, transparent);
    color: var(--teal);
    font-size: 0.61rem;
}

.readiness-preview b.optional {
    background: color-mix(in srgb, var(--amber) 12%, transparent);
    color: var(--amber);
}

.request-preview {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    margin-top: 1.4rem;
    padding: 0.75rem;
}

.poster-shape {
    display: grid;
    aspect-ratio: 2 / 3;
    place-items: center;
    border-radius: 0.45rem;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--wine) 70%, var(--surface)),
        color-mix(in srgb, var(--amber) 55%, var(--surface))
    );
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--display);
    font-size: 2.4rem;
}

.request-preview > div:last-child {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.request-preview i {
    color: var(--muted);
    font-size: 0.64rem;
    font-style: normal;
}

.request-preview strong {
    overflow: hidden;
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-preview > div:last-child > span {
    padding: 0.42rem 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.45rem;
    color: var(--amber-strong);
    font-size: 0.67rem;
    font-weight: 800;
}

.compact-list {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    margin: 1.4rem 0 0;
    list-style: none;
}

.compact-list li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.dot {
    width: 0.48rem;
    height: 0.48rem;
    flex: 0 0 auto;
    border-radius: 999px;
}

.dot-wine {
    background: var(--wine);
}
.dot-amber {
    background: var(--amber);
}
.dot-teal {
    background: var(--teal);
}

.token-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.35rem;
}

.architecture-flow,
.download-flow,
.quality-pipeline {
    display: grid;
    padding: 0;
    list-style: none;
}

.architecture-flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.architecture-flow li,
.download-flow li,
.quality-pipeline li {
    position: relative;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: var(--surface);
}

.architecture-flow li:not(:last-child)::after,
.download-flow li:not(:last-child)::after,
.quality-pipeline li:not(:last-child)::after {
    position: absolute;
    top: 50%;
    right: -0.65rem;
    z-index: 2;
    display: grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--amber);
    content: "›";
    line-height: 1;
    transform: translateY(-50%);
}

.architecture-flow span,
.download-flow b,
.quality-pipeline span {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.architecture-flow strong,
.architecture-flow small,
.download-flow span,
.download-flow small,
.quality-pipeline b,
.quality-pipeline small {
    display: block;
}

.architecture-flow strong,
.download-flow span,
.quality-pipeline b {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.architecture-flow small,
.download-flow small,
.quality-pipeline small {
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.45;
}

.architecture-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 1rem;
}

.module-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.module-groups div {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: var(--bg);
}

.module-groups b,
.module-groups span {
    display: block;
}

.module-groups b {
    margin-bottom: 0.3rem;
    color: var(--text);
    font-size: 0.78rem;
}

.module-groups span {
    color: var(--muted);
    font-size: 0.66rem;
}

.deep-note,
.runbooks details {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.deep-note summary,
.runbooks summary {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.deep-note summary::-webkit-details-marker,
.runbooks summary::-webkit-details-marker {
    display: none;
}

.deep-note summary::after,
.runbooks summary::after {
    color: var(--amber);
    content: "+";
    font-family: var(--mono);
    font-size: 1.2rem;
}

.deep-note[open] summary::after,
.runbooks details[open] summary::after {
    content: "−";
}

.deep-note > div {
    padding: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.deep-note > div p {
    max-width: 78ch;
}

.download-section {
    border-block: 1px solid var(--line);
    background:
        radial-gradient(
            circle at 12% 40%,
            color-mix(in srgb, var(--amber) 8%, transparent),
            transparent 30rem
        ),
        color-mix(in srgb, var(--surface-strong) 56%, var(--bg));
}

.download-flow {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 2rem;
}

.storage-story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.storage-card {
    min-width: 0;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    background: var(--surface);
}

.storage-card h3 {
    font-family: var(--display);
    font-size: clamp(1.7rem, 2.5vw, 2.35rem);
    font-weight: 500;
}

.storage-card > code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0.35rem 0.55rem;
    border-radius: 0.45rem;
    background: var(--bg);
    color: var(--amber-strong);
    font-size: 0.75rem;
}

.storage-card > p:not(.card-kicker) {
    margin-top: 1.1rem;
    color: var(--muted);
}

.storage-card ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0;
    margin-bottom: 0;
    list-style: none;
}

.storage-card li {
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    color: var(--muted);
    font-size: 0.68rem;
}

.staging-card {
    box-shadow: inset 0 3px 0 var(--amber);
}

.destination-card {
    box-shadow: inset 0 3px 0 var(--teal);
}

.storage-transfer {
    display: grid;
    min-width: 4.4rem;
    place-items: center;
    color: var(--muted);
}

.storage-transfer::before,
.storage-transfer::after {
    width: 1px;
    height: 100%;
    grid-area: 1 / 1;
    background: var(--line-strong);
    content: "";
}

.storage-transfer span {
    z-index: 1;
    grid-area: 1 / 1;
    padding: 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--amber);
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}

.capacity-card {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(390px, 1.2fr);
    gap: 2rem 4rem;
    align-items: center;
    margin-top: 1rem;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.capacity-card > div:first-child > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.formula {
    padding: 0.65rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--bg);
}

.formula p {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
    gap: 1rem;
    padding: 0.7rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
}

.formula p:last-child {
    border-bottom: 0;
}

.formula span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.formula code {
    color: var(--amber-strong);
    font-size: 0.71rem;
    overflow-wrap: anywhere;
}

.honesty-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.honesty-grid article {
    min-width: 0;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.honesty-grid article > span,
.decision-grid a > span {
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.honesty-grid h3 {
    margin-top: 0.55rem;
    font-size: 0.96rem;
}

.honesty-grid p {
    margin-bottom: 0;
    font-size: 0.76rem;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.trust-grid article {
    position: relative;
    min-height: 230px;
    overflow: hidden;
}

.trust-index {
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.67rem;
    font-weight: 850;
}

.trust-grid h3 {
    max-width: 18ch;
    margin-top: 2rem;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 500;
}

.trust-grid p {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.trust-grid article::after {
    position: absolute;
    right: -2.5rem;
    bottom: -3rem;
    width: 8rem;
    height: 8rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    content: "";
}

.scope-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem 2.5rem;
    align-items: start;
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--wine) 35%, var(--line));
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--wine) 5%, transparent);
}

.scope-note strong {
    color: var(--wine);
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scope-note p {
    max-width: 82ch;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.quality-pipeline {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.evidence-grid article {
    min-height: 270px;
}

.evidence-grid h3 {
    max-width: 17ch;
    margin-top: 2rem;
    font-family: var(--display);
    font-size: 1.75rem;
    font-weight: 500;
}

.evidence-grid p:last-child {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.ci-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--teal) 6%, transparent);
}

.ci-callout span,
.ci-callout strong {
    display: block;
}

.ci-callout span {
    color: var(--teal);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ci-callout strong {
    margin-top: 0.2rem;
}

.ci-callout a {
    flex: 0 0 auto;
    font-size: 0.83rem;
    font-weight: 800;
}

.topology {
    display: grid;
    grid-template-columns: minmax(140px, 0.5fr) auto minmax(320px, 1.2fr) auto minmax(240px, 0.8fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.topology-user,
.topology-core,
.topology-edges {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--surface);
}

.topology-user span,
.topology-core strong,
.topology-edges span {
    font-weight: 800;
}

.topology small,
.topology-edges small {
    color: var(--muted);
    font-size: 0.7rem;
}

.topology-core {
    border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
    background: color-mix(in srgb, var(--amber) 5%, var(--surface));
}

.topology-core strong {
    font-family: var(--display);
    font-size: 1.6rem;
}

.topology-core > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.topology-core > div span {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.62rem;
}

.topology-edges {
    gap: 0.65rem;
}

.topology-edges div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.topology-edges div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.topology-arrow {
    display: grid;
    place-items: center;
    color: var(--amber);
    font-size: 1.25rem;
}

.operations-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.operations-grid article {
    padding: 1.25rem;
}

.operations-grid h3 {
    font-size: 1.08rem;
}

.operations-grid h3 code {
    color: var(--amber-strong);
    font-size: 0.95rem;
}

.operations-grid p:last-child {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.runbooks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.code-block {
    position: relative;
    padding: 1rem;
    border-top: 1px solid var(--line);
}

.code-block button {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    min-width: 58px;
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.code-block button:hover {
    color: var(--text);
}

.code-block pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 0.75rem 5rem 0.75rem 0.5rem;
    margin: 0;
    color: var(--amber-strong);
    font-size: 0.72rem;
    line-height: 1.8;
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.decision-grid a {
    display: block;
    min-width: 0;
    min-height: 230px;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--surface);
    text-decoration: none;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease;
}

.decision-grid a:hover {
    border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
    background: var(--surface-strong);
    transform: translateY(-3px);
}

.decision-grid h3 {
    margin-top: 2.3rem;
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 500;
}

.decision-grid p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.closing {
    padding-block: clamp(7rem, 12vw, 11rem);
    text-align: center;
}

.closing h2 {
    max-width: 15ch;
    margin-inline: auto;
}

.closing > p:not(.eyebrow) {
    margin-inline: auto;
}

.closing .hero-actions {
    justify-content: center;
    margin: 2rem 0 0;
}

.site-footer {
    padding-block: 2.5rem;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 2rem 4rem;
    align-items: center;
}

.footer-brand {
    min-height: 36px;
}

.footer-grid > div > p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.footer-grid nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.footer-grid nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.revision {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.68rem;
    text-align: right;
}

.revision code {
    color: var(--amber-strong);
}

.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 500ms ease,
        transform 500ms ease;
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1120px) {
    .header-inner {
        gap: 0.75rem;
    }

    .brand-context {
        display: none;
    }

    .site-nav a {
        padding-inline: 0.48rem;
        font-size: 0.73rem;
    }

    .hero {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
        gap: 2.5rem;
    }

    .honesty-grid,
    .operations-grid,
    .decision-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .download-flow,
    .quality-pipeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .download-flow li:nth-child(3)::after,
    .quality-pipeline li:nth-child(3)::after {
        display: none;
    }

    .topology {
        grid-template-columns: minmax(120px, 0.45fr) auto minmax(280px, 1fr) auto minmax(
                210px,
                0.75fr
            );
    }
}

@media (max-width: 900px) {
    html {
        scroll-padding-top: 5.75rem;
    }

    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto auto;
        min-height: 64px;
    }

    .nav-toggle {
        display: flex;
        grid-column: 2;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 1rem;
        left: 1rem;
        display: none;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        padding: 0.5rem;
        border: 1px solid var(--line-strong);
        border-radius: 0.9rem;
        background: var(--surface);
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav a {
        justify-content: flex-start;
        padding-inline: 0.8rem;
        font-size: 0.8rem;
    }

    .header-actions {
        grid-column: 3;
    }

    .source-link {
        display: none;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 5.5rem;
    }

    .verification-card {
        max-width: 600px;
    }

    .section-heading-split,
    .architecture-grid,
    .capacity-card {
        grid-template-columns: 1fr;
    }

    .feature-card-wide {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .feature-card-wide .mini-ui {
        grid-column: 2;
    }

    .architecture-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .architecture-flow li:nth-child(3)::after {
        display: none;
    }

    .storage-story {
        grid-template-columns: 1fr;
    }

    .storage-transfer {
        min-height: 4rem;
    }

    .storage-transfer::before,
    .storage-transfer::after {
        width: 100%;
        height: 1px;
    }

    .storage-transfer span {
        writing-mode: initial;
    }

    .trust-grid,
    .evidence-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topology {
        grid-template-columns: 1fr;
    }

    .topology-arrow {
        min-height: 2rem;
        transform: rotate(90deg);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .revision {
        grid-column: 1 / -1;
        text-align: left;
    }
}

@media (max-width: 680px) {
    .shell {
        width: min(100% - 2rem, 1240px);
    }

    .brand-name {
        font-size: 1.2rem;
    }

    .theme-toggle {
        width: 44px;
        padding: 0;
    }

    .theme-toggle #theme-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }

    .hero-metrics,
    .comparison-grid,
    .feature-grid,
    .trust-grid,
    .evidence-grid,
    .operations-grid,
    .decision-grid,
    .runbooks,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-metrics div {
        padding-inline: 0.5rem;
    }

    .principle-strip,
    .scope-note {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .journey {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .journey::before {
        top: 1.4rem;
        bottom: 1.4rem;
        left: 1.35rem;
        width: 1px;
        height: auto;
    }

    .journey li {
        display: grid;
        grid-template-columns: 2.7rem minmax(0, 1fr);
        gap: 0 0.85rem;
        align-items: center;
        padding: 0;
        text-align: left;
    }

    .journey li > span {
        grid-row: 1 / 3;
        margin: 0;
    }

    .feature-card-wide {
        grid-template-columns: 1fr;
    }

    .feature-card-wide .mini-ui {
        grid-column: auto;
    }

    .architecture-flow,
    .download-flow,
    .quality-pipeline {
        grid-template-columns: 1fr;
    }

    .architecture-flow li:not(:last-child)::after,
    .download-flow li:not(:last-child)::after,
    .quality-pipeline li:not(:last-child)::after,
    .architecture-flow li:nth-child(3)::after,
    .download-flow li:nth-child(3)::after,
    .quality-pipeline li:nth-child(3)::after {
        top: auto;
        right: 50%;
        bottom: -0.7rem;
        display: grid;
        transform: translateX(50%) rotate(90deg);
    }

    .architecture-flow li:last-child::after,
    .download-flow li:last-child::after,
    .quality-pipeline li:last-child::after {
        display: none;
    }

    .module-groups,
    .storage-card ul,
    .honesty-grid {
        grid-template-columns: 1fr;
    }

    .formula p {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .trust-grid article,
    .evidence-grid article,
    .decision-grid a {
        min-height: 0;
    }

    .ci-callout {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-grid nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .header-inner {
        gap: 0.4rem;
        width: calc(100% - 1rem);
    }

    .brand {
        gap: 0.45rem;
    }

    .site-nav.is-open {
        grid-template-columns: 1fr;
    }

    .hero-actions .button {
        width: 100%;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .commit-stamp {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .request-preview {
        grid-template-columns: 3.5rem minmax(0, 1fr);
    }

    .footer-grid nav {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header.is-scrolled,
    .theme-toggle,
    .source-link {
        background: var(--surface);
        backdrop-filter: none;
    }
}

@media print {
    :root {
        --bg: #ffffff;
        --surface: #ffffff;
        --surface-strong: #f2eee9;
        --text: #181512;
        --muted: #514a43;
        --line: rgba(0, 0, 0, 0.2);
        --line-strong: rgba(0, 0, 0, 0.35);
        --amber: #814500;
        --amber-strong: #814500;
        --teal: #2f7162;
        --wine: #7e3742;
        color-scheme: light;
    }

    body {
        background: #fff;
    }

    .site-header,
    .reading-progress,
    .skip-link,
    .hero-actions,
    .theme-toggle,
    .nav-toggle,
    .code-block button {
        display: none !important;
    }

    .section,
    .hero,
    .closing {
        min-height: 0;
        padding-block: 2rem;
    }

    .section {
        break-inside: auto;
    }

    .hero,
    .closing {
        break-inside: avoid;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Technical dossier figures and evidence system
   -------------------------------------------------------------------------- */

.js:not(.reveal-ready) [data-reveal] {
    opacity: 1;
    transform: none;
}

.js.reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
}

.js.reveal-ready [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.technical-nav {
    gap: 0.05rem;
}

.technical-nav a {
    padding-inline: 0.55rem;
}

.technical-hero {
    padding-bottom: 4.5rem;
}

.technical-hero h1 {
    max-width: 820px;
    font-size: clamp(4rem, 8vw, 7.25rem);
}

.document-control h2 {
    max-width: 12ch;
    font-size: clamp(2.3rem, 3.4vw, 3.4rem);
}

.document-control .verification-list dd {
    max-width: 13rem;
    text-align: right;
}

.technical-metrics {
    position: relative;
    padding-top: 2.8rem;
}

.technical-metrics .metric-label {
    position: absolute;
    top: 0.75rem;
    left: 0;
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.technical-metrics strong {
    font-family: var(--mono);
    font-size: clamp(1.75rem, 3vw, 2.75rem);
}

.driver-grid,
.responsibility-grid,
.persistence-grid,
.security-detail-grid,
.tradeoff-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.driver-grid article,
.responsibility-grid article,
.persistence-grid article,
.security-detail-grid article,
.tradeoff-grid article,
.lane-grid article {
    min-width: 0;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.driver-grid article {
    min-height: 13rem;
}

.driver-code {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.driver-grid p,
.responsibility-grid p,
.persistence-grid p,
.security-detail-grid p,
.tradeoff-grid p,
.lane-grid p {
    margin-bottom: 0;
    color: var(--muted);
}

.table-wrap {
    max-width: 100%;
    margin-top: 2.5rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    scrollbar-color: var(--line-strong) transparent;
}

.table-wrap:focus-visible {
    outline-offset: 3px;
}

.technical-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.45;
}

.technical-table caption {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
}

.technical-table th,
.technical-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.technical-table thead th {
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.technical-table tbody th {
    max-width: 15rem;
    color: var(--text);
    font-weight: 750;
}

.technical-table tbody tr:last-child > * {
    border-bottom: 0;
}

.technical-table tbody tr:hover > * {
    background: color-mix(in srgb, var(--amber) 4%, transparent);
}

.technical-table code,
.technical-table a {
    overflow-wrap: anywhere;
}

.tech-figure {
    min-width: 0;
    margin: 4rem 0 0;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}

.tech-figure-header {
    display: flex;
    min-width: 0;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.15rem 0;
}

.tech-figure-header h3 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.5rem, 2.4vw, 2.35rem);
    font-weight: 500;
}

.figure-id {
    margin-bottom: 0.4rem;
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.diagram-legend,
.schema-legend,
.capacity-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    padding: 0;
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.66rem;
    list-style: none;
}

.diagram-legend li,
.schema-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.legend-line {
    display: inline-block;
    width: 1.5rem;
    border-top: 2px solid var(--text);
}

.legend-dashed {
    border-top-style: dashed;
}

.legend-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.18rem;
    background: var(--surface-raised);
}

.legend-policy {
    border: 1px solid var(--wine);
    background: color-mix(in srgb, var(--wine) 15%, transparent);
}

.legend-interface {
    background: var(--amber);
}

.legend-domain,
.legend-source {
    background: var(--teal);
}

.legend-data {
    border: 1px solid var(--line-strong);
    background: var(--surface-raised);
}

.legend-tests {
    background: var(--amber);
}

.tech-canvas {
    position: relative;
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 2rem);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        color-mix(in srgb, var(--surface) 58%, transparent);
    background-size:
        36px 36px,
        36px 36px,
        auto;
}

.tech-figure figcaption {
    padding: 1rem 0 1.2rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.tech-figure figcaption > span {
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 800;
}

.diagram-node {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.65rem;
    background: var(--surface);
}

.diagram-node strong,
.diagram-node small,
.diagram-node span {
    display: block;
}

.diagram-node strong {
    margin-top: 0.35rem;
    line-height: 1.25;
}

.diagram-node small {
    margin-top: 0.35rem;
    color: var(--muted);
    line-height: 1.4;
}

.node-kind,
.boundary-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.node-interface {
    border-top-color: var(--amber);
}

.node-domain {
    border-top-color: var(--teal);
}

.node-runtime {
    border-top-color: var(--amber-strong);
}

.node-data {
    border-top-color: var(--line-strong);
}

.node-external {
    border-style: dashed;
}

.context-canvas {
    display: grid;
    grid-template-columns: minmax(150px, 0.55fr) 4rem minmax(450px, 1.65fr) minmax(230px, 0.8fr);
    grid-template-areas:
        "actor relation runtime external"
        ". . resources external";
    gap: 1rem;
    align-items: center;
}

.context-actor {
    grid-area: actor;
}

.context-relation {
    grid-area: relation;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.63rem;
    text-align: center;
}

.context-relation b {
    display: block;
    color: var(--amber);
    font-size: 1.5rem;
}

.runtime-boundary {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid color-mix(in srgb, var(--amber) 58%, var(--line));
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.context-canvas > .runtime-boundary {
    grid-area: runtime;
}

.boundary-label {
    margin: 0 0 0.75rem;
    color: var(--amber-strong);
}

.runtime-components {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.context-local {
    grid-area: resources;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.context-external {
    grid-area: external;
    display: grid;
    gap: 0.7rem;
    align-self: stretch;
    padding-left: 1rem;
    border-left: 1px dashed var(--wine);
}

.layer-canvas {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
}

.architecture-layers {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.architecture-layers li {
    position: relative;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(170px, 0.65fr);
    gap: 0.8rem;
    align-items: center;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    background: var(--surface);
}

.architecture-layers li:not(:last-child)::after {
    position: absolute;
    bottom: -0.72rem;
    left: 1.65rem;
    z-index: 1;
    color: var(--teal);
    content: "↓";
    font-weight: 900;
}

.layer-number {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.architecture-layers small,
.architecture-layers strong {
    display: block;
}

.architecture-layers small {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.architecture-layers code {
    color: var(--muted);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.boundary-rail {
    padding: 1.2rem;
    border: 1px solid var(--wine);
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--wine) 6%, var(--surface));
}

.boundary-rail > span {
    color: var(--wine);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.boundary-rail ul {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    margin: 1rem 0 0;
    list-style: none;
}

.boundary-rail li {
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--line);
}

.responsibility-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sequence-trace {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
}

.sequence-trace li {
    display: grid;
    grid-template-columns: 2.5rem minmax(115px, 0.6fr) 2rem minmax(115px, 0.6fr) minmax(
            280px,
            1.6fr
        );
    gap: 0.8rem;
    align-items: center;
    min-width: 0;
    padding: 1rem 0.4rem;
    border-bottom: 1px solid var(--line);
}

.sequence-trace li:last-child {
    border-bottom: 0;
}

.sequence-index {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.sequence-from,
.sequence-to {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 750;
}

.sequence-from {
    color: var(--amber-strong);
}

.sequence-to {
    color: var(--teal);
}

.sequence-arrow {
    color: var(--muted);
    text-align: center;
}

.sequence-trace strong {
    display: block;
    line-height: 1.3;
}

.sequence-trace p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.state-canvas {
    display: grid;
    gap: 1.6rem;
}

.state-spine {
    display: grid;
    grid-template-columns:
        minmax(120px, 0.75fr) 2rem minmax(120px, 0.75fr) 2rem minmax(170px, 1.2fr)
        2rem minmax(120px, 0.75fr);
    gap: 0.45rem;
    align-items: center;
}

.state-node {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.65rem;
    background: var(--surface);
    text-align: center;
}

.state-node small,
.state-node strong {
    display: block;
}

.state-node small {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
}

.state-node strong {
    margin-top: 0.3rem;
    font-family: var(--mono);
}

.state-active,
.state-process {
    border-color: color-mix(in srgb, var(--teal) 70%, var(--line));
}

.state-warning {
    border-color: color-mix(in srgb, var(--wine) 70%, var(--line));
}

.state-success {
    background: color-mix(in srgb, var(--teal) 10%, var(--surface));
}

.state-edge {
    color: var(--teal);
    font-size: 1.4rem;
    text-align: center;
}

.state-branch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.state-recovery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line-strong);
}

.state-recovery div {
    min-width: 0;
    padding-left: 0.8rem;
    border-left: 2px solid var(--wine);
}

.state-recovery strong,
.state-recovery span {
    display: block;
}

.state-recovery strong {
    font-family: var(--mono);
    font-size: 0.72rem;
}

.state-recovery span {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.fulfillment-canvas {
    display: grid;
    gap: 1.4rem;
}

.fulfillment-map {
    display: grid;
    grid-template-columns:
        minmax(125px, 0.85fr) 1.5rem minmax(145px, 1fr) minmax(75px, 0.55fr)
        minmax(150px, 1fr) 1.5rem minmax(125px, 0.85fr);
    grid-template-areas:
        "intent edge-one pack pack-route coverage edge-two success"
        ". . trigger . coverage . ."
        ". . episodes episode-route coverage . .";
    gap: 0.65rem;
    align-items: center;
}

.fulfillment-map .state-node > span:not(.attempt-meter) {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.fulfillment-intent {
    grid-area: intent;
}

.fulfillment-edge-one {
    grid-area: edge-one;
}

.fulfillment-pack {
    grid-area: pack;
}

.fulfillment-pack-route {
    grid-area: pack-route;
}

.fulfillment-coverage {
    grid-area: coverage;
    align-self: stretch;
    display: flex;
    min-height: 11rem;
    flex-direction: column;
    justify-content: center;
}

.fulfillment-edge-two {
    grid-area: edge-two;
}

.fulfillment-success {
    grid-area: success;
}

.fulfillment-trigger {
    grid-area: trigger;
    display: grid;
    gap: 0.22rem;
    justify-items: center;
    padding: 0.45rem 0.35rem 0.25rem;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.59rem;
    line-height: 1.25;
    text-align: center;
}

.fulfillment-trigger b {
    color: var(--wine);
    font-size: 1.25rem;
}

.fulfillment-episodes {
    grid-area: episodes;
}

.fulfillment-episode-route {
    grid-area: episode-route;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fulfillment-route {
    color: var(--teal);
    font-family: var(--mono);
    text-align: center;
}

.fulfillment-route small,
.fulfillment-route span {
    display: block;
}

.fulfillment-route small {
    color: var(--muted);
    font-size: 0.58rem;
    line-height: 1.25;
}

.fulfillment-route span {
    font-size: 1.25rem;
}

.attempt-meter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    margin-top: 0.7rem;
}

.attempt-meter i {
    height: 0.32rem;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: 0 0 10px color-mix(in srgb, var(--teal) 30%, transparent);
}

.fulfillment-recovery-ledger {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
}

.fulfillment-recovery-ledger div {
    min-width: 0;
    padding: 0.85rem 1rem;
    background: var(--surface);
}

.fulfillment-recovery-ledger strong,
.fulfillment-recovery-ledger span {
    display: block;
}

.fulfillment-recovery-ledger strong {
    color: var(--teal);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.fulfillment-recovery-ledger span {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.73rem;
    line-height: 1.4;
}

.fulfillment-recovery-ledger .fulfillment-blocked {
    box-shadow: inset 3px 0 0 var(--wine);
}

.fulfillment-recovery-ledger .fulfillment-blocked strong {
    color: var(--wine);
}

.capacity-simulator {
    display: grid;
    gap: 1.35rem;
}

.capacity-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.capacity-controls label {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.capacity-controls label > span {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.capacity-controls output {
    color: var(--text);
    font-family: var(--mono);
    font-weight: 750;
}

.capacity-controls input {
    width: 100%;
    accent-color: var(--amber);
}

.capacity-result {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--teal);
    background: color-mix(in srgb, var(--teal) 7%, transparent);
}

.capacity-result span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.capacity-result strong {
    color: var(--teal);
    font-family: var(--mono);
    font-size: 1.5rem;
}

.capacity-result small {
    flex-basis: 100%;
    color: var(--muted);
}

.capacity-result.is-blocked {
    border-left-color: var(--wine);
    background: color-mix(in srgb, var(--wine) 7%, transparent);
}

.capacity-result.is-blocked strong {
    color: var(--wine);
}

.capacity-budget {
    display: flex;
    width: 100%;
    min-height: 3rem;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 0.55rem;
    background: var(--surface);
}

.capacity-segment {
    position: relative;
    display: grid;
    flex: 0 0 25%;
    min-width: 2px;
    place-items: center;
    overflow: hidden;
    border-right: 1px solid color-mix(in srgb, var(--bg) 50%, transparent);
    color: var(--amber-ink);
    font-family: var(--mono);
    font-size: 0.64rem;
    font-weight: 800;
    text-align: center;
    transition: flex-basis 180ms ease;
}

.capacity-segment:last-child {
    border-right: 0;
}

.capacity-segment span {
    padding: 0.3rem;
    white-space: nowrap;
}

.segment-floor {
    background: var(--wine);
}

.segment-active {
    background:
        repeating-linear-gradient(
            135deg,
            color-mix(in srgb, var(--muted) 45%, transparent) 0 6px,
            transparent 6px 12px
        ),
        var(--surface-raised);
}

.segment-archive {
    background: var(--amber);
}

.segment-unpack {
    background: var(--teal);
}

.capacity-key {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.capacity-key li {
    display: grid;
    grid-template-columns: 0.75rem minmax(0, 1fr);
    gap: 0.15rem 0.45rem;
    align-items: center;
    min-width: 0;
}

.capacity-key i {
    grid-row: 1 / 3;
    width: 0.75rem;
    height: 1.8rem;
    border: 1px solid var(--line);
    border-radius: 0.15rem;
}

.capacity-key span {
    overflow-wrap: anywhere;
}

.capacity-key strong {
    color: var(--text);
    font-size: 0.72rem;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.formula-grid div {
    min-width: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.formula-grid span,
.formula-grid code {
    display: block;
}

.formula-grid span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.formula-grid code {
    margin-top: 0.35rem;
    color: var(--text);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.schema-stack {
    display: flex;
    min-height: 8rem;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 0.55rem;
}

.schema-segment {
    display: flex;
    flex: 0 0 var(--segment);
    min-width: 0;
    flex-direction: column;
    justify-content: end;
    gap: 0.2rem;
    padding: 0.9rem 0.7rem;
    border-right: 1px solid color-mix(in srgb, var(--bg) 45%, transparent);
    color: var(--amber-ink);
}

.schema-segment:last-child {
    border-right: 0;
}

.schema-segment strong {
    font-family: var(--mono);
    font-size: 1.35rem;
}

.schema-segment span {
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
}

.schema-identity {
    background: var(--amber);
}

.schema-library {
    background: var(--amber-strong);
}

.schema-download {
    background: var(--teal);
}

.schema-history {
    background: color-mix(in srgb, var(--teal) 62%, var(--amber));
}

.schema-ops {
    background: var(--wine);
}

.schema-legend {
    margin-top: 1rem;
}

.schema-legend i {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.15rem;
}

.er-canvas {
    display: grid;
    grid-template-columns:
        minmax(110px, 0.7fr) auto minmax(130px, 0.8fr) auto minmax(140px, 0.9fr)
        auto minmax(150px, 1fr) auto minmax(145px, 0.9fr) auto minmax(145px, 0.9fr);
    gap: 0.45rem;
    align-items: center;
}

.er-domain {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.55rem;
    background: var(--surface);
}

.er-domain > * {
    display: block;
}

.er-domain span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.er-domain strong {
    margin-top: 0.35rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.er-domain small {
    margin-top: 0.45rem;
    color: var(--muted);
    line-height: 1.35;
}

.er-arrow {
    color: var(--teal);
    text-align: center;
}

.er-support {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line-strong);
}

.er-support div {
    min-width: 0;
    padding: 0.75rem;
    border-left: 2px solid var(--amber);
}

.er-support strong,
.er-support span {
    display: block;
}

.er-support strong {
    font-family: var(--mono);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.er-support span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.74rem;
}

.persistence-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-definition {
    margin: 0;
}

.compact-definition div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}

.compact-definition div:last-child {
    border-bottom: 0;
}

.compact-definition dt {
    color: var(--muted);
}

.compact-definition dd {
    text-align: right;
}

.migration-timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 2rem 0 0;
    margin: 0;
    list-style: none;
}

.migration-timeline::before {
    position: absolute;
    top: 0.55rem;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--line-strong);
    content: "";
}

.migration-timeline li {
    position: relative;
    min-width: 0;
    padding-top: 0.75rem;
}

.migration-timeline li::before {
    position: absolute;
    top: -1.8rem;
    left: 0;
    width: 0.7rem;
    height: 0.7rem;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 1px var(--amber);
    content: "";
}

.migration-timeline span,
.migration-timeline strong,
.migration-timeline small {
    display: block;
}

.migration-timeline span {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.65rem;
}

.migration-timeline strong {
    margin-top: 0.35rem;
}

.migration-timeline small {
    margin-top: 0.35rem;
    color: var(--muted);
    line-height: 1.4;
}

.timing-chart {
    display: grid;
    gap: 0.85rem;
}

.timing-axis,
.timing-row {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr) 4rem;
    gap: 1rem;
    align-items: center;
}

.timing-axis {
    grid-template-columns: 11rem repeat(6, minmax(0, 1fr)) 4rem;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.6rem;
}

.timing-axis span:first-child {
    grid-column: 2;
}

.timing-row > span {
    font-family: var(--mono);
    font-size: 0.72rem;
}

.timing-row > div {
    position: relative;
    height: 1.5rem;
    border-left: 1px solid var(--line-strong);
    background: repeating-linear-gradient(
        90deg,
        transparent 0 calc(20% - 1px),
        var(--line) calc(20% - 1px) 20%
    );
}

.timing-row i {
    display: block;
    width: var(--duration);
    min-width: 0.3rem;
    height: 100%;
    border-radius: 0 0.3rem 0.3rem 0;
}

.timing-tick {
    background: var(--amber);
}

.timing-heartbeat {
    background: var(--teal);
}

.timing-lease {
    background: color-mix(in srgb, var(--teal) 42%, var(--surface-raised));
}

.timing-row strong {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-align: right;
}

.lease-flow {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.65fr);
    gap: 1.2rem;
}

.lease-flow ol {
    display: grid;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.lease-flow li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 0.7rem;
    align-items: start;
    min-width: 0;
    padding: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.lease-flow li > span {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.lease-flow li small {
    color: var(--muted);
    line-height: 1.4;
}

.lease-flow aside {
    padding: 1rem;
    border: 1px solid var(--wine);
    border-radius: 0.6rem;
    background: color-mix(in srgb, var(--wine) 5%, var(--surface));
}

.lease-flow aside strong {
    display: block;
    color: var(--wine);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.lease-flow aside p {
    color: var(--muted);
    font-size: 0.8rem;
}

.lease-flow aside p:last-child {
    margin-bottom: 0;
}

.lane-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.lane-grid ol,
.lane-grid ul {
    display: grid;
    gap: 0.45rem;
    padding-left: 1.25rem;
    margin-bottom: 0;
    color: var(--muted);
}

.design-constraint,
.evidence-caveat {
    margin-top: 2.5rem;
}

.trust-boundaries {
    display: grid;
    gap: 0.85rem;
}

.trust-zone,
.trust-gate {
    min-width: 0;
    padding: 1rem;
    border-radius: 0.6rem;
}

.trust-zone {
    border: 1px solid var(--line-strong);
    background: var(--surface);
}

.trust-zone > span,
.trust-gate > span {
    display: block;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trust-zone > strong,
.trust-gate > strong {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.35;
}

.zone-untrusted {
    border-style: dashed;
    border-color: var(--wine);
}

.trust-gate {
    margin-inline: 4rem;
    border-left: 3px solid var(--wine);
    background: color-mix(in srgb, var(--wine) 6%, var(--surface));
}

.zone-runtime {
    border-color: var(--teal);
    background: color-mix(in srgb, var(--teal) 5%, var(--surface));
}

.zone-runtime > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.zone-runtime small {
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    color: var(--muted);
}

.trust-gates-split,
.trust-destinations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.trust-gates-split .trust-gate {
    margin: 0;
}

.trust-destinations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-helper {
    margin: 2.5rem 0 -1.75rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.control-matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 220px;
    background: var(--surface);
}

.control-matrix thead th:first-child {
    z-index: 3;
    background: var(--surface-strong);
}

.control-matrix td {
    min-width: 125px;
    text-align: center;
}

.control-matrix td b {
    color: var(--teal);
}

.matrix-legend {
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.security-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.deployment-canvas {
    display: grid;
    grid-template-columns: minmax(180px, 0.65fr) minmax(420px, 1.45fr) minmax(230px, 0.8fr);
    grid-template-areas:
        "browser runtime external"
        ". state external";
    gap: 1rem;
    align-items: center;
}

.deployment-browser {
    grid-area: browser;
}

.deployment-runtime {
    grid-area: runtime;
}

.deployment-runtime > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.deployment-runtime > div span {
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    background: var(--surface);
    font-size: 0.78rem;
}

.deployment-runtime > small {
    display: block;
    margin-top: 0.7rem;
    color: var(--muted);
}

.deployment-state {
    grid-area: state;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.deployment-external {
    grid-area: external;
    border-color: var(--wine);
}

.tradeoff-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 3rem;
}

.tradeoff-grid article {
    min-height: 10rem;
}

.tradeoff-grid article > span {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.7rem;
}

.module-chart {
    display: grid;
    gap: 0.75rem;
}

.module-bar {
    display: grid;
    grid-template-columns: minmax(140px, 0.75fr) minmax(280px, 3fr) 5.5rem;
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
}

.module-bar > span {
    font-family: var(--mono);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.module-bar > div {
    display: flex;
    width: var(--total);
    min-width: 2px;
    height: 1.25rem;
    overflow: hidden;
    border-radius: 0.25rem;
    background: var(--surface);
}

.module-bar i {
    display: block;
    height: 100%;
}

.module-bar .bar-source {
    width: var(--source);
    background: var(--teal);
}

.module-bar .bar-tests {
    width: var(--tests);
    background: var(--amber);
}

.module-bar > strong {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    text-align: right;
}

.proof-ladder ol {
    position: relative;
    display: grid;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.proof-ladder li {
    display: grid;
    grid-template-columns: 2.5rem minmax(130px, 0.7fr) minmax(260px, 1.7fr) minmax(120px, 0.65fr);
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--line);
}

.proof-ladder li:last-child {
    border-bottom: 0;
}

.proof-ladder li > span {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.proof-ladder p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.proof-ladder li > b {
    color: var(--teal);
    font-family: var(--mono);
    font-size: 0.72rem;
    text-align: right;
}

.evidence-ledger {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 2.5rem;
    border: 1px solid var(--line);
    background: var(--line);
}

.evidence-ledger > div {
    min-width: 0;
    padding: 1.1rem;
    background: var(--surface);
}

.evidence-ledger span,
.evidence-ledger strong,
.evidence-ledger small {
    display: block;
}

.evidence-ledger span {
    color: var(--amber-strong);
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.evidence-ledger strong {
    margin-top: 0.45rem;
}

.evidence-ledger small {
    margin-top: 0.25rem;
    color: var(--muted);
}

.traceability-table td:nth-child(3) {
    min-width: 260px;
}

.technical-decisions a {
    min-height: 15rem;
}

.technical-closing {
    max-width: 1020px;
}

.technical-closing h2 {
    max-width: 18ch;
}

@media (max-width: 1180px) {
    .technical-nav a {
        padding-inline: 0.38rem;
        font-size: 0.68rem;
    }

    .driver-grid,
    .security-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .context-canvas {
        grid-template-columns: minmax(140px, 0.5fr) 3rem minmax(380px, 1.5fr);
        grid-template-areas:
            "actor relation runtime"
            ". . resources"
            "external external external";
    }

    .context-external {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 1rem 0 0;
        border-top: 1px dashed var(--wine);
        border-left: 0;
    }

    .sequence-trace li {
        grid-template-columns: 2.25rem minmax(100px, 0.5fr) 1.5rem minmax(100px, 0.5fr) minmax(
                240px,
                1.5fr
            );
    }

    .state-recovery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .er-canvas {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .er-arrow {
        display: none;
    }

    .deployment-canvas {
        grid-template-columns: minmax(160px, 0.55fr) minmax(380px, 1.45fr);
        grid-template-areas:
            "browser runtime"
            ". state"
            "external external";
    }
}

@media (max-width: 900px) {
    .technical-hero h1 {
        font-size: clamp(3.8rem, 12vw, 6.5rem);
    }

    .tech-figure {
        margin-top: 3rem;
    }

    .tech-figure-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .layer-canvas,
    .lease-flow {
        grid-template-columns: 1fr;
    }

    .boundary-rail {
        border-color: var(--line-strong);
        border-left: 3px solid var(--wine);
    }

    .sequence-trace li {
        grid-template-columns: 2rem minmax(90px, 0.5fr) 1.25rem minmax(90px, 0.5fr) minmax(
                200px,
                1.4fr
            );
        gap: 0.55rem;
    }

    .state-spine {
        grid-template-columns: 1fr;
    }

    .fulfillment-map {
        grid-template-columns: 1fr;
        grid-template-areas:
            "intent"
            "edge-one"
            "pack"
            "trigger"
            "episodes"
            "episode-route"
            "coverage"
            "edge-two"
            "success";
    }

    .fulfillment-pack-route {
        display: none;
    }

    .fulfillment-coverage {
        min-height: 0;
    }

    .fulfillment-edge {
        transform: rotate(90deg);
    }

    .fulfillment-episode-route span {
        display: none;
    }

    .fulfillment-episode-route::after {
        color: var(--teal);
        font-size: 1.25rem;
        content: "\2193";
    }

    .state-edge {
        transform: rotate(90deg);
    }

    .state-branch {
        width: 100%;
    }

    .capacity-key,
    .formula-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .schema-stack {
        min-height: 6.5rem;
    }

    .migration-timeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2.2rem 1rem;
    }

    .migration-timeline::before {
        display: none;
    }

    .migration-timeline li {
        padding: 0.75rem;
        border-top: 1px solid var(--line-strong);
    }

    .migration-timeline li::before {
        top: -0.4rem;
    }

    .trust-gate {
        margin-inline: 1rem;
    }

    .deployment-canvas {
        grid-template-columns: 1fr;
        grid-template-areas:
            "browser"
            "runtime"
            "state"
            "external";
    }

    .tradeoff-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .driver-grid,
    .responsibility-grid,
    .persistence-grid,
    .security-detail-grid,
    .tradeoff-grid,
    .lane-grid,
    .evidence-ledger {
        grid-template-columns: 1fr;
    }

    .driver-grid article {
        min-height: 0;
    }

    .technical-table {
        min-width: 680px;
    }

    .context-canvas {
        grid-template-columns: 1fr;
        grid-template-areas:
            "actor"
            "relation"
            "runtime"
            "resources"
            "external";
    }

    .context-relation b {
        transform: rotate(90deg);
    }

    .runtime-components,
    .context-local,
    .context-external {
        grid-template-columns: 1fr;
    }

    .architecture-layers li {
        grid-template-columns: 2.25rem minmax(0, 1fr);
    }

    .architecture-layers code {
        grid-column: 2;
    }

    .sequence-trace li {
        grid-template-columns: 2rem minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: start;
        padding-block: 1rem;
    }

    .sequence-trace li > div {
        grid-column: 2 / -1;
        padding-top: 0.35rem;
    }

    .state-recovery,
    .fulfillment-recovery-ledger,
    .capacity-controls,
    .capacity-key,
    .formula-grid {
        grid-template-columns: 1fr;
    }

    .capacity-segment span {
        display: none;
    }

    .schema-stack {
        min-height: 0;
        flex-direction: column;
    }

    .schema-segment {
        flex-basis: auto !important;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        border-right: 0;
        border-bottom: 1px solid color-mix(in srgb, var(--bg) 45%, transparent);
    }

    .schema-segment:last-child {
        border-bottom: 0;
    }

    .er-canvas {
        grid-template-columns: 1fr;
    }

    .er-domain {
        position: relative;
    }

    .er-domain:not(.er-import)::after {
        display: block;
        margin-top: 0.65rem;
        color: var(--teal);
        content: "↓";
        text-align: center;
    }

    .er-support {
        grid-template-columns: 1fr;
    }

    .migration-timeline {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .timing-axis,
    .timing-row {
        grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1.7fr) 3rem;
        gap: 0.6rem;
    }

    .timing-axis {
        display: none;
    }

    .trust-gate {
        margin-inline: 0;
    }

    .zone-runtime > div,
    .trust-gates-split,
    .trust-destinations {
        grid-template-columns: 1fr;
    }

    .deployment-runtime > div,
    .deployment-state {
        grid-template-columns: 1fr;
    }

    .module-bar {
        grid-template-columns: minmax(115px, 0.8fr) minmax(120px, 1.8fr) 4.5rem;
        gap: 0.55rem;
    }

    .proof-ladder li {
        grid-template-columns: 2rem minmax(0, 1fr) auto;
    }

    .proof-ladder p {
        grid-column: 2 / -1;
    }

    .proof-ladder li > b {
        text-align: right;
    }
}

@media (max-width: 480px) {
    .technical-hero h1 {
        font-size: clamp(3.2rem, 17vw, 4.6rem);
    }

    .tech-canvas {
        padding: 0.85rem;
    }

    .diagram-node,
    .runtime-boundary,
    .trust-zone,
    .trust-gate {
        padding: 0.8rem;
    }

    .technical-metrics {
        padding-top: 3rem;
    }

    .technical-metrics .metric-label {
        top: 0.85rem;
        right: 0;
        text-align: center;
    }

    .architecture-layers li {
        padding-inline: 0.65rem;
    }

    .sequence-trace li {
        grid-template-columns: 1.7rem minmax(0, 1fr);
    }

    .sequence-from,
    .sequence-to {
        overflow-wrap: anywhere;
    }

    .sequence-arrow {
        display: none;
    }

    .sequence-to {
        grid-column: 2;
    }

    .sequence-trace li > div {
        grid-column: 2;
    }

    .state-branch {
        grid-template-columns: 1fr;
    }

    .compact-definition div {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .compact-definition dd {
        max-width: 100%;
        text-align: left;
    }

    .compact-definition code {
        overflow-wrap: anywhere;
    }

    .capacity-controls label > span {
        flex-direction: column;
        gap: 0.2rem;
    }

    .capacity-budget {
        min-height: 2.25rem;
    }

    .module-bar {
        grid-template-columns: minmax(0, 1fr) 4.25rem;
        gap: 0.4rem;
    }

    .module-bar > div {
        grid-column: 1 / -1;
        grid-row: 2;
        width: var(--total);
    }

    .module-bar > strong {
        grid-column: 2;
        grid-row: 1;
    }

    .proof-ladder li {
        grid-template-columns: 1.8rem minmax(0, 1fr);
    }

    .proof-ladder li > b,
    .proof-ladder p {
        grid-column: 2;
        text-align: left;
    }
}

@media (forced-colors: active) {
    .diagram-node,
    .runtime-boundary,
    .state-node,
    .er-domain,
    .trust-zone,
    .trust-gate,
    .technical-table,
    .table-wrap {
        border-color: CanvasText;
    }

    .capacity-segment,
    .attempt-meter i,
    .schema-segment,
    .timing-row i,
    .module-bar i,
    .legend-swatch {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
    }
}

@media print {
    .js.reveal-ready [data-reveal],
    .js.reveal-ready [data-reveal].is-visible {
        opacity: 1 !important;
        transform: none !important;
    }

    .tech-figure,
    .table-wrap,
    .driver-grid article,
    .responsibility-grid article,
    .persistence-grid article,
    .security-detail-grid article,
    .tradeoff-grid article {
        break-inside: avoid;
    }

    .tech-canvas {
        background: #fff;
    }

    .capacity-controls,
    .table-helper {
        display: none;
    }

    .table-wrap {
        overflow: visible;
    }

    .technical-table {
        min-width: 0;
        font-size: 7.5pt;
    }
}

/* --------------------------------------------------------------------------
   Code-path breakdown diagrams
   Geometry lives in SVG attributes; every paint and type value lives here so
   both themes, print, and forced colors resolve from the shared tokens.
   Inline SVG cannot use var() in presentation attributes, so nothing in the
   markup carries a fill or stroke of its own.
   -------------------------------------------------------------------------- */

.breakdown {
    padding-block: clamp(3rem, 5vw, 4.75rem);
    border-top: 1px solid var(--line);
}

.breakdown-stack > .breakdown:first-child {
    padding-top: 2rem;
    border-top: 0;
}

/* Mirrors .table-wrap: a dense trace scrolls rather than scaling into
   illegibility on a phone. */
.cpd-scroll {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-color: var(--line-strong) transparent;
}

.cpd-scroll:focus-visible {
    outline-offset: 3px;
}

.cpd-canvas {
    padding-inline: 0;
    background: none;
}

/* The rail layout caps the document column at 930px even on a wide desktop
   (1240px shell minus a 230px rail and a 5rem gap), so the canonical viewBox
   width is 930 and diagrams render at roughly 1:1 rather than scaling down
   into unreadable type. */
.cpd {
    display: block;
    width: 100%;
    min-width: 820px;
    max-width: 930px;
    height: auto;
    margin-inline: auto;
    font-family: var(--body);
}

/* --- node surfaces -------------------------------------------------------- */
.cpd-node {
    fill: var(--surface);
    stroke: var(--line-strong);
    stroke-width: 1;
}

.cpd-node-entry {
    fill: color-mix(in srgb, var(--amber) 12%, var(--surface));
    stroke: var(--amber);
}

.cpd-node-domain {
    fill: color-mix(in srgb, var(--teal) 12%, var(--surface));
    stroke: var(--teal);
}

.cpd-node-data {
    fill: var(--surface-raised);
    stroke: var(--line-strong);
}

.cpd-node-external {
    fill: none;
    stroke: var(--line-strong);
    stroke-dasharray: 5 4;
}

.cpd-node-terminal {
    fill: color-mix(in srgb, var(--wine) 12%, var(--surface));
    stroke: var(--wine);
}

.cpd-zone {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1;
    stroke-dasharray: 6 5;
}

.cpd-zone-alert {
    stroke: var(--wine);
}

.cpd-band {
    fill: color-mix(in srgb, var(--surface-strong) 70%, transparent);
    stroke: none;
}

/* --- type ----------------------------------------------------------------- */
.cpd-title {
    fill: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.cpd-kicker {
    fill: var(--amber-strong);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.cpd-path {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 11.5px;
}

.cpd-edge-label {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.cpd-lane {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

/* --- edges ---------------------------------------------------------------- */
/* Every edge kind differs by dash pattern as well as hue, so a trace stays
   readable with no color at all. */
.cpd-edge {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1.75;
}

.cpd-head {
    fill: var(--line-strong);
    stroke: none;
}

.cpd-edge-return {
    stroke: var(--teal);
    stroke-dasharray: 6 4;
}

.cpd-head-return {
    fill: var(--teal);
}

.cpd-edge-fail {
    stroke: var(--wine);
    stroke-dasharray: 3 4;
}

.cpd-head-fail {
    fill: var(--wine);
}

.cpd-edge-async {
    stroke: var(--amber);
    stroke-dasharray: 1.5 4;
    stroke-linecap: round;
}

.cpd-head-async {
    fill: var(--amber);
}

/* --- legend modifiers (compose with .legend-line) ------------------------- */
.legend-flow {
    border-top-color: var(--line-strong);
}

.legend-return {
    border-top-color: var(--teal);
    border-top-style: dashed;
}

.legend-fail {
    border-top-color: var(--wine);
    border-top-style: dashed;
}

.legend-async {
    border-top-color: var(--amber);
    border-top-style: dotted;
}

/* --- owning-source link set ----------------------------------------------- */
.source-set {
    margin-top: 2rem;
    padding: 1.15rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.source-set ul {
    display: grid;
    gap: 0.4rem;
    padding: 0;
    margin: 0.6rem 0 0;
    list-style: none;
}

.source-set code {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

@media (prefers-contrast: more) {
    .cpd-node,
    .cpd-node-entry,
    .cpd-node-domain,
    .cpd-node-data,
    .cpd-node-terminal {
        fill: var(--surface);
        stroke: var(--text);
        stroke-width: 1.5;
    }

    .cpd-edge {
        stroke: var(--text);
        stroke-width: 2.25;
    }

    .cpd-head {
        fill: var(--text);
    }

    .cpd-path,
    .cpd-edge-label,
    .cpd-lane {
        fill: var(--text);
    }
}

@media (forced-colors: active) {
    .cpd-node,
    .cpd-node-entry,
    .cpd-node-domain,
    .cpd-node-data,
    .cpd-node-terminal,
    .cpd-band {
        fill: Canvas;
        stroke: CanvasText;
    }

    .cpd-node-external,
    .cpd-zone,
    .cpd-zone-alert {
        fill: none;
        stroke: CanvasText;
    }

    .cpd-edge,
    .cpd-edge-return,
    .cpd-edge-fail,
    .cpd-edge-async {
        stroke: CanvasText;
    }

    .cpd-head,
    .cpd-head-return,
    .cpd-head-fail,
    .cpd-head-async {
        fill: CanvasText;
    }

    .cpd-title,
    .cpd-kicker,
    .cpd-path,
    .cpd-edge-label,
    .cpd-lane {
        fill: CanvasText;
    }

    .source-set {
        border-color: CanvasText;
    }
}

@media print {
    .cpd-scroll {
        overflow: visible;
    }

    .cpd {
        min-width: 0;
    }

    .breakdown,
    .source-set {
        break-inside: avoid;
    }
}
