/* Thom / Union: synthwave noir terminal */

@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("fonts/plex-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("fonts/plex-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "VT323"; font-display: swap; src: url("fonts/vt323-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "VT323"; font-display: swap; src: url("fonts/vt323-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
	--bg: #0a0612;
	--panel: rgba(14, 7, 26, 0.66);
	--text: #e8dcff;
	--dim: #a99bc9;
	--magenta: #ff2a6d;
	--pink: #ff6fa5;
	--cyan: #05d9e8;
	--violet: #7b2ff7;
	--violet-soft: #b48cff;
	--sun-a: #ffb347;
	--sun-b: #ff2a6d;
	--font: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
	--font-display: "VT323", "Plex Mono", ui-monospace, monospace;
	/* Box-drawing and block glyphs are not in the web-font subsets, so ASCII art uses one system font for every glyph. */
	--font-art: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
	--sidebar: 270px;
	--radius: 6px;
}

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

html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	font: 400 15px/1.65 var(--font);
	color: var(--text);
	background: transparent;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

/* CRT scanlines + vignette over everything, never blocking clicks */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 50;
	background:
		repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.18) 2px 3px),
		radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--magenta); color: #000; padding: .5rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

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

.layout {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
	min-height: 100vh;
}

/* ---------- sidebar ---------- */

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	padding: 2rem 1.5rem 1.5rem 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
	background: linear-gradient(to right, rgba(10, 6, 18, 0.92), rgba(10, 6, 18, 0.7));
	border-right: 1px solid rgba(123, 47, 247, 0.35);
	box-shadow: 1px 0 24px rgba(123, 47, 247, 0.15);
}

.brand { display: block; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; color: inherit; }
.brand-name {
	display: block;
	font: 400 4.2rem/0.85 var(--font-display);
	letter-spacing: 0.04em;
	background: linear-gradient(180deg, var(--sun-a) 0%, var(--magenta) 55%, var(--violet) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 0 10px rgba(255, 42, 109, 0.45));
}
.brand-sub { display: block; margin-top: .5rem; color: var(--dim); font-size: .8rem; letter-spacing: .08em; }

.menu-toggle { display: none; }

.menu h2 {
	margin: 0 0 .35rem;
	font: 400 1.15rem/1.2 var(--font-display);
	color: var(--cyan);
	letter-spacing: .06em;
	text-transform: lowercase;
}
.menu h2::before { content: "> "; color: var(--magenta); }
.menu ul { list-style: none; margin: 0 0 1.25rem; padding: 0 0 0 1.1rem; }
.menu li { margin: .15rem 0; }
.menu a { color: var(--text); display: inline-flex; gap: .5rem; align-items: baseline; }
.menu a::after { content: "↗"; font-size: .75em; color: var(--dim); }
.menu a[href^="#"]::after { content: none; }
.menu a:hover { color: var(--magenta); text-decoration: none; }
.menu a:hover::before { content: "▸"; position: absolute; margin-left: -1rem; color: var(--magenta); }
.menu .note { color: var(--dim); font-size: .75rem; }

.lang { margin-top: auto; display: flex; gap: .5rem; font-size: .85rem; }
.lang a, .lang span {
	padding: .1rem .55rem;
	border: 1px solid rgba(123, 47, 247, 0.5);
	border-radius: 3px;
	color: var(--dim);
}
.lang [aria-current] { color: #0a0612; background: var(--magenta); border-color: var(--magenta); }
.lang a:hover { color: var(--cyan); border-color: var(--cyan); text-decoration: none; }

/* ---------- terminal ---------- */

main { padding: 3rem clamp(1.25rem, 4vw, 4rem) 4rem; }

.term {
	max-width: 980px;
	margin: 0 auto;
	background: var(--panel);
	border: 1px solid rgba(255, 42, 109, 0.55);
	border-radius: var(--radius);
	box-shadow:
		0 0 0 1px rgba(123, 47, 247, 0.35),
		0 0 28px rgba(255, 42, 109, 0.25),
		0 0 90px rgba(123, 47, 247, 0.25),
		inset 0 0 60px rgba(123, 47, 247, 0.12);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	overflow: hidden;
}

.term-bar {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .45rem .9rem;
	font-size: .78rem;
	color: var(--dim);
	background: linear-gradient(90deg, rgba(255, 42, 109, 0.22), rgba(123, 47, 247, 0.22) 60%, rgba(5, 217, 232, 0.12));
	border-bottom: 1px solid rgba(255, 42, 109, 0.4);
}
.term-bar .title { flex: 1; letter-spacing: .05em; }
.term-bar .gadgets { display: flex; gap: .35rem; }
.term-bar .gadgets i { display: block; width: 14px; height: 10px; border: 1px solid rgba(232, 220, 255, 0.5); }
.term-bar .gadgets i + i { box-shadow: inset 3px 3px 0 -1px rgba(232, 220, 255, 0.5); }

.term-body { padding: clamp(1rem, 3vw, 2.25rem); }

.ps1 { color: var(--cyan); white-space: nowrap; }
.ps1 b { color: var(--magenta); font-weight: 400; }

.step + .step { margin-top: 2.5rem; }
.cmd { margin: 0 0 .75rem; font-weight: 600; }
.cmd .typed { color: var(--text); }
.cmd h2 { display: inline; font: inherit; margin: 0; }

.out { margin: 0 0 0 1.1rem; }
.out p { margin: 0 0 .75rem; max-width: 70ch; }

/* ASCII logo */
.logo-wrap { margin: .5rem 0 1.5rem; overflow-x: auto; }
.logo {
	margin: 0;
	font: 400 clamp(8px, 2.6vw, 21px)/1.05 var(--font-art);
	white-space: pre;
	color: var(--magenta);
	background: linear-gradient(180deg, var(--sun-a) 0%, var(--magenta) 50%, var(--violet-soft) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: none;
	filter: drop-shadow(-1.5px 0 0 rgba(5, 217, 232, 0.55)) drop-shadow(1.5px 0 0 rgba(255, 42, 109, 0.45)) drop-shadow(0 0 12px rgba(255, 42, 109, 0.35));
}
.tagline { color: var(--dim); margin: .5rem 0 0; }
.tagline b { color: var(--text); font-weight: 600; }

.bio { font-size: 1.02rem; }
.bio strong { color: var(--sun-a); font-weight: 600; }

/* ls -l listings */
.ls { list-style: none; margin: 0; padding: 0; }
.ls li {
	display: grid;
	grid-template-columns: 7.5rem 12.5rem minmax(0, 1fr);
	gap: 0 1.25rem;
	padding: .1rem 0;
}
.ls .perm { color: var(--violet-soft); }
.ls .name { color: var(--sun-a); font-weight: 600; }
.ls .name.dir::after { content: "/"; color: var(--dim); }
.ls .cmt { color: var(--dim); }
.ls .cmt::before { content: "# "; color: rgba(169, 155, 201, 0.6); }
.ls li:hover .name { color: var(--magenta); }

.ls.aminet li { grid-template-columns: 3.5rem 15.5rem minmax(0, 1fr); }
.ls.aminet .yr { color: var(--violet-soft); }
.ls.aminet a { font-weight: 600; color: var(--sun-a); }
.ls.aminet a:hover { color: var(--cyan); }
.out .more { margin-top: .75rem; }

/* press */
.press { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.25rem; }
.press figure { margin: 0; }
.press a.thumb {
	display: block;
	position: relative;
	aspect-ratio: 289 / 400;
	overflow: hidden;
	border: 1px solid rgba(123, 47, 247, 0.5);
	border-radius: 3px;
	background: #120a20;
}
.press img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.75) contrast(1.05); transition: filter .25s, transform .25s; }
.press a.thumb::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(123, 47, 247, 0.15), rgba(255, 42, 109, 0.25));
	mix-blend-mode: color;
	transition: opacity .25s;
}
.press a.thumb:hover img, .press a.thumb:focus-visible img { filter: none; transform: scale(1.03); }
.press a.thumb:hover::after, .press a.thumb:focus-visible::after { opacity: 0; }
.press a.thumb:hover { border-color: var(--magenta); box-shadow: 0 0 16px rgba(255, 42, 109, 0.4); }
.press figcaption { margin-top: .45rem; font-size: .8rem; line-height: 1.4; }
.press figcaption b { display: block; color: var(--text); font-weight: 600; }
.press figcaption span { color: var(--dim); }
.press .pages a { font-size: .75rem; margin-right: .4rem; }

.mentions { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.mentions li { margin: .2rem 0; }
.mentions li::before { content: "» "; color: var(--magenta); }
.mentions .src { color: var(--violet-soft); }

/* links */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: .5rem 1.5rem; }
.links a { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; padding: .3rem .5rem; margin-left: -.5rem; border-radius: 3px; color: var(--text); }
.links a:hover { background: rgba(255, 42, 109, 0.12); text-decoration: none; }
.links .k { color: var(--cyan); }
.links .v { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links a:hover .v { color: var(--pink); }

/* interactive prompt (added by term.js) */
.log { margin: 2.5rem 0 0; white-space: pre-wrap; color: var(--dim); }
.log .echo { color: var(--text); }
.log .err { color: var(--pink); }
.log:empty { margin: 0; }
.log:empty + .prompt { margin-top: 2.5rem; }
.prompt { display: flex; align-items: baseline; gap: .6rem; margin-top: .5rem; font-weight: 600; }
.prompt input {
	flex: 1;
	min-width: 0;
	font: inherit;
	color: var(--text);
	background: transparent;
	border: 0;
	padding: 0;
	caret-color: var(--magenta);
}
.prompt input:focus { outline: none; }
.prompt:focus-within { text-shadow: 0 0 8px rgba(5, 217, 232, 0.35); }
.hint { margin: .5rem 0 0 1.1rem; color: var(--dim); font-size: .8rem; }

.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--magenta); animation: blink 1s steps(1) infinite; box-shadow: 0 0 8px var(--magenta); }
@keyframes blink { 50% { opacity: 0; } }

.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: rgba(255, 42, 109, 0.25); } 100% { background: transparent; } }

/* reveal (only when term.js runs the intro) */
.js.intro .step { visibility: hidden; }
.js.intro .step.shown { visibility: visible; }
.step.shown .out { animation: fadein .45s ease-out both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* boot screen */
.boot { display: none; }
.intro .boot {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 40;
	background: #05030a;
	color: var(--cyan);
	padding: 2rem;
	font: 400 1.4rem/1.35 var(--font-display);
	letter-spacing: .03em;
	white-space: pre-wrap;
	transition: opacity .4s;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot .ok { color: var(--magenta); }
.boot .skip-hint { position: absolute; right: 2rem; bottom: 1.5rem; color: var(--dim); font-size: 1rem; }

/* dialog with scans */
dialog.viewer {
	padding: 0;
	border: 1px solid var(--magenta);
	border-radius: var(--radius);
	background: #0d0818;
	color: var(--text);
	width: min(1000px, 94vw);
	max-height: 92vh;
	box-shadow: 0 0 40px rgba(255, 42, 109, 0.35);
}
dialog.viewer::backdrop { background: rgba(5, 3, 10, 0.85); backdrop-filter: blur(3px); }
.viewer-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1rem; background: rgba(13, 8, 24, 0.95); border-bottom: 1px solid rgba(255, 42, 109, 0.4); font-size: .85rem; z-index: 1; }
.viewer-bar button { font: inherit; color: var(--text); background: transparent; border: 1px solid rgba(255, 42, 109, 0.6); border-radius: 3px; padding: .15rem .7rem; cursor: pointer; }
.viewer-bar button:hover { background: var(--magenta); color: #000; }
.viewer-pages img { display: block; width: 100%; height: auto; }
.viewer-pages img + img { border-top: 2px solid rgba(123, 47, 247, 0.5); }

footer.foot { max-width: 980px; margin: 1.5rem auto 0; color: var(--dim); font-size: .75rem; text-align: center; }

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

@media (max-width: 1023px) {
	:root { --sidebar: 230px; }
	.ls li { grid-template-columns: 7rem minmax(0, 1fr); }
	.ls .cmt { grid-column: 2; }
	.ls.aminet li { grid-template-columns: 3.5rem minmax(0, 1fr); }
}

@media (max-width: 760px) {
	body { font-size: 14px; }
	.layout { display: block; }
	.sidebar {
		position: sticky;
		top: 0;
		z-index: 30;
		height: auto;
		padding: .6rem 1rem;
		gap: 0;
		border-right: 0;
		border-bottom: 1px solid rgba(123, 47, 247, 0.45);
		background: rgba(10, 6, 18, 0.94);
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}
	.brand-name { font-size: 2.2rem; }
	.brand-sub { display: none; }
	.js .menu-toggle {
		display: block;
		font: 400 1.3rem/1 var(--font-display);
		color: var(--cyan);
		background: transparent;
		border: 1px solid rgba(5, 217, 232, 0.5);
		border-radius: 3px;
		padding: .3rem .7rem;
		cursor: pointer;
	}
	.menu-panel { flex-basis: 100%; padding-top: 1rem; }
	.js .menu-panel { display: none; }
	.js .sidebar.open .menu-panel { display: block; max-height: calc(100vh - 4rem); overflow-y: auto; }
	.lang { margin-top: .5rem; }
	main { padding: 1rem .5rem 3rem; }
	.term { border-radius: 4px; }
	.term-bar .title { font-size: .7rem; }
	.out { margin-left: 0; }
	.ls li, .ls.aminet li { grid-template-columns: 1fr; padding: .3rem 0; }
	.ls .perm { display: none; }
	.ls .cmt { grid-column: 1; }
	.links a { grid-template-columns: 1fr; gap: 0; }
	.press { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 761px) {
	.menu-panel { display: flex; flex-direction: column; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.cursor { animation: none; }
	.step.shown .out, .flash { animation: none; }
	.press img { transition: none; }
}
