/* ============================================================
   facelift64 — minimal dark showcase
   ============================================================ */

:root {
	--bg: #0b0e12;
	--panel: #131a23;
	--panel2: #0f141b;
	--ink: #dce3ea;
	--mute: #8794a2;
	--faint: #5a6673;
	--gold: #e2b34f;
	--gold-dim: #9a7b34;
	--cyan: #6cb8cf;
	--line: rgba(197, 213, 229, 0.13);
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap {
	max-width: 860px;
	margin: 0 auto;
	padding: 0 24px;
}

p {
	max-width: 70ch;
	margin: 0 0 1.4em;
}

a {
	color: var(--gold);
	text-decoration-color: var(--gold-dim);
	text-underline-offset: 3px;
}

a:hover {
	color: var(--ink);
}

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

strong {
	color: var(--ink);
}

code {
	font-family: var(--mono);
	font-size: 0.92em;
	color: var(--cyan);
	white-space: nowrap;
}

/* ---------- header ---------- */

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 26px 0 0;
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--faint);
}

.topbar .lang a {
	color: var(--mute);
	text-decoration: none;
	margin-left: 10px;
}

.topbar .lang a.active {
	color: var(--gold);
}

.topbar .lang a:hover {
	color: var(--ink);
}

header.hero {
	padding: 9vh 0 4vh;
}

.eyebrow {
	font-family: var(--mono);
	font-size: 13px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--gold);
	margin: 0 0 2vh;
}

.eyebrow .dim {
	color: var(--faint);
}

h1.mega {
	font-family: var(--mono);
	font-weight: 700;
	font-size: clamp(46px, 9vw, 110px);
	letter-spacing: 0.04em;
	line-height: 0.95;
	margin: 0 0 3vh;
}

h1.mega .dot {
	color: var(--gold);
}

p.lede {
	font-size: clamp(17px, 2vw, 21px);
	line-height: 1.55;
	max-width: 60ch;
	margin: 0 0 1.2em;
}

p.sub {
	color: var(--mute);
	max-width: 66ch;
}

.meta-row {
	display: flex;
	gap: 2.6em;
	row-gap: 0.8em;
	flex-wrap: wrap;
	font-family: var(--mono);
	font-size: 13px;
	letter-spacing: 0.06em;
	color: var(--mute);
	margin-top: 4vh;
}

.meta-row b {
	color: var(--gold);
	font-weight: 600;
}

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

section {
	margin: 9vh 0;
}

h2 {
	font-family: var(--mono);
	font-weight: 700;
	font-size: clamp(21px, 2.6vw, 28px);
	line-height: 1.25;
	letter-spacing: 0.01em;
	margin: 0 0 0.9em;
	scroll-margin-top: 30px;
}

h2 .n {
	color: var(--gold);
	margin-right: 0.7em;
}

/* aside / technical note */

.note {
	background: var(--panel2);
	border: 1px solid var(--line);
	border-left: 2px solid var(--gold-dim);
	padding: 18px 22px 4px;
	margin: 0 0 1.6em;
	font-size: 15.5px;
	color: var(--mute);
	max-width: none;
}

.note::before {
	content: "Note";
	display: block;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--gold-dim);
	margin-bottom: 0.7em;
}

.note p {
	margin: 0 0 1em;
}

/* lists */

ul.pts {
	list-style: none;
	padding: 0;
	margin: 0 0 1.6em;
	display: flex;
	flex-direction: column;
	gap: 0.55em;
	color: var(--mute);
	max-width: 66ch;
}

ul.pts li {
	padding-left: 1.5em;
	position: relative;
}

ul.pts li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.72em;
	width: 0.6em;
	height: 2px;
	background: var(--gold-dim);
}

ul.pts b {
	color: var(--ink);
	font-weight: 600;
}

/* spec sheet (bill of parts) */

.specs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 14px;
	margin: 0 0 1.6em;
}

.spec {
	background: var(--panel);
	border: 1px solid var(--line);
	padding: 16px 18px;
}

.spec h3 {
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--gold);
	margin: 0 0 0.8em;
}

.spec ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--mute);
}

.spec li {
	padding-left: 1.2em;
	position: relative;
	margin-bottom: 0.35em;
}

.spec li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.68em;
	width: 0.5em;
	height: 2px;
	background: var(--gold-dim);
}

/* ---------- figures ---------- */

.figure {
	position: relative;
	background: var(--panel2);
	border: 1px solid var(--line);
	padding: 10px;
	margin: 2.4em 0;
}

.figure > a {
	display: block;
}

.figure img.main {
	display: block;
	/* width: 100%;
	height: auto; */
}

/* devlog images: show at native resolution, never upscaled to fill the panel */
.figure.native img.main {
	width: auto;
	max-width: 100%;
	margin: 0 auto;
}

.figure .cap {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--faint);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-top: 9px;
}

/* corner brackets */
.figure::before,
.figure::after,
.figure .cap::before,
.figure .cap::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	border: 2px solid var(--gold-dim);
	pointer-events: none;
}

.figure::before {
	top: -2px;
	left: -2px;
	border-right: none;
	border-bottom: none;
}

.figure::after {
	top: -2px;
	right: -2px;
	border-left: none;
	border-bottom: none;
}

.figure .cap::before {
	bottom: -2px;
	left: -2px;
	border-right: none;
	border-top: none;
}

.figure .cap::after {
	bottom: -2px;
	right: -2px;
	border-left: none;
	border-top: none;
}

/* ---------- gallery ---------- */

.gallery {
	margin: 2.4em 0;
}

.gallery .gv {
	position: relative;
	background: #080a0d;
}

.gallery .zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.gallery .zoom img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: contain;
}

.gallery .nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 64px;
	border: 1px solid var(--line);
	background: rgba(11, 14, 18, 0.72);
	color: var(--mute);
	font-family: var(--mono);
	font-size: 20px;
	cursor: pointer;
	transition:
		color 0.15s,
		border-color 0.15s;
}

.gallery .nav:hover {
	color: var(--gold);
	border-color: var(--gold-dim);
}

.gallery .nav.prev {
	left: 10px;
}

.gallery .nav.next {
	right: 10px;
}

.gallery .cap .count {
	color: var(--gold-dim);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.gallery .thumbs {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--gold-dim) transparent;
	padding-bottom: 4px;
}

.gallery .thumbs button {
	flex: 0 0 auto;
	padding: 0;
	border: 1px solid transparent;
	background: none;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s;
}

.gallery .thumbs button img {
	display: block;
	height: 52px;
	width: auto;
}

.gallery .thumbs button:hover {
	opacity: 0.85;
}

.gallery .thumbs button[aria-current="true"] {
	opacity: 1;
	border-color: var(--gold);
}

/* ---------- lightbox ---------- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: none;
	flex-direction: column;
	background: rgba(8, 10, 13, 0.99);
	padding: 3vh 3vw;
}

.lightbox.on {
	display: flex;
}

.lightbox .lb-img {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox .lb-img img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.lightbox .lb-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5em;
	padding-top: 1.6vh;
	font-family: var(--mono);
	font-size: 12.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mute);
}

.lightbox .lb-bar .count {
	color: var(--gold-dim);
	font-variant-numeric: tabular-nums;
}

.lightbox button {
	background: none;
	border: 1px solid var(--line);
	color: var(--mute);
	font-family: var(--mono);
	font-size: 16px;
	width: 40px;
	height: 34px;
	cursor: pointer;
}

.lightbox button:hover {
	color: var(--gold);
	border-color: var(--gold-dim);
}

.lightbox .lb-close {
	position: absolute;
	top: 3vh;
	right: 3vw;
}

.lightbox .lb-navs {
	display: flex;
	gap: 8px;
}

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

footer {
	border-top: 1px solid var(--line);
	margin-top: 12vh;
	padding: 4vh 0 6vh;
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--faint);
	display: flex;
	justify-content: space-between;
	gap: 1em;
	flex-wrap: wrap;
}

footer a {
	color: var(--mute);
	text-decoration: none;
}

footer a:hover {
	color: var(--gold);
}

/* ---------- topbar site link ---------- */

.topbar .site-link {
	color: var(--faint);
	text-decoration: none;
}

.topbar .site-link:hover {
	color: var(--ink);
}

/* ---------- devlog (hoh) ---------- */

article.devlog h2 {
	margin-top: 2.4em;
}

article.devlog h3 {
	font-family: var(--mono);
	font-weight: 600;
	font-size: 17px;
	letter-spacing: 0.01em;
	color: var(--ink);
	margin: 1.8em 0 0.8em;
}

p.date {
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-dim);
	margin: 0 0 0.6em;
}

article.devlog ul:not(.pts) {
	color: var(--mute);
	max-width: 70ch;
	padding-left: 1.2em;
	margin: 0 0 1.4em;
}

article.devlog ul:not(.pts) li {
	margin-bottom: 0.4em;
}

strike {
	color: var(--faint);
}

/* inline code listings */

pre {
	background: var(--panel2);
	border: 1px solid var(--line);
	border-left: 2px solid var(--gold-dim);
	color: var(--ink);
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.55;
	padding: 16px 20px;
	margin: 0 0 1.6em;
	overflow-x: auto;
	max-width: none;
}

/* responsive video embeds */

.video {
	position: relative;
	width: 100%;
	max-width: 800px;
	aspect-ratio: 16 / 9;
	margin: 2.4em 0;
	background: #000;
	border: 1px solid var(--line);
}

.video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* before/after hover comparison */

.beforeafter {
	position: relative;
	overflow: hidden;
	max-width: 100%;
	margin: 0 auto;
}

.beforeafter .beforeimg,
.beforeafter .afterimg {
	position: absolute;
	top: 0;
	left: 0;
	max-width: 100%;
}

.beforeafter .beforeimg {
	opacity: 0;
	transition: opacity 0.6s;
}

.beforeafter:hover .beforeimg {
	opacity: 1;
}

/* ---------- HOH interactive room editor ---------- */

.hoh-editor {
	background: var(--panel2);
	border: 1px solid var(--line);
	padding: 20px;
	margin: 2.4em 0;
	overflow-x: auto;
}

.hoh-editor #resources,
.hoh-editor #buffers {
	display: none;
}

.hoh-editor #screen,
.hoh-editor #buffers {
	background: #000;
	overflow: hidden;
}

.hoh-editor #screen {
	margin: 0 auto 16px;
	width: 640px;
	max-width: 100%;
}

.hoh-editor #screen canvas {
	max-width: 100%;
	height: auto;
}

.hoh-editor #buffers {
	width: 128px;
	height: 128px;
}

.hoh-editor #table1 {
	position: relative;
	margin: 0 auto;
	width: 640px;
	max-width: 100%;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--mute);
}

.hoh-editor #table1 .table1row {
	width: 640px;
	max-width: 100%;
	height: 32px;
	margin: 0;
}

.hoh-editor #table1 .table1row:first-child {
	margin: 8px 0 4px;
}

.hoh-editor #table1 .table1row.off {
	opacity: 0.25;
}

.hoh-editor #table1 .table1row.off > div.table1cell2 {
	pointer-events: none;
}

.hoh-editor #table1 .table1cell1,
.hoh-editor #table1 .table1cell1btn {
	display: inline-block;
	width: 128px;
	height: 24px;
	vertical-align: middle;
}

.hoh-editor #table1 .table1cell1 {
	vertical-align: top;
}

.hoh-editor #table1 .table1cell1btn {
	padding: 0;
	height: 32px;
}

.hoh-editor #table1 .table1cell1.link {
	cursor: pointer;
	color: var(--gold);
}

.hoh-editor #table1 .table1cell1.link:hover {
	color: var(--ink);
}

.hoh-editor #table1 .table1cell2 {
	display: inline-block;
	width: 80px;
	height: 32px;
	vertical-align: middle;
}

.hoh-editor #table1 .table1cell2t {
	display: inline-block;
	width: 80px;
	height: 30px;
	text-align: center;
	vertical-align: top;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--faint);
}

.hoh-editor #table1 .table1cell2t small {
	font-size: 11px;
	font-weight: normal;
}

.hoh-editor div.minus,
.hoh-editor div.plus,
.hoh-editor div.wall,
.hoh-editor div.floor,
.hoh-editor div.res {
	display: inline-block;
	width: 30px;
	height: 32px;
	cursor: pointer;
	background-repeat: no-repeat;
	background-position: center;
	filter: invert(58%) sepia(6%) saturate(500%) hue-rotate(179deg) brightness(90%);
	transition: filter 0.15s;
}

.hoh-editor div.minus:hover,
.hoh-editor div.plus:hover,
.hoh-editor div.wall:hover,
.hoh-editor div.floor:hover,
.hoh-editor div.res:hover {
	filter: invert(76%) sepia(37%) saturate(647%) hue-rotate(1deg) brightness(101%) contrast(96%);
}

.hoh-editor div.minus {
	margin: 0 0 0 10px;
	background-image: url(images/minus.svg);
}

.hoh-editor div.plus {
	margin: 0 10px 0 0;
	background-image: url(images/plus.svg);
}

.hoh-editor div.wall {
	background-image: url(images/wall.svg);
}

.hoh-editor div.floor {
	background-image: url(images/floor.svg);
}

.hoh-editor div.res {
	background-image: url(images/resolution.svg);
}

/* ---------- project hub grid ---------- */

.projects {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	margin: 2vh 0 8vh;
}

.project-card {
	display: block;
	background: var(--panel);
	border: 1px solid var(--line);
	text-decoration: none;
	overflow: hidden;
	transition:
		border-color 0.2s,
		transform 0.2s;
}

.project-card:hover {
	border-color: var(--gold-dim);
	transform: translateY(-3px);
}

.project-media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #000;
}

.project-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s;
}

.project-card:hover .project-media img {
	transform: scale(1.04);
}

.project-body {
	padding: 20px 22px 24px;
}

.project-body h2 {
	font-family: var(--mono);
	font-weight: 700;
	font-size: clamp(20px, 2.4vw, 26px);
	color: var(--ink);
	margin: 0 0 0.5em;
	transition: color 0.2s;
}

.project-card:hover .project-body h2 {
	color: var(--gold);
}

.project-body h2 .dot {
	color: var(--gold);
}

.project-body p {
	color: var(--mute);
	font-size: 15px;
	line-height: 1.55;
	max-width: none;
	margin: 0 0 1.2em;
}

.project-tags {
	display: flex;
	gap: 0.6em;
	flex-wrap: wrap;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--faint);
}

.project-tags span {
	border: 1px solid var(--line);
	padding: 0.35em 0.6em;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
	body {
		font-size: 16px;
	}

	.gallery .nav {
		width: 36px;
		height: 52px;
	}

	.meta-row {
		gap: 1.4em;
	}
}

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