/* ==========================================================================
   Front page — v8 design
   Near-black stage, lavender accent, purple edge glows, big Geist type.
   Motion: ASCII-decode intro, cursor blob, portrait that follows the pointer,
   rotating roles, pinned horizontal work track, scroll-lit timeline and
   statement, a physics skills playground, an interactive terminal.
   Everything animated is transform/opacity/filter and is switched off
   under prefers-reduced-motion (end of this file, and js/fx.js).
   ========================================================================== */

:root {
	--bg: #0b0a0f;
	--bg-2: #12101a;
	--surface: rgba(255, 255, 255, 0.035);
	--surface-solid: #14121c;
	--line: rgba(255, 255, 255, 0.09);
	--line-strong: rgba(255, 255, 255, 0.18);
	--text: #e9e6f0;
	--dim: #9d97ab;
	--heading: #f6f4fb;

	--accent: #c4b5fd;      /* lavender */
	--accent-2: #a78bfa;    /* violet */
	--accent-deep: #7c3aed;
	--pink: #e879f9;
	--ok: #86efac;
	--accent-ink: #120d1f;
	--ai: var(--accent-2);
	--grad: linear-gradient(100deg, #e9d5ff 0%, var(--accent) 35%, var(--accent-2) 70%, var(--pink) 100%);

	--font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
	--wrap: 1200px;
	--r: 14px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--spring: cubic-bezier(0.34, 1.56, 0.64, 1);

	/* portfolio-chat.css reads these */
	--cyan: var(--accent);
	--cyan-dim: var(--accent-2);
	--brand: var(--accent-2);
	--bg-dark: var(--surface-solid);

	color-scheme: dark;
	interpolate-size: allow-keywords;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; overflow-x: clip; }
body {
	margin: 0; overflow-x: clip;
	background: var(--bg); color: var(--text);
	font: 400 16px/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
}
/* purple glows hugging the screen edges */
body::before {
	content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(260px 260px at 0 0, rgba(168, 85, 247, 0.45), transparent 70%),
		radial-gradient(220px 360px at 100% 50%, rgba(192, 132, 252, 0.38), transparent 70%),
		radial-gradient(600px 300px at 50% 120%, rgba(124, 58, 237, 0.18), transparent 70%);
	animation: edge-breathe 9s ease-in-out infinite alternate;
}
@keyframes edge-breathe { to { opacity: 0.65; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #e9d5ff; }
h1, h2, h3 { color: var(--heading); margin: 0; line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; }
p { margin: 0 0 12px; }
strong { color: var(--heading); font-weight: 600; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(167, 139, 250, 0.4); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hl { color: var(--accent-2); }

.skip {
	position: absolute; left: -9999px; top: 8px; z-index: 300; border-radius: 8px;
	background: var(--accent); color: var(--accent-ink); padding: 8px 14px; font: 600 14px var(--font);
}
.skip:focus { left: 8px; }

/* ---------- cursor blob (js/fx.js, fine pointers only) ---------- */
.cursor {
	position: fixed; left: 0; top: 0; z-index: 240; width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border-radius: 50%; pointer-events: none; background: #e9d5ff;
	box-shadow: 0 0 24px 6px rgba(192, 132, 252, 0.55);
	transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(var(--cs, 1));
	opacity: 0.9; transition: opacity 0.3s, background-color 0.3s; mix-blend-mode: normal;
}
.cursor.is-hover { --cs: 1.9; opacity: 0.28; }
.cursor.is-down { --cs: 0.7; }

/* ---------- fixed dock: socials left, resume right ---------- */
.dock, .dock-resume { display: none; }
@media (min-width: 1180px) {
	.dock { position: fixed; left: 34px; bottom: 34px; z-index: 40; display: flex; flex-direction: column; gap: 24px; }
	.dock a { display: block; width: 22px; height: 22px; color: var(--text); transition: color 0.2s, transform 0.3s var(--spring); }
	.dock a:hover { color: var(--accent); transform: translateY(-3px); }
	.dock svg { width: 100%; height: 100%; display: block; }
	.dock-resume {
		position: fixed; right: 30px; bottom: 112px; z-index: 40; display: block; writing-mode: vertical-rl;
		font: 500 15px var(--font); letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim);
		transition: color 0.2s, letter-spacing 0.4s var(--ease);
	}
	.dock-resume:hover { color: var(--heading); letter-spacing: 0.36em; }
}

/* ---------- scroll progress (native scroll-driven animation) ---------- */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
	.progress {
		display: block; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
		background: var(--grad); transform-origin: 0 50%;
		animation: grow linear both; animation-timeline: scroll(root);
	}
	@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- shared bits ---------- */
.btn {
	position: relative; overflow: hidden; isolation: isolate;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 13px 22px; border: 1px solid var(--line-strong); border-radius: 10px;
	color: var(--heading); background: rgba(255, 255, 255, 0.04);
	font: 500 15px var(--font); cursor: pointer;
	transition: transform 0.3s var(--spring), border-color 0.2s, background-color 0.2s, color 0.2s, box-shadow 0.3s;
}
.btn::after {
	content: ''; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
	transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--heading); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(0.96); }
.btn--primary { background: linear-gradient(180deg, #d8ccff, var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.btn--primary:hover { color: var(--accent-ink); box-shadow: 0 12px 36px -10px rgba(167, 139, 250, 0.8); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
	display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
	background: rgba(255, 255, 255, 0.03); color: var(--text); font: 400 12px/1.6 var(--mono); white-space: nowrap;
	transition: border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--ai { color: var(--accent); border-color: rgba(196, 181, 253, 0.35); background: rgba(167, 139, 250, 0.1); }

.live { font: 600 11px var(--mono); color: var(--ok); text-transform: uppercase; letter-spacing: 0.06em; }
.live::before { content: '\25CF\00a0'; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 10px; vertical-align: 1px; }
.dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* glass card + cursor glow (js/fx.js sets --gx/--gy) */
.card {
	--gx: 50%; --gy: 50%;
	position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
	border: 1px solid var(--line); border-radius: var(--r); padding: 24px;
	transition: border-color 0.3s, transform 0.5s var(--ease);
}
.card::before, .project a::before {
	content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
	background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 50%), rgba(167, 139, 250, 0.16), transparent 45%);
	transition: opacity 0.35s;
}
.card:hover::before, .project a:hover::before { opacity: 1; }
.card:hover { border-color: rgba(196, 181, 253, 0.3); }
.card__mark { font: 500 12px var(--mono); color: var(--accent); margin-bottom: 14px; text-transform: lowercase; }
.card__foot { margin: 14px 0 0; font: 400 13px var(--mono); }

.copy, .linkish { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font: 400 11px var(--mono); padding: 1px 8px; cursor: pointer; }
.copy:hover, .copy.is-copied { color: var(--accent); border-color: var(--accent); }
.linkish { border: 0; padding: 0; font-size: 13px; color: var(--accent); }
.linkish:hover { text-decoration: underline; }

.kv { margin: 0; font: 400 13px/1.5 var(--mono); }
.kv div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.kv div:first-child { border-top: 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.kv--tight { margin-top: 16px; }

/* ---------- nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: linear-gradient(var(--bg) 20%, rgba(11, 10, 15, 0)); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 76px; max-width: none; padding: 0 34px; position: relative; }
.nav__logo { font: 700 16px var(--font); color: var(--heading); letter-spacing: 0.02em; }
.nav__logo:hover { color: var(--accent); }
.nav__email { margin-right: auto; font: 500 14px var(--font); color: var(--text); letter-spacing: 0.02em; }
.nav__email:hover { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 26px; font: 500 13px var(--font); text-transform: uppercase; letter-spacing: 0.06em; }
.nav__links > a { position: relative; color: var(--text); padding: 6px 0; }
.nav__links > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease); }
.nav__links > a:hover::after, .nav__links > a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.nav__links > a:hover, .nav__links > a[aria-current] { color: var(--heading); }
.nav__ask { background: none; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font: 500 12px var(--font); padding: 6px 10px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; transition: border-color 0.2s, color 0.2s; }
.nav__ask:hover { border-color: var(--accent); color: var(--accent); }
.nav__ask kbd { font: inherit; color: var(--dim); margin-right: 4px; }
.nav__links .nav__resume { color: var(--accent); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font: 500 13px var(--font); padding: 7px 14px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; }
html:not(.js) .nav__toggle { display: none; }
@media (max-width: 1600px) { .nav__email { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: 76px; }
.hero__stage {
	position: relative; min-height: min(calc(100svh - 190px), 760px);
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
	padding: 0 clamp(24px, 8vw, 150px);
}
.hero__left { justify-self: start; }
.hero__right { justify-self: start; }
.hero__hello, .hero__a { font: 400 clamp(20px, 2vw, 28px)/1.2 var(--font); color: var(--accent); margin: 0 0 6px; letter-spacing: 0.01em; }
.hero__title { font-size: clamp(40px, 5.2vw, 84px); font-weight: 600; line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase; }
.hero__first, .hero__last { display: block; }
.hero__last { color: transparent; -webkit-text-stroke: 1.5px rgba(246, 244, 251, 0.55); }
.roles { position: relative; height: 1.05em; min-width: 7ch; font: 600 clamp(34px, 4.1vw, 72px)/1.05 var(--font); text-transform: uppercase; letter-spacing: -0.01em; color: var(--heading); margin: 0; }
.roles span { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; animation: role 9s var(--ease) infinite; }
.roles span:nth-child(2) { animation-delay: 3s; }
.roles span:nth-child(3) { animation-delay: 6s; }
@keyframes role {
	0%   { opacity: 0; transform: translateY(45%); filter: blur(10px); color: var(--accent-2); }
	6%, 28% { opacity: 1; transform: none; filter: none; color: var(--heading); }
	34%, 100% { opacity: 0; transform: translateY(-45%); filter: blur(10px); }
}
html:not(.js) .roles span:first-child { opacity: 1; animation: none; }
@media (min-width: 961px) {
	/* roles size to their column so the longest one never runs off screen */
	.hero__right { container-type: inline-size; width: 100%; }
	.roles { font-size: min(clamp(34px, 4.1vw, 72px), 13.5cqi); }
}

.portrait {
	position: relative; width: clamp(260px, 30vw, 470px); aspect-ratio: 1; isolation: isolate;
	transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(var(--tx, 0px), var(--ty, 0px), 0);
	transition: transform 0.6s var(--ease);
}
.portrait__glow {
	position: absolute; inset: 18% 6% -4%; z-index: -1; border-radius: 50%;
	background: radial-gradient(closest-side, rgba(168, 85, 247, 0.75), rgba(124, 58, 237, 0.35) 55%, transparent);
	filter: blur(40px); animation: glow-pulse 5s ease-in-out infinite alternate;
}
@keyframes glow-pulse { to { transform: scale(1.12); opacity: 0.75; } }
.portrait img {
	width: 100%; height: 100%; object-fit: cover; mix-blend-mode: lighten;
	-webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
	mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
	filter: contrast(1.05) saturate(0.9);
}
.portrait::after { /* violet rim light */
	content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
	background: radial-gradient(70% 60% at 82% 30%, rgba(232, 121, 249, 0.28), transparent 60%), radial-gradient(60% 50% at 15% 60%, rgba(139, 92, 246, 0.22), transparent 60%);
	-webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
	mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
}

.hero__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 8px; }
.hero__status { font: 400 13px var(--mono); color: var(--dim); margin: 0; }
.hero__clock { color: var(--dim); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 40px; border-block: 1px solid var(--line); }
.stats li { padding: 26px 0 22px 24px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; padding-left: 0; }
.stats strong { display: block; font: 600 clamp(38px, 4vw, 58px)/1 var(--font); letter-spacing: -0.04em; color: var(--heading); font-variant-numeric: tabular-nums; }
.stats span { font: 400 13px var(--font); color: var(--dim); }

/* intro choreography: paused until <html> gets .is-ready (js/fx.js, or the head failsafe) */
html.js .hero__hello, html.js .hero__first, html.js .hero__last, html.js .portrait, html.js .hero__right, html.js .hero__bar, html.js .stats li, html.js .nav {
	animation-duration: 1.1s; animation-timing-function: var(--ease); animation-fill-mode: both; animation-play-state: paused;
}
html.js .nav { animation-name: drop-in; }
html.js .hero__hello { animation-name: blur-in; animation-delay: 0.1s; }
html.js .hero__first { animation-name: blur-up; animation-delay: 0.2s; }
html.js .hero__last { animation-name: blur-up; animation-delay: 0.32s; }
html.js .portrait { animation-name: portrait-in; animation-duration: 0.9s; }
html.js .hero__right { animation-name: blur-in; animation-delay: 0.45s; }
html.js .hero__bar { animation-name: blur-up; animation-delay: 0.7s; }
html.js .stats li { animation-name: blur-up; }
html.js .stats li:nth-child(1) { animation-delay: 0.8s; }
html.js .stats li:nth-child(2) { animation-delay: 0.88s; }
html.js .stats li:nth-child(3) { animation-delay: 0.96s; }
html.js .stats li:nth-child(4) { animation-delay: 1.04s; }
html.is-ready .hero__hello, html.is-ready .hero__first, html.is-ready .hero__last, html.is-ready .portrait, html.is-ready .hero__right,
html.is-ready .hero__bar, html.is-ready .stats li, html.is-ready .nav { animation-play-state: running; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-24px); } }
@keyframes blur-in { from { opacity: 0; filter: blur(14px); } }
@keyframes blur-up { from { opacity: 0; transform: translateY(40px); filter: blur(10px); } }
@keyframes portrait-in { from { opacity: 0; transform: perspective(1000px) scale(0.94); } }

/* marquee band */
.marquee {
	overflow: hidden; padding: 26px 0; margin-top: 64px; border-block: 1px solid var(--line);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { font: 600 clamp(28px, 3.4vw, 46px)/1 var(--font); letter-spacing: -0.03em; padding: 0 30px; color: var(--heading); white-space: nowrap; text-transform: uppercase; }
.marquee span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgba(196, 181, 253, 0.6); }
.marquee span::after { content: '\2726'; margin-left: 60px; font-size: 0.45em; vertical-align: middle; color: var(--accent-2); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.sec { position: relative; padding-top: 120px; padding-bottom: 40px; }
.sec__head { margin-bottom: 44px; max-width: 860px; }
.sec__mark { font: 500 13px var(--mono); color: var(--dim); margin-bottom: 18px; }
.sec h2 { font-size: clamp(40px, 6vw, 84px); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.sec__intro { color: var(--dim); margin: 20px 0 0; font-size: 18px; max-width: 64ch; }
.sec__foot { margin: 28px 0 0; color: var(--dim); font-size: 15px; }

/* about */
.statement { font: 500 clamp(24px, 3vw, 40px)/1.28 var(--font); letter-spacing: -0.02em; color: var(--heading); max-width: 30ch; margin: 0 0 56px; }
.statement .wd { opacity: 0.16; transition: opacity 0.4s var(--ease), color 0.4s; }
.statement .wd.is-lit { opacity: 1; }
html:not(.js) .statement .wd { opacity: 1; }
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.about__bio { display: flex; flex-direction: column; }
.lead { font-size: 18px; color: var(--text); }
.checks { list-style: none; margin: 18px 0 22px; }
.checks li { padding: 4px 0 4px 30px; position: relative; }
.checks li::before { content: '\2713'; position: absolute; left: 0; top: 7px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--mono); color: var(--accent-ink); background: var(--accent); }
.about__principles { grid-column: 1 / -1; }
.principles { list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 28px; }
.principles li { counter-increment: p; font-size: 15px; padding-left: 46px; position: relative; }
.principles li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: -3px; font: 600 24px var(--font); color: var(--accent-2); }

/* interactive terminal */
.term {
	position: relative; display: flex; flex-direction: column; min-height: 340px; max-height: 420px; overflow: hidden;
	background: #08070c; border: 1px solid var(--line-strong); border-radius: var(--r);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 50px -20px rgba(139, 92, 246, 0.5);
	font: 400 13px/1.6 var(--mono);
}
.term__bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.term__dots { display: inline-flex; gap: 6px; }
.term__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__dots i:nth-child(2) { background: #febc2e; }
.term__dots i:nth-child(3) { background: #28c840; }
.term__title { color: var(--dim); font-size: 12px; }
.term__hint { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); border: 1px solid rgba(196, 181, 253, 0.4); border-radius: 999px; padding: 1px 8px; animation: blink 2.4s ease-in-out infinite; }
.term__out { flex: 1; overflow-y: auto; padding: 14px 16px 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.term__out p { margin: 0 0 4px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.term__out .t-dim { color: var(--dim); }
.term__out .t-ok { color: var(--ok); }
.term__out .t-ai { color: var(--accent); }
.term__out .t-warn { color: #fbbf24; }
.term__out .t-err { color: #fb7185; }
.term__out a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.term__out p.is-new { animation: line-in 0.25s var(--ease) both; }
@keyframes line-in { from { opacity: 0; transform: translateX(-6px); } }
.term__ps { color: var(--accent-2); margin-right: 8px; font-weight: 700; }
.term__in { display: flex; align-items: center; padding: 10px 16px 14px; border-top: 1px dashed var(--line); }
.term__in input { flex: 1; min-width: 0; background: none; border: 0; color: var(--heading); font: inherit; caret-color: var(--accent); padding: 4px 0; }
.term__in input:focus { outline: none; }
.term__in input::placeholder { color: #6b6578; }
.term:focus-within { border-color: rgba(196, 181, 253, 0.55); }
html:not(.js) .term__in { display: none; }

/* work — pinned horizontal track (js/fx.js adds html.hs-on on wide screens) */
.hscroll { margin-inline: calc(50% - 50vw); }
.hscroll__pin { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll__pin::-webkit-scrollbar { display: none; }
html.hs-on .hscroll__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; scroll-snap-type: none; display: flex; align-items: center; }
.cases {
	counter-reset: c; display: flex; width: max-content;
	padding-inline: max(var(--edge, 24px), calc(50vw - 576px)); border-block: 1px solid var(--line);
	transform: translate3d(var(--hx, 0px), 0, 0);
}
.case {
	counter-increment: c; position: relative; flex: none; width: min(420px, 84vw);
	display: flex; flex-direction: column; gap: 26px; padding: 40px 34px;
	border-left: 1px solid var(--line); scroll-snap-align: start;
}
.case:last-child { border-right: 1px solid var(--line); }
.case img {
	width: 100%; aspect-ratio: 40 / 21; object-fit: cover; border-radius: 10px; filter: saturate(0.8) brightness(0.9);
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(calc(0.9 + var(--focus, 1) * 0.1));
	transition: transform 0.8s var(--ease), filter 0.6s;
}
.case:hover img { --focus: 1.4; filter: none; box-shadow: 0 30px 60px -30px rgba(124, 58, 237, 0.7); }
.case:nth-child(even) img { order: 2; }
.case__body { position: relative; display: flex; flex-direction: column; gap: 6px; padding-top: 70px; }
.case__body::before {
	content: counter(c, decimal-leading-zero); position: absolute; left: 0; top: 0;
	font: 600 56px/1 var(--font); letter-spacing: -0.04em; color: var(--heading); transition: color 0.4s;
}
.case:hover .case__body::before { color: var(--accent-2); }
.case__body p { color: var(--dim); font-size: 14px; margin: 0 0 6px; }
.case__meta { position: absolute; right: 0; top: 8px; font: 500 11px var(--mono) !important; color: var(--accent) !important; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 !important; }
.case--featured .case__meta::before { content: '\2605\00a0'; color: #fbbf24; }
.case h3 { font: 500 22px/1.2 var(--font); letter-spacing: -0.02em; }
.case h3 a { color: var(--heading); }
.case h3 a::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.case h3 a:hover { color: var(--accent); }
.case:focus-within h3 a { color: var(--accent); }
.case--soon { justify-content: center; }
.case--soon .case__body { opacity: 0.6; }

/* experience — scroll-lit line (js/fx.js sets --tp 0..1 and .is-lit) */
.timeline { --tp: 0; list-style: none; position: relative; margin-left: 10px; }
.timeline::before, .timeline::after { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; }
.timeline::before { background: var(--line); }
.timeline::after { background: linear-gradient(var(--pink), var(--accent-2) 40%, var(--accent)); transform: scaleY(var(--tp)); transform-origin: top; box-shadow: 0 0 14px rgba(167, 139, 250, 0.7); }
html:not(.js) .timeline { --tp: 1; }
.timeline > li { position: relative; padding: 0 0 16px 36px; }
.timeline > li::before {
	content: ''; position: absolute; left: -6px; top: 24px; z-index: 1; width: 14px; height: 14px; border-radius: 50%;
	background: var(--bg); border: 2px solid var(--line-strong); transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s var(--spring);
}
.timeline > li.is-lit::before, html:not(.js) .timeline > li::before { border-color: var(--accent); background: var(--accent-2); box-shadow: 0 0 0 5px rgba(167, 139, 250, 0.18), 0 0 18px rgba(167, 139, 250, 0.8); transform: scale(1.1); }
.timeline__edu::before { border-style: dashed !important; }
.timeline details { background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)); border: 1px solid var(--line); border-radius: var(--r); transition: border-color 0.3s, background-color 0.3s; }
.timeline details:hover { border-color: var(--line-strong); }
.timeline details[open] { border-color: rgba(196, 181, 253, 0.35); }
.timeline details::details-content { block-size: 0; overflow: clip; transition: block-size 0.5s var(--ease), content-visibility 0.5s allow-discrete; }
.timeline details[open]::details-content { block-size: auto; }
.timeline summary { list-style: none; cursor: pointer; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.timeline summary::-webkit-details-marker { display: none; }
.timeline summary::after { content: '+'; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 18px var(--font); color: var(--accent); border: 1px solid var(--line-strong); transition: transform 0.4s var(--spring), background-color 0.2s; }
.timeline details[open] summary::after { transform: rotate(45deg); background: rgba(167, 139, 250, 0.15); }
.role { flex: 1; min-width: 240px; }
.role strong { font: 600 20px var(--font); letter-spacing: -0.02em; }
.role__co { display: block; color: var(--dim); font-size: 14px; }
.role__period { font: 500 15px var(--font); color: var(--accent); white-space: nowrap; }
.role__period .live { margin-right: 8px; }
.timeline details > p, .timeline details > ul, .timeline details > .chips { margin: 0 22px 14px; }
.timeline details > ul { padding-left: 18px; color: var(--text); font-size: 15px; }
.timeline details > ul li { margin-bottom: 6px; }
.timeline details > ul li::marker { color: var(--accent-2); }
.timeline details > .chips { padding-bottom: 8px; }

/* stack — physics playground + tier cards */
.play {
	position: relative; height: 440px; margin-bottom: 18px; overflow: hidden; touch-action: pan-y;
	border: 1px solid var(--line); border-radius: 22px;
	background: radial-gradient(60% 80% at 50% 100%, rgba(124, 58, 237, 0.35), transparent 70%), radial-gradient(40% 60% at 50% 0%, rgba(232, 121, 249, 0.12), transparent 70%), #0d0b13;
}
.play canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.play canvas:active { cursor: grabbing; }
.play__hint { position: absolute; left: 20px; top: 16px; margin: 0; font: 400 12px var(--mono); color: var(--dim); pointer-events: none; }
html:not(.js) .play { display: none; }
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.skills { list-style: none; }
.skills li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 15px; transition: padding 0.3s var(--ease), color 0.2s; }
.skills li:first-child { border-top: 0; }
.skills li:hover { padding-left: 6px; color: var(--heading); }
.tier { display: inline-flex; vertical-align: middle; --on: var(--accent-2); --off: rgba(255, 255, 255, 0.12); }
.tier::before { content: ''; width: 36px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--c1) 0 10px, transparent 10px 13px, var(--c2) 13px 23px, transparent 23px 26px, var(--c3) 26px 36px); transition: clip-path 1s var(--ease) 0.25s; }
.tier--1 { --c1: var(--on); --c2: var(--off); --c3: var(--off); }
.tier--2 { --c1: var(--on); --c2: var(--on); --c3: var(--off); }
.tier--3 { --c1: var(--on); --c2: var(--on); --c3: var(--on); }
.tools__list { margin: 0; display: grid; gap: 12px; }
.tools__list div { display: grid; grid-template-columns: 210px 1fr; gap: 12px; align-items: start; }
.tools__list dt { font: 400 13px/26px var(--mono); color: var(--dim); }
.tools__list dd { margin: 0; }

/* services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service { transform: perspective(900px) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.service:hover { --lift: -6px; }
.service h3 { font-size: 22px; margin-bottom: 8px; }
.service > p:not(.card__mark) { color: var(--dim); font-size: 15px; }
.service ul { list-style: none; margin-bottom: 16px; font-size: 14px; }
.service li { padding: 3px 0 3px 20px; position: relative; }
.service li::before { content: '\2192'; position: absolute; left: 0; color: var(--accent-2); transition: transform 0.3s var(--spring); }
.service li:hover::before { transform: translateX(4px); }
.service--ai { background: linear-gradient(160deg, rgba(167, 139, 250, 0.16), rgba(255, 255, 255, 0.012) 60%); border-color: rgba(196, 181, 253, 0.3); }
.service--ai .card__mark { color: var(--pink); }

/* projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
html:not(.js) .filters { display: none; }
.filter { background: none; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--dim); font: 500 13px var(--font); padding: 8px 18px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background-color 0.3s; }
.filter:hover { color: var(--heading); border-color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter span { opacity: 0.7; }
.projects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.project a {
	--gx: 50%; --gy: 50%; position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; overflow: hidden;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
	border: 1px solid var(--line); border-radius: var(--r); color: var(--text); padding: 0 0 16px;
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: transform 0.5s var(--ease), border-color 0.3s;
}
.project a:hover { border-color: rgba(196, 181, 253, 0.35); color: var(--text); }
.project__thumb { display: block; aspect-ratio: 16 / 10; background: var(--surface-solid) center / cover no-repeat; border-bottom: 1px solid var(--line); margin-bottom: 12px; transition: transform 0.8s var(--ease); }
.project a:hover .project__thumb { transform: scale(1.07); }
.project__thumb--code { display: flex; align-items: center; padding: 12px; }
.project__thumb--code code { font: 400 11px/1.5 var(--mono); color: var(--accent); white-space: pre; }
.project__status, .project h3, .project p, .project .chips, .project__cta { position: relative; margin: 0 16px; }
.project__status { font: 500 11px var(--mono); color: var(--ok); text-transform: uppercase; letter-spacing: 0.08em; }
.project__status--dim { color: var(--dim); }
.project h3 { font-size: 17px; letter-spacing: -0.02em; }
.project p { color: var(--dim); font-size: 13px; margin-bottom: 6px; }
.project .chips { margin-bottom: 10px; }
.project__cta { margin-top: auto; font: 500 13px var(--font); color: var(--accent); }
.project__cta::after { content: ''; display: inline-block; width: 0; transition: width 0.3s var(--ease); }
.project a:hover .project__cta::after { width: 6px; }
::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: var(--ease); }

/* arcade — games play in an on-demand iframe (js/site.js) */
.arcade { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.arcade__screen {
	position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: #000;
	border: 1px solid rgba(196, 181, 253, 0.28);
	box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02), 0 40px 90px -40px rgba(124, 58, 237, 0.8);
}
.arcade__screen:fullscreen { border: 0; border-radius: 0; }
.arcade__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) brightness(0.55); transition: filter 0.5s var(--ease), transform 1.2s var(--ease); }
.arcade__screen:hover .arcade__poster { filter: saturate(1) brightness(0.7); transform: scale(1.03); }
.arcade__screen::after { /* scanlines over the poster only */
	content: ''; position: absolute; inset: 0; pointer-events: none;
	background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55));
}
.arcade__play {
	position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
	width: 100%; background: none; border: 0; cursor: pointer; color: var(--heading); font: 500 15px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.arcade__play b { font-weight: 700; color: var(--accent); }
.arcade__btn {
	display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; padding-left: 6px;
	background: linear-gradient(180deg, #d8ccff, var(--accent-2)); color: var(--accent-ink); font-size: 30px;
	box-shadow: 0 0 0 0 rgba(196, 181, 253, 0.55), 0 18px 40px -12px rgba(167, 139, 250, 0.9);
	animation: coin 2.2s var(--ease) infinite; transition: transform 0.4s var(--spring);
}
.arcade__play:hover .arcade__btn, .arcade__play:focus-visible .arcade__btn { transform: scale(1.1); }
@keyframes coin { 70%, 100% { box-shadow: 0 0 0 26px rgba(196, 181, 253, 0), 0 18px 40px -12px rgba(167, 139, 250, 0.9); } }
.arcade__screen iframe { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: #000; }
.arcade.is-playing .arcade__screen::after, .arcade.is-playing .arcade__play { display: none; }
html:not(.js) .arcade__play { display: none; }
.arcade__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; }
.arcade__now { margin: 0; font-size: 15px; color: var(--heading); }
.arcade__now span { margin-left: 8px; font: 400 12px var(--mono); color: var(--dim); }
.arcade__tools { display: flex; gap: 8px; }
.arcade__tool { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font: 500 12px var(--mono); color: var(--dim); cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.arcade__tool:hover { color: var(--heading); border-color: var(--accent); }
.arcade__side { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)); }
.arcade__label { margin: 4px 8px 8px; font: 500 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
.arcade__list { list-style: none; counter-reset: g; margin: 0 0 14px; }
.arcade__list:last-child { margin-bottom: 0; }
.arcade__list a {
	counter-increment: g; position: relative; display: grid; grid-template-columns: 28px 1fr auto; column-gap: 8px; align-items: baseline;
	padding: 8px; border-radius: 10px; color: var(--text); transition: background-color 0.25s, color 0.25s;
}
.arcade__list a::before { content: counter(g, decimal-leading-zero); grid-row: span 2; font: 500 11px var(--mono); color: var(--dim); }
.arcade__list b { font-weight: 600; font-size: 14px; }
.arcade__list span { grid-column: 2; font-size: 12px; color: var(--dim); line-height: 1.4; }
.arcade__list i { grid-row: 1; grid-column: 3; font-style: normal; color: var(--dim); }
.arcade__list a:hover, .arcade__list a:focus-visible { background: rgba(196, 181, 253, 0.08); color: var(--heading); }
.arcade__list a[aria-current] { background: rgba(196, 181, 253, 0.14); }
.arcade__list a[aria-current]::before { content: '\25B6'; color: var(--accent); }
@media (max-width: 960px) {
	.arcade { grid-template-columns: 1fr; }
	.arcade__btn { width: 68px; height: 68px; font-size: 24px; }
}
@media (max-width: 600px) { .arcade__screen { aspect-ratio: 4 / 3; } }

/* activity */
.activity { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.commit-graph { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.commit-cell { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, 0.05); animation: cell-in 0.5s var(--spring) both; animation-delay: calc(var(--c, 0) * 18ms); transition: transform 0.2s; }
.commit-cell:hover { transform: scale(1.5); }
.commit-cell[data-level="1"] { background: #3b2a66; }
.commit-cell[data-level="2"] { background: #6d4bd1; }
.commit-cell[data-level="3"] { background: #a78bfa; }
.commit-cell[data-level="4"] { background: #e9d5ff; }
@keyframes cell-in { from { opacity: 0; transform: scale(0.2); } }
.reveal:not(.is-in) .commit-cell { animation-play-state: paused; }
.commit-graph-label span { color: var(--heading); }
.commit-graph-label em, .commit-graph-meta em { color: var(--dim); font-style: normal; }
.commit-graph-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font: 400 12px var(--mono); color: var(--dim); }
.activity__views { margin: 12px 0 0; font: 400 13px var(--mono); color: var(--dim); }
.repos, .gitlog { list-style: none; font: 400 13px/1.5 var(--mono); }
.repos > li { padding: 8px 0; border-top: 1px dashed var(--line); }
.repos > li:first-child { border-top: 0; padding-top: 0; }
.repo__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.repo__name { font-weight: 700; }
.repo__lang, .repo__stars, .repo__when { color: var(--dim); font-size: 12px; }
.repo__desc { color: var(--text); font: 400 13px/1.5 var(--font); margin: 2px 0; }
.gitlog li { padding: 6px 0; border-top: 1px dashed var(--line); display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.gitlog li:first-child { border-top: 0; padding-top: 0; }
.gitlog li.muted { display: block; }
.gitlog__hash { color: var(--accent-2); }
.gitlog__date { grid-column: 2; color: var(--dim); font-size: 12px; }

/* contact */
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; border-block: 1px solid var(--line); }
.steps li { counter-increment: s; padding: 22px 20px 20px; border-left: 1px solid var(--line); }
.steps li:first-child { border-left: 0; padding-left: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; margin-bottom: 8px; font: 600 30px var(--font); letter-spacing: -0.04em; color: var(--accent-2); }
.steps strong { display: block; font-size: 16px; }
.steps span { font-size: 13px; color: var(--dim); }
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.contact__side { display: grid; gap: 16px; }
.form-ok { border: 1px solid var(--ok); border-radius: 10px; color: var(--text); padding: 12px 14px; margin-bottom: 16px; background: rgba(134, 239, 172, 0.08); }
.form-ok strong { color: var(--ok); }
.form__honey { position: absolute; left: -9999px; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span { font: 400 12px var(--mono); color: var(--dim); }
.form input, .form select, .form textarea { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); border-radius: 10px; color: var(--heading); font: 400 15px var(--font); padding: 12px 14px; width: 100%; transition: border-color 0.2s, box-shadow 0.3s; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2); }
.form textarea { resize: vertical; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; font: 400 12px var(--mono); }
.email { font: 600 16px var(--font); margin-bottom: 14px; overflow-wrap: anywhere; }
.channels { list-style: none; }
.channels a { display: block; padding: 10px 0; border-top: 1px dashed var(--line); transition: padding 0.3s var(--ease); }
.channels a:hover { padding-left: 8px; }
.channels a:hover strong { color: var(--accent); }
.channels span { display: block; font: 400 12px var(--mono); color: var(--dim); }
.faq details { border-top: 1px dashed var(--line); }
.faq details:first-child { border-top: 0; }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size 0.4s var(--ease), content-visibility 0.4s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq summary { cursor: pointer; padding: 9px 0; font-size: 15px; color: var(--heading); }
.faq summary::marker { color: var(--accent-2); }
.faq p { color: var(--dim); font-size: 14px; }

/* footer */
.foot { position: relative; margin-top: 120px; overflow: hidden; font: 400 13px var(--font); color: var(--dim); }
.foot__cta { padding-bottom: 40px; }
.foot__kicker { color: var(--accent); margin-bottom: 14px; font-size: 16px; }
.foot__big { display: inline-block; font: 600 clamp(44px, 7.4vw, 112px)/0.95 var(--font); letter-spacing: -0.05em; color: var(--heading); transition: transform 0.6s var(--ease); }
.foot__big:hover { color: var(--heading); transform: translateX(12px); }
.foot__name {
	margin: 40px 0 -0.16em; text-align: center; white-space: nowrap; pointer-events: none;
	font: 700 clamp(44px, 12.2vw, 230px)/0.85 var(--font); letter-spacing: -0.05em; text-transform: uppercase;
	background: linear-gradient(180deg, rgba(196, 181, 253, 0.32), rgba(196, 181, 253, 0) 85%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; padding-bottom: 36px; border-top: 1px solid var(--line); }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot a:not(.foot__big) { color: var(--dim); }
.foot a:not(.foot__big):hover { color: var(--accent); }

/* chat widget */
.pchat__panel { background: var(--surface-solid) !important; border-radius: 16px !important; }

.confetti { position: fixed; inset: 0; z-index: 260; pointer-events: none; }

/* ==========================================================================
   v8.1 — components adapted from the developer-portfolios list
   ========================================================================== */

/* split identity portrait: photo | live ASCII (after adhamdannaway.com) */
.portrait { --split: 50%; }
.portrait__ascii {
	position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
	clip-path: inset(0 0 0 var(--split));
	-webkit-mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
	mask-image: radial-gradient(closest-side at 50% 46%, #000 62%, transparent 100%);
}
.portrait__divider {
	position: absolute; top: 6%; bottom: 14%; left: var(--split); width: 1px; pointer-events: none;
	background: linear-gradient(transparent, var(--accent) 18%, var(--accent) 82%, transparent);
	box-shadow: 0 0 14px 1px rgba(167, 139, 250, 0.8);
}
.portrait__divider::before {
	content: '\2039\2009\203A'; position: absolute; top: 46%; left: 0; transform: translate(-50%, -50%);
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	border: 1px solid var(--accent); background: rgba(11, 10, 15, 0.75); color: var(--accent);
	font: 600 14px/1 var(--font); backdrop-filter: blur(4px);
}
.portrait__tags { position: absolute; left: 14%; right: 14%; bottom: 7%; display: flex; justify-content: space-between; margin: 0; font: 500 11px var(--mono); color: var(--dim); letter-spacing: 0.04em; pointer-events: none; }
.portrait__tags span:last-child { color: var(--accent); }
html:not(.js) .portrait__ascii, html:not(.js) .portrait__divider, html:not(.js) .portrait__tags { display: none; }
.portrait__divider, .portrait__tags { transition: opacity 0.5s var(--ease); }
/* the photo only ever shows left of the divider, the ASCII only right of it */
html.js .portrait img { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
/* until js/fx.js starts the decode (or the <head> failsafe fires), keep the photo covered */
html.js:not(.is-ready) .portrait { --split: 0%; }
.portrait.is-decoding .portrait__divider, .portrait.is-decoding .portrait__tags { opacity: 0; }

/* big soft spotlight that trails the cursor (after brittanychiang.com) */
body::after {
	content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(640px circle at var(--mx, -999px) var(--my, -999px), rgba(124, 58, 237, 0.13), transparent 70%);
}

/* hover one, dim the rest (after brittanychiang.com) */
@media (hover: hover) and (pointer: fine) {
	.timeline > li, .services > .service, .projects > .project, .stack > .card { transition: opacity 0.35s var(--ease), transform 0.6s var(--ease); }
	.timeline:hover > li:not(:hover), .services:hover > .service:not(:hover),
	.projects:hover > .project:not(:hover), .stack:hover > .card:not(:hover) { opacity: 0.38; }
	[data-stagger]:hover > * { transition-delay: 0s !important; }
}

/* section index with a growing line (after brittanychiang.com / ilans.net) */
.sindex { display: none; }
@media (min-width: 1440px) {
	.sindex { position: fixed; left: 34px; top: 50%; transform: translateY(-50%); z-index: 40; display: block; }
	.sindex ol { list-style: none; display: grid; gap: 12px; }
	.sindex a { display: flex; align-items: center; gap: 10px; font: 500 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
	.sindex a::before { content: ''; width: 14px; height: 1px; background: currentColor; transition: width 0.45s var(--ease), background-color 0.3s; }
	.sindex b { font-weight: 500; }
	.sindex span { opacity: 0; transform: translateX(-6px); transition: opacity 0.3s, transform 0.4s var(--ease); }
	.sindex a:hover, .sindex a[aria-current] { color: var(--heading); }
	.sindex a[aria-current]::before { width: 40px; background: var(--accent); box-shadow: 0 0 8px var(--accent-2); }
	.sindex a:hover::before { width: 40px; }
	.sindex a:hover span { opacity: 1; transform: none; }
}

/* italic serif accents against the sans (after ilans.net) */
.sec h2 .hl, .foot__big .hl, .hero__hello, .hero__a {
	font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em;
}
.sec h2 .hl, .foot__big .hl { font-size: 1.08em; padding-right: 0.04em; }
.hero__hello, .hero__a { font-size: clamp(26px, 2.6vw, 38px); }

/* work track counter + progress (after carterogunsola.com) */
.hs-meta { display: none; }
html.hs-on .hs-meta {
	position: absolute; left: max(var(--edge, 24px), calc(50vw - 576px)); bottom: 7vh; display: flex; align-items: center; gap: 14px;
	font: 500 13px var(--mono); color: var(--dim);
}
.hs-meta b { font: 600 30px/1 var(--font); color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.hs-bar { position: relative; width: 180px; height: 2px; overflow: hidden; background: var(--line); border-radius: 2px; }
.hs-bar i { position: absolute; inset: 0; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--hp, 0)); }

/* ==========================================================================
   v8.3 — wow layer (all driven by js/fx.js; none of it runs under reduced motion)
   ========================================================================== */

/* hero: interactive dot field behind the stage */
.hero { isolation: isolate; }
.hero__field {
	position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
	-webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 45%, transparent 100%);
	mask-image: radial-gradient(ellipse 80% 75% at 50% 45%, #000 45%, transparent 100%);
}

/* cursor turns into a "view" pill over work and projects */
.cursor::after {
	content: 'view'; position: absolute; inset: 0; display: grid; place-items: center;
	font: 600 5px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); opacity: 0; transition: opacity 0.25s;
}
.cursor.is-view { --cs: 2.3; opacity: 0.95; background: var(--accent); }
.cursor.is-view::after { opacity: 1; }

/* work: cinematic pinned track */
html.hs-on .hscroll__pin {
	isolation: isolate;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 80px, #000 calc(100% - 80px), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 80px, #000 calc(100% - 80px), transparent);
}
html.hs-on .case { width: clamp(400px, 36vw, 560px); padding: 48px 40px; opacity: calc(0.4 + var(--focus, 1) * 0.6); transition: opacity 0.3s; }
html.hs-on .case:focus-within { opacity: 1; }
.case::before {
	content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
	background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 50%), rgba(167, 139, 250, 0.13), transparent 55%);
}
.case:hover::before { opacity: 1; }
.hs-ghost { display: none; }
html.hs-on .hs-ghost {
	display: block; position: absolute; left: 0; top: 50%; z-index: -1; pointer-events: none; white-space: nowrap;
	font: 700 21vw/1 var(--font); letter-spacing: -0.05em; text-transform: uppercase;
	color: transparent; -webkit-text-stroke: 1px rgba(196, 181, 253, 0.13);
	transform: translate3d(calc(4vw - var(--hp, 0) * 55%), -50%, 0);
}
html.hs-on .hs-ghost em { font: italic 400 1.08em/1 'Instrument Serif', Georgia, serif; letter-spacing: -0.02em; -webkit-text-stroke: 0; color: rgba(196, 181, 253, 0.07); text-transform: none; }
@media (min-width: 1180px) {
	html.hs-on .hscroll__pin {
		--edge: 190px;
		-webkit-mask-image: linear-gradient(90deg, transparent 70px, #000 170px, #000 calc(100% - 170px), transparent calc(100% - 70px));
		mask-image: linear-gradient(90deg, transparent 70px, #000 170px, #000 calc(100% - 170px), transparent calc(100% - 70px));
	}
}
@media (min-width: 1440px) {
	/* keep the track clear of the section index and dock */
	html.hs-on .hscroll__pin {
		--edge: 250px;
		-webkit-mask-image: linear-gradient(90deg, transparent 120px, #000 230px, #000 calc(100% - 170px), transparent calc(100% - 70px));
		mask-image: linear-gradient(90deg, transparent 120px, #000 230px, #000 calc(100% - 170px), transparent calc(100% - 70px));
	}
}

/* section titles rise letter by letter; the serif word sweeps in after */
.sec h2 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.12em 0.16em 0; margin: 0 -0.12em -0.16em 0; }
.sec h2 .ch { display: inline-block; }
.reveal .sec__head > .is-split { opacity: 1; transform: none; filter: none; }
.reveal .is-split .ch { transform: translateY(115%) rotate(8deg); transform-origin: 0 100%; transition: transform 0.95s var(--ease); transition-delay: calc(var(--d) * 26ms); }
.reveal .is-split .hl .ch { transform: translate(0.5em, 115%) skewX(-14deg); transition-duration: 1.1s; transition-delay: calc(120ms + var(--d) * 26ms); }
.reveal.is-in .is-split .ch { transform: none; }

/* marquee skews with scroll speed */
.marquee span { transform: skewX(var(--skew, 0deg)); }

/* project cards: light glare under the pointer */
.project a::after {
	content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s;
	background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.13), transparent 60%);
}
.project a:hover::after { opacity: 1; }

/* footer name: letters rise in, then lift and light up near the pointer */
@property --lift-n { syntax: '<number>'; inherits: true; initial-value: 0; }
.foot__name.is-split { background: none; }
.foot__name.is-split span {
	display: inline-block;
	background: linear-gradient(180deg, rgba(196, 181, 253, calc(0.32 + var(--lift-n) * 0.6)), rgba(196, 181, 253, 0) 85%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	transform: translateY(calc(var(--lift-n) * -0.12em));
	transition: --lift-n 0.6s var(--ease), translate 1s var(--ease), opacity 1s var(--ease);
	transition-delay: 0s, calc(var(--i) * 45ms), calc(var(--i) * 45ms);
}
.foot__name.is-split:not(.is-in) span { translate: 0 70%; opacity: 0; }

/* ---------- reveal on scroll (js/fx.js adds .reveal / .is-in) ---------- */
.reveal .sec__head > * { opacity: 0; transform: translateY(30px); filter: blur(8px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease); }
.reveal .sec__head > :nth-child(2) { transition-delay: 0.08s; }
.reveal .sec__head > :nth-child(3) { transition-delay: 0.16s; }
.reveal [data-stagger] > * { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-in .sec__head > *, .reveal.is-in [data-stagger] > * { opacity: 1; transform: none; filter: none; }
.reveal [data-stagger] > *:hover { transition-delay: 0s; }
.reveal:not(.is-in) .tier::before { clip-path: inset(0 100% 0 0); }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
	.roles span:first-child { opacity: 1; }
	.reveal .sec__head > *, .reveal [data-stagger] > * { opacity: 1; transform: none; filter: none; }
	.reveal:not(.is-in) .tier::before { clip-path: none; }
	.statement .wd { opacity: 1; }
	.timeline { --tp: 1; }
	.progress, .cursor { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
	.nav__links { gap: 18px; }
	.cases .case { width: min(380px, 84vw); }
	.services { grid-template-columns: repeat(2, 1fr); }
	.projects { grid-template-columns: repeat(3, 1fr); }
	.stack { grid-template-columns: repeat(2, 1fr); }
	.activity { grid-template-columns: 1fr 1fr; }
	.activity__graph { grid-column: 1 / -1; }
	.principles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
	.nav__inner { padding: 0 20px; height: 66px; }
	.nav__toggle { display: inline-block; }
	.nav__links {
		display: none; position: absolute; top: 66px; left: 12px; right: 12px;
		flex-direction: column; align-items: stretch; gap: 2px;
		background: rgba(18, 16, 26, 0.98); border: 1px solid var(--line); border-radius: 16px; padding: 10px;
	}
	.nav__links.is-open { display: flex; animation: blur-up 0.4s var(--ease) both; }
	.nav__links > a { padding: 10px 12px; }
	.nav__links > a::after { display: none; }
	.nav__ask { margin: 6px 0; text-align: left; padding: 10px 12px; }
	html:not(.js) .nav__links { display: flex; position: static; flex-direction: row; flex-wrap: wrap; background: none; border: 0; padding: 0 0 8px; }
	html:not(.js) .nav__inner { flex-wrap: wrap; height: auto; padding-top: 12px; }
	.hero { padding-top: 66px; }
	.hero__stage { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; padding: 24px 20px 0; min-height: 0; }
	.hero__left, .hero__right { justify-self: center; }
	.hero__left { order: 1; }
	.portrait { order: 2; width: min(78vw, 380px); }
	.hero__right { order: 3; }
	.roles { margin: 0 auto; min-width: 0; width: 100%; }
	.roles span { left: 50%; translate: -50% 0; }
	.hero__bar { justify-content: center; text-align: center; margin-top: 24px; }
	.about, .contact { grid-template-columns: 1fr; }
	.stats, .steps { grid-template-columns: repeat(2, 1fr); }
	.stats li:nth-child(3), .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
	.stats li:nth-child(n+3), .steps li:nth-child(n+3) { border-top: 1px solid var(--line); }
	.tools__list div { grid-template-columns: 1fr; gap: 4px; }
	.sec { padding-top: 88px; }
	.play { height: 360px; }
}

@media (max-width: 600px) {
	.wrap { padding: 0 16px; }
	.cases { padding-inline: 16px; }
	.case { padding: 28px 22px; }
	.services, .stack, .activity, .principles, .form__grid { grid-template-columns: 1fr; }
	.projects { grid-template-columns: 1fr 1fr; gap: 10px; }
	.project .chips { display: none; }
	.stats li { padding-left: 16px; }
	.stats strong { font-size: 36px; }
	.play { height: 320px; }
}

/* ==========================================================================
   Brutalist theme — raw HTML: paper white, black ink, default link blue,
   3px rules and hard offset shadows. No glow, gradient, blur or radius.
   Toggled from the nav (js/site.js); set pre-paint in index.html <head>.
   ========================================================================== */
:root[data-theme="brutal"] {
	--bg: #fff; --bg-2: #fff; --surface: #fff; --surface-solid: #fff;
	--line: #000; --line-strong: #000;
	--text: #000; --dim: #3a3a3a; --heading: #000;
	--accent: #0000ee; --accent-2: #0000ee; --accent-deep: #0000ee; --pink: #0000ee;
	--ok: #00873c; --accent-ink: #fff; --ai: #0000ee;
	--grad: linear-gradient(#0000ee, #0000ee);
	--font: 'JetBrains Mono', ui-monospace, Consolas, monospace;
	--display: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
	--r: 0;
	--hard: 6px 6px 0 #000;
	color-scheme: light;

	& *, & *::before, & *::after { border-radius: 0 !important; text-shadow: none !important; backdrop-filter: none !important; }
	& body::before, & body::after, & .portrait__glow, & .portrait::after, & .card::before,
	& .project a::before, & .project a::after, & .case::before, & .cursor { display: none; }
	& ::selection { background: #ffe600; color: #000; }
	& a:hover { color: #000; background: #ffe600; }
	& p a, & .term__out a { text-decoration: underline; text-underline-offset: 3px; }
	& :focus-visible { outline: 3px solid #000; outline-offset: 2px; }

	& h1, & h2, & h3, & .hero__title, & .stats strong, & .foot__big, & .foot__name, & .marquee span, & .roles {
		font-family: var(--display); font-weight: 900; letter-spacing: -0.04em;
	}
	& .sec h2 .hl, & .foot__big .hl, & .hero__hello, & .hero__a { font-family: var(--display); font-style: normal; font-weight: 900; }
	& .portrait img, & .portrait__ascii { -webkit-mask-image: none; mask-image: none; }
	& .hero__last { -webkit-text-stroke: 2px #000; }
	& .marquee span:nth-child(even) { -webkit-text-stroke: 2px #000; }
	& .marquee { border-block: 3px solid #000; }
	& .foot__name { background: none; color: transparent; -webkit-text-stroke: 2px #000; }
	& .nav { background: #fff; border-bottom: 3px solid #000; }

	/* boxes: hard border + hard shadow, yellow when pointed at */
	& .card, & .btn, & .term, & .play, & .project a, & .timeline details, & .arcade__screen, & .arcade__side,
	& .case img, & .portrait img, & .form input, & .form select, & .form textarea {
		background: #fff; border: 3px solid #000; box-shadow: var(--hard); filter: none;
	}
	& .btn--primary { background: #0000ee; color: #fff; }
	& .btn::after { display: none; }
	& .btn:hover, & .project a:hover, & .card:hover, & .service:hover {
		background: #ffe600; color: #000; border-color: #000; box-shadow: 9px 9px 0 #000; transform: translate(-3px, -3px);
	}
	& .chip, & .filter, & .nav__ask, & .nav__toggle { border: 2px solid #000; background: #fff; color: #000; }
	& .filter[aria-pressed="true"], & .nav__ask[aria-pressed="true"] { background: #000; color: #fff; }
	& .portrait img, & .case img, & .project__thumb, & .arcade__poster { filter: grayscale(1) contrast(1.15); }
	& .term__bar { background: #fff; border-bottom: 3px solid #000; }
	& .timeline::after, & .timeline > li.is-lit::before { box-shadow: none; }
	& .commit-cell { background: #eee; }
	& .commit-cell[data-level="1"] { background: #b3b3ff; }
	& .commit-cell[data-level="2"] { background: #6666ff; }
	& .commit-cell[data-level="3"] { background: #0000ee; }
	& .commit-cell[data-level="4"] { background: #000; }
	& .foot__inner { border-top: 3px solid #000; }
}
