/* jmshearer.com, hand-written, no framework */

@font-face {
	font-family: "Inter";
	src: url("fonts/inter-var.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}
@font-face {
	font-family: "Instrument Serif";
	src: url("fonts/instrument-serif-italic.woff2") format("woff2");
	font-style: italic;
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "JetBrains Mono";
	src: url("fonts/jetbrains-mono-var.woff2") format("woff2");
	font-weight: 100 800;
	font-display: swap;
}

:root {
	--bg: #f8f9fb;
	--surface: #ffffff;
	--raised: #f1f3f7;
	--ink: #0d1015;
	--ink-2: #2a2f38;
	--muted: #626a78;
	--line: rgb(13 16 21 / 9%);
	--line-strong: rgb(13 16 21 / 16%);
	--accent: #1d5fd1;
	--accent-ink: #ffffff;
	--accent-soft: rgb(29 95 209 / 9%);
	--glow: rgb(29 95 209 / 14%);
	--invert-bg: #0d1015;
	--invert-ink: #f2f4f8;
	--shadow-lg: 0 1px 1px rgb(13 16 21 / 4%), 0 12px 32px -8px rgb(13 16 21 / 14%), 0 40px 80px -24px rgb(13 16 21 / 18%);

	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
	--mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

	--wrap: 76rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--r-lg: 22px;
	--r-md: 14px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0c10;
		--surface: #11151b;
		--raised: #171c24;
		--ink: #eef1f6;
		--ink-2: #d2d7e0;
		--muted: #939bab;
		--line: rgb(238 241 246 / 8%);
		--line-strong: rgb(238 241 246 / 15%);
		--accent: #6ea8ff;
		--accent-ink: #06101f;
		--accent-soft: rgb(110 168 255 / 10%);
		--glow: rgb(110 168 255 / 12%);
		--invert-bg: #eef1f6;
		--invert-ink: #0a0c10;
		--shadow-lg: 0 1px 1px rgb(0 0 0 / 30%), 0 20px 50px -12px rgb(0 0 0 / 60%);
		color-scheme: dark;
	}
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1.0625rem/1.65 var(--sans);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.25; }
h1 em, h2 em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

.skip-link {
	position: absolute; left: 1rem; top: -3rem; z-index: 20;
	background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; border-radius: 99px;
}
.skip-link:focus { top: 1rem; }

/* -------------------------------------------------------------- header */

.site-header { position: sticky; top: 0; z-index: 10; padding: 0.75rem 0; }
.site-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	max-width: calc(var(--wrap) - 2 * var(--gutter) + 2rem);
	margin: 0 auto; padding: 0.45rem 0.45rem 0.45rem 1.1rem;
	border: 1px solid transparent; border-radius: 99px;
	transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled .site-header__inner,
.no-js .site-header__inner {
	background: color-mix(in srgb, var(--surface) 78%, transparent);
	border-color: var(--line);
	box-shadow: 0 8px 30px -12px rgb(0 0 0 / 18%);
	backdrop-filter: saturate(1.6) blur(14px);
	-webkit-backdrop-filter: saturate(1.6) blur(14px);
}
@media (max-width: 40rem) { .site-header__inner { margin: 0 0.6rem; } }

.site-name { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.site-name__mark {
	display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
	background: var(--ink); color: var(--bg); font: italic 400 1.1rem/1 var(--serif);
}
.site-nav { display: flex; gap: 0.15rem; }
.site-nav a {
	color: var(--muted); text-decoration: none; padding: 0.5rem 0.9rem; border-radius: 99px;
	font-size: 0.93rem; font-weight: 500; transition: color 0.2s, background-color 0.2s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.site-nav a.site-nav__cta { background: var(--ink); color: var(--bg); }
.site-nav a.site-nav__cta:hover { opacity: 0.88; }
@media (max-width: 30rem) {
	.site-name__text { display: none; }
	.site-nav a { padding: 0.5rem 0.75rem; }
}
/* Four nav items have to fit beside the avatar on small phones */
@media (max-width: 26rem) {
	.site-header__inner { gap: 0.4rem; padding-left: 0.45rem; }
	.site-nav { gap: 0; }
	.site-nav a { padding: 0.45rem 0.55rem; font-size: 0.86rem; }
}

/* ---------------------------------------------------------------- hero */

.hero { position: relative; padding: clamp(3rem, 9vw, 7rem) 0 clamp(1.5rem, 4vw, 3rem); isolation: isolate; }
.hero::before {
	content: ""; position: absolute; inset: -6rem 0 0; z-index: -1;
	background:
		radial-gradient(60rem 30rem at 85% 0%, var(--glow), transparent 70%),
		radial-gradient(40rem 24rem at 0% 10%, rgb(166 90 36 / 7%), transparent 70%);
}
.hero::after {
	content: ""; position: absolute; inset: -6rem 0 0; z-index: -1; opacity: 0.5;
	background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
}
.hero__grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.hero__grid--solo { grid-template-columns: minmax(0, 1fr); }
.hero__headline { font-size: clamp(2.7rem, 6.4vw, 5.4rem); line-height: 0.98; letter-spacing: -0.045em; margin-bottom: 0.45em; }
.hero__headline em { color: var(--accent); }
.hero__lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 36rem; }
.hero__lede p:last-child { margin: 0; }
.hero__lede strong { color: var(--ink); font-weight: 600; }

.pill {
	display: inline-flex; align-items: center; gap: 0.55rem;
	font-size: 0.85rem; font-weight: 500; color: var(--ink-2);
	padding: 0.35rem 0.85rem 0.35rem 0.65rem; border-radius: 99px;
	background: var(--surface); border: 1px solid var(--line); margin-bottom: 1.6rem;
}
.pill__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--glow); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Stacked product shots in the hero */
.showcase { position: relative; aspect-ratio: 5 / 4; }
.showcase .frame { position: absolute; }
.showcase .frame:nth-child(1) { inset: 0 12% 18% 0; transform: rotate(-2deg); }
.showcase .frame:nth-child(2) { inset: 34% 0 0 22%; transform: rotate(2.5deg); }
.showcase .frame:nth-child(3) { right: -2%; bottom: -6%; width: 22%; transform: rotate(6deg); }
.showcase .frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 56rem) {
	.hero__grid { grid-template-columns: minmax(0, 1fr); }
	.showcase { max-width: 36rem; margin-top: 1rem; }
}

/* Browser / phone frames */
.frame {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
	box-shadow: var(--shadow-lg);
}
.frame__bar { display: flex; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--raised); flex: none; }
.frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.frame__body { flex: 1; min-height: 0; }
.frame--phone { border-radius: 22px; padding: 6px; background: #111; border-color: #2a2a2a; }
.frame--phone img { border-radius: 17px; }

/* ------------------------------------------------------------- buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 2.2rem 0 0; }
.button {
	display: inline-flex; align-items: center; gap: 0.55rem;
	font: 500 0.98rem/1 var(--sans); letter-spacing: -0.01em;
	padding: 0.95rem 1.35rem; border-radius: 99px; border: 1px solid var(--ink);
	background: var(--ink); color: var(--bg); text-decoration: none; cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s, background-color 0.2s;
}
.button:hover { transform: translateY(-1px); opacity: 0.9; }
.button .icon { transition: transform 0.2s ease; }
.button:hover .icon { transform: translateX(3px); }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button--quiet:hover { background: var(--raised); opacity: 1; }

.more {
	display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; text-decoration: none;
	white-space: nowrap; color: var(--ink);
}
.more .icon { transition: transform 0.2s ease; }
.more:hover .icon { transform: translateX(3px); }
.more--back .icon { transform: scaleX(-1); }
.more--back:hover .icon { transform: scaleX(-1) translateX(3px); }

/* ------------------------------------------------------------ sections */

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section--flush-top { padding-top: 0; }
.section--line { border-top: 1px solid var(--line); }
.section__header { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__header h2 { margin: 0; max-width: 18ch; }
.section__header p { margin: 0; max-width: 32rem; }

.kicker {
	display: inline-flex; align-items: center; gap: 0.6rem;
	font: 500 0.78rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
	color: var(--muted); margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 1.4rem; height: 1px; background: currentColor; opacity: 0.6; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--ink); }

.page-header { position: relative; padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); isolation: isolate; }
.page-header::before {
	content: ""; position: absolute; inset: -6rem 0 0; z-index: -1;
	background: radial-gradient(50rem 22rem at 80% 0%, var(--glow), transparent 70%);
}
.page-header h1 { max-width: 20ch; }
.lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 42rem; }

/* ---------------------------------------------------------------- stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border-block: 1px solid var(--line); }
.stat { padding: 1.8rem 1.5rem 1.6rem 0; }
.stat + .stat { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.stat__value { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.stat__label { color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; max-width: 14rem; }
@media (max-width: 40rem) {
	.stats { grid-template-columns: 1fr 1fr; }
	.stat, .stat + .stat { padding: 1.4rem 1rem 1.2rem 0; border-left: 0; }
	.stat:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
	.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------------- pillars */

.pillars { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pillar { background: var(--bg); padding: clamp(1.5rem, 3vw, 2.2rem); }
.pillar__num { font: 500 0.78rem/1 var(--mono); color: var(--accent); margin-bottom: 2.5rem; display: block; }
.pillar__title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.pillar p { color: var(--muted); margin: 0; font-size: 0.98rem; }

/* --------------------------------------------------------------- cards */

.bento { display: grid; gap: 1.25rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bento > .card { grid-column: span 2; }
.bento > .card:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.bento > .card:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.bento > .card:nth-child(1) .card__media { aspect-ratio: auto; flex: 1; min-height: 18rem; }
.bento > .card:nth-child(2) .card__media { aspect-ratio: auto; flex: 1; min-height: 14rem; }
/* Fill the last row: a lone trailing card goes wide */
.bento > .card:nth-child(n+3):last-child:nth-child(3n+1) { grid-column: span 4; }
.bento > .card:nth-child(n+3):last-child:nth-child(3n) { grid-column: span 6; }
.bento > .card:nth-child(n+3):last-child:nth-child(3n) .card__media { aspect-ratio: 21 / 8; }
@media (max-width: 64rem) {
	.bento > .card:nth-child(n+3):last-child { grid-column: span 1; }
	.bento > .card:nth-child(n+3):last-child:nth-child(odd) { grid-column: span 2; }
	.bento > .card:nth-child(n+3):last-child .card__media { aspect-ratio: 16 / 10; }
}
@media (max-width: 64rem) {
	.bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bento > .card, .bento > .card:nth-child(2) { grid-column: span 1; grid-row: auto; }
	.bento > .card:nth-child(1) { grid-column: span 2; grid-row: auto; }
	.bento > .card:nth-child(1) .card__media, .bento > .card:nth-child(2) .card__media { aspect-ratio: 16 / 10; flex: none; min-height: 0; }
}
@media (max-width: 40rem) {
	.bento { grid-template-columns: minmax(0, 1fr); }
	.bento > .card.card { grid-column: auto !important; }
}

.card {
	position: relative; display: flex; flex-direction: column;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
	overflow: hidden; transition: border-color 0.25s, transform 0.25s ease, box-shadow 0.25s;
}
.card:has(a):hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card__media {
	position: relative; aspect-ratio: 16 / 10; overflow: hidden;
	background: var(--raised); margin: 0.5rem 0.5rem 0; border-radius: calc(var(--r-lg) - 6px);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.card:has(a):hover .card__media img { transform: scale(1.035); }
.card__mark {
	height: 100%; display: grid; place-items: center;
	font: italic 400 clamp(3rem, 7vw, 4.5rem)/1 var(--serif); color: var(--accent);
	background: radial-gradient(circle at 30% 20%, var(--glow), transparent 60%), var(--raised);
}
.card__body { padding: 1.2rem 1.4rem 1.4rem; display: flex; flex-direction: column; }
.card__meta { display: flex; justify-content: space-between; gap: 1rem; font: 500 0.75rem/1.4 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.card__title { font-size: 1.3rem; margin-bottom: 0.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card__title a { text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.card__arrow { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); flex: none; transition: background-color 0.25s, color 0.25s, transform 0.25s; }
.card__arrow .icon { width: 0.9rem; height: 0.9rem; transform: rotate(-45deg); }
.card:hover .card__arrow { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card__summary { color: var(--muted); font-size: 0.97rem; margin: 0; }
.bento > .card:nth-child(1) .card__title { font-size: 1.7rem; }

/* Workbench: compact rows */
.bench { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 0 2.5rem; }
.bench__item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; padding: 1.15rem 0; border-top: 1px solid var(--line); }
.bench__title { font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.bench__title a { text-decoration: none; }
.bench__title a::after { content: ""; position: absolute; inset: 0; }
.bench__item:has(a):hover .bench__title { color: var(--accent); }
.bench__year { font: 500 0.75rem/1.6 var(--mono); color: var(--muted); text-align: right; }
.bench__summary { grid-column: 1 / -1; color: var(--muted); font-size: 0.93rem; margin: 0; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.8rem; font-weight: 500; padding: 0.3rem 0.7rem; border-radius: 99px; background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); }

/* -------------------------------------------------------------- career */

.career { display: grid; gap: 0; }
.career__item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 2.5rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.career__item:last-child { border-bottom: 1px solid var(--line); }
.career__when { font: 500 0.82rem/1.6 var(--mono); color: var(--muted); }
.career__when span { display: block; }
.career__org { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 0 0 0.15rem; }
.career__role { color: var(--accent); font-weight: 500; margin: 0 0 0.75rem; }
.career__text { color: var(--muted); margin: 0 0 1rem; max-width: 46rem; }
.career__text:last-child { margin-bottom: 0; }
@media (max-width: 44rem) { .career__item { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------- credentials / misc */

.split { display: grid; gap: 3rem 4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.split h3 { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }
.creds { list-style: none; margin: 0; padding: 0; }
.creds li { padding: 1rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 1rem; }
.creds strong { font-weight: 600; letter-spacing: -0.01em; }
.creds span { color: var(--muted); font-size: 0.93rem; grid-column: 1; }
.creds em { font: normal 500 0.78rem/1.8 var(--mono); color: var(--muted); grid-column: 2; grid-row: 1; }
/* Optional logo: a white tile so full-color marks read in dark mode too */
.creds li.has-logo { grid-template-columns: 2.75rem minmax(0, 1fr) auto; column-gap: 0.9rem; align-items: center; }
.creds li.has-logo strong, .creds li.has-logo span { grid-column: 2; }
.creds li.has-logo em { grid-column: 3; align-self: start; }
.creds__logo {
	grid-column: 1; grid-row: 1 / span 2; width: 2.75rem; height: 2.75rem; object-fit: contain;
	background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px;
}

/* --------------------------------------------------------------- prose */

.prose { max-width: 44rem; }
.prose--lg { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.6; color: var(--ink-2); }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 2em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8em; }
.prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1.3em; }
.prose li { margin-bottom: 0.45em; padding-left: 0.2rem; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 2em 0; padding: 0; font: italic 400 clamp(1.4rem, 2.6vw, 1.9rem)/1.3 var(--serif); color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose code { font: 0.86em var(--mono); background: var(--raised); padding: 0.12em 0.4em; border-radius: 6px; border: 1px solid var(--line); }
.prose pre { font: 0.8rem/1.6 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.3rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; border: 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose img { border-radius: var(--r-md); }

/* ------------------------------------------------------------- project */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.5rem 2rem; padding: 1.5rem 0; margin-top: 2.5rem; border-top: 1px solid var(--line); }
.facts dt { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.facts dd { margin: 0; font-weight: 500; }
.facts .tags li { font-size: 0.75rem; padding: 0.2rem 0.55rem; }

.cover { margin: 0 0 clamp(3rem, 7vw, 5rem); }
.cover .frame__body img { width: 100%; }
.cover--plain img { border-radius: var(--r-lg); border: 1px solid var(--line); width: 100%; }

.project__body { display: grid; justify-content: center; grid-template-columns: minmax(0, 44rem); }

.gallery { display: grid; gap: 1.5rem; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: clamp(3rem, 7vw, 5rem) 0 0; }
.gallery figure { margin: 0; grid-column: span 12; }
.gallery figure.is-wide { grid-column: span 12; }
.gallery figure.is-half { grid-column: span 6; }
.gallery figure.is-phone { grid-column: span 4; }
.gallery figure.is-phone + figure.is-half, .gallery figure.is-half:has(+ .is-phone) { grid-column: span 8; }
.gallery figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.8rem; }
.gallery .frame--phone { max-width: 20rem; }
@media (max-width: 44rem) {
	.gallery figure, .gallery figure.is-half, .gallery figure.is-phone,
	.gallery figure.is-phone + figure.is-half, .gallery figure.is-half:has(+ .is-phone) { grid-column: span 12; }
	.gallery .frame--phone { max-width: 16rem; }
}

.project__nav { padding: 3rem 0 5rem; }

/* --------------------------------------------------------------- about */

.about { display: grid; gap: 3rem 5rem; grid-template-columns: 20rem minmax(0, 1fr); align-items: start; }
.about__figure { margin: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); position: sticky; top: 6rem; }
@media (max-width: 52rem) {
	.about { grid-template-columns: minmax(0, 1fr); }
	.about__figure { position: static; max-width: 24rem; }
}

/* ------------------------------------------------------------- contact */

.contact { display: grid; gap: 3rem 5rem; grid-template-columns: minmax(0, 38rem) minmax(0, 1fr); align-items: start; }
@media (max-width: 52rem) { .contact { grid-template-columns: minmax(0, 1fr); } }
.contact__aside h2 { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }

.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem); }
.form__row { margin-bottom: 1.2rem; }
.form label { display: block; font-weight: 500; font-size: 0.92rem; margin-bottom: 0.4rem; }
.form input, .form textarea {
	width: 100%; font: inherit; color: var(--ink);
	background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
	padding: 0.8rem 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form textarea { resize: vertical; min-height: 10rem; }
.form .actions { margin-top: 0.5rem; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine-print { font-size: 0.8rem; color: var(--muted); margin: 1rem 0 0; }
.fine-print a { color: inherit; }
.notice { padding: 0.9rem 1.1rem; border-radius: var(--r-md); margin-bottom: 1.5rem; }
.notice--error { background: rgb(192 57 43 / 10%); border: 1px solid rgb(192 57 43 / 30%); }

.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; }
.contact-list a { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink-2); }
.contact-list a:hover { color: var(--accent); }
.contact-list .icon { width: 1.05em; height: 1.05em; color: var(--muted); }
.contact-list--stacked { flex-direction: column; gap: 1rem; }

/* ----------------------------------------------------------------- cta */

.cta { padding: 0 0 clamp(3rem, 7vw, 5rem); }
.cta__panel {
	position: relative; overflow: hidden; isolation: isolate;
	background: var(--invert-bg); color: var(--invert-ink);
	border-radius: calc(var(--r-lg) + 8px); padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 6vw, 4.5rem);
	display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
}
.cta__panel::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: radial-gradient(36rem 20rem at 100% 0%, rgb(110 168 255 / 22%), transparent 70%);
}
.cta__panel h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 0 0 0.6rem; }
.cta__panel h2 em { color: #6ea8ff; }
.cta__panel p { color: color-mix(in srgb, var(--invert-ink) 65%, transparent); margin: 0; max-width: 34rem; }
.cta__panel .button { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
.cta__panel .actions { margin: 0; }
@media (max-width: 44rem) { .cta__panel { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-color-scheme: dark) { .cta__panel h2 em { color: var(--accent-ink); } .cta__panel::before { background: radial-gradient(36rem 20rem at 100% 0%, rgb(29 95 209 / 25%), transparent 70%); } }

/* -------------------------------------------------------------- footer */

.site-footer { padding: 0 0 2rem; font-size: 0.93rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.copyright { color: var(--muted); margin: 0; }

/* ------------------------------------------------------------- motion */

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.reveal > * {
			animation: rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 40%;
		}
	}
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
	.hero__copy > *, .showcase .frame { animation: enter 0.8s cubic-bezier(.2,.7,.2,1) both; }
	.hero__copy > :nth-child(2) { animation-delay: 0.06s; }
	.hero__copy > :nth-child(3) { animation-delay: 0.12s; }
	.hero__copy > :nth-child(4) { animation-delay: 0.18s; }
	.showcase .frame:nth-child(1) { animation-delay: 0.2s; }
	.showcase .frame:nth-child(2) { animation-delay: 0.32s; }
	.showcase .frame:nth-child(3) { animation-delay: 0.44s; }
}
@keyframes enter { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .cta, .actions, .hero::before, .hero::after { display: none; }
	body { background: #fff; color: #000; }
}

/* Screenshots with lots of whitespace: letterbox instead of crop */
.card__media--contain { background: #f8f9fa; }
.card__media--contain img { object-fit: contain; object-position: center; padding: 4%; }

/* Work index: compact, uniform cards. The lead card and a trailing card stretch to fill rows. */
.grid--work { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--work .card__media { aspect-ratio: 2 / 1; }
.grid--work > .card:first-child,
.grid--work > .card:last-child:nth-child(3n+1) { grid-column: span 2; }
.grid--work > .card:last-child:nth-child(3n) { grid-column: span 3; }
.grid--work > .card:first-child .card__media,
.grid--work > .card:last-child:nth-child(3n+1) .card__media { aspect-ratio: 4.2 / 1; }
.grid--work > .card:last-child:nth-child(3n) .card__media { aspect-ratio: 6.4 / 1; }
.grid--work .card__body { padding: 1rem 1.2rem 1.15rem; }
.grid--work .card__title { font-size: 1.15rem; }
.grid--work .card__summary {
	font-size: 0.92rem;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
@media (max-width: 64rem) {
	.grid--work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid--work > .card.card { grid-column: span 1; }
	.grid--work > .card:first-child { grid-column: span 2; }
	.grid--work > .card.card .card__media { aspect-ratio: 2 / 1; }
	.grid--work > .card:first-child .card__media { aspect-ratio: 3 / 1; }
}
@media (max-width: 40rem) {
	.grid--work { grid-template-columns: minmax(0, 1fr); }
	.grid--work > .card.card { grid-column: auto; }
}

/* Public card page (visitors without an access key) */
.page-card main { min-height: calc(100vh - 12rem); display: grid; place-items: center; }
.card-page { position: relative; width: 100%; padding: clamp(3rem, 10vw, 6rem) var(--gutter); isolation: isolate; }
.card-page::before {
	content: ""; position: absolute; inset: -8rem 0 0; z-index: -1;
	background: radial-gradient(40rem 24rem at 50% 0%, var(--glow), transparent 70%);
}
.card-page__inner { max-width: 34rem; margin: 0 auto; text-align: center; }
/* Just the initial, in ink, with no disc behind it */
.card-page__mark {
	display: inline-block; width: 6.5rem; height: 5.5rem; margin-bottom: 0.75rem;
	color: var(--ink);
}
.card-page__mark::before { inset: 0; }
.card-page h1 { font-size: clamp(2.6rem, 7vw, 4rem); margin-bottom: 0.3em; }
.card-page h1 em { color: var(--accent); }
.card-page .lede { margin: 0 auto; }
.card-page .actions { justify-content: center; }
.code-form { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.code-form label { display: block; font: 500 0.78rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.code-form__row { display: flex; gap: 0.5rem; max-width: 22rem; margin: 0 auto; }
.code-form input {
	flex: 1; min-width: 0; font: 500 1rem var(--mono); letter-spacing: 0.15em; text-transform: uppercase; text-align: center;
	color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99px; padding: 0.8rem 1rem;
}
.code-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-form input::placeholder { letter-spacing: 0.05em; text-transform: none; color: var(--muted); }
.code-form__error { color: #c0392b; font-size: 0.9rem; margin: 0.9rem 0 0; }

/* Avatar: the hand-drawn M, masked so it takes the theme's colors */
.avatar { position: relative; }
.avatar::before {
	content: ""; position: absolute; inset: 15% 13%;
	background: currentColor;
	-webkit-mask: url("m.png") center / contain no-repeat;
	mask: url("m.png") center / contain no-repeat;
}

/* Leave room for the sticky header when jumping to an in-page anchor */
[id] { scroll-margin-top: 5.5rem; }
