/* ============================================================================
   Lesharness — site stylesheet
   Shared by every page. Served as a real stylesheet, not inlined.

   Design notes: dark industrial, one accent (amber), IBM Plex. Structure does
   the work — restrained borders, generous vertical rhythm, controlled measure.
   No gradients, no glass, no decorative illustration.
   ========================================================================== */

:root {
  --bg:        #0d0f12;
  --bg-alt:    #101318;
  --panel:     #14171c;
  --panel-2:   #191d23;
  --line:      #262b33;
  --line-soft: #1d222a;

  --ink:   #e8ecf1;
  --body:  #a4aeba;
  --faint: #6b7681;

  --amber:      #f0a33c;
  --amber-soft: #ffc04d;
  --amber-dim:  #7a5220;

  --pass: #4ec9a0;
  --fail: #e5586e;

  --sans: "IBM Plex Sans", ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1160px;
  --prose: 68ch;
  --r: 4px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-soft); }

::selection { background: rgba(240,163,60,.26); color: #fff; }

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

/* ------------------------------------------------------------------ layout */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--amber); color: #14171c; padding: 10px 16px;
  font-weight: 600; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,18,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.hdr {
  display: flex; align-items: center; gap: 26px;
  height: 62px;
}

.lockup {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; font-size: 15px;
  letter-spacing: -.01em; flex: none;
}
.lockup:hover { color: var(--ink); }
.lockup .mark { width: 20px; height: 20px; flex: none; display: block; }
.lockup .mark rect { fill: var(--amber); }

.ver {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  color: var(--faint); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 3px; letter-spacing: .02em;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.nav a {
  color: var(--body); font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: var(--r);
  transition: color .14s ease, background .14s ease;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }

.hdr-cta { margin-left: 10px; flex: none; }

.burger {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line);
  color: var(--ink); border-radius: var(--r);
  width: 40px; height: 34px; cursor: pointer; font-size: 16px; line-height: 1;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .1s ease;
}
.btn:hover { background: var(--panel-2); border-color: #333a45; color: var(--ink); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber); border-color: var(--amber); color: #14171c;
}
.btn-primary:hover { background: var(--amber-soft); border-color: var(--amber-soft); color: #14171c; }

.btn-quiet { background: transparent; border-color: var(--line); color: var(--body); }
.btn-quiet:hover { color: var(--ink); background: var(--panel); }

.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ------------------------------------------------------------------ typography */
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; line-height: 1.18; letter-spacing: -.02em; }
h1 { font-size: clamp(34px, 4.4vw, 54px); letter-spacing: -.032em; }
h2 { font-size: clamp(24px, 2.7vw, 33px); }
h3 { font-size: 17.5px; }
p  { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }

.lede { font-size: 17.5px; line-height: 1.62; color: var(--body); max-width: 60ch; }
.prose { max-width: var(--prose); }
.prose p + p { margin-top: 18px; }

code, kbd, .mono { font-family: var(--mono); font-size: .88em; }

code {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  padding: 1.5px 5px; border-radius: 3px; color: #cfd7e0;
}

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 14px;
}
.eyebrow.dim { color: var(--faint); }

.sec-num {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  letter-spacing: .1em; display: block; margin-bottom: 12px;
}

hr.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }

/* ------------------------------------------------------------------ sections */
.section { padding: 76px 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }
.section.tight { padding: 54px 0; }

.sec-head { margin-bottom: 34px; max-width: 66ch; }
.sec-head h2 { margin-bottom: 12px; }
.sec-head p { color: var(--body); font-size: 16px; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 70px 0 62px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 62px; align-items: center;
}

.hero h1 { margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--amber); display: block; }

.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; margin: 30px 0 22px; }

.hero-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* page hero for subpages */
.phero { padding: 54px 0 44px; border-bottom: 1px solid var(--line-soft); }
.phero h1 { margin-bottom: 14px; }
.phero .lede { margin-bottom: 0; }

.crumbs {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  margin-bottom: 22px; display: flex; gap: 8px; align-items: center;
}
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--amber); }
.crumbs .sep { color: #3a424c; }

/* ------------------------------------------------------------------ terminal */
.term {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.72;
}
.term-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--faint);
}
.term-bar .dots { display: flex; gap: 5px; }
.term-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: #3a424c; display: block; }
.term-bar .ttl { margin-left: 4px; }
.term-body { padding: 15px 16px; overflow-x: auto; }
.term-body pre { margin: 0; white-space: pre; }
.term-body pre + pre { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

.c-dim { color: var(--faint); }
.c-ink { color: var(--ink); }
.c-amber { color: var(--amber); }
.c-pass { color: var(--pass); }
.c-fail { color: var(--fail); }
.c-warn { color: var(--amber-soft); }

/* ------------------------------------------------------------------ feature list */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden; background: var(--panel);
}
.fact { padding: 18px 20px; border-left: 1px solid var(--line-soft); }
.fact:first-child { border-left: 0; }
.fact .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 7px;
}
.fact .v { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.fact .n { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

/* ------------------------------------------------------------------ table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.tbl th, .tbl td { padding: 13px 17px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.tbl thead th {
  background: var(--panel-2); color: var(--faint);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; font-weight: 600;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(255,255,255,.012); }
.tbl td.m { font-family: var(--mono); }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }

.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 20px;
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--body); margin: 0; }
.card .path {
  font-family: var(--mono); font-size: 11.5px; color: var(--amber);
  display: block; margin-top: 11px;
}

/* stage list */
.stages { display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.stage {
  display: grid; grid-template-columns: 54px minmax(0,1fr);
  gap: 20px; padding: 22px 22px; background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}
.stage:last-child { border-bottom: 0; }
.stage .idx {
  font-family: var(--mono); font-size: 12px; color: var(--amber);
  padding-top: 3px; letter-spacing: .04em;
}
.stage h3 { margin-bottom: 6px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stage h3 .path {
  font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--faint);
}
.stage p { font-size: 14.5px; margin: 0; }
.stage ul { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--faint); }
.stage ul li { margin-bottom: 4px; }
.stage ul li .mono { color: var(--body); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--body);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 3px;
}

/* ---- mode chart: composition of the dataset, split by run ---------------- */
.mchart { display: flex; flex-direction: column; gap: 18px; }
.mhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.mname { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.mrole {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
  border: 1px solid var(--line); border-radius: 2px; padding: 2px 6px;
}
.mrate { margin-left: auto; font-size: 13px; color: var(--body); }
.mrate b { color: var(--ink); font-weight: 600; }

/* Every bar is the full dataset, so segment widths are literal counts out of 32
   and the two runs read against a shared denominator. */
.mbar {
  display: flex; height: 32px; border-radius: 3px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
}
.seg { display: flex; align-items: center; justify-content: center; min-width: 2px; }
.seg + .seg { border-left: 1px solid var(--bg); }
.seg i {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  font-style: normal; color: #0a0c0e;
}

.tone-pass  { background: var(--pass); }
.tone-rust  { background: #c9604a; }
.tone-amber { background: var(--amber); }
.tone-dun   { background: #907744; }
.tone-clay  { background: #7a5449; }

.mlegend {
  display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 15px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.lg {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--body);
}
.lg .sw { width: 11px; height: 11px; border-radius: 2px; flex: none; }
.lg-n { color: var(--faint); font-family: var(--sans); }

/* Per-run readout: every count as text, so a one-case segment cannot become
   invisible just because its label did not fit. */
.mread {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px;
  padding-left: 1px;
}
.rd {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--body);
}
.rd .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.rd b { color: var(--ink); font-weight: 600; margin-left: 1px; }

/* brake list */
.brakes { display: grid; gap: 14px; }
.brake {
  display: grid; grid-template-columns: 84px minmax(0,1fr) auto;
  gap: 20px; align-items: center;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 18px 20px;
}
.brake .tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.brake h3 { font-size: 16px; margin-bottom: 5px; }
.brake p { font-size: 14px; margin: 0; }
.brake .default {
  font-family: var(--mono); font-size: 12px; color: var(--amber);
  border: 1px solid var(--amber-dim); background: rgba(240,163,60,.05);
  padding: 5px 10px; border-radius: 3px; white-space: nowrap;
}

/* callout */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  background: var(--panel); border-radius: var(--r); padding: 22px 24px;
}
.callout blockquote { margin: 0; font-size: 16px; color: var(--body); line-height: 1.65; }
.callout .src {
  margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.callout .src b { color: var(--body); font-weight: 500; }

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--faint);
  background: var(--panel); border-radius: var(--r);
  padding: 15px 18px; font-size: 14px;
}
.note b { color: var(--ink); }

/* definition rows */
.defs { border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.def {
  display: grid; grid-template-columns: 200px minmax(0,1fr);
  gap: 22px; padding: 16px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}
.def:last-child { border-bottom: 0; }
.def .key { font-family: var(--mono); font-size: 12.5px; color: var(--amber); }
.def .val { font-size: 14px; }

/* ordered steps */
.steps { counter-reset: s; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 14px; align-items: start; }
.step .n {
  counter-increment: s; font-family: var(--mono); font-size: 11.5px;
  color: var(--amber); border: 1px solid var(--line);
  border-radius: 50%; width: 26px; height: 26px;
  display: grid; place-items: center; margin-top: 2px;
}
.step .n::before { content: counter(s, decimal-leading-zero); }
.step p { font-size: 14.5px; margin: 0; }

/* code block (standalone) */
.code {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin: 0;
}
.code .code-h {
  padding: 8px 14px; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.72; color: var(--body);
}
.code pre .cmt { color: var(--faint); }
.code pre .cmd { color: var(--ink); }
.code pre .ok { color: var(--pass); }
.code pre .bad { color: var(--fail); }

/* end CTA */
.cta-band {
  border-top: 1px solid var(--line-soft);
  padding: 62px 0;
  background: var(--bg-alt);
}
.cta-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 34px; flex-wrap: wrap;
}
.cta-in h2 { margin-bottom: 8px; }
.cta-in p { margin: 0; max-width: 56ch; }
.cta-actions { display: flex; gap: 11px; flex: none; }

/* ------------------------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-alt);
  padding: 52px 0 34px;
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 38px; padding-bottom: 34px;
  border-bottom: 1px solid var(--line-soft);
}
.foot-brand .lockup { margin-bottom: 13px; }
.foot-brand p { font-size: 13.5px; color: var(--faint); max-width: 34ch; margin: 0; }
.foot-col h4 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 14px;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-col a { color: var(--body); font-size: 13.5px; }
.foot-col a:hover { color: var(--amber); }

.foot-base {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap; padding-top: 22px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.foot-base .right { display: flex; gap: 18px; align-items: center; }

/* ------------------------------------------------------------------ utilities */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 46px; align-items: start; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: minmax(0,1fr); gap: 44px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .brake { grid-template-columns: 1fr auto; }
  .brake .tag { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  .nav { display: none; }
  .burger { display: block; }
  .hdr-cta { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 62px; left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px; gap: 2px; margin: 0;
  }
  .nav.open a { padding: 11px 12px; font-size: 15px; }
  .split { grid-template-columns: minmax(0,1fr); gap: 30px; }
  .grid-3 { grid-template-columns: minmax(0,1fr); }

  /* Touch targets: 44px minimum. On a phone the header links, the menu button,
     and every footer link are the primary way around the site, and a 25px-tall
     target is a miss waiting to happen. */
  .lockup { min-height: 44px; }
  .burger { width: 46px; height: 44px; }
  .foot-col a { display: flex; align-items: center; min-height: 44px; }
  .foot-col ul { gap: 0; }
  .btn-sm { min-height: 44px; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 44px 0 46px; }
  .section { padding: 52px 0; }
  .grid-2, .grid-4, .facts { grid-template-columns: minmax(0,1fr); }
  .fact { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .fact:first-child { border-top: 0; }
  .def { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .stage { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .brake { grid-template-columns: minmax(0,1fr); }
  .brake .default { justify-self: start; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-actions .btn, .cta-actions .btn { flex: 1 1 100%; }
  .cta-in { flex-direction: column; align-items: flex-start; }
  .cta-actions { width: 100%; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
