/* Design J — COMPUTATION PAD, the site's one design (built 5 Oct 2026 to the
   restarted visual guide, chosen by Hannu 10 Oct 2026; VISUAL.md)
   The page is an engineer's squared computation pad: pale green, ruled at the
   reading line's pitch, so the text sits on the pad's lines. The grid is the
   reference that makes the one bold element measurable.

   That element is the navigation, drawn as a stack of printed layers. The page
   you are on is the layer where the print failed: it and every layer above it
   sit half a grid square to the right. On the home page only the top layer, the
   name, has slipped. Half a square, never a whole one: a shift by exactly one
   period of the grid vanishes into it.

   Everything else is quiet. Charis SIL for reading (from Charter, a face drawn
   for coarse laser printers), Atkinson Hyperlegible Next for the interface (it
   tells l, I and 1 apart, which matters on a site full of commands), its mono
   for code only. Graphite text, ballpoint-blue links, correction red only on
   notices. No uppercase labels, no dots between facts, no arrows on links. */

:root {
  --pad: #E3EADF;
  --grid: #C8D8C6;
  --graphite: #252B27;    /* 11.8:1 on pad */
  --ballpoint: #1E3F9C;   /* 7.6:1 on pad; links are also underlined */
  --correction: #AE2A20;  /* 5.4:1 on pad */

  --cell: 1.75rem;        /* one grid square = one line of body text */
  --slip: calc(var(--cell) / 2);
  --round: 0.3rem;        /* an extruded line is never square: every printed edge gets this; the grid stays sharp */

  --page-bg: var(--pad);
  --page-fg: var(--graphite);
  --link: var(--ballpoint);
  --plate: var(--ballpoint);   /* base.css uses it for hover and focus */
  --muted: color-mix(in srgb, var(--graphite) 70%, var(--pad));
  --muted-strong: color-mix(in srgb, var(--graphite) 84%, var(--pad));
  --rule: var(--graphite);
  --rule-faint: var(--grid);
  --code-bg: color-mix(in srgb, var(--graphite) 7%, var(--pad));
  --layer: color-mix(in srgb, var(--graphite) 10%, var(--pad));

  --measure: 36rem;
  --wide: 64rem;
  --rail: 13rem;

  --font-display: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;
  --font-body: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;
  --font-ui: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;

  --body-size: 1.125rem;
  --body-leading: var(--cell);

  --hero-size: clamp(2rem, 4.4vw, 3rem);
  --hero-weight: 700;
  --hero-leading: 1.17;
  --hero-tracking: -0.01em;
  --title-size: clamp(1.9rem, 4vw, 2.6rem);
  --list-size: 1.3125rem;
  --list-weight: 700;
}

/* dark ink on the pad reads thinner than light ink on the dark pad, so light mode sets text one weight up */
@media (prefers-color-scheme: light) {
  body { font-weight: 500; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --pad: #141C18;
    --grid: #26352D;
    --graphite: #D8E2D9;
    --ballpoint: #A3B8F2;
    --correction: #F0968B;
  }
}

body {
  background-color: var(--pad);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  overflow-x: clip;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

/* page titles print with a layer shift in their own ink (VISUAL.md; About promises headings that look slightly
   misprinted): the real text is invisible but still selectable and read aloud; ::before prints it below the fault,
   ::after above it, slipped right. The fault is measured down from the top, so it crosses the first line only. */
[data-echo]::after { content: none; }
h1[data-echo] { --offset: 0.05em; --break-at: 0.55em; color: transparent; }
h1[data-echo]::before,
h1[data-echo]::after {
  content: attr(data-echo);
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  color: var(--graphite);
  mix-blend-mode: normal;
  pointer-events: none;
}
h1[data-echo]::before { clip-path: inset(var(--break-at) 0 0 0); }
h1[data-echo]::after {
  clip-path: inset(0 0 calc(100% - var(--break-at)) 0);
  transform: translateX(var(--offset));
}

/* base.css joins facts with " · " and appends " →"; this pad does neither */
.sep, .postlist__dot { font-size: 0; padding: 0; opacity: 1; }
.sep::before, .postlist__dot::before { content: ", "; font-size: var(--meta-size, 0.9rem); }
.arr { display: none; }

a { text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ballpoint); outline-offset: 2px; border-radius: var(--round); }

/* ---- the rail: the site as a stack of layers ------------------------------ */

@media (min-width: 64rem) {
  body {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, calc(var(--wide) - var(--rail)));
    grid-template-rows: auto 1fr;
    column-gap: calc(var(--cell) * 2);
    justify-content: center;
    padding-inline: var(--gutter);
  }
  .masthead {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: 0;
    padding: calc(var(--cell) * 2) 0 0;
    margin: 0;
  }
  .sheet, .colophon { grid-column: 2; max-width: none; margin: 0; padding-inline: 0; }
  .sheet { grid-row: 1; }
  .colophon { grid-row: 2; }
}

.masthead { display: flex; flex-direction: column; }
.wordmark { order: 1; }
.masthead__nav { order: 2; }
.masthead__recent { order: 3; }
.masthead__tagline { order: 4; }

/* the avatar (VISUAL.md) prints as the first square of the name layer */
.wordmark img {
  display: block;
  flex: none;
  width: var(--cell);
  height: var(--cell);
  border-radius: var(--round);
}

/* every layer: one grid square tall, the same width, touching but distinct */
.wordmark,
.masthead__nav a {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--cell);
  width: 100%;
  margin-bottom: 2px;
  padding: 0 0.6rem;
  border-radius: var(--round);
  background: var(--layer);
  color: var(--graphite);
  font-family: var(--font-ui);
  text-decoration: none;
}
.wordmark__text {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}
.wordmark { gap: 0.5rem; padding-left: 0; }

.masthead__nav {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.masthead__nav a:hover,
.wordmark:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

/* the failed layer is the page you are on; every layer printed after it slipped too */
.masthead__nav a[aria-current],
.kind-home .wordmark {
  background: var(--graphite);
  color: var(--pad);
  font-weight: 700;
  text-decoration: none;
}
.masthead__nav a[aria-current],
.masthead__nav a:has(~ a[aria-current]),
.masthead:has(.masthead__nav a[aria-current]) .wordmark,
.kind-home .wordmark {
  transform: translateX(var(--slip));
}

/* the newest posts: plain titles under the layers, wrapping, the open one marked by weight */
.masthead__recent {
  margin: calc(var(--cell) / 2) 0 0;
  padding: 0 0.6rem;
  max-width: 13rem;
  list-style: none;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.35;
}
.masthead__recent li + li { margin-top: 0.5rem; }
.masthead__recent a { color: var(--muted-strong); text-decoration: none; }
.masthead__recent a:hover { text-decoration: underline; }
.masthead__recent a[aria-current] { color: var(--graphite); font-weight: 700; }

.masthead__tagline {
  margin: var(--cell) 0 0;
  max-width: 13rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--muted-strong);
}

@media (max-width: 63.99rem) {
  /* the same box as .sheet below it, gutters included, so the layers end where the text and the hero end */
  .masthead { padding-top: var(--cell); max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; }
  .masthead__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2px; }
  /* in two columns "above" means nothing; only the page itself slips */
  .masthead__nav a:has(~ a[aria-current]),
  .masthead:has(.masthead__nav a[aria-current]) .wordmark { transform: none; }
  .masthead__nav a[aria-current] { transform: translateX(calc(var(--slip) / 2)); }
  .masthead__tagline { max-width: none; }
  .masthead__recent { display: none; }
  .sheet { max-width: calc(var(--measure) + 2 * var(--gutter)); }
  .colophon { max-width: calc(var(--measure) + 2 * var(--gutter)); }
}

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

.hero { padding: calc(var(--cell) * 2) 0 var(--cell); }
.hero__eyebrow { display: none; }
.hero__line { max-width: 20ch; text-wrap: balance; }
.hero__body { font-size: 1.125rem; margin-top: var(--cell); }

.index { padding-bottom: calc(var(--cell) * 2); }
.index__heading, .index__eyebrow, .track__levelname {
  margin: 0 0 var(--cell);
  padding: 0;
  border: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--graphite);
}
.index__intro { margin: calc(var(--cell) * -0.75) 0 var(--cell); color: var(--muted-strong); }
.index__eyebrow { margin-top: calc(var(--cell) * 2); }
h1.index__heading {
  margin-top: calc(var(--cell) * 2);
  font-family: var(--font-display);
  font-size: var(--title-size);
  line-height: 1.17;
}
h1.index__heading + .index__intro { margin-top: 0; }
.index__more { font-family: var(--font-ui); font-size: 0.95rem; letter-spacing: 0; }
.index__title { letter-spacing: -0.01em; }

.postlist__item { max-width: var(--measure); padding: 0 0 var(--cell); border: 0; }
.postlist__title { letter-spacing: 0; line-height: 1.33; }
.postlist__item a:hover .postlist__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.postlist__dek { margin-top: 0.25rem; }

.item__kicker, .postlist__meta, .post__kicker, .ticket, .serieslist__count,
.projectlist__state, .arc__head, .pager__dir, .plate figcaption, .colophon {
  --meta-size: 0.9rem;
  font-family: var(--font-ui);
  font-size: var(--meta-size);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.item__kicker { margin-bottom: 0.15rem; }
.postlist__meta { margin-top: 0.2rem; }
.item__label { color: var(--correction); }

/* the start path is a sequence, so its place is the number */
.front__start .postlist--guides { counter-reset: step; }
.front__start .item { position: relative; padding-left: calc(var(--cell) * 1.5); }
.front__start .item__kicker { display: none; }
.front__start .item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-ui);
  font-size: var(--list-size);
  font-weight: 800;
  line-height: 1.33;
  color: var(--muted);
}

.serieslist__item, .projectlist__item { border: 0; padding: 0 0 calc(var(--cell) / 2); }
.serieslist__name { font-weight: 700; }
.projectlist__name { font-family: var(--font-mono); font-weight: 600; }

/* ---- post ------------------------------------------------------------------ */

.post { padding-top: calc(var(--cell) * 2); }
.post__kicker { margin-bottom: calc(var(--cell) / 2); }
.post__title { letter-spacing: -0.01em; line-height: 1.17; text-wrap: balance; }
.post__dek { font-size: 1.25rem; line-height: 1.4; margin-top: calc(var(--cell) / 2); }

.ticket { gap: 0.2rem 1.4rem; margin-top: var(--cell); }
.ticket dt { text-transform: none; letter-spacing: 0; }
.ticket dt::after { content: ":"; }
.ticket dd { color: var(--graphite); }

.notice {
  border-left: 3px solid var(--correction);
  border-radius: var(--round);
  background: color-mix(in srgb, var(--correction) 7%, var(--pad));
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
}
.notice__name {
  font-family: var(--font-ui);
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: var(--correction);
}

.prose { margin-top: calc(var(--cell) * 1.5); hyphens: auto; }
/* a post's text runs as wide as its hero (Hannu, 2026-10-11: narrower "looks stupid") */
.post .prose, .post .sources, .post .changes, .post .post__foot, .post .arc, .post .pager { max-width: none; }
/* one right edge for the whole post: the title block runs as wide as the hero and the text (Hannu, 2026-10-11) */
.post .post__head, .post .post__title, .post .post__dek { max-width: none; }
.prose > * + * { margin-top: var(--cell); }
.prose p, .prose li { text-wrap: pretty; }
.prose h2 { margin-top: calc(var(--cell) * 2); font-size: 1.5rem; letter-spacing: 0; line-height: var(--cell); }
.prose h3 { font-family: var(--font-ui); font-size: 1.1rem; font-weight: 700; }
.prose strong { font-weight: 700; }
.prose code { font-size: 0.86em; background: var(--code-bg); border-radius: calc(var(--round) / 2); }
.prose pre {
  font-size: 0.86rem;
  line-height: var(--cell);
  border-left: 0;
  border-radius: var(--round);
  padding: 0 calc(var(--cell) / 2);
  background: var(--code-bg);
}
.prose blockquote { border-left: 2px solid var(--graphite); }
.prose th { font-family: var(--font-ui); font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: var(--graphite); }
.prose th, .prose td { border-bottom-color: var(--grid); }

.arc, .pager { border-top: 0; margin-top: calc(var(--cell) * 2); }
.arc__head { color: var(--graphite); font-weight: 700; }
.pager__title { font-weight: 700; }

.post__foot { font-family: var(--font-ui); font-size: 0.95rem; }

/* the sources after the text and the change log above the footer: short lists, set like the arc */
.sources, .changes { max-width: var(--measure); margin-top: 3rem; font-family: var(--font-ui); font-size: 0.95rem; }
.sources__head, .changes__head { margin: 0 0 0.6rem; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; color: var(--graphite); }
.sources__list, .changes__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.changes__list time { color: var(--muted); }
.post__rule, .colophon__rule { height: 2px; background: var(--graphite); border-radius: 1px; }

.colophon { padding-bottom: calc(var(--cell) * 3); }

/* ---- the cat on generic pages (VISUAL.md, The cats) -------------------------- */

/* narrow: the last thing on the sheet; wide: beside the title, in a column of its own */
.cat { margin: 0 0 calc(var(--cell) * 2); width: min(100%, 20rem); }
.cat img, .plate img { border: 1px solid var(--grid); border-radius: var(--round); }

@media (min-width: 75rem) {
  .sheet:has(> .cat) { position: relative; padding-right: 15rem; min-height: calc(var(--cell) * 3 + 13rem); }
  .cat { position: absolute; top: calc(var(--cell) * 2); right: 0; width: 13rem; margin: 0; }
}

/* a post's cat when the hero is not one: floated right in the text (layouts/_shortcodes/float.html) */
.float { float: right; width: min(45%, 16rem); margin: 0.3rem 0 var(--cell) var(--cell); }
.float ~ h2 { clear: both; }
.float img { border: 1px solid var(--grid); border-radius: var(--round); }

/* every picture prints with a layer shift (layouts/_partials/slip.html, VISUAL.md): above the fault the print
   slipped right, leaving a sliver of pad on the left; the image files are untouched */
.slip {
  --fault: 38%;                  /* chosen default: down from the top */
  /* a share of the picture's own shown width, so every picture slips alike whatever its size: 0.375% is the 3 px
     Hannu approved on the 800 px desktop hero (2026-10-11); a small cat stays at 1 px, never vanishing */
  --slip-img: max(0.375%, 1px);
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}
.slip > img { display: block; clip-path: inset(var(--fault) 0 0 0); }
.slip > .slip__top {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 calc(100% - var(--fault)) 0);
  transform: translateX(var(--slip-img));
}
