/* SPDX-License-Identifier: GPL-2.0-or-later
   Copyright (C) 2026 Don Liggett

   Glyphnotic site. Everything sits on the font's 8 x 16 cell: spacing in
   multiples of 8 px, the display face only at multiples of 16 px. The
   registration offset (cyan down-left, yellow up-right) is the logo's, and
   the one accent. */

@font-face {
	font-family: "Glyphnotic Uni2";
	src: url("../assets/font/uni2-fixed.woff2") format("woff2");
	font-display: swap;
}

:root {
	--paper: #ffffff;
	--ink: #0a0a0a;
	--muted: #5c5c5c;
	--rule: #e4e4e4;
	--panel: #f5f5f3;
	--cyan: #ccffff;
	--yellow: #ffff00;
	--stage: #000000;
	--reg: 4px;
	--px: "Glyphnotic Uni2", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
	--max: 1120px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #0a0a0a;
		--ink: #f2f2ee;
		--muted: #a3a3a0;
		--rule: #262626;
		--panel: #141414;
		--cyan: #1fcfcf;
		--yellow: #f0f000;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--paper: #0a0a0a;
	--ink: #f2f2ee;
	--muted: #a3a3a0;
	--rule: #262626;
	--panel: #141414;
	--cyan: #1fcfcf;
	--yellow: #f0f000;
	color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 17px/1.6 var(--sans);
	overflow-x: hidden;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: calc(-1 * var(--reg)) var(--reg) 0 var(--cyan), var(--reg) calc(-1 * var(--reg)) 0 var(--yellow); }

img { max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
p code, li code, td code { background: var(--panel); padding: 1px 5px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.px { font-family: var(--px); font-size: 16px; line-height: 16px; letter-spacing: 0; font-weight: normal; -webkit-font-smoothing: none; font-smooth: never; }
.px-32 { font-family: var(--px); font-size: 32px; line-height: 32px; font-weight: normal; }
.px-48 { font-family: var(--px); font-size: 48px; line-height: 48px; font-weight: normal; }
.reg { text-shadow: -2px 2px 0 var(--cyan), 2px -2px 0 var(--yellow); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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

.top {
	position: sticky; top: 0; z-index: 10;
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--rule);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; }
.brand svg { display: block; height: 32px; width: auto; }
.brand svg path { fill: currentColor; }
.nav { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav .gh { color: var(--ink); }
@media (max-width: 719px) { .nav a:not(.gh):not(.dl) { display: none; } .nav { gap: 16px; } }

/* ------------------------------------------------------------ hero */

.hero { padding: 64px 0 48px; }
@media (min-width: 720px) { .hero { padding: 96px 0 64px; } }
.hero h1 { margin: 0; line-height: 0; }
@media (min-width: 1040px) {
	.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; align-items: end; }
	.hero h1 { grid-row: span 4; align-self: start; }
	.hero .lede { margin-top: 0; }
}
.logo { display: block; width: min(560px, 100%); height: auto; overflow: visible; }
.logo .k { fill: var(--ink); }
.logo .c { fill: var(--cyan); }
.logo .y { fill: var(--yellow); }
.logo use { transition: transform 900ms cubic-bezier(.2, .7, .2, 1); }
.logo.flat use { transform: translate(0, 0) !important; }
.logo use.c { transform: translate(-83.7px, 83.7px); }
.logo use.y { transform: translate(83.7px, -83.7px); }

.lede { font-size: 22px; line-height: 1.45; max-width: 30ch; margin: 40px 0 16px; letter-spacing: -0.01em; }
@media (min-width: 720px) { .lede { font-size: 28px; max-width: 32ch; } }
.sub { color: var(--muted); max-width: 56ch; margin: 0 0 32px; }

.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.btn {
	display: inline-flex; align-items: center; gap: 8px;
	height: 48px; padding: 0 24px;
	border: 2px solid var(--ink); border-radius: 0;
	background: var(--paper); color: var(--ink);
	font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
	transition: box-shadow 160ms ease, transform 160ms ease;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:hover { box-shadow: calc(-1 * var(--reg)) var(--reg) 0 var(--cyan), var(--reg) calc(-1 * var(--reg)) 0 var(--yellow); }
.btn:active { transform: translate(1px, 1px); }
.meta { margin-top: 32px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 16px; }

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

section, .hero { scroll-margin-top: 56px; }
section { padding: 64px 0; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { section { padding: 96px 0; } }
.kicker { color: var(--muted); margin: 0 0 16px; text-transform: uppercase; }
h2 { margin: 0 0 16px; }
h2.px-32 { font-size: 32px; line-height: 40px; }
h3 { margin: 0 0 8px; }
.intro { max-width: 60ch; color: var(--muted); margin: 0 0 40px; }

/* ------------------------------------------------------------ demo */

.demo { border-top: 0; padding-top: 0; }
.stage {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--stage);
	box-shadow: -8px 8px 0 var(--cyan), 8px -8px 0 var(--yellow);
	margin: 8px 8px 0 8px;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	overflow: hidden;
}
@media (min-width: 720px) { .stage { box-shadow: -16px 16px 0 var(--cyan), 16px -16px 0 var(--yellow); margin: 16px 16px 0 16px; } }
.stage canvas, .stage video.fallback, .stage img.fallback {
	position: absolute; inset: 0; width: 100%; height: 100%;
	display: block; image-rendering: pixelated; object-fit: cover;
}
.stage .split {
	position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
	background: #fff; mix-blend-mode: difference; pointer-events: none;
	display: none;
}
.stage .split::after {
	content: "ORIGINAL"; position: absolute; top: 8px; right: 8px;
	font: 16px/16px var(--px); color: #fff; white-space: nowrap;
}
.stage.splitting .split { display: block; }
.stage .notice {
	position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
	padding: 24px; text-align: center; color: #f2f2ee; background: rgba(0, 0, 0, .72);
	font-size: 15px;
}
.stage .notice.show { display: flex; }
.stage .play {
	position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; padding: 0;
	border: 2px solid #fff; background: rgba(0, 0, 0, .6); cursor: pointer; display: none;
	box-shadow: -4px 4px 0 var(--cyan), 4px -4px 0 var(--yellow);
}
.stage .play::before {
	content: ""; display: block; margin: auto; width: 20px; height: 24px; background: #fff;
	clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translateX(2px);
}
.stage.paused .play { display: block; }

.controls { margin-top: 40px; display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.row > .label { width: 88px; flex: none; color: var(--muted); }
@media (max-width: 559px) { .row > .label { width: 100%; } }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	font: 16px/16px var(--px);
	height: 40px; padding: 0 16px;
	border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
	cursor: pointer; border-radius: 0;
	transition: box-shadow 120ms ease;
}
.chip:hover { box-shadow: -3px 3px 0 var(--cyan), 3px -3px 0 var(--yellow); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: -3px 3px 0 var(--cyan), 3px -3px 0 var(--yellow); }
.chip:disabled { opacity: .4; cursor: default; box-shadow: none; }
.chip.small { height: 40px; padding: 0 12px; }

.compare { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 220px; max-width: 480px; }
.compare input { flex: 1; accent-color: var(--ink); }

.status {
	margin-top: 8px; padding: 12px 16px; background: var(--panel);
	color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.status b { color: var(--ink); font-weight: normal; }
.fineprint { font-size: 14px; color: var(--muted); max-width: 72ch; margin: 16px 0 0; }

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

.grid2 { display: grid; gap: 40px 32px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.card { display: grid; gap: 16px; align-content: start; }
.shot {
	position: relative; background: #000; height: 336px; overflow: hidden;
	border: 1px solid var(--rule);
}
.shot img { display: block; width: 100%; height: 100%; object-fit: none; object-position: 50% 50%; image-rendering: pixelated; }
.card h3 { display: flex; align-items: baseline; gap: 16px; }
.card p { margin: 0; color: var(--muted); }
.card .looks { font-size: 15px; }
.card .shot { max-width: 448px; width: 100%; }
.textlink { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.facts { margin: 48px 0 0; padding: 0; list-style: none; display: grid; gap: 16px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.facts li { border-top: 2px solid var(--ink); padding-top: 16px; }

/* ------------------------------------------------------------ motion */

.motion { display: grid; gap: 0; margin: 0; }
@media (min-width: 720px) { .motion { grid-template-columns: 200px 1fr; } }
.motion dt { padding: 16px 0 0; }
.motion dd { margin: 0; padding: 4px 0 16px; color: var(--muted); border-bottom: 1px solid var(--rule); }
@media (min-width: 720px) {
	.motion dt { padding: 16px 0; border-bottom: 1px solid var(--rule); }
	.motion dd { padding: 16px 0; }
}

/* ------------------------------------------------------------ looks */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.gallery { display: grid; gap: 32px 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.look { margin: 0; display: grid; gap: 8px; }
.look .shot { height: 252px; }
.look .textlink { font-size: 15px; }
.look figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.look figcaption .px { white-space: nowrap; }

/* ------------------------------------------------------------ install */

.platforms { display: grid; gap: 24px; }
@media (min-width: 900px) { .platforms { grid-template-columns: repeat(3, 1fr); } }
.platform { border: 2px solid var(--ink); padding: 24px; display: grid; gap: 16px; align-content: start; }
.platform h3 { margin: 0; }
.platform .tag { color: var(--muted); }
.platform ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.platform p { margin: 0; }
.dl { display: grid; gap: 8px; }
.dl a {
	display: flex; justify-content: space-between; gap: 16px; align-items: center;
	padding: 12px 16px; background: var(--panel); text-decoration: none;
	border: 2px solid transparent;
}
.dl a:hover { border-color: var(--ink); }
.dl a span:last-child { color: var(--muted); font-size: 14px; white-space: nowrap; }
pre {
	margin: 0; padding: 12px 16px; background: var(--panel);
	font: 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.after { margin: 40px 0 0; display: grid; gap: 8px; }

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

.split2 { display: grid; gap: 40px; }
@media (min-width: 900px) { .split2 { grid-template-columns: 1fr 1fr; gap: 64px; } }
.big { font-size: 22px; line-height: 1.45; margin: 0 0 24px; max-width: 32ch; }
.stat { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.stat:first-of-type { border-top: 1px solid var(--rule); }
.stat .px-32 { line-height: 32px; }

footer { border-top: 1px solid var(--rule); padding: 48px 0 64px; font-size: 14px; color: var(--muted); }
footer .cols { display: grid; gap: 24px; }
@media (min-width: 900px) { footer .cols { grid-template-columns: 2fr 1fr; } }
footer p { margin: 0 0 8px; max-width: 72ch; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.theme-toggle { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
	.logo use, .btn, .chip { transition: none; }
}
