/*
 * Agent Circuits — long-form editorial story (strategy.html) + the small
 * About/Contact page (about.html).
 *
 * Layered on top of tokens.css + site.css. site.css owns the shared chrome
 * (nav, footer, buttons, .section, .kicker, display type, .pull-quote base,
 * .reveal-up). This file adds only what a long-form editorial read needs:
 * the reading-progress bar, the hero + epigraph, a quiet table of contents,
 * the reading column and its rhythm, the pull-quote block treatment, the
 * four whitepaper figures, and the two editorial tables. Tokens only — no
 * hex, no raw colour — so both themes and a future brand swap come for free.
 *
 * Palette discipline: monochrome (foreground / muted / border / card) plus a
 * SINGLE blue accent, --story-accent, mapped to the product's tool-call blue.
 * Nothing else is chromatic. Figures animate only via .reveal-up (site.js).
 */

:root {
	--story-accent: var(--mkt-status-running); /* the one blue, from tokens */
	--story-accent-soft: var(--mkt-status-running-soft);
	/* Reading measure. ~68–72ch at the 18px editorial body size. */
	--story-measure: 40rem;
	--story-figure-max: 54rem;
	--story-hairline: color-mix(in oklch, var(--border) 80%, transparent);
	--story-hairline-strong: color-mix(in oklch, var(--foreground) 22%, transparent);
}

/* ================================================ Reading-progress ==== */
/* Slim bar pinned above the nav; width driven by story.js on scroll. */

.reading-progress {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 120; /* above .site-nav (100) */
	height: 2px;
	background: transparent;
	pointer-events: none;
}
.reading-progress__fill {
	height: 100%;
	width: 0;
	transform-origin: 0 50%;
	background: var(--story-accent);
	/* width is set inline as a % by story.js; keep the paint cheap. */
	transition: width 120ms linear;
}
@media (prefers-reduced-motion: reduce) {
	.reading-progress__fill {
		transition: none;
	}
}

/* ============================================================ Hero ===== */

.story-hero {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: clamp(2rem, 5vw, 4rem);
	/* Extra top padding clears the fixed nav; generous bottom for air. */
	padding-block: clamp(6rem, 16vh, 11rem) clamp(2.5rem, 6vh, 4rem);
}
.story-hero__kicker {
	margin-bottom: 1.5rem;
}
.story-hero__title {
	max-width: 18ch;
}
.story-hero__epigraph {
	margin-top: 1.75rem;
	max-width: 30ch;
	font-family: var(--mkt-serif);
	font-style: italic;
	font-size: clamp(1.3rem, 2.6vw, 1.9rem);
	line-height: var(--mkt-line-snug);
	color: var(--muted-foreground);
	/* A short accent rule to the left, whitepaper-epigraph style. */
	padding-left: 1.25rem;
	border-left: 2px solid var(--story-accent);
}
.story-hero__lede {
	margin-top: 2.25rem;
	max-width: 54ch;
	font-size: var(--mkt-text-xl);
	line-height: var(--mkt-line-relaxed);
	color: var(--muted-foreground);
}

/* ============================================== Table of contents ===== */
/* Quiet, sticky-free. A hairline-boxed index that sits after the hero. */

.story-toc {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: clamp(2rem, 5vw, 4rem);
	padding-bottom: clamp(2rem, 5vh, 3.5rem);
}
.story-toc__inner {
	border-top: 1px solid var(--story-hairline);
	border-bottom: 1px solid var(--story-hairline);
	padding-block: 1.75rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.25rem 2.5rem;
}
.story-toc__label {
	grid-column: 1 / -1;
	margin-bottom: 0.5rem;
}
.story-toc__item {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding-block: 0.4rem;
	color: var(--muted-foreground);
	border-bottom: 1px solid transparent;
	transition: color var(--motion-fast) var(--ease-out-soft);
}
.story-toc__item:hover {
	color: var(--foreground);
}
.story-toc__num {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--story-accent);
	min-width: 1.75rem;
}
.story-toc__name {
	font-size: var(--text-sm);
}

/* ======================================================== Article ===== */
/* One centred reading column; figures + quotes break out a little wider. */

.story {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: clamp(2rem, 5vw, 4rem);
}

.story-section {
	padding-block: clamp(3rem, 8vh, 6rem);
	border-top: 1px solid var(--story-hairline);
}
.story-section:first-of-type {
	border-top: none;
}

.story-col {
	max-width: var(--story-measure);
	margin-inline: auto;
}

/* Section heading block. */
.story-head {
	max-width: var(--story-measure);
	margin-inline: auto;
	margin-bottom: 2.25rem;
}
.story-head__kicker {
	display: block;
	margin-bottom: 0.9rem;
}
.story-head__title {
	font-size: clamp(1.75rem, 3.4vw, 2.6rem);
	font-weight: var(--mkt-weight-semibold);
	line-height: var(--mkt-line-tight);
	letter-spacing: var(--mkt-tracking-tight);
	color: var(--foreground);
	text-wrap: balance;
}

/* Body copy. */
.story-col p {
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-relaxed);
	color: color-mix(in oklch, var(--foreground) 88%, var(--muted-foreground));
}
.story-col p + p {
	margin-top: 1.25rem;
}
.story-col strong {
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
}
.story-lead-in {
	font-size: var(--mkt-text-xl) !important;
	color: var(--foreground) !important;
	line-height: var(--mkt-line-normal) !important;
}

/* Editorial lists. */
.story-list {
	max-width: var(--story-measure);
	margin: 1.5rem auto 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.85rem;
}
.story-list li {
	position: relative;
	padding-left: 1.5rem;
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-normal);
	color: color-mix(in oklch, var(--foreground) 88%, var(--muted-foreground));
}
.story-list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 999px;
	background: var(--story-accent);
}
.story-list li strong {
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
}

/* ==================================================== Pull-quote ====== */
/* site.css gives .pull-quote its serif/size; here is the block framing. */

.story-quote {
	max-width: 46rem;
	margin: 3rem auto;
	padding-block: 2.25rem;
	border-top: 1px solid var(--story-hairline-strong);
	border-bottom: 1px solid var(--story-hairline-strong);
	text-align: left;
}
.story-quote .pull-quote {
	max-width: 34ch;
}
.story-quote--center {
	text-align: center;
}
.story-quote--center .pull-quote {
	margin-inline: auto;
}

/* ================================================ Person↔Agent map ==== */

.map-table {
	max-width: var(--story-measure);
	margin: 2rem auto 0;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius);
	overflow: hidden;
	background: var(--card);
}
.map-row {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: 1rem;
	padding: 0.95rem 1.25rem;
	border-top: 1px solid var(--story-hairline);
	font-size: var(--text-sm);
}
.map-row:first-child {
	border-top: none;
}
.map-row--head {
	background: color-mix(in oklch, var(--muted) 60%, transparent);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
}
.map-row__k {
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
}
.map-row__v {
	color: var(--muted-foreground);
}
.map-row__v strong {
	color: var(--foreground);
	font-weight: var(--mkt-weight-medium);
}

/* ==================================================== Figures ========= */
/* Shared figure frame — a labelled whitepaper diagram, reveal-up only. */

.figure {
	max-width: var(--story-figure-max);
	margin: 2.75rem auto 0;
}
.figure__frame {
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius-lg);
	background: var(--card);
	padding: clamp(1.5rem, 3vw, 2.5rem);
	box-shadow: var(--mkt-shadow-xs);
}
.figure__caption {
	margin-top: 0.9rem;
	font-size: var(--text-xs);
	line-height: var(--mkt-line-normal);
	color: var(--muted-foreground);
}
.figure__caption b {
	font-family: var(--font-mono);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	font-weight: var(--mkt-weight-medium);
	color: var(--foreground);
	margin-right: 0.5rem;
}

/* ---- Figure 1 — the five elements row ------------------------------- */

.fig-five {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.75rem;
}
.fig-five__cell {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.1rem 0.9rem;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius);
	background: color-mix(in oklch, var(--muted) 35%, transparent);
}
.fig-five__cell--key {
	border-color: color-mix(in oklch, var(--story-accent) 45%, var(--border));
	background: var(--story-accent-soft);
}
.fig-five__glyph {
	width: 1.75rem;
	height: 1.75rem;
	color: var(--muted-foreground);
}
.fig-five__cell--key .fig-five__glyph {
	color: var(--story-accent);
}
.fig-five__name {
	font-size: var(--text-sm);
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
	letter-spacing: var(--mkt-tracking-tight);
}
.fig-five__desc {
	font-size: 0.75rem;
	line-height: var(--mkt-line-snug);
	color: var(--muted-foreground);
}

/* ---- Figure 2 — model = engine, harness = vehicle ------------------- */

.fig-engine {
	display: flex;
	justify-content: center;
}
/* The chassis is a labelled system boundary — the model sits inside it. */
.fig-engine__chassis {
	position: relative;
	width: 100%;
	max-width: 40rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.15rem;
	padding: 2.75rem 1.5rem 2rem;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius);
	background: color-mix(in oklch, var(--muted) 28%, transparent);
}
.fig-engine__label {
	position: absolute;
	top: 0.85rem;
	left: 1.1rem;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
}
.fig-engine__core {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 1.4rem 2.5rem;
	border-radius: var(--mkt-panel-radius);
	background: var(--story-accent);
	color: oklch(1 0 0);
	text-align: center;
	box-shadow: var(--mkt-shadow-sm);
}
.fig-engine__core-k {
	font-family: var(--font-mono);
	font-size: 0.75rem; /* ≥12px label floor */
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	opacity: 0.85;
}
.fig-engine__core-t {
	font-size: var(--mkt-text-lg);
	font-weight: var(--mkt-weight-semibold);
}
.fig-engine__ring-label {
	font-size: var(--text-xs);
	color: var(--muted-foreground);
	text-align: center;
}
.fig-engine__ring {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	max-width: 34rem;
}
.fig-engine__chip {
	padding: 0.5rem 0.85rem;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-radius-pill);
	background: color-mix(in oklch, var(--muted) 40%, transparent);
	font-size: var(--text-xs);
	color: var(--foreground);
	white-space: nowrap;
}

/* ---- Figure 3 — two kinds of harness ------------------------------- */

.fig-harness {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}
.fig-harness__col {
	padding: 0.5rem clamp(1rem, 2.5vw, 1.75rem);
}
.fig-harness__col + .fig-harness__col {
	border-left: 1px solid var(--story-hairline);
}
.fig-harness__col--key {
	position: relative;
}
.fig-harness__tag {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
}
.fig-harness__col--key .fig-harness__tag {
	color: var(--story-accent);
}
.fig-harness__title {
	margin-top: 0.5rem;
	font-size: var(--mkt-text-lg);
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
	letter-spacing: var(--mkt-tracking-tight);
}
/* Node motif: one dot (local) vs many dots fanning to a hub (enterprise). */
.fig-harness__viz {
	height: 4.5rem;
	margin: 1rem 0 1.1rem;
	display: flex;
	align-items: center;
	color: var(--muted-foreground);
}
.fig-harness__col--key .fig-harness__viz {
	color: var(--story-accent);
}
.fig-harness__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.5rem;
}
.fig-harness__list li {
	position: relative;
	padding-left: 1.1rem;
	font-size: var(--text-sm);
	line-height: var(--mkt-line-snug);
	color: var(--muted-foreground);
}
.fig-harness__list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 0.3rem;
	height: 0.3rem;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.55;
}

/* ---- Figure 4 — the phased path ------------------------------------ */

.fig-path {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.75rem;
	position: relative;
}
.fig-path__step {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
.fig-path__node {
	display: flex;
	align-items: center;
	gap: 0;
	position: relative;
}
.fig-path__dot {
	flex: none;
	width: 1.6rem;
	height: 1.6rem;
	display: grid;
	place-items: center;
	border-radius: 999px;
	border: 1.5px solid var(--story-hairline-strong);
	background: var(--card);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--foreground);
	z-index: 1;
}
.fig-path__step--end .fig-path__dot {
	border-color: var(--story-accent);
	background: var(--story-accent);
	color: oklch(1 0 0);
}
.fig-path__line {
	flex: 1;
	height: 1.5px;
	background: var(--story-hairline-strong);
}
.fig-path__step:last-child .fig-path__line {
	display: none;
}
.fig-path__phase {
	font-family: var(--font-mono);
	font-size: 0.75rem; /* ≥12px label floor */
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
}
.fig-path__step--end .fig-path__phase {
	color: var(--story-accent);
}
.fig-path__name {
	font-size: var(--text-sm);
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
	line-height: var(--mkt-line-snug);
}
.fig-path__desc {
	font-size: 0.75rem;
	line-height: var(--mkt-line-snug);
	color: var(--muted-foreground);
}

/* ============================================= Orchestration motif ==== */
/* Lightweight inline step-chain (goal → delegate → verify → compile). */

.loop-chain {
	max-width: var(--story-measure);
	margin: 1.75rem auto 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}
.loop-chain__step {
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-radius-pill);
	background: var(--card);
	font-size: var(--text-sm);
	font-weight: var(--mkt-weight-medium);
	color: var(--foreground);
}
.loop-chain__arrow {
	color: var(--story-accent);
	font-size: 0.9rem;
}

/* ================================================ Risk / commit table = */

.commit {
	max-width: var(--story-figure-max);
	margin: 2rem auto 0;
	display: grid;
	gap: 0.6rem;
}
.commit__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius);
	overflow: hidden;
	background: var(--card);
}
.commit__risk,
.commit__fix {
	padding: 1rem 1.15rem;
	font-size: var(--text-sm);
	line-height: var(--mkt-line-snug);
}
.commit__risk {
	color: var(--muted-foreground);
	background: color-mix(in oklch, var(--muted) 35%, transparent);
	border-right: 1px solid var(--story-hairline);
}
.commit__fix {
	color: var(--foreground);
	font-weight: var(--mkt-weight-medium);
}
.commit__fix::before {
	content: '';
	display: inline-block;
	width: 0.45rem;
	height: 0.45rem;
	margin-right: 0.55rem;
	border-radius: 999px;
	background: var(--story-accent);
	vertical-align: middle;
}
.commit__head {
	display: grid;
	grid-template-columns: 1fr 1fr;
	max-width: var(--story-figure-max);
	margin: 2rem auto 0;
}
.commit__head span {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
	padding-inline: 1.15rem;
}
.commit__head span:last-child {
	color: var(--story-accent);
}

/* Two-up commitment callouts (human-in-loop / kill switch). */
.callout-pair {
	max-width: var(--story-figure-max);
	margin: 2rem auto 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
.callout {
	border: 1px solid var(--story-hairline);
	border-left: 2px solid var(--story-accent);
	border-radius: var(--mkt-panel-radius);
	background: var(--card);
	padding: 1.25rem 1.4rem;
}
.callout__title {
	font-size: var(--text-sm);
	font-weight: var(--mkt-weight-semibold);
	color: var(--foreground);
	margin-bottom: 0.4rem;
}
.callout__body {
	font-size: var(--text-sm);
	line-height: var(--mkt-line-normal);
	color: var(--muted-foreground);
}

/* ================================================ Disavowals ========= */

.disavow {
	max-width: var(--story-measure);
	margin: 1.75rem auto 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.75rem;
}
.disavow li {
	position: relative;
	padding-left: 2rem;
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-normal);
	color: color-mix(in oklch, var(--foreground) 88%, var(--muted-foreground));
}
.disavow li strong {
	color: var(--foreground);
	font-weight: var(--mkt-weight-semibold);
}
.disavow li::before {
	content: '✕';
	position: absolute;
	left: 0;
	top: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--story-accent);
}

/* ==================================================== Close / CTA ===== */

.story-close {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: clamp(2rem, 5vw, 4rem);
	padding-block: clamp(4rem, 11vh, 8rem);
	border-top: 1px solid var(--story-hairline);
	text-align: center;
}
.story-close__line {
	max-width: 24ch;
	margin-inline: auto;
	font-family: var(--mkt-serif);
	font-style: italic;
	font-size: clamp(1.9rem, 4.2vw, 3rem);
	line-height: var(--mkt-line-snug);
	letter-spacing: var(--mkt-tracking-tight);
	color: var(--foreground);
	text-wrap: balance;
}
.story-close__sub {
	max-width: 52ch;
	margin: 1.75rem auto 0;
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-relaxed);
	color: var(--muted-foreground);
}
.story-cta {
	margin-top: 2.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

/* ========================================================= About ===== */

.about-hero {
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: clamp(2rem, 5vw, 4rem);
	padding-block: clamp(6rem, 16vh, 10rem) clamp(2rem, 5vh, 3rem);
}
.about-hero__title {
	max-width: 16ch;
}
.about-body {
	max-width: var(--story-measure);
}
.about-body p {
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-relaxed);
	color: color-mix(in oklch, var(--foreground) 88%, var(--muted-foreground));
}
.about-body p + p {
	margin-top: 1.25rem;
}

.contact-card {
	max-width: var(--story-measure);
	margin-top: 2rem;
	border: 1px solid var(--story-hairline);
	border-radius: var(--mkt-panel-radius-lg);
	background: var(--card);
	padding: clamp(1.75rem, 4vw, 2.5rem);
	box-shadow: var(--mkt-shadow-xs);
}
.contact-card__line {
	font-size: var(--mkt-text-lg);
	line-height: var(--mkt-line-relaxed);
	color: var(--muted-foreground);
	margin-bottom: 1.5rem;
	max-width: 46ch;
}
.contact-meta {
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--story-hairline);
	display: grid;
	gap: 0.75rem;
}
.contact-meta__row {
	display: flex;
	gap: 0.85rem;
	align-items: baseline;
	font-size: var(--text-sm);
	color: var(--muted-foreground);
}
.contact-meta__k {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--mkt-tracking-caps);
	color: var(--muted-foreground);
	min-width: 6rem;
}
.contact-meta__v {
	color: var(--foreground);
}

/* ==================================================== Responsive ====== */

@media (max-width: 900px) {
	.commit__head,
	.commit__row {
		grid-template-columns: 1fr;
	}
	.commit__risk {
		border-right: none;
		border-bottom: 1px solid var(--story-hairline);
	}
	.commit__head span:last-child {
		display: none;
	}
	.callout-pair {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.fig-five {
		grid-template-columns: 1fr 1fr;
	}
	.fig-path {
		grid-template-columns: 1fr;
		gap: 0;
	}
	/* Vertical timeline on narrow screens. */
	.fig-path__step {
		flex-direction: row;
		gap: 1rem;
		padding-bottom: 1.5rem;
	}
	.fig-path__node {
		flex-direction: column;
		align-self: stretch;
	}
	.fig-path__line {
		width: 1.5px;
		height: auto;
		flex: 1;
		min-height: 1.5rem;
	}
	.fig-path__step:last-child {
		padding-bottom: 0;
	}
	.fig-path__body {
		padding-top: 0.15rem;
	}
	.fig-harness {
		grid-template-columns: 1fr;
	}
	.fig-harness__col + .fig-harness__col {
		border-left: none;
		border-top: 1px solid var(--story-hairline);
		margin-top: 0.5rem;
		padding-top: 1.25rem;
	}
	.map-row {
		grid-template-columns: 1fr;
		gap: 0.3rem;
	}
	.map-row--head {
		display: none;
	}
	.map-row__k {
		font-size: var(--text-sm);
	}
}

@media (max-width: 460px) {
	.fig-five {
		grid-template-columns: 1fr;
	}
	.story-quote .pull-quote {
		max-width: none;
	}
}

/* Utility — keep compound terms (AI-enabled) on one line. */
.u-nobr {
	white-space: nowrap;
}
