/* The foam drawer ------------------------------------------------------

   The page is a tool drawer with a two-layer foam insert: a graphite top
   layer over a signal-yellow base that shows only where something is cut
   out. Text lies on the foam; instruments (demos, diagrams, key cards,
   config) lie in pockets cut to their shape. Cuts are flat geometry — a
   hard inner wall, never a gradient. */

/* fonts ---------------------------------------------------------------- */

@font-face {
  font-family: Archivo;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Archivo;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Big Shoulders Stencil (OFL), latin subset: drawer labels, tool names,
   engraved numerals */
@font-face {
  font-family: "Big Shoulders Stencil";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/fonts/big-shoulders-stencil-latin.woff2) format("woff2");
}

/* tokens ------------------------------------------------------------- */

/* graphite foam — the only colourway; the site is dark-only. The tools
   (slabs, cards) and the yellow base sit on it. */
:root {
  --foam: #26282b;
  --foam-wall: #141517;
  --foam-groove: #1b1d1f;
  --foam-lip: #34373b;
  --on-foam: #eceae4;
  --on-foam-soft: #bfbbb2;
  --on-foam-softer: #9c988f;

  --signal: #f2c230;
  --signal-deep: #d9a915;
  --on-signal: #1d1f22;

  --slab: #17191b;
  --on-slab: #e6e3dc;
  --on-slab-soft: #a3a097;

  --card: #efece5;
  --on-card: #1d1f22;
  --on-card-soft: #55575b;
  --card-rule: #d3cfc5;
  --slab-rule: rgba(230, 227, 220, 0.22);

  --focus: var(--signal);
  --link-line: var(--signal);
  --code-on-foam: rgba(0, 0, 0, 0.28);

  --font-label: "Big Shoulders Stencil", "Archivo", system-ui, sans-serif;
  --font-body: Archivo, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --cut: 6px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

/* base --------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--foam);
  color: var(--on-foam);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus { outline: none; }

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

::selection { background: var(--signal); color: var(--on-signal); }

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

h1, h2, h3 { margin: 0; }

strong { font-weight: 650; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 5px 1px 6px;
  border-radius: 4px;
  background: var(--code-on-foam);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.35);
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 2px 7px 3px;
  border-radius: 5px;
  background: var(--slab);
  color: var(--on-slab);
  box-shadow: inset 2px 2px 0 #000;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

/* a key chord never breaks between its keys */
.chord { white-space: nowrap; }

/* a cue to more: a text link with an arrow, under the Signal stroke */
.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 0;
  font-weight: 700;
  text-decoration: underline 2px var(--link-line);
  text-underline-offset: 5px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus-visible { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the cut: a pocket in the foam ----------------------------------------- */

/* The yellow base under a hard inner wall on the top and left edges, as a
   cut through closed-cell foam looks from above. */
.cut {
  position: relative;
  border-radius: var(--cut);
  background: var(--signal);
  box-shadow: inset 5px 5px 0 var(--foam-wall), 0 1px 0 var(--foam-lip);
  display: block;
  padding: 9px 4px 4px 9px;
}

/* a tool lying in its pocket */
.tool {
  display: block;
  position: relative;
  border-radius: 4px;
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}

.tool--slab { background: var(--slab); color: var(--on-slab); }
.tool--card { background: var(--card); color: var(--on-card); }

/* a groove: the line where two foam blocks meet */
.groove {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 2px solid var(--foam-groove);
  border-bottom: 1px solid var(--foam-lip);
}

/* stencilled label */
.label {
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* the tag of origin tied to each tool: a die-cut paper tag with a punched
   eyelet and printed fields */
/* a tag never breaks across lines: a torn tag reads as two scraps. More
   facts than fit take a second tag. */
.tags { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.tag {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag li:first-child::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--foam);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.tag li {
  position: relative;
  padding: 4px 10px;
  background: var(--card);
  color: var(--on-card);
  border-left: 1px dashed var(--card-rule);
}

.tag li:first-child {
  padding-left: 24px;
  border-left: 0;
  border-radius: 3px 0 0 12px;
  font-weight: 750;
}

.tag li:last-child { border-radius: 0 3px 3px 0; }

/* the drawer label strip --------------------------------------------------- */

.strip {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.strip__name {
  font-size: 26px;
  text-decoration: none;
}

.strip__nav {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
}

.strip__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--on-foam-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.strip__link:hover,
.strip__link[aria-current="page"] { color: var(--on-foam); text-decoration: underline 2px var(--link-line); text-underline-offset: 6px; }

.strip__icons { display: flex; gap: 8px; }

/* an icon button is a small square pocket; hovering reveals the base */
.pocket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--cut);
  cursor: pointer;
  color: var(--on-foam);
  background: var(--foam-groove);
  box-shadow: inset 3px 3px 0 var(--foam-wall);
  transition: background 200ms ease, color 200ms ease;
}

.pocket-btn:hover { background: var(--signal); color: var(--on-signal); }

.pocket-btn svg { width: 19px; height: 19px; }


/* layout ------------------------------------------------------------------ */

.drawer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) 16px;
}

/* home: the opening and the insert ------------------------------------------- */

.open {
  padding: 40px 0 72px;
}

.open__title {
  font-family: var(--font-label);
  font-weight: 800;
  font-size: clamp(48px, 7.4vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.open__lead {
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--on-foam-soft);
  max-width: 44ch;
}

.insert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px 28px;
  padding-bottom: 80px;
}

.insert__head {
  grid-column: 1 / -1;
  margin-bottom: -28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--on-foam-softer);
}

/* a slot is one tool's place in the insert: its label, what it is, and
   its pocket; the whole slot is the link */
.slot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

/* side by side, the two slots share rows: names, descriptions and pockets
   each start on one line, however long the description */
.slot:not(.slot--wide) {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 14px;
}

.slot > .cut { display: flex; flex-direction: column; }
.slot > .cut > .tool { flex: 1; }

/* Nomos gets the full width: what it is on the left, the ring on the right */
.slot--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 20px 48px;
}

.slot__side { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.slot--wide > .cut { align-self: start; }

/* what the ring can do, taken from the Nomos page; the cue sits on the
   pocket's bottom edge */
.slot__facts {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--on-foam-soft);
}

.slot__facts li { padding: 9px 0; border-top: 2px solid var(--foam-groove); }

.slot .more { margin-top: auto; }

.slot__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.slot__name { font-size: 40px; }

.slot__desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--on-foam-soft);
  max-width: 52ch;
}

a.slot:hover .tool,
a.slot:focus-visible .tool {
  transform: translate(-3px, -8px);
  box-shadow: 0 16px 22px rgba(0, 0, 0, 0.32);
}

a.slot:hover .slot__name { text-decoration: underline 3px var(--link-line); text-underline-offset: 7px; }

.slot:focus-visible { outline-offset: 8px; }

/* home: writing ---------------------------------------------------------------- */

.posts { display: flex; flex-direction: column; }

.post {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 0 24px;
  border-bottom: 2px solid var(--foam-groove);
  text-decoration: none;
  color: inherit;
}

.post:first-child { padding-top: 4px; }

.post__title {
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.post:hover .post__title { text-decoration: underline 2px var(--link-line); text-underline-offset: 5px; }

.post__dek { font-size: 16px; line-height: 1.55; color: var(--on-foam-soft); max-width: 62ch; }

.posts .more { margin-top: 20px; }

/* the writing page lists nothing after its last post */
.posts > .post:last-child { border-bottom: 0; }

/* the bottom of the drawer ----------------------------------------------------------- */

.foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.foot::before {
  content: "";
  flex-basis: 100%;
  border-top: 2px solid var(--foam-groove);
  box-shadow: 0 1px 0 var(--foam-lip);
  margin-bottom: 12px;
}

.foot__name { font-size: 22px; color: var(--on-foam-soft); }

.foot__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }

.foot__links a {
  padding: 8px 0;
  font-weight: 600;
  color: var(--on-foam-soft);
  text-decoration: none;
}

.foot__links a:hover { color: var(--on-foam); text-decoration: underline 2px var(--link-line); text-underline-offset: 5px; }

/* the Nomos instrument: the ring --------------------------------------------- */

.ring { padding: 18px 20px 14px; }

.screen, .zone, .win { display: block; }

/* two monitors side by side, in the proportions of the diagram on the
   Nomos page: 352 + 28 + 111 by 198 */
.desk {
  display: block;
  position: relative;
  aspect-ratio: 491 / 198;
  contain: layout;
}

.screen {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  border: 1.5px solid rgba(230, 227, 220, 0.34);
}

.screen--land { left: 0; width: 71.69%; }
.screen--port { left: 77.39%; width: 22.61%; }

.zone {
  position: absolute;
  border: 1px dashed var(--slab-rule);
}

.zone__n {
  position: absolute;
  z-index: 2;
  left: 8px;
  top: 6px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 26px);
  line-height: 1;
  color: var(--on-slab-soft);
  transition: color 200ms ease;
}

.zone[data-n="1"] { left: 0;       top: 0;   width: 23.9%;  height: 100%; }
.zone[data-n="2"] { left: 23.9%;   top: 0;   width: 23.9%;  height: 100%; }
.zone[data-n="3"] { left: 47.8%;   top: 0;   width: 23.89%; height: 100%; }
.zone[data-n="4"] { left: 77.39%;  top: 0;   width: 22.61%; height: 50%; }
.zone[data-n="5"] { left: 77.39%;  top: 50%; width: 22.61%; height: 50%; }

/* the one window, taking the shape of each zone it lands in */
.win {
  position: absolute;
  z-index: 1;
  border-radius: 3px;
  background: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  transition: left 420ms var(--ease-out), top 420ms var(--ease-out),
              width 420ms var(--ease-out), height 420ms var(--ease-out);
}

.win::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  border-radius: 3px 3px 0 0;
  background: rgba(29, 31, 34, 0.18);
}

.win__title {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.desk[data-at="1"] .win { left: 0.6%;   top: 1.5%;  width: 22.7%; height: 97%; }
.desk[data-at="2"] .win { left: 24.5%;  top: 1.5%;  width: 22.7%; height: 97%; }
.desk[data-at="3"] .win { left: 48.4%;  top: 1.5%;  width: 22.7%; height: 97%; }
.desk[data-at="4"] .win { left: 78%;    top: 1.5%;  width: 21.4%; height: 47%; }
.desk[data-at="5"] .win { left: 78%;    top: 51.5%; width: 21.4%; height: 47%; }

.desk[data-at="1"] .zone[data-n="1"] .zone__n,
.desk[data-at="2"] .zone[data-n="2"] .zone__n,
.desk[data-at="3"] .zone[data-n="3"] .zone__n,
.desk[data-at="4"] .zone[data-n="4"] .zone__n,
.desk[data-at="5"] .zone[data-n="5"] .zone__n { color: var(--on-signal); }

.ring__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--on-slab-soft);
}

.ring__press { color: var(--on-slab); }

/* pgtop instrument: a terminal pane --------------------------------------------- */

.term {
  padding: 12px 14px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow: hidden;
}

.term__tabs { display: flex; gap: 14px; margin-bottom: 8px; color: var(--on-slab-soft); white-space: nowrap; }
.term__tabs b { color: var(--on-signal); background: var(--signal); padding: 0 5px; font-weight: 700; }

.term table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.term th { text-align: left; font-weight: 700; color: var(--on-slab-soft); padding-right: 12px; }
.term td { padding-right: 12px; }
.term tr.hot td { color: var(--signal); }
.term td:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 100%; }

/* the pgtop page: the whole pane — the connection bar, the header's
   sparklines, the tabs over a fuller activity table and the keys along the
   foot; larger than the home slot. The nidaba page's picker takes the same
   size and foot. */
.term--pane, .term--pick { padding: 16px 18px 14px; font-size: 13px; }
.term__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; color: var(--on-slab-soft); white-space: nowrap; }
.term__bar b, :is(.term--pane, .term--pick) .tool__foot b { color: var(--on-slab); font-weight: 700; }
.term__stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 14px;
  margin: 10px 0 12px;
  padding: 8px 0;
  border-block: 1px dashed var(--slab-rule);
}
.term__stats dt { color: var(--on-slab-soft); }
.term__stats dd { margin: 0; overflow: hidden; white-space: nowrap; }
.term__stats dd:not(.term__spark) { text-align: right; }
/* a sparkline: sixty one-second bars, stretched to the pane's width */
.term__spark { align-self: center; }
/* .tool prefix: beats the generic `.tool svg` sizing further down */
.tool .term__spark svg { height: 16px; fill: var(--on-slab-soft); }
:is(.term--pane, .term--pick, .conf--pane) .tool__foot { flex-wrap: wrap; margin-top: 12px; color: var(--on-slab-soft); }

/* the nidaba page: the connect picker — a search line over the hosts that
   match it, the selection a Signal band; at the pane's size */
.term__search {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  padding: 0 0 8px 0.5ch;
  border-bottom: 1px dashed var(--slab-rule);
  white-space: pre;
}
.term__search > span:first-child { color: var(--on-slab-soft); }
.term--pick td:first-child { padding-left: 0.5ch; }
.term--pick td:last-child { color: var(--on-slab-soft); }
/* each cell's 1px spill covers the seam its fractional width leaves */
.term--pick tr.sel td { background: var(--signal); color: var(--on-signal); }
.term--pick tr.sel td:not(:last-child) { box-shadow: 1px 0 0 var(--signal); }

/* nidaba instrument: the ssh config it writes ------------------------------------ */

.conf {
  padding: 12px 14px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

/* the nidaba page: the same files as the head instrument, at the pgtop
   pane's size; its foot shares the pane's rule above */
.conf--pane { padding: 16px 18px 14px; font-size: 13px; }

.conf__file {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 16px;
  margin-top: 10px;
  color: var(--on-slab-soft);
  font-weight: 700;
}

.conf__file:first-child { margin-top: 0; }

.conf__sync { font-weight: 400; transition: color 320ms var(--ease-out); }

.conf__ln {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

.conf__ln--ours { color: var(--signal); }

/* the synced block: its lines keep their space, so the pocket never resizes */
.conf__new {
  display: block;
  background: var(--signal);
  color: var(--on-signal);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}

.conf[data-step="0"] .conf__new { opacity: 0; transform: translateX(-8px); }
.conf[data-step="0"] .conf__sync { color: transparent; }

.conf__prompt { display: block; margin-top: 10px; white-space: pre; }

/* a solid terminal caret: the config pane's prompt and the picker's search */
.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--on-slab);
}

/* auditrum instrument: one audit event -------------------------------------------- */

.event {
  padding: 12px 14px 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

.event__row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--font-mono); }
.event__op { background: var(--on-slab); color: var(--slab); padding: 0 6px; font-weight: 700; }
.event__why { display: block; margin: 8px 0; font-size: 14px; font-weight: 600; }
.event__diff { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; font-family: var(--font-mono); font-size: 12px; }
.event__diff dt { color: var(--on-slab-soft); }
.event__diff dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event__diff del { text-decoration: line-through; color: var(--on-slab-soft); }
.event__diff ins { text-decoration: none; background: var(--signal); color: var(--on-signal); padding: 0 3px; }

/* the auditrum page: a row's trail of events, as blame reads it back —
   larger than the home slot, one dashed rule between events */
.event--trail { padding: 16px 18px 14px; font-size: 14px; }
.event--trail .event__diff { font-size: 13.5px; }
.event--trail .event__row + .event__diff { margin-top: 6px; }
.event--trail .event__why { font-size: 15px; }
.event--trail .tool__foot { flex-wrap: wrap; white-space: nowrap; margin-top: 14px; font-family: var(--font-mono); font-size: 12.5px; color: var(--on-slab-soft); }
.event--trail .sample { font-family: var(--font-body); }
.event__item + .event__item { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--slab-rule); }
.event__time { color: var(--on-slab-soft); }

.sample {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-slab-soft);
}

.tool--card .sample { color: var(--on-card-soft); }

.tool__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* project page -------------------------------------------------------------- */

.phead {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 48px;
  padding: 24px 0 56px;
  align-items: start;
}

.phead__text { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }

.phead__title { font-size: clamp(72px, var(--name-fluid, 9vw), var(--name-max, 132px)); line-height: 0.82; font-weight: 800; }

/* a name too wide for the head column at that size: "auditrum" is eight
   stencilled capitals, about 4.1 times the font size */
.phead__title--long { --name-fluid: 7.6vw; --name-max: 108px; }

.phead__lead { font-size: 18px; line-height: 1.55; color: var(--on-foam-soft); max-width: 42ch; }

.phead__get { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

.phead__meta { font-size: 13.5px; color: var(--on-foam-softer); }

/* the pull: the one yellow action on a page, cut into the foam like every
   instrument — flat base under the hard wall */
.pull {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 3px 24px 0 23px;
  border-radius: var(--cut);
  background: var(--signal);
  color: var(--on-signal);
  box-shadow: inset 5px 5px 0 var(--foam-wall), 0 1px 0 var(--foam-lip);
  font-family: var(--font-body);
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: background 160ms ease;
}

.pull:hover { background: var(--signal-deep); }
.pull svg { width: 20px; height: 20px; }

/* a section of text lying on the foam */
.part {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 20px 48px;
  padding: 56px 0;
}

/* foam blocks meet at a groove */
.part { border-top: 2px solid var(--foam-groove); box-shadow: inset 0 1px 0 var(--foam-lip); }

/* the first child of a part is its head: topic label and title */
.part > :first-child,
.sec__split > :first-child:has(> .part__title),
.part__head { display: flex; flex-direction: column; gap: 12px; align-self: start; }

/* a stacked part keeps the same two columns: its first split carries the
   head, and everything after it lies in the body column */
.part--stack > * { grid-column: 2; min-width: 0; }

.part--stack > .sec__split,
.sec__split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: 20px 48px;
  align-items: start;
}

.part--stack > .sec__split > * { min-width: 0; }

.part--stack > * + * { margin-top: 8px; }

/* a sub-head lying straight in a stacked part belongs to the pocket under it */
.part--stack > .sub { margin-top: 20px; }
.part--stack > .sub + * { margin-top: -12px; }

.part--stack > div:not(.cut):not(.pair):not(.sec__split),
.part--stack > p { max-width: 68ch; }

.part__body > .prose + .prose,
.sec__split > div > .prose + .prose,
.pair > div > .prose + .prose,
.part--stack > div > .prose + .prose { margin-top: 12px; }

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

.part__topic {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--on-foam-softer);
}

.part__title,
.essay__body h2 {
  font-family: var(--font-body);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.part__title--small,
.essay__body h2 { font-size: clamp(22px, 2.2vw, 28px); }

.part__body { display: flex; flex-direction: column; gap: 20px; max-width: 70ch; }

/* a part whose instrument needs the full width of the drawer */
.part__full { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 22px; }

.prose { font-size: 17px; line-height: 1.65; color: var(--on-foam-soft); }
.prose--lead { font-size: 19px; line-height: 1.6; color: var(--on-foam); }
.prose strong, .prose em { color: var(--on-foam); }

.aside-note { font-size: 15px; line-height: 1.6; color: var(--on-foam-softer); }

.link,
.essay__body a:not([class]) { text-decoration: underline 2px var(--link-line); text-underline-offset: 4px; font-weight: 600; color: var(--on-foam); }

.sub,
.essay__body h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--on-foam);
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px 40px;
}


/* figures, code and key cards sit in pockets */
.fig .tool { padding: 16px; }

figure.tool { margin: 0; }

/* diagram colours: the SVGs read these names */
.tool--slab {
  --zone: rgba(230, 227, 220, 0.06);
  --zone-line: rgba(230, 227, 220, 0.36);
  --color-accent: var(--signal);
  --accent-ink: var(--signal);
  --ink-softer: var(--on-slab-soft);
  --chip-ink: var(--on-signal);
}

.tool svg { display: block; width: 100%; height: auto; }

.tool pre {
  margin: 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}

.tool pre code { background: none; padding: 0; font-size: inherit; box-shadow: none; }

/* the key card: a laminated reference card lying in its pocket */
.keys { width: 100%; border-collapse: collapse; text-align: left; }

.keys th, .keys td { padding: 11px 10px; border-top: 1px solid var(--card-rule); vertical-align: middle; }

.keys thead th {
  padding-top: 4px;
  border-top: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-card-soft);
}

.keys tbody td:first-child { width: 36%; }
.keys tbody td:last-child { font-size: 15px; line-height: 1.5; }
.keys .plus { color: var(--on-card-soft); padding: 0 2px; }

/* code printed on the card: the foam's code tint reads as a smudge on
   laminate, so it is plain monospace ink; the command column is bold */
.keys code { padding: 0; background: none; box-shadow: none; }
.keys td:first-child code { font-weight: 600; }

/* engraved numerals for ordered facts */
.reqs { margin: 0; padding: 0; list-style: none; counter-reset: req; display: flex; flex-direction: column; }

.reqs li {
  counter-increment: req;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 2px solid var(--foam-groove);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--on-foam-soft);
}

.reqs li strong { color: var(--on-foam); }

.reqs li::before {
  content: counter(req);
  font-family: var(--font-label);
  font-weight: 800;
  font-size: 30px;
  line-height: 0.9;
  color: var(--on-foam-softer);
}

/* writing: the blog index and posts ------------------------------------------ */

/* the head of a writing page: the index's stencilled name, or a post's
   title, tag of origin, dek and meta */
.writing__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 0 56px;
}

/* a post title is a claim, so it is Archivo, not stencil */
.writing__title {
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 22ch;
}

.writing__dek { font-size: 19px; line-height: 1.6; color: var(--on-foam-soft); max-width: 56ch; }

.writing__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; color: var(--on-foam-softer); }

/* a post is a part: contents in the head column, the reading column in
   the body column. The contents stay in view while you read. */
.essay__side { position: sticky; top: 24px; }

.toc { display: flex; flex-direction: column; margin-bottom: 16px; }

.toc a {
  padding: 9px 0;
  border-top: 2px solid var(--foam-groove);
  font-size: 15px;
  line-height: 1.4;
  color: var(--on-foam-soft);
  text-decoration: none;
}

.toc a:hover { color: var(--on-foam); text-decoration: underline 2px var(--link-line); text-underline-offset: 5px; }

/* the reading column: text on the foam at a long-form measure; the cover
   and every other pocket keep to the same measure */
.essay__body {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--on-foam-soft);
}

.essay__body > * { margin: 0; }
.essay__body > * + * { margin-top: 20px; }

/* pockets get more room than paragraphs, except straight under a heading */
.essay__body > * + .cut, .essay__body > * + figure, .essay__body > .cut + :not(h2, h3) { margin-top: 28px; }

.essay__body h2 { margin-top: 52px; color: var(--on-foam); }
.essay__body h3 { margin-top: 36px; }

.essay__body h2 + *, .essay__body h3 + *,
.essay__body > h2 + .cut, .essay__body > h3 + .cut { margin-top: 14px; }

.essay__body strong { color: var(--on-foam); }

.essay__body ul { padding-left: 1.3em; }
.essay__body ul li + li { margin-top: 8px; }
.essay__body ul li::marker { color: var(--on-foam-softer); }

/* engraved numerals in their own column. A post's steps are running text
   with inline strong and links, so the numeral is positioned rather than a
   grid cell, which would split the text into separate cells. */
.essay__body .reqs li { display: block; position: relative; padding-left: 54px; font-size: 17px; line-height: 1.65; }
.essay__body .reqs li::before { position: absolute; left: 0; top: 18px; }

/* a quotation is set off by a narrow groove cut into the foam */
.essay__body blockquote {
  padding: 2px 0 2px 22px;
  box-shadow: inset 3px 0 0 var(--foam-wall), inset 4px 0 0 var(--foam-lip);
  font-size: 18px;
  font-weight: 500;
  color: var(--on-foam);
}

.essay__body figure { display: flex; flex-direction: column; gap: 12px; }

.essay__body figcaption { font-size: 15px; line-height: 1.55; color: var(--on-foam-softer); }

/* a comparison card: a key card whose rows hold one value per tool */
.keys--compare tbody th { width: 31%; padding-right: 16px; font-size: 15px; font-weight: 650; line-height: 1.4; }
.keys--compare tbody td { font-size: 15px; line-height: 1.5; color: var(--on-card-soft); }

/* responsive ------------------------------------------------------------------ */

@media (max-width: 960px) {
  .phead, .part, .slot--wide { grid-template-columns: minmax(0, 1fr); }
  .open { padding: 16px 0 48px; }
  .part--stack > * { grid-column: 1; }
  .part { padding: 44px 0; }
  /* a post reads from the top: the contents shrink to a short run of
     links above the text, and the note on the tool moves below it */
  .part--essay > .essay__side { display: contents; }
  .part--essay .toc { flex-direction: row; flex-wrap: wrap; gap: 0 18px; margin-bottom: 0; }
  .part--essay { padding-top: 28px; row-gap: 14px; }
  .part--essay .toc a { padding: 4px 0; border-top: 0; font-size: 14.5px; }
  .writing__head { padding-bottom: 36px; }
  .essay__side > .aside-note, .essay__side > .more { order: 1; }
  .essay__side > .aside-note { margin-top: 20px; }
}

@media (max-width: 640px) {
  .tag { font-size: 12px; }
  .tag li { padding: 4px 7px; }
  .tag li:first-child { padding-left: 21px; }
  .tag li:first-child::before { left: 7px; }
  .insert { grid-template-columns: minmax(0, 1fr); }
  .slot__name { font-size: 32px; }
  .insert { gap: 44px; }
  .insert__head { margin-bottom: -20px; }
  .strip__name { font-size: 22px; }
  /* the trail keeps the home slot's sizes so an event's head stays one line */
  .event--trail { padding: 12px 14px 14px; font-size: 12.5px; }
  .event--trail .event__row { column-gap: 8px; }
  .event--trail .event__diff { font-size: 12px; }
  .event--trail .event__why { font-size: 14px; }
  .event--trail .tool__foot { font-size: 12px; }
  /* the pane keeps the home slot's sizes and drops the user and wait
     columns, so the query still has room */
  .term--pane, .term--pick, .conf--pane { padding: 12px 14px 14px; font-size: 12px; }
  .term--pane :is(th, td):is(:nth-child(2), :nth-child(4)) { display: none; }
  .keys, .keys tbody, .keys tr, .keys td { display: block; }
  .keys thead { display: none; }
  .keys tbody tr { border-top: 1px solid var(--card-rule); padding: 10px 0; }
  .keys tbody td { border-top: 0; padding: 2px 0; width: auto; }
  .keys tbody td:first-child { width: auto; }
  .writing__dek { font-size: 18px; }
  /* the column heads are hidden here, so each value carries its tool's
     name; positioned rather than grid so inline keycaps keep flowing */
  .keys--compare tbody th { display: block; width: auto; padding: 0 0 6px; border-top: 0; }
  .keys--compare tbody td { position: relative; padding: 2px 0 2px 92px; }
  .keys--compare tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 13px;
    font-weight: 600;
    color: var(--on-card-soft);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool, .win, .pull, .conf__new, .conf__sync { transition: none; }
}
