/* MechVue public site.
 * Palette from the logo mark (rust #C4582A, olive #8A821E / #666014) on a pale
 * limestone ground. One typeface family (IBM Plex), condensed for headings.
 */

:root {
	--ground: #f4f5f1;      /* limestone */
	--band: #e9ebe4;        /* core-tray grey */
	--ink: #23241f;         /* shale */
	--ink-2: #4c4e45;
	--muted: #6b6d63;
	--rule: #cfd2c7;
	--rust: #a9461c;        /* text/button-safe rust (5.6:1 on ground) */
	--rust-mark: #c4582a;
	--olive: #666014;
	--olive-2: #8a821e;
	--brine: #2c6a8a;       /* pore pressure */
	--sienna: #8c6d46;      /* minimum horizontal stress */
	--window: rgba(138, 130, 30, 0.22);
	--focus: #2c6a8a;
	--on-rust: #ffffff;

	--font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
	--wrap: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--radius: 4px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ground: #1c1d19;
		--band: #24261f;
		--ink: #e7e8e1;
		--ink-2: #c4c6bb;
		--muted: #9a9c91;
		--rule: #3b3d35;
		--rust: #e07a4b;
		--rust-mark: #c4582a;
		--olive: #c2b94a;
		--olive-2: #a59c33;
		--brine: #6fb0d2;
		--sienna: #c9a46e;
		--window: rgba(194, 185, 74, 0.2);
		--focus: #6fb0d2;
		--on-rust: #1c1d19;
	}
}

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

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

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--rust); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
	position: absolute; left: 1rem; top: -3rem;
	background: var(--ink); color: var(--ground); padding: 0.5rem 0.75rem; z-index: 10;
}
.skip:focus { top: 1rem; }

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

h1, h2, h3 { font-family: var(--font-cond); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); letter-spacing: -0.02em; max-width: 16ch; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; font-weight: 500; }

p { margin: 0; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--ground); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-name { font-family: var(--font-cond); font-weight: 600; font-size: 1.35rem; }
.badge {
	font-size: 0.75rem; font-weight: 600; color: var(--olive);
	border: 1px solid currentColor; border-radius: 999px; padding: 0 0.5rem; line-height: 1.5;
}
.nav { display: flex; gap: 1.5rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 720px) { .nav { display: none; } }

/* ---------- buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
	padding: 0.85rem 1.25rem; border-radius: var(--radius); border: 1px solid transparent;
}
.btn-primary { background: var(--rust); color: var(--on-rust); }
.btn-primary:hover { background: var(--rust-mark); text-decoration: none; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-outline { color: var(--ink); border-color: var(--ink-2); }
.btn-outline:hover { background: var(--band); text-decoration: none; }
.btn-quiet { color: var(--ink); padding: 0.6rem 0.9rem; border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink-2); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.lede { font-size: 1.2rem; color: var(--ink-2); margin-top: 1.5rem; max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.fine { font-size: 0.9rem; color: var(--muted); margin-top: 1rem; }

.hero-plot { margin: 0; }
.hero-plot svg { width: 100%; height: auto; max-width: 26rem; margin: 0 auto; overflow: visible; }
.hero-plot .frame { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.hero-plot .grid line { stroke: var(--rule); stroke-width: 1; }
.hero-plot .window { fill: var(--window); stroke: none; }
.hero-plot path[class^="c-"] { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.hero-plot .c-pp { stroke: var(--brine); }
.hero-plot .c-collapse { stroke: var(--olive-2); stroke-dasharray: 5 4; }
.hero-plot .c-shmin { stroke: var(--sienna); }
.hero-plot .c-fg { stroke: var(--rust-mark); }
.hero-plot .c-mw { stroke: var(--ink); stroke-width: 2.6; }
.hero-plot .shoes path { fill: var(--ink); }
.hero-plot text { fill: var(--muted); font: 11px var(--font); }
.hero-plot .axis { fill: var(--ink-2); font-size: 12px; }

.hero-plot figcaption { max-width: 26rem; margin: 1rem auto 0; font-size: 0.85rem; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0 0 0.4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.3rem 1rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.key { flex: none; width: 1.4rem; height: 0; border-top: 2.5px solid; }
.k-pp { border-color: var(--brine); }
.k-collapse { border-color: var(--olive-2); border-top-style: dashed; }
.k-shmin { border-color: var(--sienna); }
.k-fg { border-color: var(--rust-mark); }
.k-mw { border-color: var(--ink); }
.k-window { height: 0.8rem; border: 0; background: var(--window); }

/* draw the curves in once, top to bottom, like a log being run */
@media (prefers-reduced-motion: no-preference) {
	.hero-plot .plot-clip { animation: run-log 1.8s cubic-bezier(.4, 0, .2, 1) .2s both; }
}
@keyframes run-log { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- sections ---------- */
main > section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.band { background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-lede { color: var(--ink-2); font-size: 1.1rem; margin-top: 1rem; max-width: 40rem; }

/* modules: a ruled two-column list, like a log header */
.modules { margin: 2.5rem 0 0; border-top: 2px solid var(--ink); }
.module { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.module dt { font-family: var(--font-cond); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }
.module dd { margin: 0; color: var(--ink-2); max-width: 46rem; }
@media (max-width: 720px) { .module { grid-template-columns: 1fr; gap: 0.35rem; } }

/* methods */
.methods-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(2rem, 6vw, 5rem); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.principles li { padding-left: 1.1rem; border-left: 3px solid var(--olive-2); }
.principles p { color: var(--ink-2); margin-top: 0.4rem; max-width: 38rem; }

/* beta steps: a real sequence, so numbered */
.steps { list-style: none; counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-family: var(--font-cond); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--rust); margin-bottom: 0.75rem; }
.steps p { color: var(--ink-2); margin-top: 0.4rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; gap: 1.5rem; } }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(2rem, 6vw, 5rem); }
.prose p + p { margin-top: 1rem; }
.prose p { max-width: 40rem; color: var(--ink-2); }

/* contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-form { display: grid; gap: 1.1rem; }
.topic { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.topic legend { font-weight: 500; margin-bottom: 0.5rem; padding: 0; }
.topic label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.topic input { accent-color: var(--rust); width: 1.05rem; height: 1.05rem; margin: 0; }
.field { display: grid; gap: 0.35rem; font-weight: 500; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
	font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--ground);
	border: 1px solid var(--ink-2); border-radius: var(--radius); padding: 0.7rem 0.8rem; width: 100%;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; }
.field [aria-invalid="true"] { border-color: #b3261e; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status:empty { display: none; }
.form-status { padding: 0.75rem 1rem; border-radius: var(--radius); border-left: 3px solid var(--olive-2); background: var(--ground); }
.form-status.is-error { border-left-color: #b3261e; }

@media (max-width: 820px) {
	.hero-grid, .methods-grid, .about, .contact-grid { grid-template-columns: 1fr; }
	.hero-plot svg { max-width: 22rem; }
}

/* ---------- footer ---------- */
.site-footer { padding: 2rem 0 2.5rem; font-size: 0.9rem; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-footer a { color: var(--ink-2); }

/* ---------- 404 ---------- */
.not-found { padding: clamp(4rem, 12vw, 8rem) 0; }
.not-found p { margin-top: 1rem; color: var(--ink-2); max-width: 36rem; }
