/* Three Kelvin — threekelvingame.com
 *
 * The game's interface rules, applied to a page. Palette is UITheme.gd verbatim;
 * chrome is bevelled rather than bordered (light top-left, dark bottom-right, the
 * same two-plane rule the sprite contract uses); and warm colour appears only
 * where something is emitting — the reactor, an exhaust, a button you can press.
 * Everything else is cold steel.
 *
 * Type is Silkscreen, an 8px face, so every size here is a multiple of 8 and
 * nothing is antialiased or fractionally scaled. Same reason the game forbids it:
 * a bitmap face off its grid is mush.
 */

@font-face {
	font-family: Silkscreen;
	src: url("/fonts/Silkscreen-Regular.ttf") format("truetype");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: Silkscreen;
	src: url("/fonts/Silkscreen-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}

:root {
	--void: #0a0e15;
	--panel: #111823;
	--panel2: #161f2c;
	--line: #22303f;
	--cold: #6b7d94;
	--chill: #8fa3ba;
	--ice: #c3d2e2;
	--ember: #d97b29;
	--flare: #ff9d3d;
	--hot: #ffd28a;
	--quote: #5a6470;
	--leave: #d4614f;
	--hi: #3d4d61;
	--lo: #080b11;
	--good: #7fb89a;

	--wrap: 1160px;
	--gap: 24px;
}

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

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

body {
	margin: 0;
	background: var(--void);
	color: var(--chill);
	font-family: Silkscreen, "Courier New", ui-monospace, monospace;
	font-size: 16px;
	line-height: 2;
	-webkit-font-smoothing: none;
	text-rendering: geometricPrecision;
}

img { max-width: 100%; height: auto; image-rendering: pixelated; }
a { color: var(--ember); text-decoration: none; }
a:hover, a:focus-visible { color: var(--flare); }

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }

.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;
}

/* Bevelled chrome. Raised surfaces catch light top-left. */
.panel, .hud, .shot, .btn, .notify input, .strip {
	box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
}
.dither, .hud, .strip, .notify-panel {
	background-image: repeating-linear-gradient(45deg,
		rgba(143,163,186,0.035) 0 2px, transparent 2px 4px);
}

/* ── HUD ─────────────────────────────────────────────────────────────────── */

.hud {
	position: sticky; top: 0; z-index: 20;
	background-color: #1a2430;
}
.hud-row {
	display: flex; align-items: center; gap: 16px;
	height: 56px; white-space: nowrap;
}
.hud-brand {
	display: flex; align-items: center; gap: 8px;
	color: var(--ice); font-weight: 700; letter-spacing: 1px;
}
.hud-brand img { width: 24px; height: 24px; }
.hud-nav { display: flex; gap: 16px; margin-left: 8px; }
.hud-nav a { color: var(--cold); }
.hud-nav a:hover { color: var(--ice); }
.hud-status { margin-left: auto; color: var(--cold); }
.hud-status b { color: var(--flare); font-weight: 400; }

/* ── Buttons and the form ────────────────────────────────────────────────── */

.btn {
	display: inline-block; padding: 12px 16px;
	background: var(--ember); color: #10161f;
	font-family: inherit; font-size: 16px; line-height: 1;
	border: 0; cursor: pointer; letter-spacing: 1px;
}
.btn:hover, .btn:focus-visible { background: var(--flare); color: #10161f; }
.btn-sm { padding: 8px 12px; }

.notify { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.notify input[type=email] {
	flex: 1 1 260px; min-width: 0; padding: 12px 16px;
	background: #10161f; color: var(--ice);
	font-family: inherit; font-size: 16px; line-height: 1;
	border: 0;
	box-shadow: inset 2px 2px 0 var(--lo), inset -2px -2px 0 #2a3644;
}
.notify input::placeholder { color: #46566b; }
.notify-msg { flex: 1 0 100%; margin: 0; min-height: 24px; font-size: 16px; color: var(--good); }
.notify-msg.bad { color: var(--leave); }
.fine { color: var(--quote); font-size: 16px; margin: 0; }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero { position: relative; overflow: hidden; border-bottom: 2px solid var(--line); }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-grid {
	position: relative; display: grid; gap: 32px; align-items: center;
	/* The art column is exactly 2x the sprite (260px), not a percentage: a
	   fractional column is a fractional scale, and the hull would arrive with
	   two sizes of pixel in it. */
	grid-template-columns: minmax(0, 1fr) 520px;
	padding-top: 72px; padding-bottom: 72px;
}
.eyebrow { margin: 0 0 16px; color: var(--cold); letter-spacing: 2px; font-size: 16px; }
h1 {
	margin: 0; color: var(--ice); font-weight: 700; line-height: 1.1;
	letter-spacing: 4px; display: grid;
	font-size: clamp(40px, 8vw, 72px);
}
.lede {
	max-width: 30em; margin: 24px 0 0; color: var(--chill);
	border-left: 2px solid var(--ember); padding-left: 16px;
}
.sub { margin: 16px 0 0; color: var(--ice); }
.lineage {
	display: flex; flex-wrap: wrap; gap: 8px 16px;
	list-style: none; margin: 16px 0 0; padding: 0; color: var(--quote);
}
.lineage li::before { content: "· "; color: var(--line); }
.lineage li:first-child::before { content: ""; }

/* `min-width: 0` because a grid item's automatic minimum is its content, and
   the sprite's content is 520px wide — without this the hero column refuses to
   shrink on a phone and the whole page scrolls sideways. */
.hero-art { justify-self: end; min-width: 0; }
/* Sprites are scaled by whole numbers only — 260x156 drawn at 2x. A pixel
   scaled by 1.4 is two sizes of pixel, which is the tell. */
.hero-art img { width: 520px; max-width: 100%; }
.drift { animation: drift 9s ease-in-out infinite; }
@keyframes drift {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) { .drift { animation: none; } }

/* ── Heat strip ──────────────────────────────────────────────────────────── */

.strip { background-color: #1a2430; border-block: 2px solid var(--line); }
.strip-row { display: flex; align-items: center; gap: 16px; height: 56px; overflow: hidden; }
.strip-label { color: var(--cold); }
.gauge { display: flex; gap: 2px; align-items: center; }
.gauge i {
	width: 12px; height: 18px; display: block; background: #22303f;
	box-shadow: inset 2px 2px 0 #3d4d61, inset -2px -2px 0 #080b11;
}
.gauge i.on { background: var(--ember); box-shadow: inset 2px 2px 0 var(--hot), inset -2px -2px 0 #7a3d10; }
.gauge i.over { background: var(--leave); box-shadow: inset 2px 2px 0 #e89484, inset -2px -2px 0 #6d2418; }
.gauge b { width: 2px; height: 22px; background: var(--chill); margin: 0 4px; }
.strip-note { color: var(--quote); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Bands ───────────────────────────────────────────────────────────────── */

.band { padding: 72px 0; }
.band-lede { color: var(--cold); margin: -8px 0 32px; }
.band-lede.center { text-align: center; max-width: 46em; margin-inline: auto; }

h2.rule {
	display: flex; align-items: center; gap: 16px;
	margin: 0 0 32px; font-size: 24px; font-weight: 400;
	color: var(--ice); letter-spacing: 2px;
}
h2.rule::after {
	content: ""; flex: 1; height: 2px; background: var(--line);
}

.cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.panel { background-color: var(--panel); padding: 24px; }
.panel h3 { margin: 0 0 16px; font-size: 16px; color: var(--flare); font-weight: 400; letter-spacing: 1px; }
.panel p { margin: 0; color: var(--chill); }

/* ── Screenshots ─────────────────────────────────────────────────────────── */

.shot { margin: 0; background: var(--panel); padding: 8px; }
.shot img { display: block; width: 100%; }
.shot figcaption { padding: 16px 8px 8px; color: var(--cold); font-size: 16px; }
.shot figcaption b { color: var(--ice); font-weight: 400; }
.shot.wide { margin-bottom: var(--gap); }
.shot.wide img { max-width: 960px; margin: 0 auto; }
/* A screenshot is not a sprite: it is usually shown SMALLER than it was drawn,
   and nearest-neighbour down-sampling drops whole rows of 8px type. Smooth
   these and leave `pixelated` to the art. At 1:1 the two are identical. */
.shot img { image-rendering: auto; }
.shots { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── Hulls ───────────────────────────────────────────────────────────────── */

.hulls { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hull { margin: 0; display: grid; grid-template-rows: 200px auto; text-align: center; }
.hull img { align-self: end; justify-self: center; width: auto; max-width: 100%; }
.hull figcaption { display: grid; gap: 8px; padding-top: 16px; border-top: 2px solid var(--line); }
.hull figcaption b { color: var(--flare); font-weight: 400; letter-spacing: 2px; }
.hull figcaption span { color: var(--cold); text-align: left; }

/* ── Heat band ───────────────────────────────────────────────────────────── */

.heat-band { background: var(--panel2); border-block: 2px solid var(--line); }
.heat-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: center; }
.heat-grid p { margin: 0 0 16px; max-width: 34em; }
.heat-grid .aside { color: var(--quote); }
.heat-art { display: grid; gap: 24px; justify-items: center; }
.heat-art img { width: 520px; max-width: 100%; }
.heat-art figure { margin: 0; text-align: center; }
.heat-art figcaption { color: var(--cold); letter-spacing: 2px; }
.heat-art figcaption.hot { color: var(--flare); }

/* ── Party ───────────────────────────────────────────────────────────────── */

.two { display: grid; gap: 32px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; }
.two p { margin: 0 0 16px; max-width: 34em; }
.station-art { margin: 0; text-align: center; }
.station-art img { width: 400px; max-width: 100%; }
.station-art figcaption { color: var(--quote); }

/* ── The archive quote ───────────────────────────────────────────────────── */

.doc {
	margin: 0 auto 32px; max-width: 42em; padding: 32px;
	background: var(--panel); color: var(--ice);
	box-shadow: inset 2px 2px 0 var(--lo), inset -2px -2px 0 #2a3644;
}
.doc p { margin: 0; }
.doc footer { margin-top: 24px; color: var(--quote); font-size: 16px; }

/* ── Notify band ─────────────────────────────────────────────────────────── */

.notify-band { padding-bottom: 96px; }
.notify-panel { background-color: var(--panel); padding: 40px; text-align: center; }
.notify-panel h2 { margin: 0 0 16px; font-size: 24px; font-weight: 400; color: var(--ice); letter-spacing: 2px; }
.notify-panel p { margin: 0 auto; max-width: 34em; color: var(--cold); }
.notify-panel .notify { justify-content: center; margin-top: 32px; }
.notify-panel .notify input[type=email] { flex: 0 1 320px; }
.notify-panel .notify-msg { text-align: center; }

/* ── Foot ────────────────────────────────────────────────────────────────── */

.foot { border-top: 2px solid var(--line); padding: 24px 0; color: var(--quote); }
.foot-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 16px; }

/* ── Narrow ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.hero-grid { grid-template-columns: minmax(0, 1fr); padding-top: 48px; padding-bottom: 48px; }
	.hero-art { justify-self: center; }
	.hero-art img { width: 100%; }
	.two { grid-template-columns: 1fr; }
	.hud-nav, .hud-status { display: none; }
	.band { padding: 48px 0; }
	.shots { grid-template-columns: 1fr; }
	.hulls { grid-template-columns: 1fr; }
	.hull { grid-template-rows: auto auto; }
}
@media (max-width: 560px) {
	.strip-note { display: none; }
	body { line-height: 1.9; }
	.notify-panel { padding: 24px; }
}
