/* Chainmail Jack · layout + components. Tokens in tokens.css (the Hallmark stamp lives there). */

/* ============ base ============ */

html { overflow-x: clip; }
body {
	overflow-x: clip;
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	padding-top: calc(var(--banner-h) + var(--bar-h));
}

/* Gold headings + open tracking to match the apex. The old -0.02em was tuned for
   Cabinet Grotesk; Cinzel is a serif with flared terminals and goes cramped that tight. */
h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-style: normal;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: 0.01em;
	color: var(--color-gold-hi);
	margin: 0 0 var(--space-md);
	overflow-wrap: anywhere;
	min-width: 0;
}
h1 { font-size: var(--text-display-s); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); }

p { margin: 0 0 var(--space-md); max-width: 65ch; }

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-deep); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

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

.screen-reader-text {
	clip-path: inset(50%);
	height: 1px; width: 1px;
	overflow: hidden;
	position: absolute;
}
.skip-link:focus-visible {
	clip-path: none;
	height: auto; width: auto;
	position: fixed;
	top: var(--space-xs); left: var(--space-xs);
	background: var(--color-paper);
	padding: var(--space-sm) var(--space-md);
	z-index: var(--z-tooltip);
}

.cj-container {
	max-width: 76rem;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.mono, .cj-count, .cj-price {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}

/* ============ buttons (8 states) ============ */

.cj-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45em;
	min-height: 44px;
	padding: var(--space-sm) var(--space-lg);
	border: var(--rule-hair) solid var(--color-ink);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--dur-short) var(--ease-out),
	            color var(--dur-short) var(--ease-out),
	            transform 100ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
	.cj-btn:hover { background: var(--color-ink); color: var(--color-paper); }
}
.cj-btn:active { transform: translateY(1px); }
.cj-btn:disabled,
.cj-btn[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}
.cj-btn[data-state="loading"] { color: var(--color-muted); pointer-events: none; }
.cj-btn[data-state="error"]   { border-color: var(--color-error); color: var(--color-error); }
.cj-btn[data-state="success"] { border-color: var(--color-success); color: var(--color-success); }

.cj-btn--fill {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: var(--color-accent-ink);
}
@media (hover: hover) and (pointer: fine) {
	.cj-btn--fill:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); color: var(--color-accent-ink); }
}
.cj-btn--fill:focus-visible { outline-color: var(--color-ink); }

/* ============ N12 · banner + retracting nav ============ */

.cj-nav {
	position: fixed;
	inset: 0 0 auto;
	z-index: var(--z-sticky);
	transform: translateY(0);
	transition: transform 320ms var(--ease-out);
}
.cj-nav.is-compact { transform: translateY(calc(var(--banner-h) * -1)); }
.cj-nav.is-dismissed { transform: none; }
.cj-nav.is-dismissed .cj-banner { display: none; }

.cj-banner {
	height: var(--banner-h);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-md);
	/* Was a solid gold slab — far too loud once the page went dark, and it read as a
	   warning strip rather than a shipping note. Dark bar, gold rule, gold text. */
	background: var(--color-paper-2);
	border-bottom: var(--rule-hair) solid var(--color-rule);
	color: var(--color-accent);
	font-size: var(--text-sm);
	padding-inline: var(--space-md);
}
.cj-banner p { margin: 0; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cj-banner a { color: var(--color-gold-hi); }
.cj-banner-x {
	background: none;
	border: 0;
	color: var(--color-accent);
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: var(--space-xs);
	min-width: 32px;
	min-height: 32px;
}

.cj-bar { background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
.cj-bar-inner {
	height: var(--bar-h);
	display: flex;
	align-items: center;
	gap: var(--space-lg);
}
.cj-brand {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: var(--text-md);
	letter-spacing: -0.02em;
	color: var(--color-ink);
	text-decoration: none;
	white-space: nowrap;
}
.cj-brand:hover { color: var(--color-ink); }
.cj-brand .cj-brand-dot { color: var(--color-accent); }

.cj-nav-links {
	display: flex;
	align-items: center;
	gap: var(--space-lg);
	margin-inline-start: auto;
}
.cj-nav-links ul { display: contents; list-style: none; margin: 0; padding: 0; }
.cj-nav-links a {
	color: var(--color-ink-2);
	text-decoration: none;
	font-size: var(--text-sm);
	font-weight: 500;
	white-space: nowrap;
}
.cj-nav-links a:hover { color: var(--color-ink); }
.cj-nav-links .current-menu-item > a,
.cj-nav-links a[aria-current="page"] { color: var(--color-accent); }

.cj-cart-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	min-height: 44px;
	padding: 0 var(--space-sm);
	color: var(--color-ink);
	text-decoration: none;
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}
.cj-cart-count {
	display: inline-block;
	min-width: 1.5em;
	text-align: center;
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	padding: 0.05em 0.3em;
	font-size: var(--text-xs);
}

.cj-menu-toggle {
	display: none;
	background: none;
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	color: var(--color-ink);
	font: 600 var(--text-sm) var(--font-body);
	line-height: 1.2;
	padding: var(--space-xs) var(--space-sm);
	min-height: 44px;
	cursor: pointer;
}

@media (max-width: 60rem) {
	.cj-nav-links {
		display: none;
		position: absolute;
		top: 100%;
		left: 0; right: 0;
		background: var(--color-paper);
		border-bottom: var(--rule-hair) solid var(--color-rule);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: var(--space-sm) 0;
	}
	.cj-nav-links.is-open { display: flex; }
	.cj-nav-links a {
		display: block;
		padding: var(--space-sm) clamp(1rem, 4vw, 2.5rem);
		min-height: 44px;
		display: flex;
		align-items: center;
	}
	.cj-menu-toggle { display: inline-flex; align-items: center; margin-inline-start: auto; }
	.cj-cart-link { margin-inline-start: 0; }
}

/* ============ catalogue head ============ */

.cj-cathead {
	padding-block: var(--space-2xl) var(--space-xl);
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: var(--space-xl);
	align-items: end;
}
.cj-cathead h1 { margin: 0; font-size: var(--text-display); max-width: 14ch; }
.cj-cathead-meta {
	justify-self: end;
	text-align: right;
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-sm);
	color: var(--color-muted);
	line-height: 1.8;
}
.cj-cathead-meta strong { color: var(--color-ink); font-weight: 500; }
@media (max-width: 60rem) {
	.cj-cathead { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
	.cj-cathead-meta { justify-self: start; text-align: left; }
}

/* ============ gauge truth · F3 spec sheet ============ */

.cj-gauge {
	border-block: var(--rule-hair) solid var(--color-rule);
	padding-block: var(--space-xl);
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: var(--space-xl);
}
.cj-gauge-copy h2 { max-width: 16ch; }
.cj-gauge-copy p { font-size: var(--text-sm); color: var(--color-ink-2); }
.cj-gauge-copy .cj-gauge-kicker {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-muted);
	margin-bottom: var(--space-sm);
}

.cj-spec { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.cj-spec caption {
	text-align: left;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-muted);
	padding-bottom: var(--space-sm);
}
.cj-spec th, .cj-spec td {
	text-align: left;
	padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
	border-bottom: var(--rule-hair) solid var(--color-rule);
	vertical-align: top;
}
.cj-spec thead th {
	font-family: var(--font-mono);
	font-weight: 500;
	font-size: var(--text-xs);
	color: var(--color-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.cj-spec td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cj-spec td.cj-spec-note { font-family: var(--font-body); color: var(--color-ink-2); }
.cj-spec .cj-spec-ours td { color: var(--color-ink); font-weight: 500; }
.cj-spec .cj-spec-ours .cj-spec-flag { color: var(--color-accent); font-family: var(--font-body); font-weight: 600; }
.cj-spec-foot { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-sm); max-width: 60ch; }

@media (max-width: 60rem) {
	.cj-gauge { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
}
@media (max-width: 40rem) {
	.cj-spec thead { display: none; }
	.cj-spec tr { display: block; padding-block: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); }
	.cj-spec td { display: block; border: 0; padding: 0.15rem 0; }
	.cj-spec td::before {
		content: attr(data-label);
		font-family: var(--font-mono);
		font-size: var(--text-xs);
		color: var(--color-muted);
		display: inline-block;
		min-width: 9ch;
	}
}

/* ============ aisle bands + F6 product grid ============ */

.cj-aisle { padding-block: var(--space-2xl) var(--space-lg); }
.cj-aisle + .cj-aisle { border-top: var(--rule-hair) solid var(--color-rule-2); }
.cj-aisle-head {
	display: flex;
	align-items: baseline;
	gap: var(--space-md);
	margin-bottom: var(--space-lg);
}
.cj-aisle-head h2 { margin: 0; }
.cj-aisle-head .cj-count { font-size: var(--text-sm); color: var(--color-muted); }
.cj-aisle-head .cj-aisle-all {
	margin-inline-start: auto;
	font-size: var(--text-sm);
	white-space: nowrap;
}

.cj-products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--space-xl) var(--space-lg);
	list-style: none;
	margin: 0;
	padding: 0;
}
@media (max-width: 60rem) { .cj-products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 22.5rem) { .cj-products { grid-template-columns: minmax(0, 1fr); } }

.cj-product { display: grid; gap: var(--space-xs); position: relative; margin: 0; }
.cj-product-media {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--color-paper-2);
	border: var(--rule-hair) solid var(--color-rule-2);
	border-radius: var(--radius-sm);
	overflow: hidden;
}
.cj-product-media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform var(--dur-long) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
	.cj-product-media:hover img { transform: scale(1.02); }
}
.cj-product-name {
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
}
.cj-product-name a { color: var(--color-ink); text-decoration: none; }
.cj-product-name a:hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.cj-price { font-size: var(--text-sm); color: var(--color-ink-2); }
.cj-product-add {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--color-paper);
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	color: var(--color-ink);
	font: 600 var(--text-sm) var(--font-body);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--dur-short) var(--ease-out),
	            background-color var(--dur-short) var(--ease-out),
	            color var(--dur-short) var(--ease-out);
}
.cj-product:hover .cj-product-add,
.cj-product:focus-within .cj-product-add { opacity: 1; }
@media (pointer: coarse) { .cj-product-add { opacity: 1; } }
@media (hover: hover) and (pointer: fine) {
	.cj-product-add:hover { background: var(--color-ink); color: var(--color-paper); }
}
.cj-product-add.added { border-color: var(--color-success); color: var(--color-success); opacity: 1; }

/* ============ calculator band ============ */

.cj-calcband {
	border-top: var(--rule-hair) solid var(--color-rule);
	padding-block: var(--space-2xl) var(--space-3xl);
}
.cj-calcband > .cj-calcband-intro { max-width: 52ch; margin-bottom: var(--space-lg); }
.cj-calcband > .cj-calcband-intro p { color: var(--color-ink-2); font-size: var(--text-sm); }

.cj-calc {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: var(--space-xl);
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-md);
	padding: var(--space-xl);
	background: var(--color-paper);
}
@media (max-width: 60rem) {
	.cj-calc { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); padding: var(--space-lg); }
}

.cj-field { display: grid; gap: var(--space-2xs); margin-bottom: var(--space-md); }
.cj-field label { font-size: var(--text-sm); font-weight: 600; }
.cj-field-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
@media (max-width: 40rem) { .cj-field-2col { grid-template-columns: minmax(0, 1fr); } }

.cj-input, .cj-select {
	min-height: 44px;
	padding: var(--space-xs) var(--space-sm);
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	background: var(--color-paper);
	color: var(--color-ink);
	font: 400 var(--text-base) var(--font-body);
	outline: 2px solid transparent;
	outline-offset: 1px;
	transition: background-color var(--dur-short) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
	.cj-input:hover, .cj-select:hover { background: var(--color-paper-2); }
}
.cj-input:focus-visible, .cj-select:focus-visible { outline: 2px solid var(--color-focus); }
.cj-input:disabled, .cj-select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cj-calc-results { border-inline-start: var(--rule-hair) solid var(--color-rule); padding-inline-start: var(--space-xl); }
@media (max-width: 60rem) {
	.cj-calc-results { border-inline-start: 0; padding-inline-start: 0; border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-lg); }
}
.cj-calc-results h3 { font-size: var(--text-sm); font-family: var(--font-mono); font-weight: 500; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cj-res-row {
	display: flex;
	justify-content: space-between;
	gap: var(--space-md);
	padding-block: var(--space-sm);
	border-bottom: var(--rule-hair) solid var(--color-rule-2);
	font-size: var(--text-sm);
}
.cj-res-row span { color: var(--color-ink-2); }
.cj-res-row strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.cj-res-total { border-bottom: 0; padding-top: var(--space-md); }
.cj-res-total strong { font-size: var(--text-md); }
.cj-calc-note { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-sm); max-width: none; }
.cj-calc-cta { margin-top: var(--space-md); }

/* ============ Ft4 · dense colophon ============ */

.cj-colophon {
	border-top: var(--rule-hair) solid var(--color-rule);
	background: var(--color-paper-2);
	padding-block: var(--space-xl) var(--space-2xl);
}
.cj-colophon-block {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	line-height: 1.9;
	color: var(--color-muted);
	max-width: 72ch;
}
.cj-colophon-block a { color: var(--color-ink-2); }
.cj-colophon-block a:hover { color: var(--color-accent); }

/* ============ breadcrumbs ============ */

.cj-breadcrumbs { margin-bottom: var(--space-lg); }
.cj-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2xs) var(--space-xs);
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-muted);
}
.cj-crumb { display: inline-flex; align-items: center; gap: var(--space-2xs) var(--space-xs); }
.cj-crumb + .cj-crumb::before {
	content: "/";
	color: var(--color-rule-strong);
	margin-inline-end: var(--space-2xs);
}
.cj-crumb a { color: var(--color-ink-2); text-decoration: none; }
.cj-crumb a:hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.cj-crumb [aria-current="page"] { color: var(--color-muted); }

/* ============ product spec sheet ============ */

.cj-prodspec {
	border-top: var(--rule-hair) solid var(--color-rule);
	padding-block: var(--space-xl) var(--space-lg);
}
.cj-prodspec-title,
.cj-related-title,
.cj-plan-title {
	font-size: var(--text-md);
	margin-bottom: var(--space-md);
}
.cj-prodspec .cj-spec th[scope="row"] {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: var(--text-sm);
	color: var(--color-ink);
	width: 34%;
	text-transform: none;
	letter-spacing: 0;
}
.cj-prodspec-guide {
	font-size: var(--text-sm);
	color: var(--color-ink-2);
	margin-top: var(--space-md);
	max-width: 68ch;
}

/* ============ internal link groups ============ */

.cj-related,
.cj-catlinks {
	border-top: var(--rule-hair) solid var(--color-rule);
	padding-block: var(--space-xl) var(--space-lg);
}
.cj-related-grid,
.cj-catlinks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
	gap: var(--space-lg) var(--space-xl);
}
.cj-catlinks { border-top: var(--rule-hair) solid var(--color-rule); }
.cj-linkgroup-title {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-bottom: var(--space-sm);
}
.cj-linklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--space-2xs);
}
.cj-linklist li { margin: 0; }
.cj-linklist a {
	display: inline-block;
	padding-block: var(--space-2xs);
	font-size: var(--text-sm);
	color: var(--color-ink-2);
	text-decoration: none;
	border-bottom: var(--rule-hair) solid transparent;
}
.cj-linklist a:hover {
	color: var(--color-accent);
	border-bottom-color: var(--color-accent);
}
.cj-linklist .cj-count { color: var(--color-muted); font-family: var(--font-mono); }

/* ============ plan-the-build block ============ */

.cj-plan {
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-md);
	padding: var(--space-lg);
	margin-block: var(--space-xl);
	background: var(--color-paper-2);
}
.cj-plan p { font-size: var(--text-sm); color: var(--color-ink-2); }
.cj-plan-math {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	color: var(--color-ink) !important;
}

/* ============ generic page content (index.php fallback) ============ */

.cj-main { min-height: 40vh; }
.cj-page { padding-block: var(--space-xl) var(--space-2xl); }
.cj-page .entry-title { font-size: var(--text-display-s); }

/* ============ reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 150ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 150ms !important;
	}
	.cj-nav { transition: none; }
	.cj-product-media img { transition: none; }
}

/* ---- calculator: size cards + colour row ----
   Scale size decides coverage, ring spec, weight and cost, so it gets real product photography
   and the numbers that matter, not a three-option dropdown. The colour chips are product shots
   of the exact pack that ships — there is no CC-licensed photograph of modern anodized
   scalemaille anywhere (checked 2026-08-16), so the calculator shows materials we own pictures
   of and never illustrates a finished project it cannot photograph. */

.cj-sizes { border: 0; padding: 0; margin: 0 0 var(--space-lg); }
.cj-sizes legend {
	padding: 0;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-ink-2);
	margin-bottom: var(--space-xs);
}
.cj-size-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-sm);
}
.cj-size-card {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--space-sm);
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-sm);
	background: var(--color-paper-2);
	cursor: pointer;
	transition: border-color var(--dur-short) var(--ease-out),
	            background-color var(--dur-short) var(--ease-out);
}
.cj-size-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.cj-size-card img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--radius-sm);
	margin-bottom: var(--space-xs);
}
.cj-size-name { font-weight: 700; font-size: var(--text-sm); color: var(--color-ink); }
.cj-size-dim,
.cj-size-ring,
.cj-size-cov {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-xs);
	color: var(--color-muted);
	line-height: 1.4;
}
.cj-size-ring { color: var(--color-accent); }
.cj-size-card.is-selected {
	border-color: var(--color-accent);
	background: var(--color-paper-3);
}
.cj-size-card:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.cj-size-card:hover { border-color: var(--color-rule-strong); }
}

.cj-colors { margin-bottom: var(--space-lg); }
.cj-colors-label {
	display: block;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-ink-2);
	margin-bottom: var(--space-xs);
}
.cj-color-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
}
.cj-color-chip {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	width: 4.5rem;
	padding: 4px;
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-sm);
	background: var(--color-paper-2);
	cursor: pointer;
	transition: border-color var(--dur-short) var(--ease-out);
}
.cj-color-chip img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 2px;
}
.cj-color-name {
	font-family: var(--font-mono);
	font-size: 0.62rem;
	line-height: 1.2;
	color: var(--color-muted);
	text-align: center;
	overflow-wrap: anywhere;
}
.cj-color-chip.is-selected { border-color: var(--color-accent); }
.cj-color-chip.is-selected .cj-color-name { color: var(--color-ink); }
.cj-color-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.cj-color-chip:hover { border-color: var(--color-rule-strong); }
}

@media (max-width: 40rem) {
	.cj-size-row { grid-template-columns: 1fr; }
	.cj-size-card { flex-direction: row; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
	.cj-size-card img { width: 4rem; margin-bottom: 0; flex: 0 0 auto; }
	.cj-size-name { flex: 1 1 auto; }
}

/* ---- front page: decks, groups, guide accordion ----
   Replaces nine identical aisle bands at identical padding. Rhythm is deliberately uneven:
   the ring deck is the widest and loudest (it is 90% of the catalogue), scales run as three
   wide rows, the shelf is a quiet small-card strip, and the guides close the page flat. */

.cj-deck { padding: var(--space-2xl) 0 var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule-2); }
.cj-deck:first-of-type { border-top: 0; }
.cj-deck-head { max-width: 62ch; margin-bottom: var(--space-lg); }
.cj-deck-head h2 { margin: 0 0 var(--space-2xs); }
.cj-deck-head p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.cj-deck-all { margin: var(--space-md) 0 0; font-family: var(--font-mono); font-size: var(--text-xs); }
.cj-deck-all a { color: var(--color-accent); }

.cj-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.cj-groups--rings { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.cj-groups--scales { grid-template-columns: 1fr; gap: var(--space-sm); }
.cj-groups--shelf { grid-template-columns: repeat(auto-fill, minmax(min(10rem, 100%), 1fr)); gap: var(--space-sm); }

.cj-group-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-md);
	background: var(--color-paper-2);
	overflow: hidden;
	transition: border-color var(--dur-short) var(--ease-out),
	            background-color var(--dur-short) var(--ease-out);
}
.cj-group-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.cj-group-body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-sm); }
.cj-group-name { font-weight: 700; font-size: var(--text-sm); color: var(--color-ink); line-height: 1.25; }
.cj-group-ar {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-xs);
	color: var(--color-accent);
}
.cj-group-weaves { font-size: var(--text-xs); color: var(--color-ink-2); line-height: 1.4; }
.cj-group-meta {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-xs);
	color: var(--color-muted);
	margin-top: var(--space-2xs);
}
.cj-group-link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.cj-group-link:hover { border-color: var(--color-accent); background: var(--color-paper-3); }
}

/* Scales read as wide rows — three sizes is a comparison, not a grid. */
.cj-group--wide .cj-group-link { flex-direction: row; align-items: stretch; }
.cj-group--wide .cj-group-img { width: 8rem; flex: 0 0 auto; aspect-ratio: 1 / 1; }
.cj-group--wide .cj-group-body { justify-content: center; }

.cj-group--small .cj-group-name { font-size: var(--text-xs); }

.cj-aisle-index { padding: var(--space-xl) 0 var(--space-2xl); border-top: var(--rule-hair) solid var(--color-rule-2); }
.cj-aisle-index-title { font-size: var(--text-sm); color: var(--color-muted); margin: 0 0 var(--space-sm); font-weight: 600; }
.cj-aisle-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); }
.cj-aisle-index a {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--color-ink-2);
	text-decoration: none;
	white-space: nowrap;
}
.cj-aisle-index a span { color: var(--color-muted); }
.cj-aisle-index a:hover { color: var(--color-accent); }

/* Guides — collapsed by default so six of them read as a list, not a wall. */
.cj-guides { padding: var(--space-2xl) 0 var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule-2); }
.cj-guides-head { max-width: 62ch; margin-bottom: var(--space-lg); }
.cj-guides-head h2 { margin: 0 0 var(--space-2xs); }
.cj-guides-head p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.cj-guide-list { display: grid; gap: 0; max-width: 78ch; }
.cj-guide { border-top: var(--rule-hair) solid var(--color-rule); }
.cj-guide:last-child { border-bottom: var(--rule-hair) solid var(--color-rule); }
.cj-guide summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-2xs) var(--space-sm);
	padding: var(--space-sm) 0;
	cursor: pointer;
	list-style: none;
}
.cj-guide summary::-webkit-details-marker { display: none; }
.cj-guide summary::before {
	content: "+";
	font-family: var(--font-mono);
	color: var(--color-accent);
	width: 1rem;
	flex: 0 0 auto;
}
.cj-guide[open] summary::before { content: "\2212"; }
.cj-guide-title { font-weight: 700; color: var(--color-ink); }
.cj-guide-hook { font-size: var(--text-sm); color: var(--color-muted); }
.cj-guide summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.cj-guide-body { padding: 0 0 var(--space-md) 1rem; max-width: 68ch; }
.cj-guide-body p { margin: 0 0 var(--space-sm); color: var(--color-ink-2); }
.cj-guide-more { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); }

@media (max-width: 40rem) {
	.cj-group--wide .cj-group-link { flex-direction: column; }
	.cj-group--wide .cj-group-img { width: 100%; }
	.cj-guide summary { padding: var(--space-xs) 0; }
}

/* Deliberate uneven rhythm. The audit flagged "every section padded the same" on the old front
   page; repeating that with new markup would just be the same tell in a nicer coat. The ring
   deck opens loud, scales tuck in tight under it as a comparison, the shelf is a quiet strip,
   the planner gets air on both sides because it is the page's real work, and the guides close
   flat. Values, not a formula. */
.cj-deck:nth-of-type(1) { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.cj-deck:nth-of-type(2) { padding-top: var(--space-lg); padding-bottom: var(--space-md); }
.cj-deck:nth-of-type(3) { padding-top: var(--space-lg); padding-bottom: var(--space-2xl); }
.cj-calcband { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }
.cj-gauge { padding-top: var(--space-xl); padding-bottom: var(--space-lg); }
.cj-guides { padding-top: var(--space-2xl); padding-bottom: var(--space-md); }

/* ---- calculator: the "what to put in the cart" material rows ----
   These shipped as markup with no CSS, so the product photo and its text collided into an
   unstyled pile — the single ugliest thing on the page. Each row is one purchasable line:
   photo, quantity, product name, unit price, and the whole row is the link to buy it. */
.cj-calc-sub {
	margin: var(--space-lg) 0 var(--space-xs);
	font-size: var(--text-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-accent);
}
.cj-calc-mats { display: grid; gap: var(--space-xs); margin-bottom: var(--space-md); }
.cj-calc-mat {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr);
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-xs);
	border: var(--rule-hair) solid var(--color-rule);
	border-radius: var(--radius-sm);
	background: var(--color-paper-2);
	text-decoration: none;
	color: inherit;
	transition: border-color var(--dur-short) var(--ease-out),
	            background-color var(--dur-short) var(--ease-out);
}
.cj-calc-mat-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 2px;
	display: block;
}
.cj-calc-mat-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cj-calc-mat-text strong {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-sm);
	color: var(--color-ink);
}
.cj-calc-mat-name {
	font-size: var(--text-xs);
	color: var(--color-ink-2);
	line-height: 1.3;
	overflow-wrap: anywhere;
}
.cj-calc-mat-price {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: var(--text-xs);
	color: var(--color-muted);
}
.cj-calc-mat:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
	.cj-calc-mat:hover { border-color: var(--color-accent); background: var(--color-paper-3); }
}

/* The custom width/height pair is display:grid, which beats the `hidden` attribute's
   UA display:none — so it rendered on every preset, asking for dimensions the calculator
   was not using. `hidden` must win. */
.cj-field-2col[hidden],
[hidden] { display: none !important; }

/* ---- calculator: scale silhouettes, drawn true to scale ----
   All three render into an identical box at identical inches-per-unit, so the boxes match
   and the SCALES don't — which is the whole point. Photographs of scale piles showed colour,
   never size; the photos now live on the colour row where they earn their place. */
.cj-size-svg {
	display: block;
	width: 100%;
	max-width: 4.6rem;
	height: auto;
	margin: 0 auto var(--space-xs);
}
.cj-size-card.is-selected .cj-size-svg path { fill: var(--color-paper-2); }
.cj-sizes-note {
	margin: var(--space-xs) 0 0;
	font-size: var(--text-xs);
	color: var(--color-muted);
}
@media (max-width: 40rem) {
	.cj-size-svg { max-width: 3rem; margin: 0; }
}

/* ---- custom select ----
   The native <select> popup is drawn by the OS: its selection highlight is system blue and
   unreachable from CSS, which on this palette looked like a bug. The native control stays in
   the DOM and stays authoritative (see assets/js/cj-select.js); this paints over it. */
.cj-sel { position: relative; }
.cj-sel-native {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
.cj-sel-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	width: 100%;
	min-height: 44px;
	padding: var(--space-xs) var(--space-sm);
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	background: var(--color-paper);
	color: var(--color-ink);
	font: 400 var(--text-base) var(--font-body);
	text-align: left;
	cursor: pointer;
}
.cj-sel-btn::after {
	content: "";
	flex: 0 0 auto;
	width: 0.5rem; height: 0.5rem;
	border-right: 2px solid var(--color-accent);
	border-bottom: 2px solid var(--color-accent);
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform var(--dur-short) var(--ease-out);
}
.cj-sel-btn[aria-expanded="true"]::after { transform: rotate(-135deg) translate(-2px, -2px); }
.cj-sel-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
	.cj-sel-btn:hover { border-color: var(--color-accent); }
}
.cj-sel-list {
	position: absolute;
	z-index: var(--z-dropdown);
	left: 0; right: 0; top: calc(100% + 4px);
	margin: 0; padding: var(--space-3xs) 0;
	list-style: none;
	max-height: 17rem;
	overflow-y: auto;
	background: var(--color-paper-2);
	border: var(--rule-hair) solid var(--color-accent);
	border-radius: var(--radius-sm);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.cj-sel-opt {
	padding: var(--space-xs) var(--space-sm);
	color: var(--color-ink-2);
	cursor: pointer;
	font-size: var(--text-sm);
	line-height: 1.35;
}
.cj-sel-opt.is-active { background: var(--color-paper-3); color: var(--color-ink); }
.cj-sel-opt.is-selected { color: var(--color-accent); }
.cj-sel-opt.is-selected::before { content: "\2713\00a0"; }
.cj-sel-opt:not(.is-selected)::before { content: "\00a0\00a0\00a0"; }

/* ---- weave tutorials ---- */
.cj-tut { max-width: 74ch; padding: var(--space-2xl) 0 var(--space-3xl); }
.cj-tut-kicker { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--color-accent); margin: 0 0 var(--space-xs); }
.cj-tut-head h1 { margin: 0 0 var(--space-sm); }
.cj-tut-lede { font-size: var(--text-md); color: var(--color-ink-2); margin: 0 0 var(--space-lg); }
.cj-tut-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: var(--space-sm); margin: 0 0 var(--space-xl); padding: var(--space-sm) 0;
	border-top: var(--rule-hair) solid var(--color-rule);
	border-bottom: var(--rule-hair) solid var(--color-rule); }
.cj-tut-facts dt { font-size: var(--text-xs); color: var(--color-muted); margin: 0 0 2px; }
.cj-tut-facts dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
	font-size: var(--text-sm); color: var(--color-ink); }
.cj-tut-intro { font-size: var(--text-md); }
.cj-tut-body h2 { margin: var(--space-2xl) 0 var(--space-sm); }
.cj-tut-note { color: var(--color-muted); font-size: var(--text-sm); margin: 0 0 var(--space-md); }
.cj-tut-steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.cj-tut-steps li { counter-increment: step; position: relative;
	padding: var(--space-md) 0 var(--space-md) 3rem;
	border-top: var(--rule-hair) solid var(--color-rule-2); }
.cj-tut-steps li::before { content: counter(step); position: absolute; left: 0; top: var(--space-md);
	width: 2rem; text-align: right; font-family: var(--font-mono); font-size: var(--text-lg);
	color: var(--color-accent); font-variant-numeric: tabular-nums; }
.cj-tut-steps h3 { margin: 0 0 var(--space-2xs); font-size: var(--text-md); }
.cj-tut-steps p { margin: 0; color: var(--color-ink-2); }
.cj-tut-tips ul { margin: 0; padding-left: 1.1rem; color: var(--color-ink-2); }
.cj-tut-tips li { margin-bottom: var(--space-xs); }
.cj-tut-honest { margin-top: var(--space-2xl); padding-top: var(--space-md);
	border-top: var(--rule-hair) solid var(--color-rule);
	font-size: var(--text-sm); color: var(--color-muted); }

/* ============ external products + unphotographed cards ============ */
/* 2026-08-26: replaces the "Amazon Affiliate Styling" block, which carried hardcoded
   marketplace colours (#f0c14b, #00a8e1, #e77600) and broke the tokens-only seam. An
   external product's outbound action now speaks in the theme's own button voice. */
.cj-product-ext {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	justify-self: start;
	min-height: 44px;
	padding: var(--space-xs) var(--space-md);
	border: var(--rule-hair) solid var(--color-rule-strong);
	border-radius: var(--radius-sm);
	color: var(--color-ink-2);
	font: 600 var(--text-xs) var(--font-body);
	text-decoration: none;
	transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
	.cj-product-ext:hover { border-color: var(--color-accent); color: var(--color-gold-hi); background: var(--color-paper-3); }
}
.cj-product-ext:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.cj-product-ext:active { transform: translateY(1px); }

/* Not photographed yet: an initial cut in the display face on the same ruled ground the
   department tiles use — type, never a stock image, never a remote hotlink. */
.cj-product-noimg {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	font-family: var(--font-display);
	font-size: var(--text-2xl);
	font-weight: 700;
	color: var(--color-accent-deep);
	background: repeating-linear-gradient(135deg, transparent 0 10px, var(--color-rule-2) 10px 11px);
}
