/* max.kixel.me: one page, no build step. Dark only: a night terminal with a purple glow; green is money. */

@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
	--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	--term-bg: #14111f;
	--term-ink: #e4e1f0;
	--term-dim: #8a84a3;
	--term-red: #ff6b8b;
	--term-green: #6ee7a0;
	--term-yellow: #ffd166;
	--term-bar: #1d1930;
	--tk-bin: #6ee7a0;
	--tk-flag: #ffd166;
	--tk-url: #c4b5fd;
	--tk-op: #ff6b8b;
	--tk-prompt: #6b6585;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 1.0625rem/1.6 var(--sans);
	-webkit-text-size-adjust: 100%;
	overflow-x: hidden;
}

a { color: var(--link); text-underline-offset: 0.18em; }
code { font-family: var(--mono); font-size: 0.9em; }

.top, main > section, footer {
	position: relative;
	max-width: 68rem;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 1.75rem;
}
.logo { height: 2.4rem; width: auto; max-width: 65%; }
.me { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; }
.me .avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; }
.me a { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; }
.me svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
@media (max-width: 40rem) {
	.top { gap: 0.75rem; }
	.logo { max-width: 48%; }
	.me { gap: 0.3rem; }
	.me .name { display: none; }
	.me .avatar { width: 2rem; height: 2rem; }
	.me a { width: 1.9rem; height: 1.9rem; }
	.me svg { width: 0.95rem; height: 0.95rem; }
}

.hero { padding-top: 4.5rem; }
.eyebrow { margin: 0 0 1rem; font: 600 0.85rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; }
h1 { margin: 0; text-wrap: balance; }
.lede { max-width: 42rem; margin: 1.5rem 0 0; font-size: 1.3rem; line-height: 1.5; text-wrap: pretty; }

/* Install: radio tabs, so switching works without the script. */
.install { margin-top: 2.5rem; max-width: 44rem; }
.install input { position: absolute; opacity: 0; pointer-events: none; }
.tabs { display: flex; gap: 0.25rem; }
.tabs label { cursor: pointer; padding: 0.45rem 0.95rem; font: 600 0.85rem/1.2 var(--mono); user-select: none; }
#os-unix:checked ~ .tabs label[for="os-unix"],
#os-windows:checked ~ .tabs label[for="os-windows"] { background: var(--term-bg); color: var(--term-ink); }
#os-unix:focus-visible ~ .tabs label[for="os-unix"],
#os-windows:focus-visible ~ .tabs label[for="os-windows"] { outline: 2px solid var(--link); outline-offset: 2px; }
#os-unix:checked ~ .run .windows,
#os-windows:checked ~ .run .unix { display: none; }

.run {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.15rem 1.3rem;
	background: var(--term-bg);
	color: var(--term-ink);
}
.run pre { flex: 1; margin: 0; overflow-x: auto; }
.run code { font-size: clamp(0.95rem, 2.4vw, 1.2rem); white-space: pre-wrap; overflow-wrap: anywhere; }
.sel { user-select: all; -webkit-user-select: all; }
.tk-prompt { color: var(--tk-prompt); user-select: none; -webkit-user-select: none; }
.tk-bin { color: var(--tk-bin); font-weight: 700; }
.tk-flag { color: var(--tk-flag); }
.tk-url { color: var(--tk-url); }
.tk-op { color: var(--tk-op); font-weight: 700; }
.copy, .replay {
	flex: none;
	cursor: pointer;
	padding: 0.4rem 0.8rem;
	font: 600 0.8rem/1 var(--mono);
	color: var(--term-ink);
	background: transparent;
	border: 1px solid color-mix(in srgb, var(--term-ink) 30%, transparent);
	border-radius: 0.35rem;
}
.copy:hover, .replay:hover { border-color: var(--term-ink); }
.note { margin: 0.9rem 0 0; font-size: 0.95rem; }

/* The terminal: real doctor output from assets/demo/site.py. */
.demo { margin-top: 5rem; }
.term { background: var(--term-bg); color: var(--term-ink); overflow: hidden; }
.bar {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.65rem 1rem;
	background: var(--term-bar);
	font: 600 0.8rem/1.2 var(--mono);
}
.bar .d { color: var(--term-dim); font-weight: 400; }
.bar .replay { margin-left: auto; padding: 0.3rem 0.6rem; }
.dots { display: flex; gap: 0.4rem; }
.dots i { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--term-red); }
.dots i:nth-child(2) { background: var(--term-yellow); }
.dots i:nth-child(3) { background: var(--term-green); }

/* Column-reverse keeps the newest line in view as steps appear, like a real terminal. */
.body {
	display: flex;
	flex-direction: column-reverse;
	height: 34rem;
	overflow: auto;
	padding: 1rem 1.25rem;
}
.screen { margin: 0 0 auto; }
.screen code { font-size: 0.78rem; line-height: 1.45; white-space: pre; }
.screen .b { font-weight: 700; }
.screen .d { color: var(--term-dim); }
.screen .r { color: var(--term-red); }
.screen .g { color: var(--term-green); }
.screen .y { color: var(--term-yellow); }
.screen .elided { color: var(--term-dim); font-style: italic; }
.cur { display: none; }

.term.wait .step, .term.wait .typed { display: none; }
.term.play .typed {
	display: inline-block;
	vertical-align: bottom;
	overflow: hidden;
}
.body:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
/* site.js marks each step shown, then answered, at its --t and --gap (seconds after --t);
   animating display itself is not supported everywhere. */
.term.play .step:not(.shown), .term.play .step:not(.answered) .ans { display: none; }
.term.play .step:not(.answered) .cur {
	display: inline-block;
	width: 0.6em;
	height: 1.1em;
	vertical-align: text-bottom;
	background: var(--term-ink);
	animation: blink 1s step-end infinite;
}
/* run: assets/demo/site.py writes the run's timing and the breakdown's bars here */
.term.play .typed { animation: type 2.7s steps(89) 0.3s both; }
@keyframes type { from { width: 0; } to { width: 89ch; } }
.step:nth-child(2) { --t: 3.4s; --gap: 1.4s; }
.step:nth-child(3) { --t: 5.4s; --gap: 1.4s; }
.step:nth-child(4) { --t: 7.4s; --gap: 1.4s; }
.step:nth-child(5) { --t: 10.3s; --gap: 0.0s; }
.step:nth-child(6) { --t: 12.8s; --gap: 0.0s; }
.step:nth-child(7) { --t: 13.4s; --gap: 0.0s; }
.step:nth-child(8) { --t: 14.0s; --gap: 0.0s; }
.step:nth-child(9) { --t: 14.6s; --gap: 0.0s; }
.step:nth-child(10) { --t: 15.2s; --gap: 0.0s; }
.step:nth-child(11) { --t: 15.8s; --gap: 0.0s; }
.step:nth-child(12) { --t: 16.4s; --gap: 0.0s; }
.step:nth-child(13) { --t: 17.0s; --gap: 0.0s; }
.step:nth-child(14) { --t: 17.6s; --gap: 0.0s; }
.step:nth-child(15) { --t: 18.2s; --gap: 0.0s; }
.step:nth-child(16) { --t: 18.8s; --gap: 0.0s; }
.step:nth-child(17) { --t: 19.4s; --gap: 0.0s; }
.breakdown li:nth-child(1) .plan { width: 0.0%; }
.breakdown li:nth-child(1) .api { width: 100.0%; }
.breakdown li:nth-child(2) .plan { width: 24.1%; }
.breakdown li:nth-child(2) .api { width: 0.0%; }
.breakdown li:nth-child(3) .plan { width: 2.2%; }
.breakdown li:nth-child(3) .api { width: 0.3%; }
.breakdown li:nth-child(4) .plan { width: 1.1%; }
.breakdown li:nth-child(4) .api { width: 0.0%; }
.breakdown li:nth-child(5) .plan { width: 0.9%; }
.breakdown li:nth-child(5) .api { width: 0.0%; }
.breakdown li:nth-child(6) .plan { width: 2.2%; }
.breakdown li:nth-child(6) .api { width: 0.3%; }
/* /run */
@keyframes blink { 50% { opacity: 0; } }

/* Findings */
h2 { margin: 6rem 0 0; text-wrap: balance; }
.aside { margin: 0.4rem 0 0; font-size: 0.9rem; }
.context { margin: 2rem 0 1rem; font: 600 0.9rem/1.4 var(--mono); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.col { padding: 1.4rem 1.5rem; }
.col h3 { margin: 0; font: 600 0.8rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.col p { margin: 0.5rem 0 0; }
.col .big { margin-top: 0.7rem; font-size: 3.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.where { margin: 2.5rem 0 1rem; font: 600 0.8rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.breakdown { margin: 0; padding: 0; list-style: none; }
.breakdown li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.3rem 1rem;
	padding: 0.55rem 0;
}
.breakdown .amt { font: 700 1rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.breakdown .amt small { font-weight: 400; }
.breakdown .track { grid-column: 1 / -1; display: flex; height: 0.5rem; }
.breakdown .track i { display: block; }
.tag { margin-left: 0.5rem; padding: 0.1rem 0.45rem; font: 600 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; vertical-align: 0.15em; }
.key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 0.75rem 0 0; font: 0.8rem/1.3 var(--mono); }
.key span::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.45rem; vertical-align: -0.05em; border-radius: 2px; }
.fine { max-width: 48rem; margin: 1.75rem 0 0; font-size: 0.85rem; line-height: 1.5; }

/* How it knows */
.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.steps li { position: relative; padding: 1.6rem 1.5rem 1.5rem; }
.steps .num { display: block; font: 800 3.25rem/1 var(--mono); }
.steps h3 { margin: 0.75rem 0 0.5rem; font-size: 1.5rem; }
.steps p { margin: 0; font-size: 0.98rem; }

footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	margin-top: 6rem;
	padding-top: 1.75rem;
	padding-bottom: 3rem;
	font-weight: 600;
}

@media (max-width: 40rem) {
	.body { height: 28rem; }
	.screen code { font-size: 0.7rem; }
}

/* Theme */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
:root {
	--bg: #07060c; --ink: #f2f0ff; --muted: #a29cbc; --link: #c4b5fd;
	--sans: "Space Grotesk", system-ui, sans-serif;
	--violet: #8b5cf6; --green: #4ade80;
	--term-bg: #0d0b16; --term-bar: #13101f;
	color-scheme: dark;
}
body {
	background-image:
		linear-gradient(#ffffff08 1px, transparent 1px),
		linear-gradient(90deg, #ffffff08 1px, transparent 1px);
	background-size: 48px 48px;
	background-position: center top;
}
.glow { position: absolute; inset: 0 0 auto; height: 60rem; pointer-events: none;
	background: radial-gradient(40rem 28rem at 18% 8%, #8b5cf640, transparent 70%), radial-gradient(34rem 24rem at 85% 30%, #22c55e26, transparent 70%); }
.top { z-index: 1; }
.me .avatar { box-shadow: 0 0 0 2px #8b5cf6aa; }
.me a { color: var(--ink); border: 1px solid #ffffff26; background: #ffffff0a; }
.me a:hover { border-color: var(--violet); }
.eyebrow { color: var(--green); }
.eyebrow::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-right: 0.6em; vertical-align: 0.1em; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
h1 { font-size: clamp(3rem, 9vw, 7rem); font-weight: 700; line-height: 0.95; letter-spacing: -0.045em; padding-bottom: 0.15em;
	background: linear-gradient(100deg, #fff 30%, #c4b5fd 55%, var(--green) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--muted); }
.lede strong { color: var(--ink); }
.tabs label { color: var(--muted); border-radius: 0.5rem 0.5rem 0 0; }
.run { border: 1px solid #ffffff1f; border-radius: 0 0.75rem 0.75rem 0.75rem; box-shadow: 0 0 0 1px #8b5cf633, 0 20px 60px -10px #8b5cf666; }
.copy { border-radius: 99px; }
.note { color: var(--muted); }
.term { border: 1px solid #ffffff1f; border-radius: 0.9rem; box-shadow: 0 30px 120px -30px #8b5cf6aa, 0 0 0 1px #8b5cf622; }
.bar { border-bottom: 1px solid #ffffff12; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; }
.aside { color: var(--muted); }
.context { color: var(--muted); }
.col { background: linear-gradient(180deg, #ffffff0d, #ffffff05); border: 1px solid #ffffff1a; border-radius: 1rem; }
.col h3, .col p { color: var(--muted); }
.col.plan .big { color: var(--ink); }
.col.api { border-color: #4ade8066; background: linear-gradient(180deg, #4ade801f, #4ade8008); box-shadow: 0 0 60px -20px #4ade8088; }
.col.api .big { color: var(--green); text-shadow: 0 0 28px #4ade8080; }
.nope { color: var(--ink); font-weight: 700; }
.where { color: var(--muted); }
.breakdown li { border-bottom: 1px solid #ffffff12; }
.breakdown .amt { color: var(--green); }
.breakdown .amt small { color: var(--muted); }
.breakdown .track { background: #ffffff0a; border-radius: 99px; overflow: hidden; }
.breakdown .track .plan, .key .k-plan::before { background: var(--green); }
.breakdown .track .api, .key .k-api::before { background: var(--violet); }
.tag { border-radius: 99px; background: #8b5cf633; color: var(--link); }
.key { color: var(--muted); }
.fine { color: var(--muted); }
/* A pipeline: three nodes joined by a gradient rail. */
.steps { gap: 2rem; position: relative; }
.steps::before { content: ""; position: absolute; left: 1.8rem; right: 1.8rem; top: 1.8rem; height: 2px; background: linear-gradient(90deg, var(--violet), var(--green)); opacity: 0.6; }
.steps li { padding: 0; }
.steps .num { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; font-size: 1.1rem; border-radius: 50%;
	background: var(--bg); border: 2px solid var(--violet); color: var(--ink); box-shadow: 0 0 24px #8b5cf688; position: relative; }
.steps li:nth-child(2) .num { border-color: #a5b4fc; box-shadow: 0 0 24px #a5b4fc77; }
.steps li:nth-child(3) .num { border-color: var(--green); box-shadow: 0 0 24px #4ade8088; }
.steps h3 { font-size: 1.6rem; letter-spacing: -0.02em; margin-top: 1.25rem; }
.steps p { color: var(--muted); }
.steps strong { color: var(--ink); }
footer { border-top: 1px solid #ffffff14; }
footer a { color: var(--muted); text-decoration: none; }
@media (max-width: 56rem) { .steps::before { display: none; } }
