/* Paper and ink, one accent. Three text weights and three surfaces are the
   whole vocabulary — the same discipline the workspace primitives use, written
   out by hand because this site ships no framework. */

:root {
  color-scheme: light dark;

  /* Surfaces: the page, something lifted off it, something recessed into it. */
  --surface-base: #f9fbf9;
  --surface-raised: #ffffff;
  --surface-sunken: #edf2ef;

  /* Three text weights. Primary says it, secondary supports it, tertiary is
     metadata a reader skims past. There is no fourth. */
  --text-primary: #141815;
  --text-secondary: #4e5a53;
  --text-tertiary: #7f8d85;

  --stroke: #dde6e0;
  --stroke-strong: #c3d0c8;

  /* One accent. Pine against warm-neutral paper: cool where the sibling tool
     is warm, and none of the cyan, violet or acid green a generated site
     reaches for. */
  --accent: #2c6049;
  --accent-soft: #e7f1ec;

  /* The terminal is the hero, so it gets its own small palette. */
  --term-bg: #141815;
  --term-fg: #d7e0da;
  --term-dim: #7f8d85;
  --term-mark: #5cbf95;

  /* Semantic, and deliberately not the accent: an advisory is not a feature
     to highlight, and reusing the accent for it makes both mean less. */
  --warn: #8a4b1d;
  --warn-soft: #f6ece3;

  --radius: 6px;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-base: #0f1512;
    --surface-raised: #171d19;
    --surface-sunken: #0b100d;
    --text-primary: #e4ebe6;
    --text-secondary: #9daaa3;
    --text-tertiary: #6b786f;
    --stroke: #242c27;
    --stroke-strong: #333d37;
    --accent: #6fbf9a;
    --accent-soft: #15231c;
    /* Lifted off the page rather than sunk into it: on a dark ground a darker
       terminal is invisible, and the terminal is the hero. */
    --term-bg: #1a211d;
    --term-fg: #e4ebe6;
    --term-dim: #84918a;
    --term-mark: #6fbf9a;
    --warn: #d99a63;
    --warn-soft: #241a12;
  }
}

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

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

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

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--text-primary);
  font:
    16px/1.7 ui-serif,
    Georgia,
    "Times New Roman",
    serif;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  text-rendering: optimizeLegibility;
}

/* Inline only. A shorthand here would set the block sides too, and since a
   class outranks a type selector it would silently kill main's own padding. */
.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: 1.5rem;
}

/* ---------- header ---------- */

header.site {
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-base);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site > .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.brand svg {
  display: block;
}

header.site nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.9rem;
}

/* Below the width where five links and the brand share a line, the nav takes a
   line of its own and scrolls rather than wrapping one item onto a third row. */
@media (max-width: 34rem) {
  header.site > .wrap {
    flex-wrap: wrap;
    padding-top: 0.5rem;
    padding-bottom: 0.4rem;
    min-height: 0;
    gap: 0.4rem;
  }

  header.site nav {
    margin-left: 0;
    width: 100%;
    gap: 0.85rem;
    font-size: 0.84rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  header.site nav::-webkit-scrollbar {
    display: none;
  }
}

header.site nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

header.site nav a:hover,
header.site nav a[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ---------- type ---------- */

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

main {
  padding-block: 3rem 5rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 640;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 620;
  margin: 3.5rem 0 0.9rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.02rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.5rem;
}

p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}

.lede {
  font-size: clamp(1.08rem, 2.2vw, 1.22rem);
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  max-width: 34rem;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
  margin: 0 0 0.6rem;
}

ul,
ol {
  padding-left: 1.2rem;
  margin: 0 0 1.1rem;
}

li {
  margin: 0.35rem 0;
}

strong {
  font-weight: 640;
}

/* ---------- the terminal, which is the hero ---------- */

.term {
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: var(--radius);
  border: 1px solid var(--stroke-strong);
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* A terminal line that wraps stops looking like a terminal, so it scrolls
     instead, and shrinks first so that on a phone there is nothing to scroll. */
  white-space: nowrap;
  font-size: clamp(0.72rem, 3vw, 0.875rem);
  line-height: 1.62;
  margin: 0 0 1.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.term .cmd {
  color: var(--term-fg);
  font-weight: 600;
}

.term .cmd::before {
  content: "$ ";
  color: var(--term-dim);
  font-weight: 400;
}

.term .mark {
  color: var(--term-mark);
}

.term .dim {
  color: var(--term-dim);
}

.term .gap {
  display: block;
  height: 0.62rem;
}

/* ---------- code ---------- */

pre {
  background: var(--surface-sunken);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.865rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--surface-sunken);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 0.08em 0.34em;
  white-space: nowrap;
}

/* ---------- tables: the evidence carrier ---------- */

.scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--stroke);
}

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

th {
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--surface-sunken);
  white-space: nowrap;
}

td .yes {
  color: var(--accent);
  font-weight: 620;
}

td .no {
  color: var(--text-tertiary);
}

@media (max-width: 30rem) {
  table {
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 0.5rem 0.6rem;
  }
}

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

blockquote {
  margin: 1.75rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--text-secondary);
  font-size: 1.02rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.note {
  background: var(--accent-soft);
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

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

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

.rows {
  border-top: 1px solid var(--stroke);
  margin: 1.5rem 0 0;
}

.row {
  border-bottom: 1px solid var(--stroke);
  padding: 1.1rem 0;
}

.row h3 {
  margin: 0 0 0.3rem;
}

.row p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 560;
  border: 1px solid var(--stroke-strong);
  color: var(--text-primary);
  background: var(--surface-raised);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--stroke);
  padding: 2.25rem 0 3.5rem;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

footer.site a {
  color: var(--text-secondary);
}

footer.site nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

/* ---------- reading aids ---------- */

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

.skip:focus {
  left: 1rem;
  top: 0.6rem;
  background: var(--surface-raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  z-index: 20;
}

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

/* Where a skill line stands. A frozen line is recessed, because it is still
   the thing you came for; a recalled one is lifted and marked, because it is
   the reason not to. */
.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--stroke-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.notice > :first-child {
  margin-top: 0;
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice h2 {
  font-size: 1rem;
  color: var(--text-primary);
}

div.notice {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  vertical-align: middle;
}

.tag.warn {
  border-color: var(--warn);
  color: var(--warn);
}

.examination {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stroke);
}

.examination h2 {
  font-size: 1.05rem;
}

/* The quoted line is the evidence, so it gets its own line rather than being
   squeezed in beside the sentence that describes it. */
.observations {
  margin: 1rem 0;
  padding-left: 1.1rem;
}

.observations li {
  margin-bottom: 0.75rem;
}

.observations code {
  display: block;
  margin-top: 0.35rem;
  overflow-x: auto;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media print {
  header.site,
  footer.site nav,
  .actions {
    display: none;
  }

  .term {
    background: #fff;
    color: #000;
    border-color: #999;
  }
}
