/* Values follow the dark theme in web/src/styles/tokens.css, plus a
   terminal green for prompts. The site is dark only. */

@font-face {
	font-family: 'Space Grotesk Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 300 700;
	src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
	font-family: 'Space Mono';
	font-style: normal;
	font-display: swap;
	font-weight: 400;
	src: url('/fonts/space-mono-latin-400-normal.woff2') format('woff2');
}

/* Registered so the card border trace can animate its angle. */
@property --a {
	syntax: '<angle>';
	inherits: false;
	initial-value: 0deg;
}

:root {
	--surface: #111214;
	--raised: #18191c;
	--term: #0c0d0f;
	--text: #e9e8e5;
	--muted: #9c9fa2;
	--faint: #6b6f73;
	--border: #2c2e31;
	--border-strong: #46484a;
	--action: #75a9ff;
	--action-hover: #8fbdff;
	--action-text: #0a111f;
	--green: #75d78d;
	--danger: #fe8b83;
	--tile: #1a2440;
	--ink: #9cc2ff;
	--trace: rgba(150, 165, 190, 0.16);
	--trace-hot: rgba(140, 185, 255, 0.75);
	--grid-dot: rgba(255, 255, 255, 0.045);
	--sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--display: 'Space Grotesk Variable', ui-sans-serif, system-ui, sans-serif;
	--mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color-scheme: dark;
}


*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--surface);
	background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0);
	background-size: 24px 24px;
	color: var(--text);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--action);
	outline-offset: 2px;
}

::selection {
	background: color-mix(in oklab, var(--action) 35%, transparent);
}

.wrap {
	max-width: 72.5rem;
	margin: 0 auto;
	padding-left: 16px;
	padding-right: 16px;
}

@media (min-width: 640px) {
	.wrap {
		padding-left: 40px;
		padding-right: 40px;
	}
}

.ps {
	color: var(--green);
}

/* Bar */
.bar {
	position: relative;
	z-index: 3;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 68px;
}

.mark {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	font-family: var(--display);
	font-size: 17px;
	font-weight: 500;
	letter-spacing: -0.01em;
}

/* The signal bracket mark. Same paths as favicon.svg; the pulse runs the
   signal once every few seconds, like a trace on the hero board. */
.logo {
	display: block;
	overflow: visible;
}

.logo-tile {
	fill: var(--tile);
}

.logo-bracket,
.logo-signal,
.logo-run {
	fill: none;
	stroke: var(--ink);
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.logo-bracket {
	opacity: 0.45;
}

.logo-run {
	stroke: var(--green);
	stroke-dasharray: 9 300;
	stroke-dashoffset: 9;
	animation: logo-run 4.2s ease-in-out 1.2s infinite;
}

@keyframes logo-run {
	0% {
		stroke-dashoffset: 9;
	}

	55%,
	100% {
		stroke-dashoffset: -60;
	}
}

.nav {
	display: flex;
	gap: 22px;
	font-family: var(--mono);
	font-size: 12px;
	text-transform: lowercase;
}

.nav a {
	color: var(--muted);
	text-decoration: none;
	transition: color 0.15s;
}

.nav a::before {
	content: '/';
	margin-right: 2px;
	color: var(--faint);
}

.nav a:hover {
	color: var(--text);
}

@media (max-width: 480px) {
	.nav a:not(:last-child) {
		display: none;
	}
}

/* Hero */
.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: min(94vh, 880px);
	overflow: hidden;
	isolation: isolate;
}

/* fx.js mounts the circuit here; everything below the copy is decorative. */
.circuit,
.circuit-hot {
	position: absolute;
	inset: 0;
	z-index: -2;
	pointer-events: none;
}

.circuit svg,
.circuit-hot svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Fade the board out behind the copy so the text stays readable. */
.circuit {
	-webkit-mask-image: radial-gradient(ellipse 42% 46% at 50% 52%, transparent 35%, #000 85%);
	mask-image: radial-gradient(ellipse 42% 46% at 50% 52%, transparent 35%, #000 85%);
}

/* The cursor spotlight: a brighter copy of the traces, visible only near
   the pointer. --mx and --my are set by fx.js. */
.circuit-hot {
	--mx: -999px;
	--my: -999px;
	z-index: -1;
	opacity: 0.9;
	-webkit-mask-image: radial-gradient(circle 170px at var(--mx) var(--my), #000, transparent 100%);
	mask-image: radial-gradient(circle 170px at var(--mx) var(--my), #000, transparent 100%);
}

.trace {
	fill: none;
	stroke: var(--trace);
	stroke-width: 1.25;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.pad {
	fill: var(--surface);
	stroke: var(--trace);
	stroke-width: 1.25;
}

.via {
	fill: var(--trace);
}

.circuit-hot .trace,
.circuit-hot .pad {
	stroke: var(--trace-hot);
}

.circuit-hot .via {
	fill: var(--trace-hot);
}

/* A pulse is a short dash that runs the length of its trace, then rests.
   fx.js sets --len, --dash, --dur and --delay per trace. */
.pulse {
	fill: none;
	stroke: var(--action);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-dasharray: var(--dash) var(--len);
	stroke-dashoffset: var(--dash);
	animation: run var(--dur) linear var(--delay) infinite;
}

.pulse.alt {
	stroke: var(--green);
}

.pulses {
	filter: drop-shadow(0 0 3px color-mix(in oklab, var(--action) 70%, transparent));
}

@keyframes run {
	0% {
		stroke-dashoffset: var(--dash);
	}

	55%,
	100% {
		stroke-dashoffset: calc(var(--len) * -1);
	}
}

.pad.live {
	animation: land var(--dur) linear var(--delay) infinite;
}

@keyframes land {
	0%,
	50% {
		stroke: var(--trace);
	}

	56% {
		stroke: var(--action);
	}

	80%,
	100% {
		stroke: var(--trace);
	}
}

.hero.paused .pulse,
.hero.paused .pad.live,
.hero.paused .caret {
	animation-play-state: paused;
}

.hero-fade {
	position: absolute;
	inset: auto 0 0;
	z-index: -1;
	height: 140px;
	background: linear-gradient(transparent, var(--surface));
	pointer-events: none;
}

.hero-copy {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding-top: 48px;
	padding-bottom: 96px;
}

.hero-copy::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(closest-side at 50% 48%, color-mix(in oklab, var(--action) 14%, transparent), transparent);
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 28px;
	padding: 5px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: color-mix(in oklab, var(--raised) 75%, transparent);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--muted);
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
}

.dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green);
	box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 60%, transparent);
	animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
	0% {
		box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 55%, transparent);
	}

	70%,
	100% {
		box-shadow: 0 0 0 7px transparent;
	}
}

h1,
h2,
h3 {
	margin: 0;
	font-family: var(--display);
	letter-spacing: -0.015em;
}

h1 {
	max-width: 52rem;
	font-size: clamp(38px, 7.2vw, 66px);
	font-weight: 300;
	line-height: 1.06;
	text-wrap: balance;
}

.glow-text {
	background: linear-gradient(100deg, var(--action) 0%, var(--green) 45%, var(--action) 90%);
	background-size: 220% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: sheen 9s ease-in-out infinite alternate;
}

@keyframes sheen {
	from {
		background-position: 0% 50%;
	}

	to {
		background-position: 100% 50%;
	}
}

.lede {
	max-width: 36rem;
	margin: 26px 0 0;
	color: var(--muted);
	font-size: clamp(16px, 2.1vw, 19px);
	line-height: 1.6;
	text-wrap: balance;
}

.prompt {
	min-height: 1.6em;
	margin: 22px 0 34px;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 13px;
}

.caret {
	display: inline-block;
	width: 0.6em;
	height: 1.1em;
	margin-left: 2px;
	vertical-align: -0.2em;
	background: var(--green);
	animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

.actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: 8px;
	background: var(--action);
	color: var(--action-text);
	font: 500 15px/1 var(--sans);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

/* One light sweep across the button on hover. */
.button::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
	transform: translateX(-120%);
	pointer-events: none;
}

.button:hover {
	background: var(--action-hover);
}

.button:hover::after {
	transform: translateX(120%);
	transition: transform 0.6s ease;
}

.button.ghost {
	border-color: var(--border-strong);
	background: color-mix(in oklab, var(--raised) 70%, transparent);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--text);
	font-family: var(--mono);
	font-size: 13px;
}

.button.ghost:hover {
	border-color: var(--action);
	color: var(--action);
}

.button.ghost::after {
	display: none;
}

.button:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* Sections */
.block {
	padding-top: 56px;
	padding-bottom: 72px;
}

.label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.label::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, var(--border-strong), transparent);
}

.idx {
	color: var(--action);
}

h2 {
	margin-top: 18px;
	font-size: clamp(26px, 3.6vw, 34px);
	font-weight: 400;
	line-height: 1.2;
}

/* Cards */
.cards {
	display: grid;
	gap: 16px;
	margin-top: 32px;
}

@media (min-width: 700px) {
	.cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media (min-width: 1040px) {
	.cards {
		gap: 24px;
	}
}

.card {
	position: relative;
	padding: 28px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: color-mix(in oklab, var(--raised) 85%, transparent);
	transition: transform 0.25s ease, border-color 0.25s;
}

/* A light trace that runs around the border on hover. */
.card::before {
	content: '';
	position: absolute;
	inset: -1px;
	padding: 1px;
	border-radius: inherit;
	background: conic-gradient(from var(--a), transparent 0 62%, var(--action) 80%, var(--green) 88%, transparent 100%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.card:hover {
	transform: translateY(-3px);
	border-color: transparent;
}

.card:hover::before {
	opacity: 1;
	animation: orbit 2.8s linear infinite;
}

@keyframes orbit {
	to {
		--a: 360deg;
	}
}

.icon {
	width: 44px;
	height: 44px;
	fill: none;
	stroke: var(--action);
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon .fill {
	fill: var(--action);
	stroke: none;
}

.icon .blink {
	stroke: var(--green);
	animation: blink 1.1s steps(1) infinite;
}

.icon .led {
	fill: var(--green);
	animation: led 1.8s steps(1) infinite;
}

.icon .led.b {
	animation-delay: 0.9s;
}

@keyframes led {
	50% {
		opacity: 0.2;
	}
}

.icon .pip {
	fill: var(--green);
	animation: ping-pip 2.4s ease-out infinite;
}

@keyframes ping-pip {
	0% {
		r: 2.2;
		opacity: 1;
	}

	70%,
	100% {
		r: 5;
		opacity: 0;
	}
}

.icon .core {
	fill: color-mix(in oklab, var(--action) 25%, transparent);
	animation: core 3s ease-in-out infinite;
}

@keyframes core {
	50% {
		fill: color-mix(in oklab, var(--green) 45%, transparent);
	}
}

.card-idx {
	margin: 18px 0 6px;
	color: var(--faint);
	font-family: var(--mono);
	font-size: 12px;
}

.card h3 {
	font-family: var(--sans);
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0;
}

.card h3 + p {
	margin: 10px 0 0;
	color: var(--muted);
}

.ticks {
	display: grid;
	gap: 8px;
	margin: 18px 0 0;
	padding: 16px 0 0;
	border-top: 1px dashed var(--border);
	list-style: none;
	font-size: 14px;
}

.ticks li {
	position: relative;
	padding-left: 22px;
}

.ticks li::before {
	content: '>';
	position: absolute;
	left: 0;
	color: var(--green);
	font-family: var(--mono);
}

/* Terminal */
.about-grid {
	display: grid;
	gap: 28px;
	margin-top: 18px;
}

@media (min-width: 900px) {
	.about-grid {
		grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
		gap: 56px;
		align-items: center;
	}
}

.about-grid h2 {
	margin-top: 0;
}

.term {
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--border-strong);
	border-radius: 12px;
	background: var(--term);
	box-shadow: 0 24px 60px -30px color-mix(in oklab, var(--action) 45%, transparent);
	color: #d7dae0;
	font-family: var(--mono);
	font-size: 13.5px;
	line-height: 1.75;
}

.term-bar {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 10px 14px;
	border-bottom: 1px solid #24262b;
	background: #15171a;
}

.term-bar span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #33363c;
}

.term-bar p {
	margin: 0 0 0 10px;
	color: #7b8088;
	font-size: 12px;
}

.term-body {
	padding: 18px 20px 20px;
	overflow-x: auto;
}

.term .ln {
	margin: 0;
	white-space: pre-wrap;
}

.term .ps {
	color: #75d78d;
}

.term .out {
	color: #9aa0a8;
	padding-left: 1.2em;
}

.term .out a {
	color: #8fbdff;
	text-decoration: none;
}

.term .out a:hover {
	text-decoration: underline;
}

.term .stack span {
	color: #8fbdff;
}

.term .caret {
	background: #75d78d;
}

/* While fx.js types, unrevealed lines keep their space so nothing jumps. */
.term.typing .ln:not(.shown) {
	visibility: hidden;
}

/* Contact */
.contact-grid {
	display: grid;
	gap: 32px;
}

@media (min-width: 860px) {
	.contact-grid {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		gap: 64px;
		align-items: start;
	}
}

.muted {
	max-width: 40ch;
	margin: 14px 0 0;
	color: var(--muted);
}

.email {
	display: inline-block;
	margin-top: 6px;
	color: var(--action);
	font-family: var(--mono);
	font-size: 16px;
	text-decoration: none;
	border-bottom: 1px dashed color-mix(in oklab, var(--action) 50%, transparent);
}

.email:hover {
	border-bottom-style: solid;
}

.form {
	display: grid;
	gap: 16px;
	margin-top: 18px;
	padding: 24px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: color-mix(in oklab, var(--raised) 85%, transparent);
}

.form-head {
	margin: 0;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
}

.form label {
	display: grid;
	gap: 6px;
}

.form label span {
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
	text-transform: lowercase;
}

.form input,
.form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: 15px/1.5 var(--sans);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.form textarea {
	resize: vertical;
}

.form input:focus-visible,
.form textarea:focus-visible {
	outline: none;
	border-color: var(--action);
	box-shadow: 0 0 0 3px color-mix(in oklab, var(--action) 25%, transparent);
}

.form .button {
	justify-self: start;
}

.hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.status {
	min-height: 1.6em;
	margin: 0;
	font-size: 14px;
}

.status.ok {
	color: var(--green);
}

.status.err {
	color: var(--danger);
}

/* Footer */
.foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	padding-top: 24px;
	padding-bottom: 40px;
	border-top: 1px solid var(--border);
	color: var(--faint);
	font-size: 13px;
}

.foot-mono {
	font-family: var(--mono);
	font-size: 12px;
}

.foot a {
	color: var(--muted);
	text-decoration: none;
}

.foot a:hover {
	color: var(--text);
}

/* Entrance: content is visible by default; motion is opt-in. */
@media (prefers-reduced-motion: no-preference) {
	.hero-copy > * {
		animation: rise 0.7s cubic-bezier(0.2, 0, 0, 1) both;
	}

	.hero-copy > :nth-child(2) {
		animation-delay: 0.08s;
	}

	.hero-copy > :nth-child(3) {
		animation-delay: 0.16s;
	}

	.hero-copy > :nth-child(4) {
		animation-delay: 0.24s;
	}

	.hero-copy > :nth-child(5) {
		animation-delay: 0.32s;
	}

	.reveal {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0, 0, 1);
	}

	.reveal.in {
		opacity: 1;
		transform: none;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.pulse {
		display: none;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
