/*
 * bytecreation main stylesheet.
 *
 * Tokens are defined in critical.css (inlined before this file) — do not
 * redeclare them here. Values come from docs/design-tokens.json.
 */

/* ---------- Self-hosted fonts ---------- */

/*
 * Variable woff2 subsets (latin), served from the theme. The <link>
 * preloads in the head reference the same files; font-display: swap keeps
 * first paint independent of the download.
 */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-var.woff2") format("woff2");
}

@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 100 800;
	font-display: swap;
	src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
}

/* ---------- Base ---------- */

img,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--bc-accent);
	text-decoration: none;
	transition: color 120ms ease;
}

/* Hover ink comes from the token, not theme.json: the style engine emits
   static palette hexes, so its link hover froze the light-mode ink colour
   (#191C1F) over the dark background - invisible. Kept as a token pair. */
a:hover {
	color: var(--bc-fg);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/* Body-copy links are underlined, not accent-coloured only: colour alone is the
   only signal today, which fails WCAG 1.4.1 (user request 2026-10-27). Scoped to
   article prose; the interface-ish links that live inside the_content stay plain
   - the TOC is injected by bytecreation_content_toc(), the hub mosaic tiles are
   whole clickable cards, and neither should read as inline prose links. */
.entry-content a {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.entry-content .bc-toc a,
.entry-content .bc-mosaic-tile {
	text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--bc-accent);
	outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 2.5rem 0 1rem;
}

h1 {
	font-size: 2.08rem;
	line-height: 1.25;
	letter-spacing: -0.02em;
	margin-top: 0;
}

h2 {
	font-size: 1.66rem;
}

h3 {
	font-size: 1.33rem;
}

h4 {
	font-size: 1.0625rem;
}

p {
	margin: 0 0 1.25rem;
}

ul,
ol {
	margin: 0 0 1.25rem;
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.35rem;
}

hr {
	border: 0;
	border-top: 1px solid var(--bc-rule);
	margin: 2rem 0;
}

/* ---------- Layout ---------- */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1;
	width: 100%;
	max-width: 61rem; /* 58rem content + 1.5rem gutters, ADR-11 rev3 */
	margin: 0 auto;
	padding: 2rem 1.5rem 4rem;
}

.page-header {
	margin-bottom: 2rem;
}

.page-title {
	font-size: 1.66rem;
}

.archive-description,
.search-count {
	color: var(--bc-muted);
	font-size: 0.85rem;
}

/* Front-page welcome: fills the wide shell's top of page with the site
 * pitch; lives in the text track at every viewport. */
.front-blurb {
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--bc-rule);
}

.site-tagline {
	margin: 0 0 0.35rem;
	font-size: 1.66rem;
}

.front-blurb p {
	margin: 0;
	color: var(--bc-muted);
}

/* The line under the site title reads as a subtitle, not as a sentence of
   body copy: set below the 1.66rem title and lighter than it. Scoped to this
   one element (.front-blurb p keeps its old metrics), so no other page,
   archive description or article styling moves. */
.front-blurb-sub {
	font-size: 1.0625rem;
	font-weight: 350;
	letter-spacing: 0.005em;
	text-wrap: balance;
}

/* ---------- Navigation ---------- */

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-grow: 1;
}

.main-navigation a {
	color: var(--bc-muted);
	font-size: 0.95rem;
}

.main-navigation a:hover {
	color: var(--bc-fg);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--bc-accent);
}

/* ---------- Mode toggle ---------- */

.bc-mode-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--bc-muted);
	cursor: pointer;
	transition: color 120ms ease, background-color 120ms ease;
}

.bc-mode-toggle:hover {
	color: var(--bc-accent);
	background-color: color-mix(in srgb, var(--bc-accent) 10%, transparent);
}

.bc-icon {
	width: 20px;
	height: 20px;
}

/* ---------- Post cards ---------- */

.posts-loop {
	display: flex;
	flex-direction: column;
}

.post-card {
	display: flow-root; /* contains the card thumbnail's float */
	padding: 1.25rem 0 1rem;
	border-bottom: 1px solid var(--bc-rule);
}

/*
 * Card thumbnail: a 16:9 frame floated against the excerpt (ADR-10).
 * The registered crop already cuts 16:9; the aspect-ratio box keeps the
 * layout stable even when a crop falls back to the source image, and
 * object-fit keeps that fallback from stretching.
 */
.card-thumb {
	float: right;
	width: 16rem;
	max-width: 45%;
	margin: 0.25rem 0 0.5rem 1.5rem;
}

.card-thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	transition: box-shadow 120ms ease;
}

.card-thumb:hover img {
	box-shadow: 0 2px 8px color-mix(in srgb, var(--bc-fg) 12%, transparent);
}

.card-title {
	margin: 0 0 0.35rem;
	font-size: 1.33rem;
	line-height: 1.35;
}

.card-title a {
	color: var(--bc-fg);
	transition: color 120ms ease;
}

.card-title a:hover {
	color: var(--bc-accent);
	text-decoration: none;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
	color: var(--bc-muted);
	font-size: 0.85rem;
}

.entry-meta .updated {
	font-style: normal;
}

.meta-sep {
	color: var(--bc-rule);
}

.entry-categories {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.bc-chip {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	color: var(--bc-muted);
	font-size: 0.78rem;
	font-weight: 500;
	transition: color 120ms ease, border-color 120ms ease;
}

.bc-chip:hover {
	border-color: var(--bc-accent);
	color: var(--bc-accent);
	text-decoration: none;
}

.card-body p {
	margin: 0 0 0.75rem;
}

.more-link {
	color: var(--bc-accent);
}

/* ---------- Model-guide mosaic (hub hero, ADR-18) ----------
 * The hub plate rebuilt as real links: hairline rules, mono labels, token
 * colours only (light/dark for free), the accent hue reserved for hover and
 * the lead tile. List markup keeps semantics + the agent pairing clean.
 * Tap targets stay >= 44px. */
.bc-mosaic {
	margin: 0 0 2rem;
}

.bc-mosaic-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bc-mosaic-list li {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bc-mosaic-list li.is-lead {
	grid-column: 1 / -1;
}

.bc-mosaic-tile {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.3rem;
	min-height: 4.75rem;
	padding: 0.85rem 0.9rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	color: var(--bc-fg);
	text-decoration: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.bc-mosaic-tile:hover,
.bc-mosaic-tile:focus-visible {
	border-color: var(--bc-accent);
	box-shadow: 0 2px 8px color-mix(in srgb, var(--bc-fg) 12%, transparent);
	text-decoration: none;
}

.bc-mosaic-tile:hover .mosaic-title {
	color: var(--bc-accent);
}

/* Lead tile: the orchestrator, full width, single accent hairline. */
.bc-mosaic-lead {
	border-left: 2px solid var(--bc-accent);
}

.bc-mosaic-lead .mosaic-title {
	font-size: 1.15rem;
}

.mosaic-kicker {
	color: var(--bc-muted);
	font-family: "JetBrains Mono", ui-monospace, "Menlo", monospace;
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mosaic-title {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
}

.mosaic-meta {
	color: var(--bc-muted);
	font-family: "JetBrains Mono", ui-monospace, "Menlo", monospace;
	font-size: 0.78rem;
}

/* Card brand marks on the Local AI hub (user ruling 2026-10-31): the
   site's stylised model marks - the same art the header plates carry -
   floating right in each tile. Transparent PNGs at 2x (tools/hub-marks.py),
   inserted by tools/hub-marks-apply.php; decorative (empty alt), positioned,
   so the tiles' own text flow never moves. */
.bc-mosaic-tile {
	position: relative;
	padding-right: 4.5rem;
}

.bc-mosaic-tile .mosaic-mark {
	position: absolute;
	top: 50%;
	right: 1rem;
	transform: translateY(-50%);
	height: 2.6rem;
	width: auto;
	max-width: 3.25rem;
}

.bc-mosaic-lead {
	padding-right: 6.5rem;
}

.bc-mosaic-lead .mosaic-mark {
	height: 3.5rem;
	max-width: 5rem;
}

/* ---------- Single post / page ---------- */

.entry-header {
	margin-bottom: 1.5rem;
}

.entry-title {
	margin: 0 0 0.5rem;
}

/* Article subtitle (ADR-17): the one-line claim under the title, above
 * the hero figure. Muted and lighter than the title, tighter than meta. */
.entry-subtitle {
	margin: 0 0 0.75rem;
	color: var(--bc-muted);
	font-weight: 500;
	font-size: 1.15rem;
	line-height: 1.4;
}

.entry-thumbnail {
	margin: 0 0 2rem;
}

/* Widescreen treatment (ADR-10): the featured figure is always a 16:9
 * frame; a source that predates the crops is covered, never stretched.
 * Framed like the card thumbs so dark-native art doesn't dissolve into
 * the dark page background. */
.entry-thumbnail img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
}

.entry-thumbnail figcaption {
	margin-top: 0.5rem;
	color: var(--bc-muted);
	font-size: 0.85rem;
	text-align: center;
}

.entry-content {
	overflow-wrap: break-word;
}

.entry-content figure {
	margin: 1.5rem 0;
}

.entry-content figcaption {
	margin-top: 0.5rem;
	color: var(--bc-muted);
	font-size: 0.85rem;
	text-align: center;
}

.entry-content blockquote {
	margin: 1.5rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 2px solid var(--bc-accent);
	color: var(--bc-fg);
	font-size: 1.15rem;
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content .bc-highlight {
	margin: 2.5rem 0;
	padding: 2rem 2.25rem;
	border: 1px solid var(--bc-rule);
	border-top: 2px solid var(--bc-accent);
	border-bottom: 2px solid var(--bc-accent);
	background: color-mix(in srgb, var(--bc-accent) 6%, transparent);
	color: var(--bc-fg);
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.4;
}

@media (max-width: 48rem) {
	.entry-content .bc-highlight {
		font-size: 1.375rem;
	}
}

.entry-content .bc-highlight p {
	margin: 0;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
	font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--bc-rule);
	padding: 0.5rem 0.75rem;
	text-align: left;
}

.entry-content th {
	background-color: var(--bc-surface);
	font-weight: 600;
}

/* ---------- Charts (ADR-24) ----------
 * Server-rendered SVG (inc/charts.php): a fixed viewBox stretched to the full
 * content measure. That measure is the site's single measure (ADR-11 rev3), so
 * a chart is exactly as wide as a featured figure and never wider than prose.
 * Tokens only: bars take the accent hue, an optional inset overlay series
 * takes --bc-chart-alt (the house code-face rust pair), the cumulative line and
 * the tick labels take muted, gridlines take rule, the guide line takes fg. No
 * mode-specific rules, so light and dark come free.
 */
.bc-chart {
	margin: 1.5rem 0;
}

.bc-chart-controls {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

/* No script, no switch: every scale renders, stacked and readable. */
.bc-chart:not(.bc-chart--js) .bc-chart-controls {
	display: none;
}

.bc-chart:not(.bc-chart--js) .bc-chart-figure + .bc-chart-figure {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--bc-rule);
}

.bc-chart-scale {
	padding: 0.2rem 0.7rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	background-color: transparent;
	color: var(--bc-muted);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.bc-chart-scale:hover {
	border-color: var(--bc-accent);
	color: var(--bc-accent);
}

.bc-chart-scale[aria-pressed="true"] {
	border-color: var(--bc-accent);
	background-color: var(--bc-accent);
	color: var(--bc-chip-on);
}

.bc-chart-figure {
	margin: 0;
}

.bc-chart-svg {
	display: block;
	width: 100%;
	height: auto;
	touch-action: pan-y;
}

.bc-chart-grid,
.bc-chart-rule {
	stroke: var(--bc-rule);
	stroke-width: 1;
}

.bc-chart-axis {
	stroke: var(--bc-muted);
	stroke-width: 1;
}

.bc-chart-series {
	fill: var(--bc-accent);
}

/* Optional second series (dataset `overlay`, inc/charts.php): drawn narrower
 * and centred inside each bucket's bar, so a subset of the series reads as a
 * subset. The hue carries the count; the inset geometry carries the relation,
 * which is why it needs no drawn legend and stays legible without colour. */
.bc-chart-series.is-overlay {
	fill: var(--bc-chart-alt);
}

.bc-chart-line {
	fill: none;
	stroke: var(--bc-muted);
	stroke-width: 1.5;
	stroke-dasharray: 4 3;
}

/* Tick numerals are set in the code face, matching the meta-numerals rule. */
.bc-chart-tick {
	fill: var(--bc-muted);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 10px;
	text-anchor: middle;
}

.bc-chart-tick.is-y {
	text-anchor: end;
}

.bc-chart-tick.is-x {
	text-anchor: end;
}

.bc-chart-tick.is-y2 {
	text-anchor: start;
}

/* Pie (1.1.27): wedges take the accent hue with stepped fill-opacity set
 * inline; the background-coloured stroke separates neighbours. */
.bc-chart-wedge {
	stroke: var(--bc-bg);
	stroke-width: 2;
}

/* An inline fill-opacity on the wedge outranks any class rule, so the active
 * slice reads with a brightness lift instead of an opacity change. */
.bc-chart-wedge.is-active {
	filter: brightness(1.15);
}

.bc-chart-swatch {
	fill: var(--bc-accent);
	stroke: var(--bc-rule);
}

/* Percentage marks sit on the accent wedge, so they take the page surface
 * rather than the muted ink: light-on-accent in light mode, the reverse in
 * dark. Legend rows start-anchor like the y2 axis (the tick default of
 * middle would centre them over the swatch) and stay on the muted ink of
 * every other tick. */
.bc-chart-tick.is-pie {
	fill: var(--bc-bg);
}

.bc-chart-tick.is-legend {
	text-anchor: start;
}

.bc-chart-cursor {
	visibility: hidden;
}

.bc-chart-cursor.is-active {
	visibility: visible;
}

.bc-chart-focus {
	fill: var(--bc-accent);
	opacity: 0.18;
}

.bc-chart-guide {
	stroke: var(--bc-fg);
	stroke-width: 1;
	stroke-dasharray: 2 2;
}

.bc-chart-readout {
	margin: 0.5rem 0 0;
	color: var(--bc-muted);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85rem;
}

/* Colour key (1.1.28, shortcode key="1"): the same code face and muted ink as
 * the readout line; dots take the series fills themselves, so a key can never
 * drift from what the figure draws. The pie dots inherit the wedge ramp via an
 * inline fill-opacity, blended over the page ground like the wedges. */
.bc-chart-key {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0.5rem 0 0;
	color: var(--bc-muted);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85rem;
}

.bc-chart-key-item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.bc-chart-key-dot {
	flex: none;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--bc-accent);
}

.bc-chart-key-dot.is-overlay {
	background: var(--bc-chart-alt);
}

/* Narrow viewports: bc-chart.js starts such charts on the coarse scale,
 * because 30 readable bars beat 355 hairlines at that width. Which figure is
 * visible is state on the wrapper (data-view), never a second stylesheet. */
.bc-chart--js .bc-chart-figure {
	display: none;
}

.bc-chart--js[data-view="month"] .bc-chart-figure[data-bc-view="month"],
.bc-chart--js[data-view="year"] .bc-chart-figure[data-bc-view="year"] {
	display: block;
}

/* Data-table folds (bytecreation_chart_fold_tables): the collapsed state is
 * native <details>; these rules only dress the handle. Tokens only, so
 * light and dark come free. */
.bc-table-fold {
	margin: 1.5rem 0;
}

.bc-table-fold > summary {
	cursor: pointer;
	color: var(--bc-accent);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	padding: 0.35rem 0;
}

.bc-table-fold > summary:hover {
	color: var(--bc-fg);
}

.bc-table-fold[open] > summary {
	margin-bottom: 0.25rem;
}

.bc-table-fold > table {
	margin-top: 0.5rem;
}


/* ---------- Code ---------- */

pre {
	margin: 1.5rem 0;
	padding: 1rem;
	border-radius: 4px;
	background-color: var(--bc-surface);
	border: 1px solid var(--bc-rule);
	color: var(--bc-code-plain);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85rem;
	line-height: 1.6;
	overflow-x: auto;
	-moz-tab-size: 4;
	tab-size: 4;
}

code,
kbd,
samp {
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85em;
}

:not(pre) > code {
	padding: 0.1em 0.35em;
	border-radius: 4px;
	background-color: var(--bc-surface);
	border: 1px solid var(--bc-rule);
}

kbd {
	padding: 0.1em 0.4em;
	border: 1px solid var(--bc-rule);
	border-bottom-width: 2px;
	border-radius: 4px;
	background-color: var(--bc-surface);
}

/* ---------- Table of contents ---------- */

/*
 * Anchor jumps land under the sticky header and hide the heading
 * (measured gap -53px one-line, -103px wrapped below 48rem). Park
 * every fragment target clear of the header with breathing room so
 * the reader can see the section they jumped to.
 */
:target {
	scroll-margin-top: 4.75rem; /* 76px above a 53px header */
}

@media (max-width: 48rem) {
	:target {
		scroll-margin-top: 7.75rem; /* 124px above a 103px wrapped header */
	}
}

.bc-toc {
	margin: 1.5rem 0 2rem;
	padding: 0.75rem 0 0.75rem 1rem;
	border-left: 1px solid var(--bc-rule);
}

.bc-toc-title {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bc-muted);
}

.bc-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bc-toc li {
	margin: 0;
	font-size: 0.9rem;
}

.bc-toc .bc-toc-h3 {
	padding-left: 1rem;
}

.bc-toc a {
	color: var(--bc-muted);
}

.bc-toc a:hover {
	color: var(--bc-accent);
	text-decoration: none;
}

/* ---------- Post navigation ---------- */

.post-navigation {
	margin: 3rem 0 1rem;
	border-top: 1px solid var(--bc-rule);
	padding-top: 1rem;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	max-width: 45%;
}

.post-navigation .nav-next {
	margin-left: auto;
	text-align: right;
}

.post-navigation .nav-label {
	color: var(--bc-muted);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.post-navigation .post-link-title {
	color: var(--bc-fg);
	font-size: 0.95rem;
}

.post-navigation a:hover .post-link-title {
	color: var(--bc-accent);
}

/* ---------- Pagination ---------- */

.pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	list-style: none;
	margin: 2.5rem 0 0;
	padding: 0;
}

.pagination li {
	margin: 0;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
	display: inline-block;
	min-width: 2.25rem;
	padding: 0.35rem 0.6rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	text-align: center;
	color: var(--bc-muted);
	font-size: 0.9rem;
}

.pagination a.page-numbers:hover {
	border-color: var(--bc-accent);
	color: var(--bc-accent);
	text-decoration: none;
}

.pagination .current {
	border-color: var(--bc-accent);
	background-color: var(--bc-accent);
	color: var(--bc-chip-on);
}

/* ---------- Search ---------- */

.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0;
}

.search-field {
	flex-grow: 1;
	min-width: 0;
	max-width: 24rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	background-color: var(--bc-surface);
	color: var(--bc-fg);
	font: inherit;
}

/* ---------- The standard button ----------
 * The site's single button DNA (2026-11-18): accent fill, 4px radius,
 * JetBrains Mono, and the falling 1s-and-0s glyph rain on hover/focus —
 * a miniature of the ambient glyph-rain canvas. Every button follows the
 * contact-form Send button (see mu-plugins/bc-contact.css for the form
 * itself; the DNA lives HERE, one source for the whole site).
 * The rain is an animated background-image rather than a pseudo-element
 * so it works on <button> AND <input type="submit"> (Post Comment is an
 * input; pseudo-elements are illegal on void elements). The two palettes
 * mirror critical.css's scheme switch; glyphs are always the button's own
 * text color, so it reads as the label's alphabet falling through. */

.search-submit,
.comment-form .submit,
.post-password-form input[type="submit"],
.wp-block-button .wp-block-button__link,
.bc-contact-form button[type="submit"] {
	padding: 0.6rem 1.5rem;
	border: 1px solid var(--bc-accent);
	border-radius: 4px;
	background-color: var(--bc-accent);
	color: var(--bc-chip-on);
	font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 1em;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.search-submit:hover,
.search-submit:focus-visible,
.comment-form .submit:hover,
.comment-form .submit:focus-visible,
.post-password-form input[type="submit"]:hover,
.post-password-form input[type="submit"]:focus-visible,
.wp-block-button .wp-block-button__link:hover,
.bc-contact-form button[type="submit"]:hover,
.bc-contact-form button[type="submit"]:focus-visible {
	background-color: color-mix(in srgb, var(--bc-accent) 85%, var(--bc-bg));
	box-shadow: 0 2px 14px color-mix(in srgb, var(--bc-accent) 35%, transparent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='120'%3E%3Cg font-family='monospace' font-size='13' fill='%23FFFFFF' opacity='0.30'%3E%3Ctext x='4' y='16'%3E1 0 1 1 0%3C/text%3E%3Ctext x='36' y='42'%3E0 1%3C/text%3E%3Ctext x='12' y='68'%3E1 0 1 0 1%3C/text%3E%3Ctext x='52' y='94'%3E0 1 0%3C/text%3E%3Ctext x='6' y='120'%3E1 1 0 0 1%3C/text%3E%3C/g%3E%3C/svg%3E");
	background-size: 96px 120px;
	background-repeat: repeat;
	animation: bc-btn-rain 1.1s linear infinite;
}

/* Dark scheme: the fill turns pale, so the glyphs turn dark. */
@media (prefers-color-scheme: dark) {
	:root:not([data-mode="light"]) .search-submit:hover,
	:root:not([data-mode="light"]) .search-submit:focus-visible,
	:root:not([data-mode="light"]) .comment-form .submit:hover,
	:root:not([data-mode="light"]) .comment-form .submit:focus-visible,
	:root:not([data-mode="light"]) .post-password-form input[type="submit"]:hover,
	:root:not([data-mode="light"]) .post-password-form input[type="submit"]:focus-visible,
	:root:not([data-mode="light"]) .wp-block-button .wp-block-button__link:hover,
	:root:not([data-mode="light"]) .bc-contact-form button[type="submit"]:hover,
	:root:not([data-mode="light"]) .bc-contact-form button[type="submit"]:focus-visible {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='120'%3E%3Cg font-family='monospace' font-size='13' fill='%23101214' opacity='0.35'%3E%3Ctext x='4' y='16'%3E1 0 1 1 0%3C/text%3E%3Ctext x='36' y='42'%3E0 1%3C/text%3E%3Ctext x='12' y='68'%3E1 0 1 0 1%3C/text%3E%3Ctext x='52' y='94'%3E0 1 0%3C/text%3E%3Ctext x='6' y='120'%3E1 1 0 0 1%3C/text%3E%3C/g%3E%3C/svg%3E");
	}
}

:root[data-mode="dark"] .search-submit:hover,
:root[data-mode="dark"] .search-submit:focus-visible,
:root[data-mode="dark"] .comment-form .submit:hover,
:root[data-mode="dark"] .comment-form .submit:focus-visible,
:root[data-mode="dark"] .post-password-form input[type="submit"]:hover,
:root[data-mode="dark"] .post-password-form input[type="submit"]:focus-visible,
:root[data-mode="dark"] .wp-block-button .wp-block-button__link:hover,
:root[data-mode="dark"] .bc-contact-form button[type="submit"]:hover,
:root[data-mode="dark"] .bc-contact-form button[type="submit"]:focus-visible {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='120'%3E%3Cg font-family='monospace' font-size='13' fill='%23101214' opacity='0.35'%3E%3Ctext x='4' y='16'%3E1 0 1 1 0%3C/text%3E%3Ctext x='36' y='42'%3E0 1%3C/text%3E%3Ctext x='12' y='68'%3E1 0 1 0 1%3C/text%3E%3Ctext x='52' y='94'%3E0 1 0%3C/text%3E%3Ctext x='6' y='120'%3E1 1 0 0 1%3C/text%3E%3C/g%3E%3C/svg%3E");
}

@keyframes bc-btn-rain {
	from { background-position: 0 -120px; }
	to   { background-position: 0 0; }
}

/* ---------- Forms ---------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--bc-rule);
	border-radius: 4px;
	background-color: var(--bc-surface);
	color: var(--bc-fg);
	font: inherit;
}

textarea {
	width: 100%;
}

/* ---------- Comments ---------- */

.comments-area {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--bc-rule);
}

.comments-title {
	font-size: 1.33rem;
}

.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .comment {
	padding: 1rem 0;
	border-bottom: 1px solid var(--bc-rule);
}

.comment-list .children {
	list-style: none;
	margin: 0;
	padding-left: 1.5rem;
}

.comment-meta {
	margin-bottom: 0.5rem;
	color: var(--bc-muted);
	font-size: 0.85rem;
}

.comment-author {
	font-weight: 600;
	color: var(--bc-fg);
}

.comment-reply-link {
	font-size: 0.85rem;
}

.no-comments {
	color: var(--bc-muted);
	font-style: italic;
}

.comment-form label {
	display: block;
	margin: 0.75rem 0 0.25rem;
	font-size: 0.9rem;
	font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 30rem;
}

.comment-form .submit {
	margin-top: 1rem; /* layout only; the look is the standard button above */
}

/* ---------- Footer ---------- */

/* Background-less on purpose: the footer band is one of the ambient
 * glyph rain's paint bands (see #bc-rain-canvas below); a background
 * color here would hide it. The page background comes through instead. */
.site-footer {
	border-top: 1px solid var(--bc-rule);
}

.site-footer-inner {
	max-width: 61rem;
	margin: 0 auto;
	padding: 2rem 1.5rem;
}

.footer-widgets {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	margin-bottom: 1.5rem;
}

.widget {
	flex: 1 1 14rem;
}

.widget-title {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bc-muted);
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}

.footer-navigation a {
	color: var(--bc-muted);
	font-size: 0.9rem;
}

.site-info {
	color: var(--bc-muted);
	font-size: 0.85rem;
}

.site-info p {
	margin: 0.25rem 0;
}

.footer-feeds a {
	margin-right: 1rem;
	color: var(--bc-muted);
}

.footer-feeds a:hover {
	color: var(--bc-accent);
}

/* ---------- 404 / states ---------- */

.error-404 .page-content,
.no-results .page-content {
	margin-top: 1rem;
}

.back-home {
	display: inline-block;
}

/* ---------- Block alignment fallbacks ----------
 * One measure everywhere (58rem): alignwide has no rails to bleed into
 * and simply uses the gutters. theme.json sets contentSize == wideSize
 * so core's own alignwide math resolves to zero margins. */

.entry-content .alignleft {
	float: left;
	margin: 0.5rem 1.5rem 1rem 0;
}

/*
 * About page head shot: sized in CSS (not inline styles) so the responsive
 * override can shrink it instead of fighting an inline width.
 */
.entry-content .profile-photo {
	width: 15rem;
}

/* ---------- Profile reveal (About page) ----------
 * The robot twin of the profile photo (ADR-21): an <img> layer masked to
 * a cursor/finger-following circle plus a canvas ring, both built by
 * assets/js/profile-reveal.js (see its header for the contract —
 * aria-hidden decorations, pointer-events none, no-JS = plain photo).
 * touch-action pan-y: horizontal drags over the photo drive the reveal;
 * vertical swipes still scroll the page. */
.entry-content figure.profile-photo {
	position: relative;
	touch-action: pan-y;
}

/* Block display kills the inline baseline gap, so the figure box is
 * exactly the img box and the twin layer above it registers pixel-exact. */
.entry-content figure.profile-photo img {
	display: block;
}

.bc-profile-robot {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	pointer-events: none;
	-webkit-mask-image: radial-gradient(circle var(--prr, 0px) at var(--prx, 50%) var(--pry, 50%), #000 96%, transparent 100%);
	mask-image: radial-gradient(circle var(--prr, 0px) at var(--prx, 50%) var(--pry, 50%), #000 96%, transparent 100%);
	/* No CSS opacity transition here: profile-reveal.js drives the twin's
	 * opacity from one animation-frame envelope — fast in, quick out for a
	 * mouse, a linear 3.5 s fade for a lifted finger (user: fade mobile
	 * only) — a transition would fight it. */
}

.bc-profile-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.entry-content .alignright {
	float: right;
	margin: 0.5rem 0 1rem 1.5rem;
}

.entry-content .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 48rem) {
	.site-header-inner {
		flex-wrap: wrap;
		min-height: 0;
	}

	.card-thumb {
		float: none;
		width: 100%;
		max-width: none;
		margin: 0 0 1rem;
	}

	.entry-content .profile-photo {
		width: 9.5rem;
		margin-right: 1rem;
	}

	.main-navigation {
		order: 3;
		width: 100%;
	}

	.main-navigation ul {
		gap: 0.75rem 1rem;
	}

	.site-main {
		padding: 1.5rem 1rem 3rem;
	}

	h1 {
		font-size: 1.66rem;
	}

	.entry-content .alignwide {
		margin-left: -1rem;
		margin-right: -1rem;
	}
}

/* ---------- Masthead ----------
 * The header/footer follow the same 61rem shell as the content: brand
 * at the left content edge, nav (and the mode toggle) pushed right
 * with margin-left:auto - a two-point line at every width down to the
 * wrap breakpoint. Below 48rem the header wraps and nav becomes a full
 * width row, where the auto margin is inert. */

.main-navigation {
	margin-left: auto;
}

/* ---------- Ambient glyph rain (decorative) ----------
 * The header plates' faint monospace scatter as a live background layer:
 * assets/js/glyph-rain.js paints a single viewport-fixed canvas inside
 * the gutters beside the 61rem shell and across the footer band, in grey
 * shades derived from the live tokens. The layering contract:
 * z-index -1 puts it above the page background and below every piece of
 * content (it can never paint over text), and the footer stays
 * background-less so its band shows through. Motion and reduced-motion
 * behavior live in the script, not here. */

#bc-rain-canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
