/* Cat DeLo — Helix Portfolio
   Design tokens + full layout: top bar, side rail, 3D helix stage,
   detail panel, bottom bar, case study pages. */

/* ─── Webfonts ─── */

@font-face {
	font-family: "DOTBask";
	src: url("../../assets/fonts/DOTBask-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* ─── Tokens ─── */

:root {
	/* B&W + orange — high-contrast, no warm neutrals */
	--color-dark-brown: #000000;
	--color-rust: #000000;
	--color-orange: #ff6037;
	--color-teal: #ff6037; /* counter-accent collapses into orange */
	--color-cream: #ffffff;
	--color-light-gray: #ffffff;

	--bg-page: var(--color-light-gray);
	--bg-elevated: var(--color-cream);
	--bg-inverse: var(--color-dark-brown);

	--fg-1: var(--color-dark-brown);
	--fg-2: var(--color-dark-brown); /* full contrast — no muted tier */
	--fg-3: var(--color-dark-brown); /* full contrast — no muted tier */
	--fg-on-dark: var(--color-cream);
	--fg-accent: var(--color-orange);

	--border-soft: rgba(0, 0, 0, 0.35);

	--font-display: "DOTBask", "DM Serif Display", serif;
	--font-sans: "IBM Plex Sans", system-ui, sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ─── Dark mode token overrides ─── */

[data-theme="dark"] {
	/* Pure black — matches the B&W + orange system */
	--bg-page: #000000;
	--bg-elevated: #111111;
	--bg-inverse: #ffffff;

	/* Foreground — pure white across the board */
	--fg-1: #ffffff;
	--fg-2: #ffffff;
	--fg-3: #ffffff;
	--fg-on-dark: #000000;

	/* Accents — orange on black is maximum punch */
	--fg-accent: var(--color-orange);

	/* Hairlines — white-on-black */
	--border-soft: rgba(255, 255, 255, 0.4);

	color-scheme: dark;
}

/* Surfaces that hard-coded --color-cream need patching in dark mode */
[data-theme="dark"] .helix-card .frame .caption,
[data-theme="dark"] .content-hero,
[data-theme="dark"] .cs-hero,
[data-theme="dark"] .cs-figure,
[data-theme="dark"] .about-pillar {
	background: var(--bg-elevated);
}

/* Primary action button stays readable */
[data-theme="dark"] .panel-actions a.primary {
	color: var(--color-cream);
}

/* Drag cursor — double-arrow, white halo for legibility over cards */
[data-theme="dark"] .stage {
	cursor:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><g fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='%23ffffff' stroke-width='4.5' opacity='0.9'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g><g stroke='%23ffffff' stroke-width='2'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g></g></svg>")
			18 18,
		grab;
}
[data-theme="dark"] .stage.dragging,
[data-theme="dark"] .stage:active {
	cursor:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><g fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='%23ffffff' stroke-width='4.5' opacity='0.9'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g><g stroke='%23FF6037' stroke-width='2.4'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g></g></svg>")
			18 18,
		grabbing;
}

/* ─── Baseline ink weight — small all-caps mono labels everywhere ─── */
.topbar,
.bottombar,
.rail-nav,
.rail-meta,
.rail-footer,
.rail-list button .num,
.rail-list button .kind,
.helix-card .frame .caption .meta,
.panel-header,
.panel-category,
.panel-list li,
.panel-actions a,
.content-eyebrow,
.content-meta .k,
.about-section-eyebrow,
.about-pillar .pillar-tag,
.about-principles li::before,
.about-outside .row-label,
.about-outside .row-stat,
.cs-eyebrow,
.cs-eyebrow .cs-id,
.cs-facts .k,
.cs-section .cs-label,
.cs-process li::before,
.cs-pull cite,
.cs-colophon .k,
.cs-nav,
.cs-nav .cs-nav-label,
.bar-section {
	font-weight: 600;
}

/* Card shadow override handled in .helix-card .frame below */

/* ─── Theme toggle button ─── */

.theme-toggle {
	background: transparent;
	border: 1px solid var(--fg-1);
	color: var(--fg-1);
	padding: 0 10px;
	height: 22px;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	line-height: 1;
	transition:
		color 160ms ease,
		border-color 160ms ease,
		background 160ms ease;
}
.theme-toggle:hover {
	color: var(--fg-accent);
	border-color: var(--fg-accent);
}
.theme-toggle:focus-visible {
	outline: 2px solid var(--fg-accent);
	outline-offset: 2px;
}
.theme-toggle .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--fg-1);
	display: inline-block;
	transition: background 160ms ease;
}
[data-theme="dark"] .theme-toggle .dot {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--fg-1);
}
.theme-toggle:hover .dot {
	background: var(--fg-accent);
	box-shadow: none;
}

/* Gap between toggle buttons and other right-section items */
.topbar .bar-section.right {
	gap: 14px;
}

.topbar-label {
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-1);
}

/* ─── Reset ─── */

*,
*::before,
*::after {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	padding: 0;
}

body {
	background: var(--bg-page);
	color: var(--fg-1);
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
}

button {
	font: inherit;
}

/* ─── App shell ─── */

.app {
	position: fixed;
	inset: 0;
	background-color: var(--bg-page);
	overflow: hidden;
}

/* ─── Top / bottom bars ─── */

.topbar,
.bottombar {
	position: absolute;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	padding: 0 24px;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-1);
	background: var(--bg-page);
	z-index: 20;
}
.topbar {
	top: 0;
	height: 40px;
	border-bottom: 1px solid var(--fg-1);
}
.bottombar {
	bottom: 0;
	height: 32px;
	border-top: 1px solid var(--fg-1);
	font-size: 12px;
}
.bottombar a {
	color: var(--fg-1);
	text-decoration: none;
	opacity: 1;
}
.bottombar a:hover {
	color: var(--fg-accent);
}

.bar-section {
	display: flex;
	align-items: center;
	gap: 12px;
}
.bar-section.center {
	display: none;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}
.bar-section.right {
	margin-left: auto;
}
.bar-dot {
	width: 6px;
	height: 6px;
	background: var(--color-orange);
	border-radius: 50%;
}

/* ─── Side rail ─── */

.rail {
	position: absolute;
	left: 0;
	top: 40px;
	bottom: 32px;
	width: 320px;
	border-right: 1px solid var(--fg-1);
	background: transparent;
	padding: 32px 28px 24px;
	display: flex;
	flex-direction: column;
	z-index: 15;
	overflow-y: auto;
}

.rail-wordmark {
	font-family: var(--font-display);
	font-size: 82px;
	line-height: 1;
	color: var(--fg-accent);
	letter-spacing: -0.01em;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
	text-decoration: none;
	white-space: nowrap;
	margin-left: -2px; /* optical alignment — flush to rail edge */
}
.rail-wordmark .kern-L {
	margin-left: -3px; /* manual kern: tighten eL pair */
}

.rail-tagline {
	margin-top: 12px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--fg-1);
	white-space: nowrap;
}

/* ─── Topbar center wordmark ─── */

.topbar-wordmark {
	font-family: var(--font-display);
	font-size: 22px;
	line-height: 1;
	color: var(--fg-accent);
	letter-spacing: -0.01em;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	user-select: none;
}
.topbar-wordmark .kern-L {
	margin-left: -2px; /* tighten eL pair at topbar scale */
}

.rail-nav {
	margin-top: 18px;
	display: flex;
	gap: 14px;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}
.rail-nav a {
	color: var(--fg-2);
	text-decoration: none;
	padding: 4px 0;
	border-bottom: 1px solid transparent;
	transition:
		color 160ms ease,
		border-color 160ms ease;
}
.rail-nav a:hover {
	color: var(--fg-accent);
}
.rail-nav a.active {
	color: var(--fg-1);
	border-bottom-color: var(--fg-accent);
}

.rail-meta {
	margin-top: 24px;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-2);
	display: flex;
	justify-content: space-between;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--fg-1);
}
.rail-meta .count {
	color: var(--fg-1);
}

.rail-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
}
.rail-list li {
	margin: 0;
	border-bottom: 1px solid var(--border-soft);
	position: relative;
}
.rail-list button {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	align-items: baseline;
	gap: 10px;
	width: 100%;
	padding: 12px 0;
	background: transparent;
	border: 0;
	text-align: left;
	cursor: pointer;
	color: var(--fg-1);
	transition:
		color 160ms ease,
		transform 160ms ease;
}
.rail-list button:hover {
	color: var(--fg-accent);
	transform: translateX(3px);
}
.rail-list button .num {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.18em;
	color: var(--fg-3);
}
.rail-list button .name {
	font-size: 16px;
	font-weight: 500;
}
.rail-list button .kind {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--fg-3);
}
.rail-list li.active button {
	color: var(--fg-accent);
}
.rail-list li.active button .num,
.rail-list li.active button .kind {
	color: var(--fg-accent);
}
.rail-list li.active button::before {
	content: "";
	position: absolute;
	width: 6px;
	height: 6px;
	background: var(--fg-accent);
	border-radius: 50%;
	left: -18px;
	top: 19px;
}

.rail-footer {
	margin-top: auto;
	padding-top: 24px;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-2);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.rail-footer a {
	color: var(--fg-1);
	text-decoration: none;
}
.rail-footer a:hover {
	color: var(--fg-accent);
}

/* ─── Main stage (helix) ─── */

.stage {
	position: absolute;
	top: 40px;
	bottom: 32px;
	left: 320px;
	right: 0;
	overflow: hidden;
	transition: right 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
	cursor:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><g fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='%23ffffff' stroke-width='4.5' opacity='0.9'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g><g stroke='%23000000' stroke-width='2'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g></g></svg>")
			18 18,
		grab;
}
.stage.dragging,
.stage:active {
	cursor:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><g fill='none' stroke-linecap='round' stroke-linejoin='round'><g stroke='%23ffffff' stroke-width='4.5' opacity='0.9'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g><g stroke='%23FF6037' stroke-width='2.4'><path d='M9 18H27'/><path d='M14 13L9 18l5 5'/><path d='M22 13l5 5-5 5'/></g></g></svg>")
			18 18,
		grabbing;
}

body.panel-open .stage {
	right: 380px;
}
body.panel-open .helix-controls {
	opacity: 0;
	pointer-events: none;
	transition: opacity 160ms ease;
}

.scene {
	position: absolute;
	inset: 0;
	perspective: 1600px;
	perspective-origin: 50% 50%;
}

.helix {
	position: absolute;
	top: 50%;
	left: 50%;
	transform-style: preserve-3d;
	will-change: transform;
}

.helix-card {
	position: absolute;
	top: 0;
	left: 0;
	width: 240px;
	height: 288px;
	margin-left: -120px;
	margin-top: -144px;
	transform-style: preserve-3d;
	transform-origin: 50% 50%;
	cursor: pointer;
	transition:
		opacity 280ms ease,
		filter 280ms ease;
}

.helix-card.is-dimmed {
	opacity: 0.22;
	filter: grayscale(1);
	pointer-events: none;
}

.helix-card .frame {
	width: 100%;
	height: 100%;
	position: relative;
	background: var(--bg-page);
	border: 2px solid var(--fg-1);
	box-shadow: 8px 8px 0 0 var(--fg-1);
	overflow: hidden;
	transition:
		border-color 150ms ease,
		box-shadow 150ms ease,
		transform 150ms ease;
}
.helix-card:hover:not(.is-focused) .frame {
	border-color: var(--fg-accent);
	box-shadow: 8px 8px 0 0 var(--fg-accent);
}
.helix-card.is-focused .frame {
	border-color: var(--fg-accent);
	box-shadow: 10px 10px 0 0 var(--fg-accent);
}

.helix-card .frame img {
	display: block;
	width: 100%;
	height: 70%;
	object-fit: cover;
	border-bottom: 2px solid var(--fg-1);
}
.helix-card .frame img.img-contain {
	object-fit: contain;
	padding: 16px;
	background: #ded2c7;
}

.helix-card .frame .caption {
	height: 30%;
	padding: 10px 14px 12px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	background: var(--color-cream);
}
.helix-card .frame .caption .name {
	font-family: var(--font-sans);
	font-size: 17px;
	font-weight: 600;
	color: var(--fg-1);
	letter-spacing: -0.01em;
	line-height: 1.1;
}
.helix-card .frame .caption .meta {
	display: flex;
	justify-content: space-between;
	font-family: var(--font-mono);
	font-size: 11.5px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-2);
}
.helix-card .frame .caption .meta .num {
	color: var(--fg-accent);
}

/* ─── Detail panel ─── */

.panel {
	position: absolute;
	top: 40px;
	bottom: 32px;
	right: 0;
	width: 380px;
	background: var(--bg-page);
	border-left: 1px solid var(--fg-1);
	z-index: 18;
	transform: translateX(100%);
	transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}
.panel.open {
	transform: translateX(0);
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	border-bottom: 1px solid var(--fg-1);
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-1);
}
.panel-close {
	width: 28px;
	height: 28px;
	border: 1px solid var(--fg-1);
	background: transparent;
	color: var(--fg-1);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	font-family: var(--font-sans);
	font-weight: 400;
	transition:
		color 160ms ease,
		border-color 160ms ease;
}
.panel-close:hover {
	color: var(--fg-accent);
	border-color: var(--fg-accent);
}

.panel-hero {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-bottom: 1px solid var(--fg-1);
	background: var(--bg-page);
	overflow: hidden;
}
.panel-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.panel-body {
	padding: 24px 22px;
}
.panel-category {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-accent);
}
.panel-title {
	font-family: var(--font-display);
	font-size: 44px;
	line-height: 1;
	color: var(--fg-1);
	letter-spacing: -0.01em;
	margin: 10px 0 18px;
	font-weight: 400;
}
.panel-desc {
	font-size: 16px;
	line-height: 1.55;
	color: var(--fg-1);
	margin: 0 0 22px;
}
.panel-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--fg-1);
}
.panel-list li {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--border-soft);
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.panel-list .k {
	color: var(--fg-2);
}
.panel-list .v {
	color: var(--fg-1);
}

.panel-actions {
	margin-top: 24px;
	display: flex;
	gap: 12px;
}
.panel-actions a {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 14px;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	text-decoration: none;
	border: 1px solid var(--fg-1);
	color: var(--fg-1);
	transition:
		background 160ms ease,
		color 160ms ease;
}
.panel-actions a:hover {
	background: var(--fg-1);
	color: var(--bg-page);
}
.panel-actions a.primary {
	background: var(--fg-accent);
	border-color: var(--fg-accent);
	color: var(--color-cream);
}
.panel-actions a.primary:hover {
	background: var(--fg-1);
	border-color: var(--fg-1);
	color: var(--bg-page);
}

/* ─── Static content (About / Contact pages) ─── */

.content {
	position: absolute;
	top: 40px;
	bottom: 32px;
	left: 320px;
	right: 0;
	overflow-y: auto;
	padding: 56px 64px 64px;
}
.content-inner {
	max-width: 720px;
}

.content-eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-2);
}

.content h1 {
	font-family: var(--font-display);
	font-size: clamp(64px, 9vw, 120px);
	line-height: 0.92;
	color: var(--fg-accent);
	letter-spacing: -0.02em;
	margin: 14px 0 36px;
	font-weight: 400;
}

.content-hero {
	margin: 0 0 44px;
	width: 100%;
	max-width: 520px;
	aspect-ratio: 5 / 4;
	background: var(--color-cream);
	border: 2px solid var(--fg-1);
	box-shadow: 8px 8px 0 0 var(--fg-1);
	overflow: hidden;
}
.content-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 30%;
	display: block;
}

.content p {
	font-size: 17px;
	line-height: 1.6;
	color: var(--fg-1);
	margin: 0 0 22px;
	max-width: 60ch;
}
.content p:last-of-type {
	margin-bottom: 0;
}
.content p em {
	font-style: normal;
	color: var(--fg-accent);
}
.content p.muted {
	color: var(--fg-2);
	font-size: 14px;
}

.content-meta {
	margin-top: 56px;
	padding-top: 28px;
	border-top: 1px solid var(--fg-1);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 28px;
}
.content-meta .k {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-3);
	display: block;
	margin-bottom: 6px;
}
.content-meta .v {
	font-size: 18px;
	line-height: 1.5;
	color: var(--fg-1);
}
.content-meta .v a {
	color: var(--fg-1);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.content-meta .v a:hover {
	color: var(--fg-accent);
}

/* ─── About page sections ─── */

.about-section {
	margin-top: 96px;
	padding-top: 36px;
	border-top: 1px solid var(--fg-1);
}

.about-section-eyebrow {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-2);
	margin-bottom: 24px;
}
.about-section-eyebrow .num {
	color: var(--fg-accent);
}

.about-h2 {
	font-family: var(--font-display);
	font-size: clamp(42px, 5.5vw, 80px);
	line-height: 0.95;
	color: var(--fg-1);
	letter-spacing: -0.02em;
	margin: 0 0 36px;
	font-weight: 400;
}

/* Pillars grid */
.about-pillars {
	margin: 44px 0 44px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	border-top: 1px solid var(--fg-1);
	border-left: 1px solid var(--fg-1);
}
.about-pillar {
	padding: 24px 22px 28px;
	border-right: 1px solid var(--fg-1);
	border-bottom: 1px solid var(--fg-1);
}
.pillar-tag {
	display: block;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-accent);
	margin-bottom: 14px;
}
.about-pillar h3 {
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: 600;
	color: var(--fg-1);
	margin: 0 0 10px;
	letter-spacing: -0.01em;
}
.pillar-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0;
}
.pillar-list li {
	font-size: 13px;
	line-height: 1.45;
	color: var(--fg-2);
	padding: 6px 0;
	border-bottom: 1px solid var(--border-soft);
}
.pillar-list li:last-child {
	border-bottom: 0;
}

/* Principles list */
.about-principles {
	margin: 12px 0 36px;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0;
	max-width: 60ch;
	border-top: 1px solid var(--border-soft);
}
.about-principles li {
	display: grid;
	grid-template-columns: 36px 1fr;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border-soft);
	font-size: 16px;
	line-height: 1.55;
	color: var(--fg-1);
}
.about-principles li::before {
	content: attr(data-n);
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	color: var(--fg-accent);
	padding-top: 5px;
}

/* About section links */
.about-section a {
	color: var(--fg-1);
	border-bottom: 1px solid var(--fg-1);
	text-decoration: none;
	transition:
		color 160ms ease,
		border-color 160ms ease;
}
.about-section a:hover {
	color: var(--fg-accent);
	border-color: var(--fg-accent);
}

/* Outside the studio rows */
.about-outside {
	margin-top: 36px;
	border-top: 1px solid var(--fg-1);
}
.row {
	display: grid;
	grid-template-columns: 160px 1fr auto;
	gap: 32px;
	align-items: start;
	padding: 24px 0;
	border-bottom: 1px solid var(--border-soft);
}
.row-label {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-2);
	padding-top: 4px;
}
.row-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--fg-1);
	margin-bottom: 8px;
	letter-spacing: -0.01em;
}
.row-body {
	font-size: 15px;
	line-height: 1.55;
	color: var(--fg-2);
	margin: 0;
	max-width: 52ch;
}
.row-stat {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--fg-3);
	padding-top: 4px;
	white-space: nowrap;
}

.contact-mailto {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	font-family: var(--font-display);
	font-size: clamp(36px, 5vw, 64px);
	line-height: 1;
	color: var(--fg-1);
	text-decoration: none;
	margin: 0 0 44px;
	letter-spacing: -0.01em;
	transition: color 200ms ease;
	border-bottom: 2px solid var(--fg-1);
	padding-bottom: 6px;
}
.contact-mailto:hover {
	color: var(--fg-accent);
	border-bottom-color: var(--fg-accent);
}
.contact-mailto::after {
	content: " →";
	font-size: 0.8em;
	color: var(--fg-accent);
}

/* ─── Helix Controls ─── */

.helix-controls {
	position: fixed;
	bottom: 48px;
	right: 20px;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	padding: 12px 14px;
	min-width: 180px;
}

.helix-controls label {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--fg-2);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: default;
}

.helix-controls .ctrl-row {
	display: flex;
	justify-content: space-between;
}

.helix-controls .ctrl-row span:last-child {
	color: var(--fg-1);
}

.helix-controls input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 2px;
	background: var(--border);
	outline: none;
	cursor: pointer;
}

.helix-controls input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 10px;
	height: 10px;
	background: var(--fg-accent);
	border: none;
	border-radius: 0;
	cursor: pointer;
}

.helix-controls input[type="range"]::-moz-range-thumb {
	width: 10px;
	height: 10px;
	background: var(--fg-accent);
	border: none;
	border-radius: 0;
	cursor: pointer;
}

/* ─── Case study layout ─── */

.cs-eyebrow {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-2);
	padding-bottom: 16px;
	border-bottom: 1px solid var(--fg-1);
}
.cs-eyebrow .cs-id {
	color: var(--fg-accent);
}

.cs-header {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 56px;
	align-items: end;
	margin: 28px 0 48px;
}
.cs-header h1 {
	font-family: var(--font-display);
	font-size: clamp(72px, 9vw, 132px);
	line-height: 0.9;
	color: var(--fg-1);
	letter-spacing: -0.025em;
	margin: 0;
	font-weight: 400;
}
.cs-header .cs-deck {
	font-size: 17px;
	line-height: 1.5;
	color: var(--fg-1);
	margin: 0;
	max-width: 38ch;
}

.cs-facts {
	margin: 0 0 56px;
	padding: 20px 0;
	border-top: 1px solid var(--fg-1);
	border-bottom: 1px solid var(--fg-1);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 24px;
}
.cs-facts .k {
	font-family: var(--font-mono);
	font-size: 14px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-3);
	display: block;
	margin-bottom: 6px;
}
.cs-facts .v {
	font-size: 16px;
	line-height: 1.4;
	color: var(--fg-1);
}

.cs-hero {
	width: 100%;
	margin: 0 0 56px;
	border: 2px solid var(--fg-1);
	box-shadow: 12px 12px 0 0 var(--fg-1);
	overflow: hidden;
	background: var(--color-cream);
}
.cs-hero img {
	display: block;
	width: 100%;
	height: auto;
}

.cs-section {
	margin: 0 0 56px;
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 32px;
	align-items: start;
}
.cs-section .cs-label {
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-2);
	padding-top: 6px;
}
.cs-section .cs-body p {
	font-size: 19px;
	line-height: 1.6;
	color: var(--fg-1);
	margin: 0 0 18px;
	max-width: 60ch;
}
.cs-section .cs-body p:last-child {
	margin-bottom: 0;
}

.cs-figure {
	margin: 0 0 56px;
	border: 2px solid var(--fg-1);
	box-shadow: 8px 8px 0 0 var(--fg-1);
	overflow: hidden;
	background: var(--color-cream);
}
.cs-figure img,
.cs-figure video {
	display: block;
	width: 100%;
	height: auto;
}

/* ── PDF download ── */
.cs-download {
	padding: 28px 0;
}
.cs-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--fg-1);
	border: 1px solid var(--fg-1);
	transition:
		background 160ms ease,
		color 160ms ease;
}
.cs-download-btn::before {
	content: "↓";
	font-size: 13px;
	color: var(--fg-accent);
}
.cs-download-btn:hover {
	background: var(--fg-1);
	color: var(--bg-page);
}
.cs-download-btn:hover::before {
	color: var(--fg-accent);
}

.cs-nav {
	margin-top: 80px;
	padding-top: 28px;
	border-top: 1px solid var(--fg-1);
	display: flex;
	justify-content: space-between;
	gap: 32px;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}
.cs-nav a {
	color: var(--fg-1);
	text-decoration: none;
	display: inline-flex;
	flex-direction: column;
	gap: 6px;
	max-width: 45%;
}
.cs-nav a:hover {
	color: var(--fg-accent);
}
.cs-nav .cs-nav-label {
	color: var(--fg-3);
	font-size: 10px;
}
.cs-nav .cs-nav-title {
	font-family: var(--font-display);
	font-size: 22px;
	line-height: 1;
	letter-spacing: -0.01em;
	text-transform: none;
}
.cs-nav .next {
	text-align: right;
	align-items: flex-end;
}

/* ── Pull quote ── */
.cs-pull {
	margin: 0 0 56px;
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 32px;
	align-items: start;
}
.cs-pull .cs-pull-mark {
	font-family: var(--font-display);
	font-size: 64px;
	line-height: 0.7;
	color: var(--fg-accent);
	padding-top: 4px;
}
.cs-pull blockquote {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(28px, 3.2vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--fg-1);
	margin: 0 0 14px;
	max-width: 24ch;
	text-wrap: pretty;
}
.cs-pull cite {
	display: block;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-3);
	font-style: normal;
}

/* ── Process list ── */
.cs-process {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 60ch;
}
.cs-process li {
	display: grid;
	grid-template-columns: 36px 1fr;
	gap: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--border-soft);
	font-size: 16px;
	line-height: 1.5;
	color: var(--fg-1);
}
.cs-process li:first-child {
	padding-top: 0;
	border-top: 0;
}
.cs-process li::before {
	content: attr(data-n);
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.22em;
	color: var(--fg-accent);
	padding-top: 5px;
}

/* ── Colophon ── */
.cs-colophon {
	margin: 56px 0 0;
	padding: 24px 0 28px;
	border-top: 1px solid var(--fg-1);
	border-bottom: 1px solid var(--fg-1);
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px;
}
.cs-colophon .k {
	font-family: var(--font-mono);
	font-size: 14px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--fg-3);
	display: block;
	margin-bottom: 6px;
}
.cs-colophon .v {
	font-size: 16px;
	line-height: 1.4;
	color: var(--fg-1);
}

/* ─── Mobile ─── */

/* Hamburger injected by mobile-nav.js — desktop only hides it */
.mobile-ham {
	display: none;
}

@media (max-width: 768px) {
	/* Mobile helix layout (helix hidden — MobileApp renders instead) */
	body {
		overflow: auto;
	} /* undo desktop overflow:hidden for mobile scroll */
	.mobile-ham {
		display: flex;
		margin-right: 10px;
		flex-shrink: 0;
	}
	.rail {
		display: none;
	}
	.stage {
		left: 0;
	}
	.panel {
		width: 100%;
	}
	body.panel-open .stage {
		right: 0;
	}
	.bar-section.center {
		display: flex;
		transform: translateX(-50%) translateY(-1px);
	}
	/* Case study + static pages */
	.content {
		left: 0;
		padding: 36px 28px;
	}
	.cs-header {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.cs-section {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.cs-pull {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.cs-colophon {
		grid-template-columns: repeat(2, 1fr);
	}
	.about-pillars {
		grid-template-columns: 1fr;
	}
	.row {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.row-stat {
		display: none;
	}
	.contact-mailto {
		font-size: clamp(22px, 6.5vw, 36px);
		letter-spacing: -0.02em;
	}
	.about-img-3 {
		width: 100% !important;
	}
	.about-img-4 {
		width: 100% !important;
	}
	.bottombar {
		font-size: 12.75px;
		letter-spacing: 0.08em;
		padding: 0 14px;
	}
	.topbar-label {
		display: none;
	}
}
