/* MUDBasher - site styles
   Theme: dark only, locked. Palette derived from the pixel-art brand mark
   (torch fire against dungeon stone). One accent: --accent. */

:root {
	--bg: #0c0b0a;
	--bg-raise: #16130f;
	--line: #2c2620;
	--line-soft: #201c18;
	--text: #f0ece6;
	--text-dim: #a49b8e;
	--text-mute: #8b8175;
	--accent: #ff6a1f;
	--accent-quiet: #ffb387;

	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--wrap: 1180px;
	--gut: 1.5rem;
}

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--accent);
}

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

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

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

.skip {
	position: absolute;
	left: -9999px;
}

.skip:focus {
	left: 1rem;
	top: 1rem;
	z-index: 100;
	background: var(--accent);
	color: var(--bg);
	padding: 0.6rem 1rem;
	font-family: var(--mono);
	font-weight: 700;
}

/* ---------- Navigation : one line, 64px ---------- */

.nav {
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid var(--line-soft);
}

.brand {
	font-family: var(--mono);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
}

.brand span {
	color: var(--accent);
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	font-family: var(--mono);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.nav-links a {
	color: var(--text-dim);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
	color: var(--text);
}

.nav-links .nav-cta {
	color: var(--bg);
	background: var(--accent);
	padding: 0.42rem 0.85rem;
	font-weight: 700;
}

.nav-links .nav-cta:hover {
	background: var(--accent-quiet);
	color: var(--bg);
}

/* ---------- Shared section furniture ---------- */

.section {
	padding: 6rem 0;
	border-top: 1px solid var(--line-soft);
}

h1,
h2,
h3 {
	font-family: var(--mono);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.12;
	text-wrap: balance;
}

h2 {
	font-size: clamp(1.6rem, 3.4vw, 2.4rem);
	margin-bottom: 1rem;
}

h3 {
	font-size: 1.05rem;
	letter-spacing: 0.02em;
	margin-bottom: 0.6rem;
}

.lede {
	color: var(--text-dim);
	max-width: 60ch;
	font-size: 1.05rem;
}

/* ---------- Hero : asymmetric split ---------- */

.hero {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 4rem;
	align-items: center;
	padding: 5rem 0 6rem;
}

.hero h1 {
	/* mono display type sets wide; capped so the headline holds 2 lines */
	font-size: clamp(1.95rem, 4.1vw, 2.9rem);
	margin-bottom: 1.4rem;
}

.hero h1 em {
	font-style: normal;
	color: var(--accent);
}

.hero p {
	color: var(--text-dim);
	font-size: 1.1rem;
	max-width: 46ch;
	margin-bottom: 2.2rem;
}

.hero-shot {
	border: 1px solid var(--line);
	background: #000;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	background: var(--accent);
	color: var(--bg);
	font-family: var(--mono);
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.95rem 1.5rem;
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid var(--accent);
	transition: background 0.18s ease, transform 0.08s ease;
}

.btn:hover {
	background: var(--accent-quiet);
	border-color: var(--accent-quiet);
}

.btn:active {
	transform: translateY(1px);
}

.btn svg {
	width: 20px;
	height: 20px;
	flex: none;
}

/* ---------- Feature bento : 6 cells, asymmetric ---------- */

.bento {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1px;
	background: var(--line-soft);
	border: 1px solid var(--line-soft);
	margin-top: 2.5rem;
}

.cell {
	background: var(--bg);
	padding: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.cell p {
	color: var(--text-dim);
	font-size: 0.95rem;
}

.cell-wide {
	grid-column: span 7;
}

.cell-med {
	grid-column: span 5;
}

.cell-third {
	grid-column: span 4;
}

/* these two frame list/form UI, so show the top rather than the bottom */
.cell--top .cell-art img {
	object-position: 50% 4%;
}

.cell--art {
	background: var(--bg-raise);
	padding: 0;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	min-height: 19rem;
}

.cell--art .cell-body {
	padding: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
}

.cell--art .cell-art {
	flex: none;
	width: 190px;
	position: relative;
	overflow: hidden;
	border-left: 1px solid var(--line-soft);
	background: #000;
}

/* absolute so the tall screenshot's intrinsic height never drives row height */
.cell--art .cell-art img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* bias to the lower half where the terminal output lives */
	object-position: 50% 88%;
}

.spec {
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--text-mute);
	letter-spacing: 0.02em;
	margin-top: auto;
	padding-top: 1rem;
}

.spec b {
	color: var(--accent-quiet);
	font-weight: 500;
}

/* ---------- Privacy statement : full width, no cards ---------- */

.statement {
	border-top: 1px solid var(--line-soft);
	padding: 6rem 0;
}

.statement h2 {
	font-size: clamp(1.8rem, 4.6vw, 3rem);
	max-width: 18ch;
	margin-bottom: 1.5rem;
}

.statement-cols {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem;
	margin-top: 3rem;
	border-top: 1px solid var(--line-soft);
	padding-top: 2rem;
}

.statement-cols h3 {
	color: var(--accent-quiet);
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.statement-cols p {
	color: var(--text-dim);
	font-size: 0.95rem;
}

/* ---------- Story ---------- */

.story {
	display: grid;
	grid-template-columns: 0.85fr 1.15fr;
	gap: 4rem;
	align-items: start;
}

.story p {
	color: var(--text-dim);
	margin-bottom: 1.1rem;
	max-width: 62ch;
}

.story p:last-child {
	margin-bottom: 0;
}

.story strong {
	color: var(--text);
	font-weight: 600;
}

/* ---------- Closing CTA : the one centred moment ---------- */

.close {
	text-align: center;
	padding: 7rem 0;
	border-top: 1px solid var(--line-soft);
}

.close h2 {
	margin-bottom: 1.25rem;
}

.close p {
	color: var(--text-dim);
	max-width: 46ch;
	margin: 0 auto 2.2rem;
}

/* ---------- Footer ---------- */

.foot {
	border-top: 1px solid var(--line-soft);
	padding: 2.5rem 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	justify-content: space-between;
	align-items: center;
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--text-mute);
}

.foot nav {
	display: flex;
	gap: 1.5rem;
}

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

.foot a:hover {
	color: var(--text);
}

/* ---------- Document pages (privacy, support) ---------- */

.doc {
	padding: 4rem 0 6rem;
	max-width: 74ch;
}

.doc h1 {
	font-size: clamp(1.9rem, 4.6vw, 2.6rem);
	margin-bottom: 0.5rem;
}

.doc .updated {
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--text-mute);
	margin-bottom: 3rem;
}

.doc h2 {
	font-size: 1.25rem;
	margin-top: 3rem;
	margin-bottom: 0.9rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line-soft);
}

.doc h3 {
	font-size: 1rem;
	margin-top: 2rem;
	color: var(--accent-quiet);
}

.doc h4 {
	font-family: var(--mono);
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
	color: var(--text);
}

.doc p,
.doc li {
	color: var(--text-dim);
	margin-bottom: 0.85rem;
}

.doc ul {
	margin-left: 1.1rem;
	margin-bottom: 1.25rem;
}

.doc li {
	margin-bottom: 0.4rem;
}

.doc strong {
	color: var(--text);
	font-weight: 600;
}

.doc .summary {
	background: var(--bg-raise);
	border-left: 3px solid var(--accent);
	padding: 1.5rem;
	margin-top: 3rem;
}

.doc .summary h2 {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* ---------- Guide pages ----------
   Components for the automation, MSP and background-connection guides.
   Same tokens, same sharp corners, same single accent as the rest of the site. */

.doc-sub {
	color: var(--text-dim);
	font-size: 1.1rem;
	max-width: 58ch;
	margin-bottom: 2.5rem;
}

.doc code {
	font-family: var(--mono);
	font-size: 0.88em;
	color: var(--accent-quiet);
	background: var(--bg-raise);
	border: 1px solid var(--line-soft);
	padding: 0.1em 0.35em;
	overflow-wrap: anywhere;
}

/* Screenshot figure. Phone captures are tall, so cap the width. */
.shot {
	margin: 2rem 0;
}

.shot img {
	border: 1px solid var(--line);
	max-width: 300px;
	width: 100%;
}

.shot figcaption {
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--text-mute);
	margin-top: 0.65rem;
	max-width: 46ch;
}

/* Worked example: pattern in, result out. */
.example {
	background: var(--bg-raise);
	border-left: 2px solid var(--accent);
	padding: 1.25rem 1.5rem;
	margin: 2rem 0;
}

.example h4 {
	font-family: var(--mono);
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	color: var(--accent-quiet);
	margin: 0 0 0.85rem;
}

.example p {
	color: var(--text-dim);
	font-size: 0.95rem;
	margin-bottom: 0.5rem;
}

.example p:last-child {
	margin-bottom: 0;
}

/* Tip / caveat callout. */
.note {
	border: 1px solid var(--line);
	border-left: 2px solid var(--accent-quiet);
	background: var(--bg-raise);
	padding: 1.15rem 1.4rem;
	margin: 2rem 0;
	color: var(--text-dim);
	font-size: 0.95rem;
}

.note strong {
	color: var(--text);
}

/* Left-to-right architecture flow. */
.flow {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.5rem 0 2rem;
	font-family: var(--mono);
	font-size: 0.82rem;
}

.flow-box {
	border: 1px solid var(--line);
	background: var(--bg-raise);
	padding: 0.7rem 0.9rem;
	color: var(--text);
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}

.flow-box.is-dead {
	border-color: var(--accent);
	color: var(--accent-quiet);
}

.flow-arrow {
	display: flex;
	align-items: center;
	color: var(--text-mute);
	padding: 0 0.2rem;
	white-space: nowrap;
	flex: none;
}

.flow-arrow.is-cut {
	color: var(--accent);
}

/* Then vs now. */
.compare {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	background: var(--line-soft);
	border: 1px solid var(--line-soft);
	margin: 2rem 0;
}

.compare > div {
	background: var(--bg);
	padding: 1.4rem;
}

.compare h4 {
	font-family: var(--mono);
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	margin-bottom: 0.85rem;
	color: var(--text-mute);
}

.compare .is-now h4 {
	color: var(--accent-quiet);
}

.compare ul {
	margin: 0 0 0 1rem;
}

.compare li {
	font-size: 0.9rem;
	margin-bottom: 0.4rem;
}

/* What happens, in order. */
.timeline {
	margin: 1.5rem 0 2rem;
	border-top: 1px solid var(--line-soft);
}

.timeline > div {
	display: grid;
	grid-template-columns: 10rem 1fr;
	gap: 1.25rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--line-soft);
}

.timeline dt,
.timeline .step-label {
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--accent-quiet);
}

.timeline dd,
.timeline .step-text {
	color: var(--text-dim);
	font-size: 0.95rem;
	margin: 0;
}

/* Reference table. */
.table-scroll {
	overflow-x: auto;
	margin: 1.5rem 0 2rem;
	border: 1px solid var(--line-soft);
}

.doc table {
	border-collapse: collapse;
	width: 100%;
	min-width: 34rem;
	font-size: 0.9rem;
}

.doc caption {
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--text-mute);
	text-align: left;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--line-soft);
}

.doc th {
	font-family: var(--mono);
	font-size: 0.76rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--accent-quiet);
	text-align: left;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

.doc td {
	padding: 0.7rem 1rem;
	color: var(--text-dim);
	border-bottom: 1px solid var(--line-soft);
	vertical-align: top;
}

.doc tbody tr:last-child td {
	border-bottom: 0;
}

/* In-page contents. */
.toc {
	border: 1px solid var(--line-soft);
	background: var(--bg-raise);
	padding: 1.15rem 1.4rem;
	margin: 2rem 0;
	font-family: var(--mono);
	font-size: 0.85rem;
}

.toc strong {
	display: block;
	color: var(--text-mute);
	font-size: 0.76rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 500;
	margin-bottom: 0.6rem;
}

.toc ul {
	list-style: none;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
}

.toc li {
	margin: 0;
}

.doc-end {
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line-soft);
	font-family: var(--mono);
	font-size: 0.78rem;
	color: var(--text-mute);
}

@media (max-width: 640px) {
	.compare {
		grid-template-columns: 1fr;
	}

	.timeline > div {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	.flow {
		flex-direction: column;
	}

	.flow-arrow {
		justify-content: center;
	}
}

/* ---------- Support form ---------- */

.form {
	max-width: 34rem;
	margin-top: 2.5rem;
}

.field {
	margin-bottom: 1.5rem;
}

.field label {
	display: block;
	font-family: var(--mono);
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text);
	margin-bottom: 0.5rem;
}

.field input,
.field textarea {
	width: 100%;
	padding: 0.8rem 0.9rem;
	background: var(--bg-raise);
	border: 1px solid var(--line);
	color: var(--text);
	font-family: var(--sans);
	font-size: 1rem;
	transition: border-color 0.18s ease;
}

.field input::placeholder,
.field textarea::placeholder {
	/* --text-mute clears 4.8:1 against --bg-raise */
	color: var(--text-mute);
}

.field input:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(255, 106, 31, 0.25);
}

.field textarea {
	min-height: 9rem;
	resize: vertical;
}

.field .hint {
	font-size: 0.85rem;
	color: var(--text-mute);
	margin-top: 0.4rem;
}

.form button {
	font-family: var(--mono);
	cursor: pointer;
}

/* ---------- Motion : MOTION_INTENSITY 4 ----------
   Entry reveal communicates reading sequence. Nothing loops.
   Gated on no-preference, so reduced-motion users get the static page. */

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.reveal {
			animation: rise linear both;
			animation-timeline: view();
			animation-range: entry 10% cover 26%;
		}
	}

	.hero-intro {
		animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
	}

	.hero-art {
		animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

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

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
	.hero,
	.story {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}

	.hero {
		padding-top: 3rem;
	}

	.cell-wide,
	.cell-med,
	.cell-third {
		grid-column: span 12;
	}

	.statement-cols {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}
}

@media (max-width: 640px) {
	.section,
	.statement {
		padding: 3.5rem 0;
	}

	.close {
		padding: 4rem 0;
	}

	.cell,
	.cell--art .cell-body {
		padding: 1.5rem;
	}

	.cell--art {
		flex-direction: column;
	}

	.cell--art .cell-art {
		width: 100%;
		height: 200px;
		border-left: 0;
		border-top: 1px solid var(--line-soft);
	}

	.cell--art .cell-art img {
		object-position: 50% 72%;
	}

	.nav-links {
		gap: 0.85rem;
		font-size: 0.72rem;
	}

	.foot {
		flex-direction: column;
		align-items: flex-start;
	}

	.foot nav {
		flex-wrap: wrap;
		gap: 1rem;
	}
}

/* Six nav items cannot hold one line on a phone. One line is a desktop
   rule; below this the bar stacks and grows instead of overflowing. */
@media (max-width: 820px) {
	.nav {
		height: auto;
		min-height: 64px;
		flex-wrap: wrap;
		padding: 0.85rem 0;
		gap: 0.75rem 1rem;
	}

	.nav-links {
		flex-wrap: wrap;
		gap: 0.75rem 1.1rem;
	}
}

@media (max-width: 420px) {
	:root {
		--gut: 1.15rem;
	}

	.brand {
		font-size: 0.85rem;
		letter-spacing: 0.1em;
	}
}

@media (max-width: 340px) {
	/* keep the CTA label on one line on the narrowest phones */
	.btn {
		font-size: 0.72rem;
		padding: 0.85rem 1rem;
		gap: 0.5rem;
	}

	.btn svg {
		width: 17px;
		height: 17px;
	}

	h1,
	h2 {
		overflow-wrap: anywhere;
	}
}
