/* =====================================================================
   SERGIO GUGLIANDOLO — "Blueprint lab" stylesheet
   ---------------------------------------------------------------------
   1. Fonts            7. Buttons, chips, badges
   2. Design tokens    8. Cards
   3. Base             9. Page sections (home, projects, project,
   4. Background          links, qr, sum, error)
   5. Layout          10. Overlays (lightbox, qr, toast)
   6. Header/footer   11. Motion + utilities
   Colors live in section 2: change them there and the whole site follows.
   ===================================================================== */

/* ---------- 1. Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
	font-family: "Space Grotesk";
	src: url("../fonts/space-grotesk.woff2") format("woff2");
	font-weight: 300 700;
	font-display: swap;
}
@font-face {
	font-family: "Inter";
	src: url("../fonts/inter.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}
@font-face {
	font-family: "JetBrains Mono";
	src: url("../fonts/jetbrains-mono.woff2") format("woff2");
	font-weight: 100 800;
	font-display: swap;
}

/* ---------- 2. Design tokens ---------- */
:root {
	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	/* light = engineering paper */
	--bg: #f2f5f9;
	--bg-2: #e8edf3;
	--surface: #ffffff;
	--surface-2: #f5f7fa;
	--ink: #0d1520;
	--ink-2: #45536a;
	--ink-3: #5c697d;
	--line: #d7dee8;
	--line-strong: #b8c3d2;
	--accent: #2462b8;
	--accent-ink: #ffffff;
	--accent-soft: #e2ebf8;
	--signal: #e8562a;
	--signal-soft: #fde7de;
	--ok: #18905b;
	--warn: #b67b00;
	--solo: #6650c8;
	--dot: 36, 98, 184; /* rgb of the background dots */
	--grid-line: rgba(36, 98, 184, 0.06);
	--shadow-sm: 0 1px 2px rgba(13, 21, 32, 0.06);
	--shadow: 0 1px 2px rgba(13, 21, 32, 0.05), 0 10px 30px -12px rgba(13, 21, 32, 0.18);
	--shadow-lg: 0 2px 4px rgba(13, 21, 32, 0.05), 0 24px 60px -20px rgba(13, 21, 32, 0.28);
	--header-bg: rgba(242, 245, 249, 0.78);

	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 22px;
	--wrap: 1180px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	color-scheme: light;
}

/* dark = night blueprint */
:root[data-theme="dark"] {
	--bg: #08101c;
	--bg-2: #0c1626;
	--surface: #0f1a2c;
	--surface-2: #132035;
	--ink: #e8eef7;
	--ink-2: #a5b4c8;
	--ink-3: #7b8ba2;
	--line: #1d2b42;
	--line-strong: #2b3d5a;
	--accent: #6ea8ff;
	--accent-ink: #061021;
	--accent-soft: #14284a;
	--signal: #ff7c4d;
	--signal-soft: #3b1c10;
	--ok: #3cc98a;
	--warn: #f0b429;
	--solo: #a594ff;
	--dot: 110, 168, 255;
	--grid-line: rgba(110, 168, 255, 0.05);
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
	--shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 60px -20px rgba(0, 0, 0, 0.75);
	--header-bg: rgba(8, 16, 28, 0.72);
	color-scheme: dark;
}

/* ---------- 3. Base ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 84px;
}
body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--ink);
	background-color: var(--bg);
	/* faint blueprint grid lines (the moving dots are drawn by background.js) */
	background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
	background-size: 120px 120px;
	background-position: -1px -1px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img,
svg,
video {
	display: block;
	max-width: 100%;
}
img {
	height: auto;
}
a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
a:hover {
	text-decoration-thickness: 2px;
}
button {
	font: inherit;
	color: inherit;
}
h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
	font-weight: 600;
	text-wrap: balance;
}
h1 {
	font-size: clamp(2.4rem, 6.4vw, 4.8rem);
	letter-spacing: -0.035em;
}
h2 {
	font-size: clamp(1.7rem, 3.6vw, 2.6rem);
}
h3 {
	font-size: 1.25rem;
}
p {
	margin: 0 0 1em;
	text-wrap: pretty;
}
::selection {
	background: var(--accent);
	color: var(--accent-ink);
}
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}
.i {
	width: 1.15em;
	height: 1.15em;
	flex: none;
}
.i-stroke {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.i-fill {
	fill: currentColor;
}

/* ---------- 4. Background canvas ---------- */
#bg {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
	-webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
	mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
}

/* ---------- 5. Layout ---------- */
.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: clamp(1.1rem, 4vw, 2rem);
}
.wrap-narrow {
	max-width: 780px;
}
main {
	flex: 1;
}
.section {
	padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
.section-tight {
	padding-block: clamp(2rem, 5vw, 3.5rem);
}
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-bottom: 2rem;
}
.section-head h2 {
	margin: 0.35rem 0 0;
}
.section-head p {
	margin: 0.6rem 0 0;
	color: var(--ink-2);
	max-width: 46ch;
}
.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ink-3);
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
}
.eyebrow::before {
	content: "";
	width: 18px;
	height: 1px;
	background: currentColor;
}
.lead {
	font-size: clamp(1.08rem, 1.6vw, 1.25rem);
	color: var(--ink-2);
	line-height: 1.6;
}
.muted {
	color: var(--ink-2);
}
.mono {
	font-family: var(--font-mono);
}
.grid-2 {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	grid-template-columns: 1fr;
}
@media (min-width: 900px) {
	.grid-2 {
		grid-template-columns: 1fr 1fr;
		align-items: center;
	}
}

/* ---------- 6. Header & footer ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--header-bg);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	backdrop-filter: saturate(160%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.25s, background-color 0.3s;
}
.site-header.is-scrolled {
	border-bottom-color: var(--line);
}
.header-inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	height: 64px;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	color: var(--ink);
	text-decoration: none;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	margin-right: auto;
	white-space: nowrap;
}
.brand img {
	width: 30px;
	height: 30px;
	will-change: transform;
}
.brand-short {
	display: none;
}
@media (max-width: 420px) {
	.brand-full {
		display: none;
	}
	.brand-short {
		display: inline;
	}
}
.nav {
	display: flex;
	gap: 0.25rem;
}
.nav a {
	position: relative;
	padding: 0.45rem 0.75rem;
	border-radius: 999px;
	color: var(--ink-2);
	text-decoration: none;
	font-size: 0.94rem;
	font-weight: 500;
	transition: color 0.2s, background-color 0.2s;
}
.nav a:hover {
	color: var(--ink);
	background: var(--surface-2);
}
.nav a[aria-current="page"] {
	color: var(--ink);
	background: var(--surface);
	box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.nav a .dot {
	position: absolute;
	top: 6px;
	right: 6px;
}
.tools {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.seg {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--line);
}
.seg button {
	border: 0;
	background: none;
	cursor: pointer;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	color: var(--ink-3);
	transition: background-color 0.2s, color 0.2s;
}
.seg button[aria-pressed="true"] {
	background: var(--surface);
	color: var(--ink);
	box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
}
.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	border: 0;
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--line);
	color: var(--ink-2);
	cursor: pointer;
	transition: color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover {
	color: var(--ink);
	background: var(--surface);
}
.icon-btn:active {
	transform: scale(0.94);
}
.icon-btn .i {
	width: 18px;
	height: 18px;
}
.theme-btn .i {
	transition: transform 0.5s var(--ease);
}
.theme-btn:hover .i {
	transform: rotate(40deg);
}
.menu-btn {
	display: none;
}
.mobile-nav {
	display: none;
}
@media (max-width: 760px) {
	.site-header .nav {
		display: none;
	}
	.menu-btn {
		display: inline-grid;
	}
	.mobile-nav {
		display: grid;
		gap: 0.25rem;
		padding: 0 clamp(1.1rem, 4vw, 2rem);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
	}
	.site-header.is-open .mobile-nav {
		max-height: 420px;
		padding-block: 0.25rem 1rem;
	}
	.mobile-nav a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0.85rem 1rem;
		border-radius: var(--radius);
		background: var(--surface);
		box-shadow: inset 0 0 0 1px var(--line);
		color: var(--ink);
		text-decoration: none;
		font-family: var(--font-display);
		font-weight: 500;
		font-size: 1.1rem;
	}
	.mobile-nav a[aria-current="page"] {
		box-shadow: inset 0 0 0 1.5px var(--accent);
	}
}

.site-footer {
	margin-top: 3rem;
	border-top: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 70%, transparent);
	padding-block: 2.2rem;
	font-size: 0.9rem;
	color: var(--ink-2);
}
.footer-inner {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}
@media (min-width: 760px) {
	.footer-inner {
		grid-template-columns: 1.4fr 1fr auto;
		align-items: start;
	}
}
.footer-inner p {
	margin: 0.3rem 0 0;
}
.footer-social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.footer-meta {
	display: grid;
	gap: 0.35rem;
}
.footer-meta a {
	color: var(--ink-2);
	text-decoration: none;
}
.footer-meta a:hover {
	color: var(--ink);
	text-decoration: underline;
}
.footer-joke {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--ink-3);
}

/* ---------- 7. Buttons, chips, badges ---------- */
.btn {
	--btn-bg: var(--surface);
	--btn-ink: var(--ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.78rem 1.2rem;
	border-radius: 999px;
	border: 0;
	background: var(--btn-bg);
	color: var(--btn-ink);
	box-shadow: inset 0 0 0 1px var(--line-strong);
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.25s;
	white-space: nowrap;
}
.btn:hover {
	transform: translateY(-2px);
	box-shadow: inset 0 0 0 1px var(--ink-3), var(--shadow);
	text-decoration: none;
}
.btn:active {
	transform: translateY(0) scale(0.98);
}
.btn .i {
	transition: transform 0.25s var(--ease);
}
.btn:hover .i-move {
	transform: translateX(3px);
}
.btn-primary {
	--btn-bg: var(--ink);
	--btn-ink: var(--bg);
	box-shadow: none;
}
.btn-primary:hover {
	box-shadow: var(--shadow-lg);
}
.btn-accent {
	--btn-bg: var(--accent);
	--btn-ink: var(--accent-ink);
	box-shadow: none;
}
.btn-sm {
	padding: 0.5rem 0.85rem;
	font-size: 0.86rem;
}
.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.42rem 0.8rem;
	border-radius: 999px;
	border: 0;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	color: var(--ink-2);
	font-size: 0.86rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s var(--ease);
	white-space: nowrap;
}
.chip:hover {
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--ink-3);
}
.chip[aria-pressed="true"] {
	background: var(--ink);
	color: var(--bg);
	box-shadow: none;
}
.chip .count {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--ink-3);
}
.chip[aria-pressed="true"] .count {
	color: inherit;
	opacity: 0.8;
}
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}
.tag {
	display: inline-flex;
	align-items: center;
	padding: 0.18rem 0.55rem;
	border-radius: 6px;
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--line);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.02em;
	color: var(--ink-2);
	white-space: nowrap;
}
a.tag {
	text-decoration: none;
	transition: color 0.2s, box-shadow 0.2s;
}
a.tag:hover {
	color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent);
}
.badge {
	--c: var(--ink-3);
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.25rem 0.6rem 0.25rem 0.5rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--c) 12%, var(--surface));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent);
	color: color-mix(in srgb, var(--c) 80%, var(--ink));
	font-family: var(--font-mono);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}
.badge.status-wip {
	--c: var(--signal);
}
.badge.status-paused {
	--c: var(--warn);
}
.badge.status-done {
	--c: var(--ok);
}
.badge.status-solo {
	--c: var(--solo);
}
.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--c, var(--signal));
	flex: none;
}
.status-wip .dot,
.dot.pulse {
	animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--signal)) 60%, transparent);
	}
	100% {
		box-shadow: 0 0 0 9px transparent;
	}
}
.status-paused .dot {
	background: none;
	width: 9px;
	border-radius: 0;
	border-inline: 3px solid var(--c);
}

/* ---------- 8. Cards ---------- */
.card {
	position: relative;
	background: var(--surface);
	border-radius: var(--radius-lg);
	box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
	transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
a.card {
	color: inherit;
	text-decoration: none;
}
a.card:hover {
	box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-lg);
}
/* blueprint corner ticks that appear on hover */
.ticks::before,
.ticks::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	border: 1.5px solid var(--accent);
	opacity: 0;
	transition: opacity 0.3s, transform 0.35s var(--ease);
	pointer-events: none;
	z-index: 3;
}
.ticks::before {
	top: -6px;
	left: -6px;
	border-right: 0;
	border-bottom: 0;
	transform: translate(4px, 4px);
}
.ticks::after {
	bottom: -6px;
	right: -6px;
	border-left: 0;
	border-top: 0;
	transform: translate(-4px, -4px);
}
.ticks:hover::before,
.ticks:hover::after,
.ticks:focus-visible::before,
.ticks:focus-visible::after {
	opacity: 1;
	transform: none;
}
.tilt {
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
}
.tilt:hover {
	--ty: -3px;
}
/* figure tile: dotted blueprint background so cut-out photos look intentional */
.plate {
	position: relative;
	background-color: var(--surface-2);
	background-image: radial-gradient(rgba(var(--dot), 0.22) 1px, transparent 1.2px);
	background-size: 14px 14px;
	overflow: hidden;
}

/* ---------- 9a. Home ---------- */
.hero {
	padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}
.hero-grid {
	display: grid;
	gap: clamp(2rem, 5vw, 4rem);
	grid-template-columns: 1fr;
	align-items: center;
}
@media (min-width: 940px) {
	.hero-grid {
		grid-template-columns: 1.15fr 0.85fr;
	}
}
.hero h1 {
	margin: 1rem 0 1.2rem;
}
.hero h1 .cursor {
	display: inline-block;
	width: 0.08em;
	height: 0.82em;
	margin-left: 0.08em;
	background: var(--signal);
	vertical-align: -0.04em;
	animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
	50% {
		opacity: 0;
	}
}
.rotator {
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 2.4vw, 1.7rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	margin: 0 0 1.2rem;
	color: var(--ink);
	min-height: 1.4em;
}
.rotator .word {
	color: var(--accent);
	border-bottom: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.rotator .caret {
	display: inline-block;
	width: 2px;
	height: 1.05em;
	background: var(--accent);
	vertical-align: -0.15em;
	margin-left: 2px;
	animation: blink 0.9s steps(1) infinite;
}
.hero .lead {
	max-width: 52ch;
}
.hero .btn-row {
	margin-top: 1.8rem;
}
.now-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 1.6rem;
	padding: 0.45rem 0.9rem 0.45rem 0.7rem;
	border-radius: 999px;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	color: var(--ink-2);
	font-size: 0.9rem;
	text-decoration: none;
	transition: box-shadow 0.2s, transform 0.25s var(--ease);
}
.now-pill:hover {
	box-shadow: inset 0 0 0 1px var(--signal);
	transform: translateX(3px);
	text-decoration: none;
}
.now-pill strong {
	color: var(--ink);
}
.now-pill .dot {
	--c: var(--signal);
}

/* the photo, drawn like a technical drawing sheet */
.sheet {
	position: relative;
	padding: 14px;
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg);
}
.sheet-img {
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 4 / 3.4;
}
.sheet-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 62% 40%;
	transform: scale(1.04);
	transition: transform 1.2s var(--ease);
}
.sheet:hover .sheet-img img {
	transform: scale(1.08);
}
.titleblock {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr;
	margin-top: 12px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	color: var(--ink-2);
	overflow: hidden;
}
.titleblock > div {
	padding: 0.45rem 0.6rem;
	border-right: 1px solid var(--line-strong);
}
.titleblock > div:last-child {
	border-right: 0;
}
.titleblock .k {
	display: block;
	color: var(--ink-3);
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.titleblock .wide {
	grid-column: 1 / -1;
	border-right: 0;
	border-top: 1px solid var(--line-strong);
	color: var(--ink);
}
.dim {
	position: absolute;
	font-family: var(--font-mono);
	font-size: 0.62rem;
	color: var(--accent);
	letter-spacing: 0.06em;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}
.dim-top {
	top: -22px;
	left: 14px;
	right: 14px;
}
.dim-top::before,
.dim-top::after {
	content: "";
	flex: 1;
	height: 1px;
	background: currentColor;
}
.dim-side {
	right: -26px;
	top: 14px;
	bottom: 30%;
	flex-direction: column;
	writing-mode: vertical-rl;
}
.dim-side::before,
.dim-side::after {
	content: "";
	flex: 1;
	width: 1px;
	background: currentColor;
}
@media (max-width: 560px) {
	.dim-side {
		display: none;
	}
}

/* "Now" BrainTex feature */
.feature {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
}
@media (min-width: 860px) {
	.feature {
		grid-template-columns: 1.1fr 0.9fr;
	}
}
.feature-body {
	padding: clamp(1.5rem, 4vw, 2.8rem);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: flex-start;
}
.feature-body h2 {
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	margin: 0;
}
.feature-body p {
	margin: 0;
	color: var(--ink-2);
}
.feature-logo {
	display: flex;
	align-items: center;
	gap: 0.8rem;
}
.feature-logo img {
	width: 52px;
	height: auto;
}
.scanner {
	position: relative;
	min-height: 260px;
	overflow: hidden;
	background: #111;
}
.scanner > img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.scanner .detected {
	clip-path: inset(0 0 calc(100% - var(--scan, 0%)) 0);
}
.scanner .beam {
	position: absolute;
	left: 0;
	right: 0;
	top: var(--scan, 0%);
	height: 2px;
	background: var(--signal);
	box-shadow: 0 0 18px 4px color-mix(in srgb, var(--signal) 60%, transparent);
}
.scanner .hud {
	position: absolute;
	left: 12px;
	bottom: 12px;
	font-family: var(--font-mono);
	font-size: 0.68rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	padding: 0.3rem 0.55rem;
	border-radius: 6px;
	letter-spacing: 0.06em;
}

/* about */
.about-text p {
	font-size: 1.08rem;
}
.about-text p:first-child {
	font-size: clamp(1.2rem, 2vw, 1.4rem);
	color: var(--ink);
	font-family: var(--font-display);
	letter-spacing: -0.01em;
	line-height: 1.45;
}
.sum-card {
	display: block;
	padding: clamp(1.5rem, 4vw, 2.2rem);
	overflow: hidden;
}
.sum-card .big {
	font-family: var(--font-display);
	font-size: clamp(3rem, 8vw, 5rem);
	font-weight: 600;
	letter-spacing: -0.04em;
	line-height: 1;
	margin: 0.6rem 0 0.4rem;
	color: var(--ink);
	transition: color 0.3s;
}
.sum-card:hover .big {
	color: var(--signal);
}
.sum-card .formula {
	font-family: var(--font-mono);
	color: var(--ink-3);
	font-size: 0.85rem;
}
.stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.8rem;
	margin-top: 1.4rem;
}
.stat {
	padding: 1rem 1.1rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
}
.stat b {
	display: block;
	font-family: var(--font-display);
	font-size: 1.9rem;
	letter-spacing: -0.03em;
	line-height: 1.1;
}
.stat span {
	font-size: 0.82rem;
	color: var(--ink-2);
	line-height: 1.3;
	display: block;
}

/* timeline */
.timeline {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0 0 0 1.8rem;
	display: grid;
	gap: 1.6rem;
}
.timeline::before {
	content: "";
	position: absolute;
	left: 5px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: var(--line);
}
.timeline::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 6px;
	width: 2px;
	height: calc((100% - 12px) * var(--progress, 0));
	background: linear-gradient(var(--accent), var(--signal));
	transition: height 0.15s linear;
}
.timeline li {
	position: relative;
}
.timeline li::before {
	content: "";
	position: absolute;
	left: calc(-1.8rem + 0px);
	top: 0.45rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--surface);
	box-shadow: inset 0 0 0 2px var(--line-strong);
	z-index: 1;
}
.timeline li.is-now::before {
	background: var(--signal);
	box-shadow: 0 0 0 4px var(--signal-soft);
}
.timeline .when {
	font-family: var(--font-mono);
	font-size: 0.76rem;
	color: var(--ink-3);
	letter-spacing: 0.04em;
}
.timeline h3 {
	margin: 0.15rem 0 0.2rem;
	font-size: 1.12rem;
}
.timeline .where {
	color: var(--ink-2);
	font-size: 0.92rem;
}
.timeline p {
	margin: 0.3rem 0 0;
	font-size: 0.92rem;
	color: var(--ink-2);
}

/* contact band */
.contact-band {
	padding: clamp(1.8rem, 5vw, 3rem);
	display: grid;
	gap: 1.4rem;
	grid-template-columns: 1fr;
	align-items: center;
	background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
@media (min-width: 860px) {
	.contact-band {
		grid-template-columns: 1fr auto;
	}
}
.contact-band.is-compact {
	grid-template-columns: 1fr;
	margin-top: 2.5rem;
	padding: clamp(1.4rem, 4vw, 2rem);
}
.contact-band.is-compact h2 {
	font-size: clamp(1.4rem, 3vw, 1.8rem);
}
.contact-band h2 {
	margin: 0.3rem 0 0.4rem;
}
.contact-band p {
	margin: 0;
	color: var(--ink-2);
}

/* ---------- 9b. Projects grid ---------- */
.page-head {
	padding-block: clamp(2.2rem, 6vw, 4.5rem) 1.5rem;
}
.page-head h1 {
	margin: 0.8rem 0 0.8rem;
	font-size: clamp(2.3rem, 5.5vw, 4rem);
}
.page-head .lead {
	max-width: 60ch;
	margin: 0;
}
.filters {
	position: sticky;
	top: 64px;
	z-index: 10;
	padding-block: 0.8rem;
	margin-bottom: 1.2rem;
	background: linear-gradient(var(--bg) 70%, transparent);
}
.filters .chips {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
	margin: -2px;
	-webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
	mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.filters .chips::-webkit-scrollbar {
	display: none;
}
@media (min-width: 900px) {
	.filters .chips {
		flex-wrap: wrap;
		-webkit-mask-image: none;
		mask-image: none;
	}
}
.project-grid {
	display: grid;
	gap: clamp(1rem, 2.4vw, 1.6rem);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.pcard {
	display: flex;
	flex-direction: column;
	overflow: visible;
}
.pcard.is-hidden {
	display: none;
}
.pcard .plate {
	aspect-ratio: 4 / 3;
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.pcard .plate img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 14px;
	transition: transform 0.6s var(--ease);
}
.pcard .plate img.cover-fill {
	object-fit: cover;
	padding: 0;
}
.pcard:hover .plate img {
	transform: scale(1.05);
}
.pcard .badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
}
.pcard-body {
	padding: 1.1rem 1.2rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	flex: 1;
}
.pcard-title {
	margin: 0;
	font-size: 1.2rem;
}
.pcard-tagline {
	margin: 0;
	color: var(--ink-2);
	font-size: 0.92rem;
	line-height: 1.5;
}
.skill-line {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.7rem;
	border-top: 1px dashed var(--line);
	font-size: 0.86rem;
	color: var(--ink);
	font-weight: 500;
}
.skill-line .k {
	font-family: var(--font-mono);
	font-size: 0.64rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	white-space: nowrap;
}
.pcard.is-featured {
	grid-column: 1 / -1;
}
@media (min-width: 860px) {
	.pcard.is-featured {
		flex-direction: row;
	}
	.pcard.is-featured .plate {
		width: 48%;
		flex: none;
		aspect-ratio: auto;
		min-height: 320px;
		border-radius: var(--radius-lg) 0 0 var(--radius-lg);
	}
	.pcard.is-featured .plate img {
		position: absolute;
		inset: 0;
	}
	.pcard.is-featured .pcard-body {
		padding: 2rem 2.2rem;
		justify-content: center;
	}
	.pcard.is-featured .pcard-title {
		font-size: 1.8rem;
	}
}
.skill-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.8rem 1.2rem;
	margin-top: 2rem;
}
a.chip {
	text-decoration: none;
}
.empty-note {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--ink-3);
	font-family: var(--font-mono);
	font-size: 0.85rem;
}
.empty-note a {
	color: var(--ink-2);
}

/* ---------- 9c. Project page ---------- */
.crumbs {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.88rem;
	color: var(--ink-3);
}
.crumbs a {
	color: var(--ink-2);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.crumbs a:hover {
	color: var(--ink);
}
.project-head {
	padding-block: clamp(1.6rem, 4vw, 2.8rem) 1.5rem;
}
.project-head h1 {
	margin: 1rem 0 0.7rem;
	font-size: clamp(2.2rem, 5vw, 3.8rem);
}
.project-head .lead {
	max-width: 62ch;
	margin: 0 0 1.2rem;
}
.meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}
.meta-row .years {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--ink-3);
}
/* phones: photos -> "skill unlocked" box -> story. desktop: box sticks on the right */
.project-layout {
	display: grid;
	gap: clamp(1.5rem, 4vw, 2.6rem) clamp(1.5rem, 4vw, 3rem);
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "gallery" "aside" "body";
	align-items: start;
}
.area-gallery {
	grid-area: gallery;
}
.project-aside {
	grid-area: aside;
}
.area-body {
	grid-area: body;
	min-width: 0;
}
@media (min-width: 980px) {
	.project-layout {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
		grid-template-areas: "gallery aside" "body aside";
	}
	.project-aside {
		position: sticky;
		top: 84px;
		align-self: start;
	}
}
.skillbox {
	padding: 1.4rem 1.5rem 1.5rem;
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	position: relative;
	overflow: hidden;
}
.skillbox::after {
	content: "";
	position: absolute;
	right: -40px;
	top: -40px;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
}
.skillbox h2 {
	font-size: 1.35rem;
	margin: 0.5rem 0 0.9rem;
}
.skillbox ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.65rem;
}
.skillbox li {
	position: relative;
	padding-left: 1.6rem;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--ink-2);
}
.skillbox li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.32em;
	width: 14px;
	height: 14px;
	border-radius: 4px;
	background: var(--accent-soft);
	box-shadow: inset 0 0 0 1.5px var(--accent);
}
.skillbox li::after {
	content: "";
	position: absolute;
	left: 4px;
	top: calc(0.32em + 3px);
	width: 4px;
	height: 7px;
	border: solid var(--accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.skillbox .tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 1.1rem;
}
.aside-links {
	display: grid;
	gap: 0.5rem;
	margin-top: 1rem;
}
.aside-links .btn {
	justify-content: flex-start;
	white-space: normal;
	text-align: left;
}
.aside-links .btn .i:last-child {
	margin-left: auto;
}

.gallery {
	display: grid;
	gap: 0.6rem;
}
.gallery-main {
	position: relative;
	border-radius: var(--radius-lg);
	aspect-ratio: 4 / 3;
	box-shadow: inset 0 0 0 1px var(--line);
	cursor: zoom-in;
	touch-action: pan-y;
}
.gallery-main img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: clamp(8px, 2vw, 20px);
	transition: opacity 0.35s var(--ease), transform 0.5s var(--ease);
}
.gallery-main img.is-leaving {
	opacity: 0;
	transform: scale(0.98);
}
.gallery-nav {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	z-index: 2;
	opacity: 0.9;
}
.gallery-nav.prev {
	left: 10px;
}
.gallery-nav.next {
	right: 10px;
}
.gallery-count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	color: var(--ink-2);
}
.thumbs {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	padding: 2px;
	scrollbar-width: thin;
}
.thumbs button {
	flex: none;
	width: 74px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px var(--line);
	opacity: 0.6;
	transition: opacity 0.2s, box-shadow 0.2s;
}
.thumbs button[aria-current="true"] {
	opacity: 1;
	box-shadow: inset 0 0 0 2px var(--accent);
}
.thumbs img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 4px;
}
.prose {
	font-size: 1.05rem;
	max-width: 68ch;
}
.prose p {
	margin-bottom: 1.1em;
}
.prose h2 {
	font-size: 1.5rem;
	margin: 2rem 0 0.8rem;
}
.prose ul {
	padding-left: 1.2rem;
}
.prose li {
	margin-bottom: 0.35rem;
}
.prose li::marker {
	color: var(--accent);
}
.prose code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	background: var(--surface-2);
	padding: 0.1em 0.35em;
	border-radius: 5px;
	box-shadow: inset 0 0 0 1px var(--line);
}
.meme {
	position: relative;
	margin: 1.6rem 0;
	padding: 1rem 1.2rem 1rem 3rem;
	border-radius: var(--radius);
	background: var(--signal-soft);
	color: var(--ink);
	font-size: 0.98rem;
	line-height: 1.5;
}
.meme::before {
	content: "//";
	position: absolute;
	left: 1rem;
	top: 0.95rem;
	font-family: var(--font-mono);
	font-weight: 700;
	color: var(--signal);
}
.prose .specs,
.specs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.6rem;
	margin: 1.2rem 0 1.6rem;
	padding: 0;
	list-style: none;
}
.prose .specs li,
.specs li {
	margin: 0;
	padding: 0.75rem 0.9rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	font-size: 0.9rem;
	line-height: 1.35;
}
.specs b {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ink-3);
	margin-bottom: 0.2rem;
}

/* version stepper (photo frame) */
.versions {
	margin-top: 2.5rem;
}
.version-tabs {
	display: flex;
	gap: 0.35rem;
	overflow-x: auto;
	padding: 2px;
	margin-bottom: 1rem;
}
.version-tabs button {
	flex: none;
	min-width: 48px;
	padding: 0.5rem 0.7rem;
	border: 0;
	border-radius: 10px;
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	font-family: var(--font-mono);
	font-weight: 600;
	font-size: 0.82rem;
	color: var(--ink-2);
	cursor: pointer;
}
.version-tabs button[aria-selected="true"] {
	background: var(--ink);
	color: var(--bg);
	box-shadow: none;
}
.version-panel {
	padding: 1.4rem 1.5rem;
}
.version-panel h3 {
	margin: 0 0 0.6rem;
}
.version-panel p {
	color: var(--ink-2);
}
.problems {
	list-style: none;
	padding: 0;
	margin: 0.8rem 0 1rem;
	display: grid;
	gap: 0.4rem;
}
.problems li {
	position: relative;
	padding-left: 1.5rem;
	font-size: 0.92rem;
}
.problems li::before {
	content: "!";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 0.66rem;
	font-weight: 800;
	color: var(--warn);
	box-shadow: inset 0 0 0 1.5px var(--warn);
}
.version-progress {
	height: 3px;
	border-radius: 3px;
	background: var(--line);
	overflow: hidden;
	margin-bottom: 1rem;
}
.version-progress span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--signal));
	transition: width 0.4s var(--ease);
}

.code-peek {
	margin-top: 2rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	overflow: hidden;
}
.code-peek summary {
	cursor: pointer;
	padding: 0.9rem 1.1rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	list-style: none;
}
.code-peek summary::-webkit-details-marker {
	display: none;
}
.code-peek pre {
	margin: 0;
	max-height: 480px;
	overflow: auto;
	padding: 1rem 1.1rem;
	border-top: 1px solid var(--line);
	background: var(--surface-2);
	font-family: var(--font-mono);
	font-size: 0.78rem;
	line-height: 1.55;
	tab-size: 4;
}

.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.8rem;
	margin-top: 3rem;
}
.pager a {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem 1.2rem;
}
.pager a.next {
	text-align: right;
	align-items: flex-end;
}
.pager .k {
	font-family: var(--font-mono);
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ink-3);
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}
.pager b {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.05rem;
}

/* ---------- 9d. Links page ---------- */
.links-page {
	max-width: 620px;
	margin-inline: auto;
	padding: 1.2rem clamp(1rem, 4vw, 1.5rem) 2rem;
}
.profile {
	position: relative;
	overflow: hidden;
	text-align: center;
	padding-bottom: 1.4rem;
}
.profile-banner {
	height: 150px;
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
	overflow: hidden;
	position: relative;
}
.profile-banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 32%;
}
.profile-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(transparent 40%, color-mix(in srgb, var(--surface) 70%, transparent));
}
.avatar {
	position: relative;
	z-index: 2;
	width: 92px;
	height: 92px;
	margin: -48px auto 0.6rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--surface);
	box-shadow: 0 0 0 5px var(--surface), var(--shadow);
}
.avatar img {
	width: 64px;
	height: 64px;
	animation: spin 30s linear infinite;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
.profile h1 {
	font-size: clamp(1.8rem, 6vw, 2.3rem);
	margin: 0 0 0.35rem;
}
.profile .role {
	color: var(--ink-2);
	margin: 0 auto;
	padding-inline: 1.2rem;
	max-width: 44ch;
	font-size: 0.98rem;
}
.profile .now-pill {
	margin-top: 1rem;
}
.quick {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.1rem;
	padding-inline: 1rem;
}
.links-section {
	margin-top: 1.8rem;
}
.links-section h2 {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--ink-3);
	margin: 0 0 0.7rem 0.3rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.links-section h2::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}
.link-list {
	display: grid;
	gap: 0.6rem;
}
.link-card {
	display: flex;
	align-items: center;
	gap: 0.95rem;
	padding: 0.75rem 1rem 0.75rem 0.75rem;
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
	transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.link-card:hover {
	transform: translateY(-2px);
	box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow);
	text-decoration: none;
}
.link-card:active {
	transform: scale(0.985);
}
.link-icon {
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--tile, var(--surface-2));
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
	overflow: hidden;
}
.link-icon .i {
	width: 24px;
	height: 24px;
}
.link-icon img {
	width: 34px;
	height: 34px;
	object-fit: contain;
}
.link-icon.is-plain {
	background: var(--surface-2);
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--line);
}
.link-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.link-text b {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.02rem;
	letter-spacing: -0.01em;
}
.link-text small {
	color: var(--ink-2);
	font-size: 0.82rem;
	line-height: 1.35;
}
.link-card > .i {
	color: var(--ink-3);
	transition: transform 0.25s var(--ease), color 0.2s;
}
.link-card:hover > .i {
	color: var(--accent);
	transform: translate(2px, -2px);
}
.link-card.is-warn small {
	color: var(--warn);
}

/* ---------- 9e. QR page ---------- */
.qr-grid {
	display: grid;
	gap: 1.2rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.qr-card {
	padding: 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}
.qr-card h2 {
	font-size: 1.15rem;
	margin: 0;
}
.qr-card p {
	margin: 0;
	font-size: 0.86rem;
	color: var(--ink-2);
}
.qr-tile {
	background: #fff;
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: inset 0 0 0 1px var(--line);
	cursor: zoom-in;
	border: 0;
	display: block;
	width: 100%;
}
.qr-tile svg {
	width: 100%;
	height: auto;
}
.qr-card .btn-row .btn {
	flex: 1;
}
.vcard-lines {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--ink-3);
	line-height: 1.6;
	margin: 0;
	word-break: break-word;
}

/* ---------- 9f. Before/after slider + team chips (BrainTex) ---------- */
.compare {
	position: relative;
	aspect-ratio: 1;
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	background: #111;
	touch-action: pan-y; /* vertical swipe still scrolls the page */
	cursor: ew-resize;
	user-select: none;
	-webkit-user-select: none;
}
.compare img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}
.compare .after {
	clip-path: inset(0 0 0 var(--pos, 50%));
}
.compare .handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos, 50%);
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
	pointer-events: none;
}
.compare .handle::after {
	content: "⟷";
	position: absolute;
	top: 50%;
	left: 50%;
	translate: -50% -50%;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: #fff;
	color: #111;
	font-size: 1.1rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.compare .lbl {
	position: absolute;
	top: 12px;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	padding: 0.3rem 0.55rem;
	border-radius: 6px;
	pointer-events: none;
}
.compare .lbl.l {
	left: 12px;
}
.compare .lbl.r {
	right: 12px;
}
.compare input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: ew-resize;
	margin: 0;
}
.compare-caption {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--ink-3);
	text-align: center;
	margin-top: 0.7rem;
}
.after-gallery {
	margin-top: 2rem;
}
.prose .team {
	margin: 1rem 0 1.6rem;
}
.team {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}
.member {
	padding: 0.7rem 1rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: inset 0 0 0 1px var(--line);
	line-height: 1.3;
}
.member b {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
}
.member span {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--ink-3);
	letter-spacing: 0.04em;
}
.member.is-me {
	box-shadow: inset 0 0 0 1.5px var(--signal);
}
.member.is-me span {
	color: var(--signal);
}

/* ---------- 9g. −0.08(3) page ---------- */
.sum-hero {
	text-align: center;
	padding-block: clamp(2.5rem, 7vw, 5rem) 2rem;
}
.sum-hero .huge {
	font-family: var(--font-display);
	font-size: clamp(3.6rem, 15vw, 9rem);
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 0.95;
	margin: 0.8rem 0;
}
.counter {
	margin: 1.5rem auto 0;
	max-width: 640px;
	padding: 1.4rem;
	text-align: center;
}
.counter .series {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--ink-3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.counter .total {
	font-family: var(--font-mono);
	font-size: clamp(1.5rem, 5vw, 2.4rem);
	font-weight: 700;
	margin: 0.5rem 0 1rem;
	word-break: break-all;
	min-height: 1.3em;
	font-variant-numeric: tabular-nums;
}
.counter .total.is-glitch {
	color: var(--signal);
	animation: glitch 0.5s steps(2) 3;
}
@keyframes glitch {
	0% {
		transform: translate(0);
		text-shadow: 2px 0 var(--accent), -2px 0 var(--signal);
	}
	50% {
		transform: translate(-2px, 1px);
		text-shadow: -3px 0 var(--accent), 3px 0 var(--signal);
	}
	100% {
		transform: translate(1px, -1px);
		text-shadow: none;
	}
}
.quiz {
	display: grid;
	gap: 0.8rem;
	margin: 1.5rem 0;
}
.quiz-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	padding: 1rem 1.1rem;
}
.quiz-row label {
	font-family: var(--font-mono);
	font-size: 0.92rem;
	flex: 1 1 260px;
}
.quiz-row input {
	flex: 0 1 150px;
	min-width: 0;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	border: 0;
	box-shadow: inset 0 0 0 1px var(--line-strong);
	background: var(--surface-2);
	color: var(--ink);
	font-family: var(--font-mono);
	font-size: 0.95rem;
}
.quiz-row input:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--accent);
}
.quiz-row.is-solved {
	opacity: 0.75;
}
.quiz-row.is-solved label::after {
	content: " ✓";
	color: var(--ok);
}
.quiz-row[hidden] {
	display: none;
}
.feedback {
	min-height: 1.5em;
	color: var(--ink-2);
	font-style: italic;
}
math {
	font-size: 1.1em;
}
/* "skip the maths" link + the highlighted conclusion */
.skip-to-point {
	display: inline-flex;
	align-items: center;
	margin-bottom: 1.5rem;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	background: var(--accent-soft);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
	color: var(--accent);
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none;
	transition: transform 0.25s var(--ease);
}
.skip-to-point:hover {
	text-decoration: none;
	transform: translateY(2px);
}
.math-end {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 3rem 0 1.4rem;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.math-end::before,
.math-end::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line-strong);
}
.why-card {
	padding: clamp(1.5rem, 5vw, 2.6rem);
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, var(--accent-soft), var(--surface));
	box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-lg);
}
.why-card .eyebrow {
	color: var(--accent);
}
.why-card h2 {
	font-size: clamp(1.8rem, 4.6vw, 2.7rem);
	margin: 0.6rem 0 1rem;
}
.why-card p {
	font-size: 1.15rem;
}
.why-card .meme {
	margin-bottom: 0;
}

/* ---------- 9h. 404 / blank ---------- */
.error-page {
	text-align: center;
	padding-block: clamp(3rem, 10vw, 7rem);
}
.error-page .code {
	font-family: var(--font-mono);
	font-size: clamp(4rem, 18vw, 9rem);
	font-weight: 700;
	letter-spacing: -0.05em;
	line-height: 1;
	color: var(--line-strong);
}
.error-page .btn-row {
	justify-content: center;
	margin-top: 1.5rem;
}
.video-frame {
	max-width: 720px;
	margin: 2rem auto 0;
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	background: #000;
}
.video-frame video {
	width: 100%;
}

/* ---------- 10. Overlays ---------- */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgba(4, 8, 14, 0.86);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: fade 0.25s var(--ease);
}
@keyframes fade {
	from {
		opacity: 0;
	}
}
.overlay .close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
}
.lightbox img {
	max-width: min(1400px, 96vw);
	max-height: 86vh;
	object-fit: contain;
	border-radius: 10px;
	animation: pop 0.3s var(--ease);
}
@keyframes pop {
	from {
		transform: scale(0.96);
		opacity: 0;
	}
}
.lightbox .prev,
.lightbox .next {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
}
.lightbox .prev {
	left: 14px;
}
.lightbox .next {
	right: 14px;
}
.lightbox .count {
	position: absolute;
	bottom: 18px;
	left: 50%;
	translate: -50% 0;
	color: #cbd5e1;
	font-family: var(--font-mono);
	font-size: 0.8rem;
}
.qr-overlay .qr-big {
	background: #fff;
	padding: clamp(14px, 4vw, 28px);
	border-radius: var(--radius-lg);
	width: min(86vw, 70vh, 520px);
	animation: pop 0.3s var(--ease);
}
.qr-overlay .qr-big svg {
	width: 100%;
	height: auto;
}
.qr-overlay .qr-title {
	color: #e2e8f0;
	text-align: center;
	margin-top: 1rem;
	font-family: var(--font-display);
	font-size: 1.15rem;
}
.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 120;
	translate: -50% 0;
	padding: 0.7rem 1.1rem;
	border-radius: 999px;
	background: var(--ink);
	color: var(--bg);
	font-size: 0.9rem;
	box-shadow: var(--shadow-lg);
	animation: toast 2.6s var(--ease) forwards;
	white-space: nowrap;
}
@keyframes toast {
	0% {
		opacity: 0;
		transform: translateY(10px);
	}
	12%,
	85% {
		opacity: 1;
		transform: none;
	}
	100% {
		opacity: 0;
	}
}
.to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 40;
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	transition: opacity 0.3s, transform 0.3s var(--ease);
	box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
	background: var(--surface);
}
.to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

/* ---------- 11. Motion & utilities ---------- */
.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
	transition-delay: var(--delay, 0s);
}
.js .reveal.is-in {
	opacity: 1;
	transform: none;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	left: 1rem;
	top: -60px;
	z-index: 200;
	padding: 0.6rem 1rem;
	border-radius: 8px;
	background: var(--ink);
	color: var(--bg);
}
.skip-link:focus {
	top: 1rem;
}
.noscript {
	max-width: 640px;
	margin: 4rem auto;
	padding: 1.5rem;
	text-align: center;
}
@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;
	}
	.js .reveal {
		opacity: 1;
		transform: none;
	}
}
@media print {
	#bg,
	.site-header,
	.site-footer,
	.to-top {
		display: none !important;
	}
	body {
		background: #fff;
	}
}
