/* ============================================================
   preston — style.css
   disassembly-listing aesthetic: hex-offset gutter, mono type,
   near-black, one breakpoint-red accent.
   ============================================================ */

:root {
	--bg:        #0a0a0a;
	--surface:   #111111;
	--line:      #1e1e1e;
	--text:      #d4d4d4;
	--text-dim:  #8a8a8a;
	--text-faint:#5c5c5c;
	--white:     #f5f5f5;
	--accent:    #e2654f;   /* breakpoint red */
	--accent-dim:#9c4636;
	--link:      #8ec9ff;

	--gutter: 72px;          /* hex address column */
	--font: 'JetBrains Mono', ui-monospace, 'Source Code Pro', monospace;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 13px;
	line-height: 1.6;
}

body.has-bg {
	background-color: var(--bg);
}
body.has-bg .container {
	background: rgba(10, 10, 10, 0.88);
	backdrop-filter: blur(2px);
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible {
	outline: 1px solid var(--accent);
	outline-offset: 2px;
}

.container {
	max-width: 980px;
	margin: 0 auto;
	padding: 56px 32px 80px;
}

kbd {
	font-family: var(--font);
	font-size: 10px;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 3px;
	padding: 0 4px;
	color: var(--text-dim);
}

/* ---------- hex-address gutter (the signature) ---------- */

.intro,
.sec {
	display: grid;
	grid-template-columns: var(--gutter) 1fr;
	column-gap: 24px;
	position: relative;
}

.addr,
.sec::before {
	font-size: 11px;
	color: var(--text-faint);
	letter-spacing: 1px;
	padding-top: 4px;
	user-select: none;
	font-variant-numeric: tabular-nums;
}

.sec::before {
	content: attr(data-addr);
	grid-column: 1;
	grid-row: 1;
}

/* vertical rule between gutter and content */
.intro::after,
.sec::after {
	content: '';
	position: absolute;
	left: calc(var(--gutter) + 11px);
	top: 0;
	bottom: -28px;
	width: 1px;
	background: var(--line);
}
.sec:last-of-type::after { bottom: 0; }

.intro-body,
.sec > .sec-head,
.sec > .sec-body {
	grid-column: 2;
}

/* ---------- intro ---------- */

.intro { margin-bottom: 48px; }

.name {
	font-size: 64px;
	font-weight: 300;
	margin: 0 0 12px;
	letter-spacing: -2px;
	color: var(--white);
}

.cursor {
	display: inline-block;
	width: 22px;
	height: 46px;
	margin-left: 8px;
	background: var(--accent);
	animation: blink 1.1s steps(1) infinite;
	vertical-align: baseline;
}

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

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

.age-line {
	margin: 1px 0;
	color: var(--text);
}
.age-line.dim { color: var(--text-faint); }
.age-line span {
	color: var(--white);
	font-variant-numeric: tabular-nums;
}
.age-line.dim span { color: var(--text-dim); }

.bio {
	margin-top: 18px;
	color: var(--text-dim);
	max-width: 580px;
}

.hint {
	margin-top: 14px;
	font-size: 11px;
	color: var(--text-faint);
}

/* ---------- sections ---------- */

.sec { margin-bottom: 28px; padding-bottom: 8px; }

.sec-head {
	font-size: 13px;
	font-weight: 500;
	margin: 0 0 16px;
	color: var(--text-dim);
	cursor: pointer;
	user-select: none;
	text-transform: lowercase;
	display: flex;
	align-items: center;
	gap: 8px;
	letter-spacing: 0.5px;
}

.sec-head::before {
	content: '−';
	color: var(--accent-dim);
	width: 10px;
}
.sec.collapsed .sec-head::before { content: '+'; }
.sec-head:hover { color: var(--white); }
.sec-head:hover::before { color: var(--accent); }

.sec.collapsed .sec-body { display: none; }

/* ---------- project filters ---------- */

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 20px;
}

.filter {
	font-family: var(--font);
	font-size: 11px;
	background: transparent;
	color: var(--text-faint);
	border: 1px solid var(--line);
	padding: 2px 9px;
	cursor: pointer;
	transition: color .12s, border-color .12s;
}
.filter:hover { color: var(--text); border-color: var(--text-faint); }
.filter.active {
	color: var(--accent);
	border-color: var(--accent-dim);
}

/* ---------- projects ---------- */

.projects {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px 24px;
}

.project {
	border: 1px solid var(--line);
	background: var(--surface);
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	transition: border-color .15s, transform .15s;
}
.project:hover {
	border-color: var(--accent-dim);
	transform: translateY(-1px);
}

.project-head {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.project a { text-decoration: none; }

.project h3 {
	font-size: 13px;
	font-weight: 500;
	margin: 0;
	color: var(--white);
}
.project a:hover h3 { color: var(--accent); }
.project a:hover h3::after { content: ' ↗'; color: var(--text-faint); }

.badge-wip {
	font-size: 9px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--accent);
	border: 1px solid var(--accent-dim);
	padding: 0 5px;
}

.project-desc {
	font-size: 12px;
	color: var(--text-dim);
	margin: 0;
	flex: 1;
}

.project-desc code {
	background: #181818;
	padding: 1px 4px;
	color: #c9c9c9;
	font-size: 11px;
}

.project-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 10px;
}

.tag { color: var(--text-faint); }
.tag::before { content: '#'; color: var(--accent-dim); }

.gh-stats {
	margin-left: auto;
	color: var(--text-faint);
	font-variant-numeric: tabular-nums;
}

.empty { color: var(--text-faint); font-size: 12px; }

/* ---------- stack ---------- */

.skills-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.skill-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	width: 46px;
}

.skill-item i {
	font-size: 20px;
	color: #b0b0b0;
	transition: color .15s, transform .15s;
}
.skill-item:hover i { color: var(--white); transform: translateY(-2px); }
.skill-item span { font-size: 10px; color: var(--text-faint); }

/* ---------- plain lists ---------- */

ul.plain {
	list-style: none;
	padding: 0;
	margin: 0;
}
ul.plain li {
	font-size: 12px;
	color: var(--text-dim);
	margin-bottom: 5px;
}
ul.plain.cols {
	columns: 2;
	column-gap: 40px;
	max-width: 480px;
}
.dim-span { color: var(--text-faint); }
.place { color: var(--accent); }

/* ---------- timeline ---------- */

.timeline-track {
	position: relative;
	margin: 0 auto;
	max-width: 560px;
}
.timeline-track::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 1px;
	background: var(--line);
	transform: translateX(-0.5px);
}

.timeline-year {
	position: relative;
	text-align: center;
	font-size: 12px;
	color: var(--text-dim);
	background: var(--bg);
	padding: 6px 0;
	margin: 4px 0;
	z-index: 1;
}
body.has-bg .timeline-year { background: transparent; }

.timeline-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	margin: 8px 0;
}

a.timeline-card {
	display: block;
	background: var(--surface);
	border: 1px solid var(--line);
	padding: 8px 12px;
	font-size: 11px;
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s;
}
a.timeline-card:hover { border-color: var(--accent-dim); color: var(--white); }
.timeline-card.empty { background: transparent; border: none; }

/* ---------- footer ---------- */

footer {
	margin-top: 56px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	font-size: 11px;
	display: flex;
	align-items: center;
	gap: 10px;
}
footer a { color: var(--text-faint); text-decoration: none; }
footer a:hover { color: var(--text); }
.foot-sep { color: var(--line); }

.linklike {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: var(--text-faint);
	cursor: pointer;
}
.linklike:hover { color: var(--accent); }

/* ---------- command palette ---------- */

.palette-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	justify-content: center;
	padding-top: 16vh;
	z-index: 100;
}
.palette-overlay[hidden] { display: none; }

.palette {
	width: min(520px, calc(100vw - 32px));
	height: fit-content;
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.palette input {
	width: 100%;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--line);
	padding: 12px 14px;
	color: var(--white);
	font-family: var(--font);
	font-size: 13px;
}
.palette input:focus { outline: none; }
.palette input::placeholder { color: var(--text-faint); }

.palette ul {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	max-height: 320px;
	overflow-y: auto;
}

.palette li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 7px 14px;
	font-size: 12px;
	color: var(--text-dim);
	cursor: pointer;
}
.palette li.selected {
	background: #181818;
	color: var(--white);
	box-shadow: inset 2px 0 0 var(--accent);
}
.cmd-hint { color: var(--text-faint); font-size: 10px; }
.cmd-empty { cursor: default; color: var(--text-faint); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
	:root { --gutter: 0px; }
	.intro, .sec { grid-template-columns: 1fr; column-gap: 0; }
	.addr, .sec::before { display: none; }
	.intro::after, .sec::after { display: none; }
	.intro-body, .sec > .sec-head, .sec > .sec-body { grid-column: 1; }

	.projects { grid-template-columns: 1fr; }
	ul.plain.cols { columns: 1; }
	.name { font-size: 44px; }
	.cursor { width: 16px; height: 32px; }
	.container { padding: 32px 20px 48px; }
	.hint { display: none; }
}
