/* ============================================================
   Velocitas — the Craft layer (inc/craft.php, ADR-007).
   Loads after theme.css and desk.css and only re-skins them:
   warm paper and ink, hairline frame with corner ticks, Archivo
   display type with an italic serif accent, mono HUD labels,
   square buttons that invert, light/dark modes, scroll reveals.
   HTML stories keep their own type and colour: on story pages
   only the chrome around them takes these tokens.
   ============================================================ */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ------------------------------------------------------ tokens */

:root {
	--c-bg: #f2f1ee;
	--c-raised: #faf9f7;
	--c-sunken: #e9e8e4;
	--c-ink: #101014;
	--c-strong: #000;
	--c-muted: #1010149e;
	--c-faint: #1010146b;
	--c-line: #10101429;
	--c-line-strong: #10101466;
	--c-accent: #2d81ff;
	--c-accent-ink: #1659c4;
	--c-accent-btn: #1659c4; /* white text on it: 6.2:1, in both modes */
	--c-invert-bg: #101014;
	--c-invert-fg: #f2f1ee;
	--c-scan: #10101408;

	--c-display: "Archivo", system-ui, sans-serif;
	--c-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--c-serif: "Instrument Serif", Georgia, serif;
	--c-mono: "Geist Mono", ui-monospace, "Cascadia Code", Menlo, monospace;

	--c-frame: 80rem;
	--c-pad: clamp(1.25rem, 4vw, 2.5rem);
	--c-head: 3.5rem;
	--c-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
	--c-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	color-scheme: light;
}

:root[data-theme="dark"] {
	--c-bg: #121316;
	--c-raised: #18191d;
	--c-sunken: #060607;
	--c-ink: #f2f1ee;
	--c-strong: #fff;
	--c-muted: #f2f1ee99;
	--c-faint: #f2f1ee61;
	--c-line: #f2f1ee26;
	--c-line-strong: #f2f1ee66;
	--c-accent-ink: #74aaff;
	--c-invert-bg: #fff;
	--c-invert-fg: #0b0b0c;
	--c-scan: #ffffff06;
	color-scheme: dark;
}
/* Without the head script (no JS) the system preference decides. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--c-bg: #121316;
		--c-raised: #18191d;
		--c-sunken: #060607;
		--c-ink: #f2f1ee;
		--c-strong: #fff;
		--c-muted: #f2f1ee99;
		--c-faint: #f2f1ee61;
		--c-line: #f2f1ee26;
		--c-line-strong: #f2f1ee66;
		--c-accent-ink: #74aaff;
		--c-invert-bg: #fff;
		--c-invert-fg: #0b0b0c;
		--c-scan: #ffffff06;
		color-scheme: dark;
	}
}

/* Theme tokens and theme.json presets, re-pointed. Both are needed: --v-* were
   resolved on :root, the presets feed WordPress's global styles. */
body.craft:not(.story-page),
.craft.story-page :is(.site-header, .site-footer, .breadcrumbs, .entry-header, .entry-footer, .doc-endmatter, .related, .comments-area, .post-navigation, .pagination) {
	--v-ink: var(--c-ink);
	--v-paper: var(--c-bg);
	--v-sand: var(--c-sunken);
	--v-hairline: var(--c-line);
	--v-muted: var(--c-muted);
	--v-accent: var(--c-accent-ink);
	--v-accent-dark: var(--c-ink);
	--v-serif: var(--c-body);
	--v-sans: var(--c-body);
	--v-mono: var(--c-mono);
	--v-radius: 0px;
	--v-shadow: 0 1px 0 var(--c-line), 0 18px 40px -24px rgb(0 0 0 / 0.35);
	--v-wide: calc(var(--c-frame) - 2 * var(--c-pad));

	--wp--preset--color--ink: var(--c-ink);
	--wp--preset--color--paper: var(--c-bg);
	--wp--preset--color--sand: var(--c-sunken);
	--wp--preset--color--hairline: var(--c-line);
	--wp--preset--color--muted: var(--c-muted);
	--wp--preset--color--accent: var(--c-accent-ink);
	--wp--preset--color--accent-dark: var(--c-ink);
	--wp--preset--font-family--serif: var(--c-body);
	--wp--preset--font-family--sans: var(--c-body);
	--wp--preset--font-family--mono: var(--c-mono);
}

/* ------------------------------------------------------ base */

html:has(body.craft:not(.story-page)) { background: var(--c-bg); }

body.craft:not(.story-page) {
	background: transparent;
	color: var(--c-ink);
	font-family: var(--c-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* The frame: two hairlines bounding the 1280px column, behind everything. */
body.craft:not(.story-page)::before {
	content: "";
	position: fixed;
	inset: 0 auto 0 50%;
	z-index: -1;
	width: min(100%, var(--c-frame));
	transform: translateX(-50%);
	border-inline: 1px solid var(--c-line);
	pointer-events: none;
}

.craft ::selection { background: var(--c-accent-btn); color: #fff; }
.craft :focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 0; }

/* :where() keeps this at one class, so component title colours win. */
:where(.craft) :where(h1, h2, h3, h4, h5, h6):not(.story-content *) {
	font-family: var(--c-display);
	font-weight: 500;
	letter-spacing: -0.025em;
	color: var(--c-strong);
}

.craft-accent {
	font-family: var(--c-serif);
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.01em;
	color: var(--c-muted);
}

/* HUD labels: mono, tracked, uppercase. */
.craft :is(.desk-kicker, .desk-meta, .desk-section__title, .desk-stat dt, .desk-chart__cap, .desk-chart__src, .desk-chart__label, .desk-topic__n,
	.entry-kicker, .entry-meta, .post-card__kicker, .post-card__meta, .breadcrumbs ol, .site-tagline, .front-feed__title, .related__title,
	.page-kicker, .widget-title, .toc__title, .colophon__line, .footer-menu a, .author-box__eyebrow, .comment-date,
	.about-latest .wp-block-latest-posts__post-date) {
	font-family: var(--c-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

/* Corner tick: a small hairline cross. */
.craft-tick,
.craft .desk > section::before,
.craft .desk > section::after,
.craft .desk-lead__media::before,
.craft .desk-lead__media::after,
.craft .subscribe-panel::before,
.craft .subscribe-panel::after {
	content: "";
	position: absolute;
	z-index: 2;
	width: 11px;
	height: 11px;
	background:
		linear-gradient(var(--c-line-strong), var(--c-line-strong)) center / 1px 100% no-repeat,
		linear-gradient(var(--c-line-strong), var(--c-line-strong)) center / 100% 1px no-repeat;
	pointer-events: none;
}

/* ------------------------------------------------------ buttons */

.craft :is(.desk-btn, .wp-block-button__link, .contact__send, .comment-form .submit, .search-form__button, .subscribe-panel .subscribe__send, .about-cta .wp-block-button__link) {
	border-radius: 0;
	font-family: var(--c-mono);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	transition: background-color 0.12s linear, color 0.12s linear, border-color 0.12s linear;
}
.craft .desk-btn {
	gap: 0.6rem;
	padding: 0.8rem 1.15rem;
	border: 1px solid var(--c-invert-bg);
	background: var(--c-invert-bg);
	color: var(--c-invert-fg);
}
.craft .desk-btn::after {
	content: "→";
	font-family: var(--c-body);
	letter-spacing: 0;
	transition: transform 0.35s var(--c-ease);
}
.craft .desk-btn:hover { background: var(--c-accent-btn); border-color: var(--c-accent-btn); color: #fff; }
.craft .desk-btn:hover::after { transform: translateX(3px); }
.craft .desk-btn--ghost { background: transparent; border-color: var(--c-line-strong); color: var(--c-ink); }
.craft .desk-btn--ghost:hover { background: var(--c-invert-bg); border-color: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft :is(.wp-block-button__link, .contact__send, .comment-form .submit) {
	background: var(--c-invert-bg);
	color: var(--c-invert-fg);
	border: 1px solid var(--c-invert-bg);
}
.craft :is(.wp-block-button__link, .contact__send, .comment-form .submit):hover { background: var(--c-accent-btn); border-color: var(--c-accent-btn); color: #fff; }

/* ------------------------------------------------------ forms */

.craft :is(input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select):not(.story-content *) {
	border-radius: 0;
	border-color: var(--c-line-strong);
	background: var(--c-raised);
	color: var(--c-ink);
	font-family: var(--c-body);
}
.craft :is(input, textarea, select):not(.story-content *):focus { border-color: var(--c-ink); outline: none; }

/* ------------------------------------------------------ header */

.craft .site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid transparent;
	background: color-mix(in srgb, var(--c-bg) 74%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	transition: border-color 0.3s ease, background-color 0.3s ease;
}
.craft .site-header.is-scrolled { border-bottom-color: var(--c-line); }
.admin-bar.craft .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.craft .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar.craft .site-header { top: 0; } }

.craft .masthead {
	width: min(100%, var(--c-frame));
	min-height: var(--c-head);
	padding: 0.45rem var(--c-pad);
	gap: 1rem;
}
.craft .site-title { font-family: var(--c-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; }
.craft .site-title a { color: var(--c-strong); }
.craft .site-tagline { margin-top: 0.1rem; color: var(--c-muted); font-size: 0.6rem; }
.craft .custom-logo-link img { max-height: 2.25rem; }
.craft .site-header__nav { gap: 0.75rem; }

.craft .nav-menu a {
	padding: 0.5rem 0.7rem;
	font-family: var(--c-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--c-muted);
	transition: background-color 0.12s linear, color 0.12s linear;
}
.craft .nav-menu a:hover { background: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .nav-menu :is(.current-menu-item, .current_page_item, .current-menu-ancestor) > a { color: var(--c-strong); font-weight: 600; box-shadow: inset 0 -1px 0 currentColor; }
.craft .nav-menu .sub-menu { padding: 0.25rem; background: var(--c-raised); border-color: var(--c-line); }
.craft .submenu-toggle { color: var(--c-muted); border-radius: 0; }

.craft .search-form__field {
	width: 9.5rem;
	padding: 0.5rem 0.7rem;
	font-size: 0.8125rem;
	background: transparent;
	transition: width 0.4s var(--c-ease), border-color 0.12s linear;
}
.craft .search-form__field:focus { width: 13rem; }
.craft .search-form__button { width: 2.25rem; height: 2.25rem; background: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .search-form__button:hover { background: var(--c-accent-btn); color: #fff; }

.craft-mode {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid var(--c-line-strong);
	background: transparent;
	color: var(--c-ink);
	cursor: pointer;
	transition: background-color 0.12s linear, color 0.12s linear, border-color 0.12s linear;
}
.craft-mode:hover { background: var(--c-invert-bg); border-color: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft-mode svg { grid-area: 1 / 1; transition: transform 0.5s var(--c-ease), opacity 0.3s ease; }
.craft-mode__sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"] .craft-mode__sun { opacity: 1; transform: none; }
[data-theme="dark"] .craft-mode__moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

.craft .nav-toggle { border-radius: 0; border-color: var(--c-line-strong); }
.craft .nav-toggle__bar, .craft .nav-toggle__bar::before, .craft .nav-toggle__bar::after { height: 1.5px; background: var(--c-ink); }
.craft .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }

.craft .reading-progress { height: 2px; }
.craft .reading-progress__bar { background: var(--c-accent); }

/* ------------------------------------------------------ layout */

.craft:not(.welcome-page):not(.about-page):not(.story-page) .site-content {
	width: min(100%, var(--c-frame));
	padding-inline: var(--c-pad);
}

.craft .breadcrumbs ol { gap: 0.5rem; color: var(--c-muted); }
.craft .breadcrumbs li + li::before { content: "/"; color: var(--c-faint); }
.craft .breadcrumbs a { color: var(--c-muted); }
.craft .breadcrumbs a:hover { color: var(--c-strong); }

/* ------------------------------------------------------ data desk */

.craft .desk { --desk-pad: max(var(--c-pad), calc((100% - var(--c-frame)) / 2 + var(--c-pad))); }
.craft .desk { overflow-x: clip; }
.craft .desk > section { position: relative; }
.craft .desk > section::before { top: -6px; left: calc(max(0px, (100% - var(--c-frame)) / 2) - 5px); }
.craft .desk > section::after { top: -6px; right: calc(max(0px, (100% - var(--c-frame)) / 2) - 5px); }
.craft .desk > section:first-child::before,
.craft .desk > section:first-child::after { display: none; }

.craft .desk-mast {
	align-items: flex-end;
	padding-block: clamp(4rem, 11vw, 9rem) clamp(2.5rem, 5vw, 4rem);
	border-bottom: 1px solid var(--c-line);
	background-image: repeating-linear-gradient(to bottom, var(--c-scan) 0 1px, transparent 1px 4px);
}
.craft .desk-mast__copy { max-width: 58rem; }

/* Hero background (inc/craft.php + js/orbit.js): rings on a canvas and the
   latest stories as frames, all behind the copy. */
.craft .desk-mast { position: relative; overflow: hidden; isolation: isolate; }
.craft .desk-mast > :not(.craft-orbit) { position: relative; z-index: 2; }
.craft .desk-mast__copy { pointer-events: none; }
.craft .desk-mast__copy a { pointer-events: auto; }
.craft-orbit { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.craft-orbit__rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.craft-orbit__card {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: calc(5.5rem + 4.5rem * var(--d));
	translate: -50% -50%;
	opacity: 0.5;
	color: var(--c-ink);
	text-decoration: none;
	pointer-events: auto;
	will-change: transform, opacity;
}
.craft-orbit__inner {
	display: block;
	padding: 0.4rem 0.4rem 0.55rem;
	border: 1px solid var(--c-line-strong);
	background: color-mix(in srgb, var(--c-raised) 78%, transparent);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	transition: border-color 0.3s ease, background-color 0.3s ease;
}
.craft-orbit__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.craft-orbit__media img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(0.92); transition: filter 0.5s ease; }
.craft-orbit__media--empty { background: repeating-linear-gradient(135deg, var(--c-line) 0 1px, transparent 1px 8px); }
.craft-orbit__title {
	display: -webkit-box;
	margin-top: 0.45rem;
	overflow: hidden;
	font-family: var(--c-display);
	font-size: calc(0.56rem + 0.16rem * var(--d));
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.craft-orbit__date { display: block; margin-top: 0.25rem; font-family: var(--c-mono); font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted); }
.craft-orbit__card:is(:hover, .is-near) .craft-orbit__inner { border-color: var(--c-ink); background: var(--c-raised); }
.craft-orbit__card:is(:hover, .is-near) img { filter: none; }
.craft-orbit__card:hover { opacity: 1 !important; }

/* Narrower screens: fewer, fainter frames; phones keep only the rings. */
@media (max-width: 1100px) {
	.craft-orbit__card:nth-child(n + 6) { display: none; }
	.craft-orbit__card { width: calc(4.5rem + 3.5rem * var(--d)); }
}
@media (max-width: 760px) {
	.craft-orbit__card { display: none; }
	.craft-orbit__rings { opacity: 0.7; }
}
.craft .desk-kicker { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.5rem; color: var(--c-muted); }
.craft .desk-kicker::before { content: ""; width: 6px; height: 6px; background: var(--c-accent); }
.craft .desk-mast__title {
	font-size: clamp(2.75rem, 7.4vw, 6.25rem);
	font-weight: 500;
	line-height: 0.96;
	letter-spacing: -0.045em;
	color: var(--c-strong);
}
.craft .desk-mast__lede { max-width: 36rem; margin-top: 1.5rem; font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--c-muted); }
.craft .desk-mast__links { gap: 0.5rem; }

.craft .desk-meta { gap: 0.25rem 1rem; font-size: 0.65rem; color: var(--c-muted); }
.craft .desk-meta__tag { color: var(--c-accent-ink); font-weight: 600; }

.craft .desk-lead {
	gap: clamp(1.5rem, 4vw, 4rem);
	padding-block: clamp(2rem, 5vw, 4rem);
	border-bottom: 1px solid var(--c-line);
}
.craft :is(.desk-lead__media, .desk-card__media) { position: relative; border-color: var(--c-line); border-radius: 0; }
.craft .desk-lead__media::before { top: 8px; left: 8px; opacity: 0.7; }
.craft .desk-lead__media::after { right: 8px; bottom: 8px; opacity: 0.7; }
.craft :is(.desk-lead__img, .desk-card__img) { transition: transform 0.9s var(--c-ease-out); }
.craft :is(.desk-lead__media:hover .desk-lead__img, .desk-card:hover .desk-card__img) { transform: scale(1.035); }
.craft .desk-lead__title { margin-top: 1rem; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.02; letter-spacing: -0.04em; }
.craft :is(.desk-lead__title, .desk-card__title) a { color: var(--c-strong); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--c-ease); }
.craft :is(.desk-lead__title, .desk-card__title) a:hover { color: var(--c-strong); background-size: 100% 1px; }
.craft .desk-lead__dek { margin-top: 1.1rem; font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.55; }
.craft .desk-lead__foot { margin-top: 1.75rem; }

/* Sections: the head becomes a sticky, blurred bar whose rule draws in. */
.craft .desk-section { padding-top: 0; border-bottom: 1px solid var(--c-line); }
.craft .desk-section__head {
	position: sticky;
	top: calc(var(--c-head) + 1px);
	z-index: 5;
	align-items: center;
	margin: 0 calc(-1 * var(--c-pad)) clamp(1.5rem, 3vw, 2.25rem);
	padding: 0.85rem var(--c-pad);
	background:
		linear-gradient(var(--c-line), var(--c-line)) 0 100% / var(--draw, 100%) 1px no-repeat,
		color-mix(in srgb, var(--c-bg) 62%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}
.admin-bar.craft .desk-section__head { top: calc(var(--c-head) + 33px); }
@media (max-width: 782px) { .admin-bar.craft .desk-section__head { top: calc(var(--c-head) + 47px); } }
@media (max-width: 600px) { .admin-bar.craft .desk-section__head { top: calc(var(--c-head) + 1px); } }
.craft .desk-section__title { color: var(--c-muted); }
.craft .desk-more { font-family: var(--c-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--c-muted); }
.craft .desk-more:hover { color: var(--c-strong); text-decoration: none; }
.craft .desk-more span { display: inline-block; transition: transform 0.35s var(--c-ease); }
.craft .desk-more:hover span { transform: translateX(3px); }

/* Latest stories: a hairline grid that runs to the frame. */
.craft .desk-section:has(> .desk-grid) { padding-bottom: 0; }
.craft .desk-grid {
	gap: 0;
	margin: calc(-1 * clamp(1.5rem, 3vw, 2.25rem)) calc(-1 * var(--c-pad)) 0;
}
.craft .desk-card {
	padding: clamp(1.25rem, 2.5vw, 1.75rem) var(--c-pad) clamp(1.5rem, 3vw, 2.25rem);
	border-right: 1px solid var(--c-line);
	border-bottom: 1px solid var(--c-line);
	transition: background-color 0.25s ease;
}
.craft .desk-card:nth-child(3n) { border-right: 0; }
.craft .desk-card:hover { background: var(--c-raised); }
.craft .desk-card__media { margin-bottom: 1.1rem; }
.craft .desk-card__title { margin-top: 0.6rem; font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.15; letter-spacing: -0.025em; }

.craft .desk-topics { gap: 0.4rem; }
.craft .desk-topic {
	gap: 0.75rem;
	padding: 0.55rem 0.9rem;
	border-color: var(--c-line-strong);
	border-radius: 0;
	color: var(--c-ink);
	font-size: 0.875rem;
	transition: background-color 0.12s linear, color 0.12s linear, border-color 0.12s linear;
}
.craft .desk-topic:hover { background: var(--c-invert-bg); border-color: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .desk-topic:hover .desk-topic__n { color: inherit; }
.craft .desk-topic__n { color: var(--c-muted); font-size: 0.6rem; }

.craft .desk-stats { gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); }
.craft .desk-stat { padding: 1.25rem 1.25rem 1.4rem; background: var(--c-bg); }
.craft .desk-stat dt { color: var(--c-muted); font-size: 0.6rem; }
.craft .desk-stat dd { margin-top: 0.6rem; font-family: var(--c-display); font-weight: 500; letter-spacing: -0.04em; color: var(--c-strong); }
.craft .desk-chart__bars { border-bottom-color: var(--c-line-strong); }
.craft .desk-chart__bar { background: var(--c-accent); border-radius: 0; transform-origin: bottom; transition: transform 1.1s var(--c-ease-out); }
html.craft-motion.craft-ready .desk-chart:not(.is-in) .desk-chart__bar { transform: scaleY(0); }
.craft .desk-chart__label { color: var(--c-muted); }

.craft .desk-about { background: var(--c-invert-bg); color: var(--c-invert-fg); border-top: 0; }
.craft .desk-about::before, .craft .desk-about::after { display: none; }
.craft .desk-about__title { color: var(--c-invert-fg); font-size: clamp(2rem, 4.5vw, 3.75rem); line-height: 0.98; letter-spacing: -0.04em; }
.craft .desk-about__body { color: color-mix(in srgb, var(--c-invert-fg) 72%, transparent); font-size: 1.0625rem; }
.craft .desk-btn--light { background: var(--c-invert-fg); border-color: var(--c-invert-fg); color: var(--c-invert-bg); }
.craft .desk-btn--light:hover { background: var(--c-accent-btn); border-color: var(--c-accent-btn); color: #fff; }
.craft .desk-btn--outline { background: transparent; border-color: color-mix(in srgb, var(--c-invert-fg) 45%, transparent); color: var(--c-invert-fg); }
.craft .desk-btn--outline:hover { background: var(--c-invert-fg); border-color: var(--c-invert-fg); color: var(--c-invert-bg); }

@media (max-width: 900px) {
	.craft .desk-card:nth-child(3n) { border-right: 1px solid var(--c-line); }
	.craft .desk-card:nth-child(2n) { border-right: 0; }
}
@media (max-width: 600px) {
	.craft .desk-card { border-right: 0 !important; }
	.craft .desk-mast__links { width: 100%; }
}

/* ------------------------------------------------------ cards & archives */

.craft .post-card {
	border-color: var(--c-line);
	border-radius: 0;
	background: var(--c-bg);
	transition: background-color 0.25s ease, border-color 0.25s ease;
}
.craft .post-card:hover { transform: none; box-shadow: none; background: var(--c-raised); border-color: var(--c-line-strong); }
.craft .post-card__media { background: var(--c-sunken); }
.craft .post-card__media img { transition: transform 0.9s var(--c-ease-out); }
.craft .post-card__kicker { color: var(--c-accent-ink); }
.craft .post-card__title { font-family: var(--c-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.craft .post-card__title a { color: var(--c-strong); }
.craft .post-card__title a:hover { color: var(--c-accent-ink); }
.craft .post-card__excerpt { color: var(--c-muted); }
.craft .post-card--hero { border: 0; }
.craft .post-card--hero .post-card__kicker { border-radius: 0; background: var(--c-accent-btn); color: #fff; }
.craft .post-card--hero .post-card__title,
.craft .post-card--hero .post-card__title a { color: #fff; }
.craft .post-card--hero .post-card__excerpt { color: rgb(255 255 255 / 0.85); }
.craft .post-card--hero .post-card__meta { color: rgb(255 255 255 / 0.7); }
.craft .front-feed__title { border-top: 1px solid var(--c-line-strong); color: var(--c-muted); }

.craft .page-header { padding-bottom: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--c-line); }
.craft .page-title { font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.04em; }
.craft .page-kicker { color: var(--c-muted); }

.craft .pagination :is(a, span) { border-radius: 0; border-color: var(--c-line-strong); font-family: var(--c-mono); font-size: 0.75rem; }
.craft .pagination a:hover { background: var(--c-invert-bg); border-color: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .pagination .current { background: var(--c-invert-bg); border-color: var(--c-invert-bg); color: var(--c-invert-fg); }

/* ------------------------------------------------------ single (non-story) */

.craft:not(.story-page) .entry-kicker { color: var(--c-accent-ink); text-decoration: none; }
.craft:not(.story-page) .entry-title { font-size: clamp(2.25rem, 5.2vw, 4.25rem); line-height: 1; letter-spacing: -0.045em; text-wrap: balance; }
.craft:not(.story-page) .entry-standfirst { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--c-muted); }
.craft .entry-meta { color: var(--c-muted); }
.craft .entry-meta a { color: var(--c-ink); }
.craft:not(.story-page) .entry-media img { border: 1px solid var(--c-line); }
.craft .entry-content { font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.125rem); line-height: 1.72; }
.craft .entry-content a { color: var(--c-accent-ink); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.craft .entry-content a:hover { text-decoration-color: currentColor; }
.craft .entry-content :is(h2, h3) { letter-spacing: -0.03em; line-height: 1.12; }
.craft .entry-content blockquote { border-left-color: var(--c-accent); }
.craft .entry-content blockquote p { font-family: var(--c-serif); font-style: italic; font-size: 1.35em; line-height: 1.35; color: var(--c-strong); }
.craft .entry-content :is(code, pre) { font-family: var(--c-mono); }
.craft .entry-content pre { border-radius: 0; background: var(--c-sunken); border: 1px solid var(--c-line); }
.craft.has-dropcap .entry-content > p:first-of-type::first-letter { font-family: var(--c-display); font-weight: 500; color: var(--c-strong); }
.craft .toc { border-radius: 0; border-color: var(--c-line); background: var(--c-raised); }
.craft .entry-tags a { border-radius: 0; border-color: var(--c-line-strong); font-family: var(--c-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }

.craft .author-box, .craft .comments-area, .craft .related { border-color: var(--c-line); border-radius: 0; }
.craft .author-box { background: var(--c-raised); }
.craft .comment-body { border-radius: 0; border-color: var(--c-line); }
.craft .post-navigation a { border-radius: 0; border-color: var(--c-line); }
.craft .post-navigation a:hover { background: var(--c-raised); border-color: var(--c-line-strong); }
.craft .related__title { color: var(--c-muted); border-color: var(--c-line-strong); }

/* Story pages: chrome only. The story's own type and colour are untouched. */
.craft.story-page .entry-header--dateline { font-family: var(--c-body); }

/* ------------------------------------------------------ About & Contact */

.craft .about { --about-pad: max(var(--c-pad), calc((100% - var(--c-frame)) / 2 + var(--c-pad))); }
.craft .about-hero { border-bottom-color: var(--c-line); background-image: repeating-linear-gradient(to bottom, var(--c-scan) 0 1px, transparent 1px 4px); }
.craft .about-hero__title { font-weight: 500; letter-spacing: -0.055em; color: var(--c-strong); }
.craft .about-pov { border-bottom-color: var(--c-line); }
.craft .about-pov__body { font-family: var(--c-display); font-weight: 400; letter-spacing: -0.03em; color: var(--c-strong); }
.craft .about-principles { background-color: var(--c-line); } /* not the shorthand: it would reset background-clip */
.craft .about-principle { background: var(--c-bg); border: 0; transition: background-color 0.25s ease; }
.craft .about-principle:hover { background: var(--c-raised); }
.craft .about-latest .wp-block-latest-posts__featured-image img { border-color: var(--c-line); border-radius: 0; }
.craft .about-latest .wp-block-latest-posts__post-title { font-family: var(--c-display); font-weight: 500; letter-spacing: -0.025em; color: var(--c-strong); }
.craft .about__content > .about-latest__title { border-top-color: var(--c-line); }
.craft .about-cta { background: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .about-cta__title { color: var(--c-invert-fg); letter-spacing: -0.04em; }
.craft .about-cta__body { color: color-mix(in srgb, var(--c-invert-fg) 72%, transparent); }
.craft .about-cta .wp-block-button__link { padding: 0.85rem 1.2rem; background: var(--c-invert-fg); border-color: var(--c-invert-fg); color: var(--c-invert-bg); }
.craft .about-cta .wp-block-button__link:hover { background: var(--c-accent-btn); border-color: var(--c-accent-btn); color: #fff; }

.craft .contact__notice { border-radius: 0; }

/* ------------------------------------------------------ sidebar & widgets */

.craft .widget-title { color: var(--c-muted); }
/* Block widgets title themselves with plain headings: same HUD label. */
.craft .site-sidebar .widget :is(h2, h3, .wp-block-heading, .wp-block-search__label) {
	margin: 0 0 0.85rem;
	font-family: var(--c-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--c-muted);
}
.craft .site-sidebar .widget { margin-bottom: 2.25rem; }
.craft .site-sidebar .widget { border-color: var(--c-line); border-radius: 0; }

/* ------------------------------------------------------ footer */

.craft .site-footer { margin-top: 0; background: transparent; border-top: 1px solid var(--c-line); }
.craft.story-page .site-footer { background: var(--c-bg); }
.craft .footer-widgets { width: min(100%, var(--c-frame)); padding: clamp(2rem, 5vw, 3.5rem) var(--c-pad); }

.craft .subscribe-panel {
	position: relative;
	padding: clamp(1.75rem, 4vw, 3rem);
	border: 1px solid var(--c-line);
	border-radius: 0;
	background: var(--c-raised);
	color: var(--c-ink);
}
.craft .subscribe-panel::before { top: -6px; left: -6px; }
.craft .subscribe-panel::after { right: -6px; bottom: -6px; }
.craft .subscribe-panel__title { color: var(--c-strong); font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1; letter-spacing: -0.04em; }
.craft .subscribe-panel__body { color: var(--c-muted); font-size: 1rem; }
.craft .subscribe-panel input.subscribe__email { border: 1px solid var(--c-line-strong); border-radius: 0; background: var(--c-bg); color: var(--c-ink); font-size: 1rem; }
.craft .subscribe-panel input.subscribe__email::placeholder { color: var(--c-muted); }
.craft .subscribe-panel input.subscribe__email:focus-visible { border-color: var(--c-ink); outline: 2px solid var(--c-accent); }
.craft .subscribe-panel .subscribe__send { padding: 0.8rem 1.3rem; background: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .subscribe-panel .subscribe__send:hover { background: var(--c-accent-btn); color: #fff; }
.craft .subscribe-panel .subscribe__send:focus-visible { outline: 2px solid var(--c-accent); }
.craft .subscribe-panel :is(.subscribe__fine, .subscribe__note) { color: var(--c-muted); }
.craft .subscribe-panel .subscribe__note--ok { color: #1f9d55; }
.craft .subscribe-panel .subscribe__note--error { color: #b3261e; }

.craft-wordmark {
	width: min(100%, var(--c-frame));
	margin: 0 auto;
	padding: clamp(1rem, 3vw, 2rem) var(--c-pad) 0;
	overflow: hidden;
	font-family: var(--c-display);
	/* Fit the name to the frame: ~0.62em per character at this tracking. */
	font-size: clamp(2.5rem, calc((min(100vw, var(--c-frame)) - 2 * var(--c-pad)) / (var(--wm-chars, 7) * 0.62)), 15.5rem);
	font-weight: 600;
	line-height: 0.78;
	letter-spacing: -0.065em;
	white-space: nowrap;
	color: transparent;
	background: linear-gradient(to bottom, var(--c-ink) 15%, color-mix(in srgb, var(--c-ink) 6%, transparent) 95%);
	-webkit-background-clip: text;
	background-clip: text;
	user-select: none;
}
.craft .colophon {
	width: min(100%, var(--c-frame));
	padding: 1.1rem var(--c-pad) 1.4rem;
	border-top: 1px solid var(--c-line);
}
.craft .footer-menu a { padding: 0.4rem 0.6rem; color: var(--c-muted); }
.craft .footer-menu a:hover { background: var(--c-invert-bg); color: var(--c-invert-fg); }
.craft .colophon__line { color: var(--c-muted); }
.craft .colophon__line a { color: var(--c-muted); text-decoration: none; }
.craft .colophon__line a:hover { color: var(--c-strong); }

/* ------------------------------------------------------ mobile nav */

@media (max-width: 880px) {
	.craft .site-header { position: sticky; }
	.craft .site-header__nav {
		padding: 1rem var(--c-pad) 1.5rem;
		background: var(--c-bg);
		border-bottom: 1px solid var(--c-line);
		box-shadow: 0 24px 40px -28px rgb(0 0 0 / 0.4);
	}
	.craft .nav-menu a { padding: 0.85rem 0.25rem; font-size: 0.75rem; border-bottom: 1px solid var(--c-line); }
	.craft .nav-menu a:hover { background: transparent; color: var(--c-strong); }
	.craft .search-form__field, .craft .search-form__field:focus { width: 100%; }
}

/* ------------------------------------------------------ motion */

/* Reveal list — keep in step with REVEAL in theme.js. */
html.craft-motion :is(.desk-mast__copy > *, .desk-mast__links, .desk-lead__media, .desk-lead__body, .desk-section__head, .desk-card, .desk-topics > li, .desk-stat, .desk-chart, .desk-about > div, .page-header, .post-card, .about__content > *, .related__title, .subscribe-panel, .craft-wordmark, .no-results, body:not(.story-page) .entry-header > *):not(.is-in) {
	opacity: 0;
	transform: translate3d(0, 18px, 0);
}
html.craft-motion :is(.desk-mast__copy > *, .desk-mast__links, .desk-lead__media, .desk-lead__body, .desk-section__head, .desk-card, .desk-topics > li, .desk-stat, .desk-chart, .desk-about > div, .page-header, .post-card, .about__content > *, .related__title, .subscribe-panel, .craft-wordmark, .no-results, body:not(.story-page) .entry-header > *) {
	transition: opacity 0.9s var(--c-ease-out), transform 0.9s var(--c-ease-out), background-color 0.25s ease, border-color 0.25s ease, --draw 1.2s var(--c-ease-out);
}
/* If the script never arrives, show everything after a moment anyway. */
html.craft-motion:not(.craft-ready) :is(.desk-mast__copy > *, .desk-mast__links, .desk-lead__media, .desk-lead__body, .desk-section__head, .desk-card, .desk-topics > li, .desk-stat, .desk-chart, .desk-about > div, .page-header, .post-card, .about__content > *, .related__title, .subscribe-panel, .craft-wordmark, .no-results, body:not(.story-page) .entry-header > *) {
	animation: craft-failsafe 0.6s ease 2.5s both;
}
@keyframes craft-failsafe { to { opacity: 1; transform: none; } }

/* Section rules draw in from the left. */
@property --draw { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
html.craft-motion.craft-ready .desk-section__head:not(.is-in) { --draw: 0%; }

/* Colour-mode switch: everything cross-fades together. */
html.craft-fade *, html.craft-fade *::before, html.craft-fade *::after {
	transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease, stroke 0.4s ease !important;
}

@media (prefers-reduced-motion: reduce) {
	.craft-mode svg, .craft .desk-btn::after { transition: none; }
}

@media print {
	.craft-mode, .craft-wordmark { display: none !important; }
	body.craft::before { display: none; }
}
