/* snubber.dev — one page, one stylesheet.
   Tokens first; everything below reads from them. */

:root {
  --paper: #faf6f0;
  --card: #f4eee5;
  --ink: #1a1814;
  --mid: #6d665b;
  --rule: #e2d9cc;
  --accent: oklch(0.52 0.11 42);
  --term: #f4eee5;
  --termink: #1a1814;
  --termmid: #6d665b;
  --termrule: #e2d9cc;
  --blend: multiply;
  --imgop: 0.92;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Archivo, Helvetica, Arial, sans-serif;
  --measure: 880px;
  --pad: 22px;
}

/* Dark is the same table twice: once for the explicit choice, once for the
   system default. Neither may be the only place a colour is defined. */
:root[data-theme="dark"] {
  --paper: #121110;
  --card: #1a1916;
  --ink: #eae4da;
  --mid: #948c80;
  --rule: #2c2a25;
  --accent: oklch(0.76 0.11 62);
  --term: #1a1916;
  --termink: #eae4da;
  --termmid: #948c80;
  --termrule: #332f2a;
  --blend: normal;
  --imgop: 0.9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121110;
    --card: #1a1916;
    --ink: #eae4da;
    --mid: #948c80;
    --rule: #2c2a25;
    --accent: oklch(0.76 0.11 62);
    --term: #1a1916;
    --termink: #eae4da;
    --termmid: #948c80;
    --termrule: #332f2a;
    --blend: normal;
    --imgop: 0.9;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--ink); }

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

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--ink);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header .bar {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.wordmark-name { color: var(--accent); }
.wordmark-tld { color: var(--mid); }

.bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--mid);
}

.theme-toggle {
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--mid);
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }

/* Hero -------------------------------------------------------------------- */

.hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 52px var(--pad) 44px;
}

.hero h1 {
  margin: 0;
  max-width: 23ch;
  font-size: clamp(30px, 7.6vw, 52px);
  line-height: 1.13;
  letter-spacing: -0.024em;
  font-weight: 500;
}

/* Board texture band ------------------------------------------------------ */

.band {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 62%, transparent);
}

.band pre {
  margin: 0 auto;
  padding: 26px var(--pad);
  max-width: 1180px;
  height: clamp(150px, 26vw, 230px);
  font-family: var(--mono);
  font-size: clamp(11px, 2.5vw, 14px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--mid);
  white-space: pre;
  overflow: hidden;
}

/* Main -------------------------------------------------------------------- */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--pad) 76px;
}

.prose {
  padding-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 62ch;
}

.prose p { margin: 0; }

.lead {
  font-size: clamp(18px, 4.4vw, 21px);
  line-height: 1.55;
}

.body {
  font-size: clamp(16px, 4vw, 17.5px);
  line-height: 1.62;
  color: var(--mid);
}

.body-sm {
  font-size: 16px;
  line-height: 1.6;
  color: var(--mid);
  max-width: 60ch;
}

/* Status + facts rail ----------------------------------------------------- */

.rail {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px 44px;
  align-items: start;
}

.note {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note p {
  margin: 0;
  font-size: 16px;
  line-height: 1.62;
  color: var(--mid);
}

.note .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.facts {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  border-top: 1px solid var(--rule);
}

.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt { margin: 0; color: var(--mid); }
.facts dd { margin: 0; }

/* Sections ---------------------------------------------------------------- */

.section { margin-top: 58px; }
.section.first { margin-top: 64px; }

.section h2 {
  margin: 0 0 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
}

/* Terminal blocks --------------------------------------------------------- */

.term {
  position: relative;
  background: var(--term);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.term pre {
  margin: 0;
  padding: 22px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: clamp(12.5px, 3.4vw, 13.5px);
  line-height: 1.95;
  color: var(--termink);
}

.term pre.loose { line-height: 1.85; }

/* Deliberately overlaps the block's corner. */
.copy {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 8px 10px;
  min-height: 34px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--termmid);
  background: none;
  border: 1px solid var(--termrule);
  border-radius: 2px;
  cursor: pointer;
}
.copy:hover { color: var(--termink); border-color: var(--termmid); }

.after-term { margin-top: 18px; }
.after-term .body-sm { margin: 0 0 14px; }

.trail { margin: 16px 0 0; }

/* Exit codes — the 1px grid gap on a --rule ground draws the dividers. */
.codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.codes > div {
  background: var(--paper);
  padding: 14px 16px;
}

.code-num {
  margin: 0 0 5px;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
}

.code-label {
  margin: 0;
  font-size: 14.5px;
  color: var(--mid);
}

/* Record figures ---------------------------------------------------------- */

.records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.records figure {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--card);
}

.records figcaption {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--mid);
}

.records pre {
  margin: 0;
  padding: 16px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink);
}

/* Garden vignette --------------------------------------------------------- */

.vignette {
  background: var(--paper);
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.vignette-frame {
  position: relative;
  width: 100%;
  max-width: 1180px;
  aspect-ratio: 21 / 9;
  max-height: 380px;
}

/* The mask is what makes this a signature rather than a hero: it must fade
   on every edge into the page ground. */
.vignette-image {
  position: absolute;
  inset: 0;
  mix-blend-mode: var(--blend);
  opacity: var(--imgop);
  -webkit-mask-image: radial-gradient(66% 58% at 50% 46%, #000 0%, rgba(0, 0, 0, 0.5) 44%, transparent 76%);
  mask-image: radial-gradient(66% 58% at 50% 46%, #000 0%, rgba(0, 0, 0, 0.5) 44%, transparent 76%);
}

.vignette-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.site-footer { border-top: 1px solid var(--rule); }

.site-footer .bar {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 13px;
}

.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-footer .licence { color: var(--mid); }
