/* ============================================================
   Aayush Goel, portfolio
   Concept: 200 OK. Systems claim success when they fail; the site
   shows the claim, struck through, and the truth beside it.
   Palette: the logo's blue-black and bracket steel, and the resume's
   white paper and navy for light.
   Type: Archivo (display) · IBM Plex Sans (text) · IBM Plex Mono (the logo, data)
   ============================================================ */

:root {
	--ground: #0B0E14;       /* the logo's tile */
	--panel: #11161F;
	--panel-2: #171D29;
	--line: #1E2531;
	--line-2: #2A3240;
	--ink: #E8ECF4;          /* the logo's "ag" */
	--muted: #8B94A7;
	--brand: #7D9BCE;        /* the logo's brackets */
	--brand-ink: #0B0E14;    /* text on a brand fill */
	--strike: #7D9BCE;
	--ok: #5FBF8A;
	--header-bg: rgba(11, 14, 20, 0.94);

	--font-display: "Geist", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Geist", "Helvetica Neue", Arial, sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

	--t-mega: clamp(84px, 2.4rem + 11.5vw, 216px);
	--t-h1: clamp(30px, 1.05rem + 2.7vw, 54px);
	--t-h2: clamp(26px, 1rem + 1.9vw, 40px);
	--t-h3: clamp(19px, 0.95rem + 0.5vw, 23px);
	--t-body: clamp(16px, 0.95rem + 0.15vw, 17.5px);

	--ease: cubic-bezier(0.7, 0, 0.2, 1);
	--ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
	--container: 1180px;
	--gutter: 24px;
	--radius: 6px;
}

/* light: the resume, white paper and navy 52,67,100 */
:root[data-theme="light"] {
	--ground: #F7F8FA;
	--panel: #FFFFFF;
	--panel-2: #EEF1F6;
	--line: #E3E8F0;
	--line-2: #C9D1DE;
	--ink: #1C2536;
	--muted: #556073;
	--brand: #344364;
	--brand-ink: #F4F6FA;
	--strike: #344364;
	--ok: #24804F;
	--header-bg: rgba(247, 248, 250, 0.95);
}

html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
	animation-duration: 0.32s;
	animation-timing-function: var(--ease);
}
@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
}

/* swish: applied only during a theme toggle so normal hovers stay snappy */
:root.theme-anim, :root.theme-anim * {
	transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease,
		fill 0.4s ease, stroke 0.4s ease !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--t-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.container {
	max-width: var(--container);
	margin: 0 auto;
	padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
	padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }

a { color: inherit; }
::selection { background: var(--brand); color: var(--brand-ink); }

h1, h2, h3, h4 { text-wrap: balance; }

/* ---------- skip link ---------- */
.skip-link {
	position: absolute; left: 16px; top: -60px; z-index: 100;
	padding: 10px 16px;
	background: var(--brand); color: var(--brand-ink);
	font: 500 14px var(--font-mono); text-decoration: none;
	border-radius: var(--radius);
	transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ---------- header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--header-bg);
	border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
	.site-header { backdrop-filter: blur(14px) saturate(1.2); }
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }

.logo {
	font-family: var(--font-mono); font-weight: 500; font-size: 24px;
	text-decoration: none; letter-spacing: 0.02em; white-space: nowrap;
	display: inline-flex; align-items: center; min-height: 44px;
}
.logo-bracket {
	color: var(--brand);
	display: inline-block;
	transition: transform 0.35s var(--ease-out);
}
.logo:hover .logo-bracket:first-child { transform: translateX(-4px); }
.logo:hover .logo-bracket:last-child { transform: translateX(4px); }
.logo-expanded { letter-spacing: -0.01em; }

.header-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-nav a {
	position: relative;
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 0 14px;
	font-size: 14.5px; color: var(--muted); text-decoration: none;
	transition: color 0.2s;
}
/* the logo's brackets close around the hovered or current link */
.header-nav a::before, .header-nav a::after {
	position: absolute; top: 50%;
	font-family: var(--font-mono); color: var(--brand);
	opacity: 0;
	transition: opacity 0.2s, transform 0.3s var(--ease-out);
}
.header-nav a::before { content: "["; left: 2px; transform: translate(-6px, -52%); }
.header-nav a::after { content: "]"; right: 2px; transform: translate(6px, -52%); }
.header-nav a:hover, .header-nav a.nav-current { color: var(--ink); }
.header-nav a:hover::before, .header-nav a:hover::after,
.header-nav a.nav-current::before, .header-nav a.nav-current::after { opacity: 1; transform: translate(0, -52%); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle, .nav-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px;
	background: transparent; color: var(--muted);
	border: 1px solid var(--line); border-radius: var(--radius);
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--ink); border-color: var(--brand); }
.theme-toggle svg { width: 16px; height: 16px; transition: transform 0.45s var(--ease-out); }
.theme-toggle:hover svg { transform: rotate(-25deg); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .nav-icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-icon-close { display: block; }

/* ---------- buttons: a brand flood from the left ---------- */
.btn {
	position: relative; isolation: isolate; overflow: hidden;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px;
	font: 500 15px/1 var(--font-body); text-decoration: none; white-space: nowrap;
	border: 1px solid var(--line); border-radius: var(--radius);
	color: var(--ink); background: transparent;
	cursor: pointer;
	transition: color 0.3s var(--ease), border-color 0.3s;
}
.btn::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: var(--brand);
	transform: scaleX(0); transform-origin: right;
	transition: transform 0.45s var(--ease);
}
.btn:hover { color: var(--brand-ink); border-color: var(--brand); }
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn:active { translate: 0 1px; }
.btn .arr { display: inline-block; transition: transform 0.35s var(--ease-out); }
.btn:hover .arr { transform: translate(3px, 0); }

.btn-primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn-primary::before { background: var(--brand); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- the strike: the site's one mark ---------- */
.struck { position: relative; display: inline-block; color: var(--muted); }
.struck::after {
	content: ""; position: absolute; left: -0.04em; right: -0.04em; top: 54%;
	height: max(2px, 0.075em);
	background: var(--strike);
	transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
	.struck.draw::after { animation: strike 0.7s var(--ease) both; animation-delay: var(--d, 0.15s); }
}
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 96px); }
.hero-grid {
	display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(32px, 5vw, 72px); align-items: end;
}
.hero-meta { font: 13px/1.5 var(--font-mono); color: var(--muted); margin-bottom: 18px; }
.hero-meta b { color: var(--ink); font-weight: 500; }
.claim {
	font: 600 var(--t-mega)/0.84 var(--font-display);
	letter-spacing: -0.055em;
	margin-left: -0.05em;
	white-space: nowrap;
}
.claim .struck::after { height: max(5px, 0.06em); }
.hero h1 {
	font: 600 var(--t-h1)/1.06 var(--font-display);
	letter-spacing: -0.03em;
	margin-top: clamp(22px, 3vw, 34px);
	max-width: 19ch;
}
.hero-pitch { max-width: 56ch; color: var(--muted); margin-top: 20px; }
.hero-pitch strong { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* terminal line, under the actions (the easter eggs live in it) */
.hero-typed {
	margin-top: 26px; font: 14px/1.5 var(--font-mono); color: var(--muted);
	min-height: 22px; cursor: text; width: fit-content; max-width: 100%;
	overflow-wrap: anywhere;
}
.prompt { color: var(--brand); }
.hero-typed.term-live .prompt { color: var(--ok); }
.cursor {
	display: inline-block; width: 8px; height: 16px; margin-left: 3px;
	background: var(--brand); vertical-align: text-bottom;
	animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-out {
	font: 13px/1.55 var(--font-mono); color: var(--muted);
	white-space: pre-wrap; overflow-wrap: anywhere;
	margin-top: 10px; padding: 12px 14px; max-width: 64ch;
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.term-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.term-shake { animation: term-shake 0.62s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes term-shake {
	10%, 90% { transform: translateX(-2px); }
	20%, 80% { transform: translateX(4px); }
	30%, 50%, 70% { transform: translateX(-7px); }
	40%, 60% { transform: translateX(7px); }
}

/* the ledger of lies */
.ledger { border-top: 1px solid var(--line-2); }
.ledger-head, .lie {
	display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 4px 16px;
}
.ledger-head {
	padding: 10px 0; border-bottom: 1px solid var(--line);
	font: 12px var(--font-mono); color: var(--muted); letter-spacing: 0.04em;
}
.lie {
	position: relative;
	padding: 14px 0; border-bottom: 1px solid var(--line);
	text-decoration: none; align-items: baseline;
}
.lie .sys { font: 500 13px var(--font-mono); color: var(--brand); }
.lie .said { font: 14px var(--font-mono); }
.lie .truth { grid-column: 2; font-size: 15.5px; line-height: 1.45; }
.lie .truth b { font-weight: 600; }
.lie .go {
	position: absolute; right: 0; top: 14px;
	font: 14px var(--font-mono); color: var(--brand);
	opacity: 0; transform: translateX(-6px);
	transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
a.lie .truth { transition: transform 0.35s var(--ease-out); padding-right: 22px; }
a.lie:hover .truth { transform: translateX(6px); }
a.lie:hover .go { opacity: 1; transform: none; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--line); }
.section-head {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 24px 48px; align-items: end; margin-bottom: clamp(32px, 4vw, 52px);
}
.section-head h2 {
	font: 600 var(--t-h2)/1 var(--font-display); letter-spacing: -0.035em;
}
.section-head p { color: var(--muted); max-width: 52ch; }
.section-head .bracket { color: var(--brand); font-family: var(--font-mono); font-weight: 400; }

/* ---------- work index ---------- */
.work-list { list-style: none; border-top: 1px solid var(--line-2); }
.work-row {
	position: relative; isolation: isolate;
	display: grid; grid-template-columns: 3.2em minmax(0, 5fr) minmax(0, 6fr) 2em;
	gap: 8px 28px; align-items: baseline;
	padding: 28px 0; border-bottom: 1px solid var(--line);
	text-decoration: none;
}
.work-row::before {
	content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)); z-index: -1;
	background: var(--panel);
	transform: scaleY(0); transform-origin: bottom;
	transition: transform 0.45s var(--ease);
}
.work-row:hover::before { transform: scaleY(1); }
.work-idx { font: 13px var(--font-mono); color: var(--muted); }
.work-title { font: 600 var(--t-h3)/1.2 var(--font-display); letter-spacing: -0.02em; }
.work-claim { display: block; font: 14px/1.5 var(--font-mono); margin-top: 8px; }
.work-truth { color: var(--muted); font-size: 16px; }
.work-truth b { color: var(--ink); font-weight: 500; }
.work-tags { display: block; margin-top: 10px; font: 12.5px var(--font-mono); color: var(--muted); }
.work-go {
	font: 18px var(--font-mono); color: var(--brand); justify-self: end;
	transition: transform 0.4s var(--ease-out);
}
.work-row:hover .work-go { transform: translate(4px, -4px); }
.work-row:hover .work-title { color: var(--brand); }

/* ---------- writing list (home and /blog/) ---------- */
.post-list { list-style: none; border-top: 1px solid var(--line-2); }
.post-item {
	position: relative; isolation: isolate;
	display: grid; grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px 48px; padding: clamp(28px, 3vw, 40px) 0; border-bottom: 1px solid var(--line);
	text-decoration: none;
}
.post-item::before {
	content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)); z-index: -1;
	background: var(--panel);
	transform: scaleY(0); transform-origin: bottom;
	transition: transform 0.45s var(--ease);
}
.post-item:hover::before { transform: scaleY(1); }
.post-item h2, .post-item h3 {
	font: 600 var(--t-h3)/1.25 var(--font-display); letter-spacing: -0.02em;
	transition: color 0.2s;
}
.post-item:hover h2, .post-item:hover h3 { color: var(--brand); }
.post-item p { grid-column: 1; color: var(--muted); font-size: 15.5px; max-width: 70ch; }
.post-meta {
	grid-column: 2; grid-row: 1 / span 2; align-self: start;
	font: 12.5px/1.6 var(--font-mono); color: var(--muted); text-align: right; white-space: nowrap;
}
.post-meta .dot { display: none; }
.post-meta span { display: block; }
.more-link {
	display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; min-height: 44px;
	font: 14px var(--font-mono); color: var(--brand); text-decoration: none;
}
.more-link .arr { transition: transform 0.35s var(--ease-out); }
.more-link:hover .arr { transform: translateX(4px); }

/* ---------- experience ---------- */
.xp-list { list-style: none; border-top: 1px solid var(--line-2); }
.xp {
	display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 2fr);
	gap: 8px 28px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.xp h3 { font: 600 18px/1.3 var(--font-display); letter-spacing: -0.015em; }
.xp .org { display: block; font-size: 14.5px; color: var(--muted); font-weight: 400; font-family: var(--font-body); letter-spacing: 0; margin-top: 2px; }
.xp p { color: var(--muted); font-size: 15.5px; }
.xp p b { color: var(--ink); font-weight: 500; }
.xp .when { font: 13px var(--font-mono); color: var(--muted); text-align: right; }

.stack {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px 28px; margin-top: 48px;
}
.stack h3 { font: 500 13px var(--font-mono); color: var(--brand); margin-bottom: 8px; }
.stack p { font-size: 15px; color: var(--muted); line-height: 1.7; }

/* ---------- contact band ---------- */
.contact { padding: clamp(72px, 10vw, 140px) 0; border-top: 1px solid var(--line); }
.contact h2 {
	font: 600 clamp(34px, 1.2rem + 4vw, 76px)/0.98 var(--font-display);
	letter-spacing: -0.045em; max-width: 16ch;
}
.contact-mail {
	display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
	margin-top: 32px;
}
.mail-big {
	position: relative;
	font: 500 clamp(20px, 0.9rem + 1.6vw, 32px) var(--font-mono);
	text-decoration: none; color: var(--ink);
	padding-bottom: 4px;
	background: linear-gradient(var(--brand), var(--brand)) 0 100% / 100% 2px no-repeat;
	transition: background-size 0.4s var(--ease), color 0.2s;
}
.mail-big:hover { color: var(--brand); background-size: 0 2px; background-position: 100% 100%; }
.copy-btn { font-family: var(--font-mono); font-size: 13px; }
.contact-alt { margin-top: 14px; font: 14px var(--font-mono); color: var(--muted); }
.contact-alt a { color: var(--brand); text-underline-offset: 4px; display: inline-block; min-height: 24px; }
.contact-alt a:hover { text-decoration-thickness: 2px; }
.contact-note { margin-top: 22px; color: var(--muted); max-width: 60ch; }
.proof {
	display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 40px; padding-top: 18px;
	border-top: 1px solid var(--line);
	font: 13px var(--font-mono); color: var(--muted);
}
.proof b { color: var(--ink); font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.footer-inner > p { font: 13px var(--font-mono); color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.footer-links a, .kbd-hint {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
	font: 13px var(--font-mono); color: var(--muted); text-decoration: none;
	transition: color 0.2s;
}
.footer-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.kbd-hint { gap: 6px; border: 0; background: none; cursor: pointer; }
.kbd-hint:hover { color: var(--brand); }
.kbd-hint kbd, .kbd-list kbd {
	padding: 1px 6px;
	border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
	background: var(--ground); font: 12px var(--font-mono); color: var(--brand);
}
.footer-easter {
	flex-basis: 100%; font: 12.5px var(--font-mono); color: var(--muted);
	opacity: 0; transform: translateY(6px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.footer-easter.is-in { opacity: 1; transform: none; }

/* ---------- shortcut sheet ---------- */
.kbd-sheet {
	position: fixed; inset: 0; z-index: 90;
	display: flex; align-items: center; justify-content: flex-end;
	padding: 20px clamp(20px, 5vw, 64px);
	background: rgba(0, 0, 0, 0.55);
}
.kbd-card {
	width: min(420px, 100%);
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--panel); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}
.kbd-head { padding: 13px 20px; font: 13px var(--font-mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: baseline; padding: 18px 20px; }
.kbd-list dt { text-align: right; }
.kbd-list dd { font-size: 14px; color: var(--muted); }
.kbd-secret { display: flex; gap: 10px; padding: 12px 20px; font: 12px var(--font-mono); color: var(--muted); border-top: 1px solid var(--line); }
.kbd-secret span { color: var(--brand); letter-spacing: 0.08em; }

/* konami: the page as an amber phosphor terminal, briefly */
:root.vt220 {
	--ink: #FFB000; --muted: #C98A12; --brand: #FFC340; --strike: #FFC340;
	--line: #4A3306; --ground: #0D0800; --panel: #1C1200; --panel-2: #241700; --ok: #FFB000;
	--brand-ink: #0D0800;
}
:root.vt220 body { text-shadow: 0 0 2px rgba(255, 176, 0, 0.55); }
:root.vt220 img { filter: sepia(1) hue-rotate(-18deg) saturate(2.4); }
@media (prefers-reduced-motion: no-preference) {
	:root.vt220 body::after {
		content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none;
		background: repeating-linear-gradient(rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
	}
}

/* ---------- page heads (writing, about, resume) ---------- */
.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 4vw, 52px); }
.page-head .claim-sm {
	font: 600 clamp(44px, 1.6rem + 5vw, 104px)/0.9 var(--font-display);
	letter-spacing: -0.05em; margin-left: -0.04em;
}
.page-head h1 {
	font: 600 var(--t-h1)/1.05 var(--font-display); letter-spacing: -0.035em;
	margin-top: 18px; max-width: 22ch;
}
.page-head .lead { margin-top: 18px; color: var(--muted); max-width: 60ch; font-size: 17.5px; }
.writing-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(36px, 4vw, 56px); }
.writing-hero .lead { max-width: 62ch; }
.writing-hero + .section { border-top: 0; }

/* ---------- case study ---------- */
.case-head { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); }
.crumb {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
	font: 13px var(--font-mono); color: var(--muted); text-decoration: none;
}
.crumb:hover { color: var(--brand); }
.crumb .arr { transition: transform 0.35s var(--ease-out); }
.crumb:hover .arr { transform: translateX(-4px); }
.case-claim {
	margin-top: 22px;
	font: 600 clamp(34px, 1.2rem + 4.2vw, 88px)/0.95 var(--font-display);
	letter-spacing: -0.05em;
}
.case-head h1 {
	font: 600 var(--t-h1)/1.08 var(--font-display); letter-spacing: -0.03em;
	margin-top: 22px; max-width: 24ch;
}
.case-head .lead { margin-top: 18px; color: var(--muted); max-width: 62ch; font-size: 18px; }
.facts {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px 28px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line-2);
}
.facts dt { font: 12.5px var(--font-mono); color: var(--muted); margin-bottom: 4px; }
.facts dd { font-size: 15px; }
.facts dd b { font: 600 22px/1.2 var(--font-display); letter-spacing: -0.02em; display: block; }

.figure { margin: 8px 0 0; }
.figure-box {
	border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
	padding: clamp(18px, 3vw, 32px); overflow-x: auto;
}
.figure figcaption { font: 13px/1.5 var(--font-mono); color: var(--muted); margin-top: 10px; }

.case-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: 0 48px; padding: clamp(40px, 6vw, 72px) 0; }
.case-body section { display: contents; }
.case-body h2 {
	grid-column: 1; font: 500 13px/1.6 var(--font-mono); color: var(--brand);
	padding-top: 6px; margin-bottom: 8px;
}
.case-body .txt { grid-column: 2; margin-bottom: 40px; }
.case-body p, .case-body li { color: var(--ink); max-width: 66ch; }
.case-body p + p { margin-top: 14px; }
.case-body ul { padding-left: 20px; margin-top: 10px; }
.case-body li + li { margin-top: 8px; }
.case-body code, .article-body code {
	font: 0.875em var(--font-mono); background: var(--panel-2);
	border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
.case-body .txt > a, .case-body p a { color: var(--brand); text-underline-offset: 3px; }

.next-case {
	display: block; padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line);
	text-decoration: none;
}
.next-case .lbl { font: 13px var(--font-mono); color: var(--muted); }
.next-case .t {
	display: block; margin-top: 10px;
	font: 600 clamp(28px, 1rem + 3vw, 60px)/1 var(--font-display); letter-spacing: -0.04em;
	transition: color 0.2s, transform 0.45s var(--ease-out);
}
.next-case:hover .t { color: var(--brand); transform: translateX(10px); }

/* figures: the NAT wire */
.wire-fig { min-width: 640px; }
.wire-row { position: relative; height: 120px; }
.wire-row .wire { position: absolute; left: 4%; right: 4%; top: 36px; height: 2px; background: var(--ink); }
.wire-node { position: absolute; top: 36px; transform: translate(-50%, -50%); text-align: center; font: 12.5px/1.4 var(--font-mono); width: 140px; }
.wire-node i { display: block; width: 16px; height: 16px; margin: 0 auto 12px; border: 2px solid var(--ink); background: var(--panel); border-radius: 50%; }
.wire-node span { display: block; color: var(--muted); }
.wire-node b { color: var(--ink); font-weight: 500; }
.wire-nat { position: absolute; left: 61%; top: 4px; bottom: 6px; border-left: 2px dashed var(--brand); }
.wire-nat em { position: absolute; left: 8px; top: -2px; font: 500 12px var(--font-mono); font-style: normal; color: var(--brand); white-space: nowrap; }
.wire-pkt { position: absolute; top: 36px; left: 4%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
	.wire-pkt { animation: pkt 4.2s var(--ease) infinite; }
}
@keyframes pkt {
	0% { left: 96%; } 45% { left: 4%; } 55% { left: 4%; } 100% { left: 96%; }
}

/* figures: code / plan */
.plan-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan {
	font: 13px/1.6 var(--font-mono); white-space: pre; overflow-x: auto;
	background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 16px 18px;
}
.plan .t { display: block; margin-bottom: 8px; color: var(--muted); }
.plan .hot { color: var(--ink); background: color-mix(in srgb, var(--strike) 24%, transparent); }
.plan .ok { color: var(--ok); }
.plan .dim { color: var(--muted); }

/* figures: tenancy matrix */
.matrix { border-collapse: collapse; font: 13px var(--font-mono); min-width: 560px; width: 100%; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 10px 12px; text-align: center; }
.matrix th { color: var(--muted); font-weight: 400; }
.matrix td.ok { color: var(--ok); }
.matrix td.no { color: var(--muted); }
.matrix td.no span { position: relative; }
.matrix td.no span::after { content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px; background: var(--strike); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; padding-bottom: clamp(56px, 7vw, 96px); }
.about-copy p { max-width: 62ch; }
.about-copy p + p { margin-top: 16px; }
.about-copy h2 { font: 600 var(--t-h3)/1.2 var(--font-display); letter-spacing: -0.02em; margin: 40px 0 12px; }
.about-copy a { color: var(--brand); text-underline-offset: 3px; }
.about-side { border-top: 1px solid var(--line-2); align-self: start; }
.about-side div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.about-side dt { font: 12.5px var(--font-mono); color: var(--muted); }
.about-side dd { font-size: 15.5px; margin-top: 2px; }
.about-side dd a { color: var(--brand); text-underline-offset: 3px; }
.about-side .btn { margin-top: 20px; }

/* ---------- article (blog posts) ---------- */
.article { padding: clamp(44px, 6vw, 80px) 0 40px; }
.article-head { max-width: 760px; margin-bottom: 44px; }
.eyebrow { font: 13px var(--font-mono); color: var(--muted); letter-spacing: 0.02em; }
.article-head h1 {
	font: 600 clamp(30px, 1.1rem + 2.8vw, 52px)/1.06 var(--font-display);
	letter-spacing: -0.035em; margin: 14px 0 18px;
}
.article-head .standfirst { font-size: 18.5px; color: var(--muted); line-height: 1.6; }
.article-body { max-width: 720px; }
.article-body p { font-size: 17px; line-height: 1.75; margin-bottom: 20px; }
.article-body h2 { font: 600 25px/1.2 var(--font-display); letter-spacing: -0.02em; margin: 48px 0 14px; }
.article-body h3 { font: 600 19px/1.3 var(--font-display); letter-spacing: -0.01em; margin: 32px 0 10px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 22px; }
.article-body li { font-size: 17px; line-height: 1.7; margin-bottom: 10px; }
.article-body a { color: var(--brand); text-underline-offset: 3px; }
.article-body strong { font-weight: 600; }
.article-body pre {
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 18px 20px; overflow-x: auto; margin: 0 0 22px; line-height: 1.6;
}
.article-body pre code { background: none; border: 0; padding: 0; font-size: 13.5px; white-space: pre; }
.article-body blockquote { margin: 0 0 22px; padding: 2px 0 2px 20px; border-left: 2px solid var(--brand); color: var(--muted); }
.article-body figure { margin: 0 0 22px; }
.article-body figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.article-body figcaption { font: 13px var(--font-mono); color: var(--muted); margin-top: 8px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.callout { border: 1px solid var(--line); border-left: 2px solid var(--brand); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 0 0 22px; }
.callout p { margin: 0; font-size: 16px; color: var(--muted); }
.callout strong { color: var(--ink); }
.article-foot { max-width: 720px; margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line); }
.article-foot p { font-size: 16px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.article-foot .btn { margin: 0 8px 8px 0; }

/* ---------- resume page ---------- */
.resume-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- 404 ---------- */
.nf { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; padding: 64px 0; }
.nf .claim { font-size: clamp(72px, 2rem + 12vw, 200px); }
.nf h1 { font: 600 var(--t-h1)/1.06 var(--font-display); letter-spacing: -0.03em; margin-top: 26px; max-width: 20ch; }
.nf p { color: var(--muted); margin-top: 14px; max-width: 52ch; }
.nf .hero-actions { margin-top: 28px; }

/* ---------- reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
	.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
	.js .reveal.visible { opacity: 1; transform: none; }
}

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

/* ---------- responsive ---------- */
@media (max-width: 980px) {
	.hero-grid { grid-template-columns: 1fr; align-items: start; }
	.section-head { grid-template-columns: 1fr; }
	.work-row { grid-template-columns: 2.4em minmax(0, 1fr) 1.5em; }
	.work-row .work-truth { grid-column: 2; grid-row: 2; }
	.work-row .work-go { grid-column: 3; grid-row: 1; }
	.xp { grid-template-columns: minmax(0, 1fr) auto; }
	.xp p { grid-column: 1 / -1; grid-row: 2; }
	.xp .when { grid-row: 1; grid-column: 2; }
	.stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.case-body { grid-template-columns: 1fr; }
	.case-body h2, .case-body .txt { grid-column: 1; }
	.about-grid { grid-template-columns: 1fr; }
	.plan-pair { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.header-inner { gap: 12px; }
	.header-actions { margin-left: auto; }
	.header-actions .btn { display: none; }
	.header-nav {
		position: fixed; top: 64px; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 0; margin: 0;
		background: var(--panel); border-bottom: 1px solid var(--line);
		padding: 6px 0 10px;
		max-height: calc(100vh - 64px); overflow-y: auto;
		opacity: 0; visibility: hidden; transform: translateY(-8px);
		transition: opacity 0.2s ease, transform 0.25s var(--ease-out), visibility 0.2s;
	}
	.header-nav.open { opacity: 1; visibility: visible; transform: none; }
	.header-nav a {
		min-height: 52px; padding: 0 max(28px, env(safe-area-inset-left, 0px));
		font-size: 17px; border-bottom: 1px solid var(--line);
	}
	.header-nav a:last-child { border-bottom: 0; }
	.header-nav a::before { left: 12px; }
	.header-nav a::after { content: none; }
	.header-nav .nav-mail { display: inline-flex; color: var(--brand); }
}
.header-nav .nav-mail { display: none; }

@media (max-width: 600px) {
	:root { --gutter: 16px; }
	.hero h1 { max-width: none; }
	.ledger-head, .lie { grid-template-columns: 5.4rem minmax(0, 1fr); gap: 4px 12px; }
	.post-item { grid-template-columns: 1fr; }
	.post-meta { grid-column: 1; grid-row: auto; text-align: left; display: flex; gap: 14px; }
	.post-item p { grid-column: 1; }
	.stack { grid-template-columns: 1fr; gap: 20px; }
	.facts { grid-template-columns: 1fr 1fr; }
	.footer-inner { flex-direction: column; align-items: flex-start; }
	.footer-links { margin-left: -10px; }
	.kbd-sheet { justify-content: center; padding: 20px; }
	p, li, dd { overflow-wrap: anywhere; }
}

.about-copy .faq-q { font: 600 17px/1.4 var(--font-body); margin: 24px 0 6px; }
.section-head p a { color: var(--brand); text-underline-offset: 3px; }

/* the big claim never outgrows its column */
.hero-grid > div:first-child { container-type: inline-size; }
.claim { font-size: min(var(--t-mega), 24cqi); }

/* small claims get caught on hover; touch has no hover, so they stay struck */
.lie .said .struck::after, .work-claim .struck::after {
	transform: scaleX(0); transform-origin: left;
	transition: transform 0.45s var(--ease);
}
a.lie:hover .said .struck::after, a.lie:focus-visible .said .struck::after,
.work-row:hover .work-claim .struck::after, .work-row:focus-visible .work-claim .struck::after {
	transform: scaleX(1);
}
@media (hover: none) {
	.lie .said .struck::after, .work-claim .struck::after { transform: none; }
}

/* resume viewer: a long filename must never push the fullscreen button off screen */
.viewer-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
#viewer-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-fullscreen { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }

/* ============================================================
   v2: calmer claims, exhibits, and the chat sidebar on home
   ============================================================ */
.hero h1 { font-weight: 600; letter-spacing: -0.035em; max-width: 18ch; }
.hero h1 s, .ex-title s { text-decoration: none; position: relative; color: var(--muted); white-space: nowrap; }
.hero h1 s::after, .ex-title s::after {
	content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px;
	background: var(--strike); transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
	.hero h1 s::after { animation: strike 0.7s var(--ease) 0.3s both; }
}
.case-claim, .page-head .claim-sm, .nf .claim {
	font: 500 clamp(18px, 1rem + 0.6vw, 24px)/1.3 var(--font-mono); letter-spacing: 0; margin-left: 0; white-space: normal;
}
.case-claim .struck::after, .page-head .claim-sm .struck::after, .nf .claim .struck::after { height: 2px; }

.exhibit .ex-title { font: 600 var(--t-h2)/1.12 var(--font-display); letter-spacing: -0.03em; max-width: 22ch; }
.exhibit .ex-title a { text-decoration: none; transition: color 0.2s; }
.exhibit .ex-title a:hover { color: var(--brand); }
.exhibit .ex-line { color: var(--muted); max-width: 58ch; margin-top: 14px; }
.exhibit .ex-line b { color: var(--ink); font-weight: 500; }
.exhibit .figure { margin-top: 28px; max-width: 860px; }
.exhibit .more-link { margin-top: 14px; }

/* the sidebar */
.chat { display: none; }
@media (min-width: 901px) {
	body.has-chat { --side: clamp(340px, 27vw, 420px); }
	body.has-chat main .container, body.has-chat .site-footer .container, body.has-chat .site-header .container {
		max-width: none; margin: 0;
		padding-left: max(48px, env(safe-area-inset-left, 0px)); padding-right: calc(var(--side) + 48px);
	}
}
body.has-chat .chat {
	position: fixed; z-index: 40; top: 65px; right: 0; bottom: 0; width: var(--side);
	padding-right: env(safe-area-inset-right, 0px);
	display: flex; flex-direction: column;
	background: var(--panel); border-left: 1px solid var(--line);
}
.chat-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.chat-avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 500 11px var(--font-mono); }
.chat-who { min-width: 0; line-height: 1.3; }
.chat-who strong { display: block; font-size: 14px; font-weight: 500; }
.chat-who span { font: 11.5px var(--font-mono); color: var(--muted); }
.chat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.chat-toggle { display: none; }
.chat-thread { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.chat-thread > * { flex-shrink: 0; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
	.msg, .typing { animation: pop 0.3s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg.them { align-self: flex-end; margin-top: 10px; background: var(--panel-2); color: var(--muted); border-bottom-right-radius: 4px; }
.msg.me { align-self: flex-start; border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.msg.me b { font-weight: 600; }
.msg.note { align-self: flex-start; padding: 2px; font: 11.5px var(--font-mono); color: var(--muted); }
.msg.note::before { content: "↳ "; color: var(--brand); }
.msg .copy { font: 11.5px var(--font-mono); margin-left: 8px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line-2); background: none; color: var(--brand); cursor: pointer; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 14px; border-bottom-left-radius: 4px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: tdot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot { 50% { opacity: 0.25; } }
.chat-compose { border-top: 1px solid var(--line); padding: 12px 20px; }
.chat-reset { width: 100%; min-height: 44px; font: 12.5px var(--font-mono); color: var(--muted); background: none; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.chat-reset:hover { color: var(--ink); border-color: var(--brand); }

/* phone: the sidebar docks as a bottom bar */
@media (max-width: 900px) {
	body.has-chat main { padding-bottom: 84px; }
	body.has-chat .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
	body.has-chat .chat {
		left: 0; top: auto; width: auto; max-height: 68px;
		border-left: 0; border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0;
		padding-right: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
		box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.35);
	}
	body.has-chat .chat.open { max-height: 72vh; }
	.chat-head { cursor: pointer; }
	.chat-toggle { display: inline-flex; align-items: center; margin-left: auto; min-height: 44px; font: 12px var(--font-mono); color: var(--brand); background: none; border: 0; cursor: pointer; }
	.chat-who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw; }
	.chat:not(.open) .chat-thread, .chat:not(.open) .chat-compose { display: none; }
	.chat.open .chat-thread { height: calc(72vh - 124px); }
}

/* the sidebar is also the terminal */
.chat-compose { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 20px; }
.chat-prompt { font: 500 14px var(--font-mono); color: var(--ok); }
.chat-input {
	flex: 1; min-width: 0; min-height: 44px; padding: 0 4px;
	background: none; border: 0; outline: none;
	font: 14px var(--font-mono); color: var(--ink); caret-color: var(--brand);
}
.chat-input::placeholder { color: var(--muted); opacity: 0.7; }
.chat-compose:focus-within { box-shadow: inset 0 1px 0 var(--brand); }
.chat-reset { width: 44px; min-height: 44px; padding: 0; font-size: 16px; flex-shrink: 0; }
.msg.code { font: 12.5px/1.55 var(--font-mono); white-space: pre-wrap; color: var(--muted); max-width: 100%; }
.msg.note a { color: var(--brand); text-underline-offset: 3px; }
.msg.note a::after { content: " →"; display: inline-block; transition: transform 0.3s var(--ease-out); }
.msg.note a:hover::after { transform: translateX(3px); }
.msg .mono { font-family: var(--font-mono); }
.chat-avatar { display: flex; align-items: center; justify-content: center; white-space: nowrap; letter-spacing: -0.02em; }
.chat-who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* wire figure: circles sit on the line, labels never collide, nothing scrolls */
.wire-fig { min-width: 560px; }
.wire-row { height: 104px; }
.wire-row .wire { left: 7%; right: 7%; top: 30px; height: 1px; background: var(--line-2); }
.wire-node { top: 30px; width: 120px; transform: translate(-50%, -8px); }
.wire-node i { width: 14px; height: 14px; margin-bottom: 10px; border-width: 1.5px; }
.wire-nat { top: 10px; bottom: 0; }
.wire-nat em { top: auto; bottom: -2px; left: 8px; }
.wire-pkt { top: 30px; }
@media (prefers-reduced-motion: no-preference) {
	.wire-pkt { animation-name: pkt2; }
}
@keyframes pkt2 { 0% { left: 93%; } 45%, 55% { left: 7%; } 100% { left: 93%; } }

/* hero: a live request log behind the headline, where some 200s get caught lying */
.hero { position: relative; overflow: hidden; }
.hero > .container { position: relative; z-index: 1; }
.hero-log {
	position: absolute; inset: 0; z-index: 0; pointer-events: none;
	padding: 28px 0 0 max(48px, env(safe-area-inset-left, 0px));
	font: 12.5px/2 var(--font-mono); color: var(--muted); white-space: pre; overflow: hidden;
	opacity: 0.5;
	-webkit-mask-image: linear-gradient(90deg, transparent 44%, #000 64%, #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
	mask-image: linear-gradient(90deg, transparent 44%, #000 64%, #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
	-webkit-mask-composite: source-in; mask-composite: intersect;
}
.hero-log div { padding-left: 52%; }
.hero-log .ok { color: var(--ok); }
.hero-log .log-lie { color: var(--muted); position: relative; }
.hero-log .log-lie::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 1.5px; background: var(--strike); transform-origin: left; transform: scaleX(0); transition: transform 0.5s var(--ease); }
.hero-log .caught .log-lie::after { transform: scaleX(1); }
.hero-log .log-truth { color: var(--brand); opacity: 0; transition: opacity 0.4s; }
.hero-log .caught .log-truth { opacity: 1; }
@media (max-width: 900px) { .hero-log { opacity: 0.18; } .hero-log div { padding-left: 4%; } }

@media (prefers-reduced-motion: no-preference) {
	.hero .container > * { animation: rise 0.9s var(--ease-out) both; }
	.hero .container > :nth-child(2) { animation-delay: 0.08s; }
	.hero .container > :nth-child(3) { animation-delay: 0.22s; }
	.hero .container > :nth-child(4) { animation-delay: 0.32s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
@media (min-width: 901px) {
	body.has-chat .hero-log { right: var(--side); }
	body.has-chat .hero-log div { padding-left: 46%; }
	body.has-chat .hero-log { -webkit-mask-image: linear-gradient(90deg, transparent 36%, #000 56%, #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent 36%, #000 56%, #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); }
}

/* exhibits: words left, figure right, on wide screens */
@media (min-width: 1240px) {
	.exhibit .container {
		display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		column-gap: 56px; align-items: center;
	}
	.exhibit .container > * { grid-column: 1; }
	.exhibit .container > .figure { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; max-width: none; }
	.exhibit .ex-title { max-width: 16ch; }
	.exhibit .plan-pair { grid-template-columns: 1fr; }
	.exhibit .wire-fig { min-width: 440px; }
	.exhibit .wire-node { width: 96px; font-size: 11px; }
}
.exhibit .wire-nat { left: 53%; }

/* phone sheet slides with transform, not max-height */
@media (max-width: 900px) {
	body.has-chat .chat {
		max-height: none; height: 72vh;
		transform: translateY(calc(100% - 68px - env(safe-area-inset-bottom, 0px)));
		transition: transform 0.4s var(--ease);
	}
	body.has-chat .chat.open { max-height: none; transform: none; }
}

/* chat presence: a live dot on the avatar, status under the name */
.chat-avatar { position: relative; }
.chat-presence {
	position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
	background: var(--ok); border: 2px solid var(--panel);
}
@media (prefers-reduced-motion: no-preference) {
	.chat-presence::after {
		content: ""; position: absolute; inset: -2px; border-radius: 50%;
		border: 2px solid var(--ok); animation: presence 2.2s ease-out infinite;
	}
}
@keyframes presence { from { transform: scale(0.8); opacity: 0.7; } to { transform: scale(2.2); opacity: 0; } }
.chat-status { display: block; font: 11.5px var(--font-mono); color: var(--ok); }
.chat-latest { display: none; }
@media (max-width: 900px) {
	.chat-status { display: none; }
	.chat-latest { display: block; }
}
.chat-who .chat-latest { display: none; }
@media (max-width: 900px) {
	.chat-who .chat-status { display: none; }
	.chat-who .chat-latest { display: block; }
}
.hero-log .err4 { color: #D9A94E; }
.hero-log .err5 { color: #E06C6C; }
.hero-log .log-truth-static { color: var(--brand); }

/* the log rewrites itself; never let the browser anchor scroll to it */
.hero-log, .hero-log * { overflow-anchor: none; }

/* no rubber-band at the page edges: the fixed chat and the sticky header must move as one */
html, body { overscroll-behavior-y: none; }

.resume-highlights { margin: 18px 0 0; padding-left: 18px; max-width: 64ch; color: var(--muted); }
.resume-highlights li + li { margin-top: 6px; }

/* ===== jury re-score 2 fixes ===== */
/* hero log: right of the text, tilted back like a panel floating behind the hero */
@media (min-width: 901px) {
	/* starts past the text column (~700px) in px, so a narrow window shows less log instead of log under the headline */
	body.has-chat .hero-log div { padding-left: max(54%, 740px); }
	body.has-chat .hero-log {
		-webkit-mask-image: linear-gradient(90deg, transparent max(50%, 740px), #000 max(66%, 820px), #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 22%, #000 72%, transparent);
		mask-image: linear-gradient(90deg, transparent max(50%, 740px), #000 max(66%, 820px), #000 96%, transparent 100%), linear-gradient(180deg, transparent, #000 22%, #000 72%, transparent);
	}
}
/* laptop widths: a narrow strip hugging the text, cropped at the chat */
@media (min-width: 1280px) and (max-width: 1599px) {
	/* the headline's widest line is ~12.1em of --t-h1, so the log tracks it as the font shrinks */
	body.has-chat .hero-log div { padding-left: calc(12.2 * var(--t-h1) + 16px); }
	body.has-chat .hero-log {
		-webkit-mask-image: linear-gradient(90deg, transparent calc(12.2 * var(--t-h1) + 40px), #000 calc(12.2 * var(--t-h1) + 64px), #000 98%, transparent 100%), linear-gradient(180deg, transparent, #000 22%, #000 72%, transparent);
		mask-image: linear-gradient(90deg, transparent calc(12.2 * var(--t-h1) + 40px), #000 calc(12.2 * var(--t-h1) + 64px), #000 98%, transparent 100%), linear-gradient(180deg, transparent, #000 22%, #000 72%, transparent);
	}
}
/* below that, only a sliver would show */
@media (min-width: 901px) and (max-width: 1279px) {
	body.has-chat .hero-log { display: none; }
}
@media (max-width: 900px) {
	.hero-log { -webkit-mask-image: linear-gradient(90deg, transparent 55%, #000 80%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent 55%, #000 80%), linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent); }
	.hero-log div { padding-left: 50%; }
}

/* every button lifts; inline links tighten their underline; project titles get an arrow */
.btn:hover { translate: 0 -1px; }
.btn:active { translate: 0 1px; }
.about-copy a, .about-side a, .article-body a, .article-foot a, .case-body a, .section-head p a, .writing-hero a, .msg.note a {
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
	padding-block: 3px;
	transition: text-underline-offset 0.2s, text-decoration-thickness 0.2s, color 0.2s;
}
.about-copy a:hover, .about-side a:hover, .article-body a:hover, .article-foot a:hover, .case-body a:hover, .section-head p a:hover, .writing-hero a:hover, .msg.note a:hover {
	text-decoration-thickness: 2px; text-underline-offset: 2px;
}
.writing-hero a { display: inline-block; min-height: 24px; }
.exhibit .ex-title a::after {
	content: "↗"; display: inline-block; margin-left: 0.25em; font-size: 0.55em; vertical-align: 0.35em;
	color: var(--brand); transition: transform 0.35s var(--ease-out);
}
.exhibit .ex-title a:hover::after { transform: translate(3px, -3px); }

/* every page rises in, not just home */
@media (prefers-reduced-motion: no-preference) {
	.page-head .container > *, .case-head .container > *, .article-head > *, .nf > * { animation: rise 0.9s var(--ease-out) both; }
	.page-head .container > :nth-child(2), .case-head .container > :nth-child(2), .article-head > :nth-child(2), .nf > :nth-child(2) { animation-delay: 0.08s; }
	.page-head .container > :nth-child(3), .case-head .container > :nth-child(3), .article-head > :nth-child(3), .nf > :nth-child(3) { animation-delay: 0.18s; }
	.case-head .container > :nth-child(n+4), .nf > :nth-child(n+4) { animation-delay: 0.26s; }
}

/* 404 keeps the page gutter */
.nf { padding-block: 64px; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
