/* sultaan.io - "Lab notebook" theme.
   Day: a cool engineering graph pad with a red margin rule and blue ink.
   Night: a blueprint sheet with cyan lines and coral margin marks.
   Monospace headings, system sans body, no external fonts, no images. */

@layer reset, tokens, base, layout, components, print;

/* ------------------------------------------------------------------ reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul, pre { margin: 0; }
  ol, ul { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  table { border-collapse: collapse; }
  button, input, select, textarea { font: inherit; }
}

/* ----------------------------------------------------------------- tokens */
@layer tokens {
  :root {
    color-scheme: light dark;

    --paper: #f5f8fb;
    --paper-2: #eaf0f6;
    --paper-3: #dde6ef;
    --ink: #14213a;
    --ink-2: #44506a;
    --grid: rgb(59 110 180 / .10);
    --grid-strong: rgb(59 110 180 / .18);
    --margin: #d0362a;
    --margin-text: #b02a1f;
    --accent: #1d4ed8;
    --accent-hover: #1239a8;
    --hl: #fff1a6;
    --code-bg: #e9eef5;
    --edge: #c3cfdd;
    --rust: #9a4a12;
    --ok: #17673a;
    --warn: #8a5600;
    --bar: #2f5fc4;
    --bar-soft: #9db6e6;

    --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

    /* Minor-third scale, fluid only at the top */
    --step--1: .8125rem;
    --step-0: 1rem;
    --step-1: 1.2rem;
    --step-2: 1.44rem;
    --step-3: clamp(1.6rem, 1.3rem + 1.2vw, 1.85rem);
    --step-4: clamp(1.85rem, 1.25rem + 2.6vw, 2.75rem);

    --gutter: 7rem;
    --notes: 15rem;
    --measure: 44rem;
    --cell: 24px;
    --radius: 6px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #0e1a2b;
      --paper-2: #13233a;
      --paper-3: #1a2e4a;
      --ink: #e3ecf7;
      --ink-2: #a8b8cf;
      --grid: rgb(120 180 255 / .075);
      --grid-strong: rgb(120 180 255 / .15);
      --margin: #ff6b5e;
      --margin-text: #ff8a7f;
      --accent: #7cc4ff;
      --accent-hover: #b3dcff;
      --hl: #4b4316;
      --code-bg: #0a1524;
      --edge: #2a4060;
      --rust: #f0a36b;
      --ok: #7fd6a0;
      --warn: #f0c46a;
      --bar: #5aa9f0;
      --bar-soft: #2c5b8a;
    }
  }
}

/* ------------------------------------------------------------------- base */
@layer base {
  html { background: var(--paper); scroll-padding-top: 1rem; }
  body {
    background-color: var(--paper);
    background-image:
      linear-gradient(var(--grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: var(--cell) var(--cell);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    min-height: 100vh;
    overflow-wrap: break-word;
  }
  h1, h2, h3 {
    font-family: var(--mono);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-wrap: balance;
  }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-2); }
  h3 { font-size: var(--step-0); letter-spacing: 0; }
  p, li, dd { text-wrap: pretty; }
  a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
  a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--margin); outline-offset: 3px; border-radius: 2px; }
  main:focus { outline: none; }
  code, pre, kbd, samp { font-family: var(--mono); font-size: .875em; }
  :not(pre) > code {
    background: var(--code-bg);
    border: 1px solid var(--edge);
    border-radius: 3px;
    padding: .02em .32em;
    overflow-wrap: anywhere;
  }
  mark { background: var(--hl); color: inherit; }
  ::selection { background: var(--hl); color: var(--ink); }
  strong { font-weight: 700; }

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

/* ----------------------------------------------------------------- layout */
@layer layout {
  .wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: 16px; }
  @media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }

  .skip {
    position: absolute; left: 1rem; top: -4rem; z-index: 10;
    background: var(--ink); color: var(--paper);
    font-family: var(--mono); font-size: var(--step--1);
    padding: .55rem .9rem; border-radius: 4px; text-decoration: none;
  }
  .skip:focus { top: 1rem; color: var(--paper); }

  /* masthead: a notebook cover label and index tabs */
  .masthead { background: var(--paper); border-bottom: 1px solid var(--ink-2); }
  .masthead__inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .75rem 2rem; padding-block: 1.1rem .9rem;
  }
  .brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
  .brand:hover { color: var(--ink); }
  .brand__mark { width: 2.5rem; height: 2.5rem; flex: none; }
  .brand__text { display: flex; flex-direction: column; line-height: 1.15; }
  .brand__name { font-family: var(--mono); font-weight: 800; font-size: 1.3rem; letter-spacing: .22em; }
  .brand__sub { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); }
  .masthead__meta {
    display: flex; flex-wrap: wrap; gap: .2rem 0;
    font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2);
  }
  .masthead__meta span + span::before { content: "/"; content: "/" / ""; color: var(--margin-text); margin-inline: .6rem; }

  .mk-paper { fill: var(--paper-2); stroke: var(--ink-2); stroke-width: 1.5; }
  .mk-grid { stroke: var(--grid-strong); stroke-width: 1; fill: none; }
  .mk-margin { stroke: var(--margin); stroke-width: 2; fill: none; }
  .mk-ink { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

  .tabs ul { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin-bottom: -1px; }
  .tabs a {
    display: block; padding: .5rem .8rem .45rem;
    font-family: var(--mono); font-size: var(--step--1); color: var(--ink);
    text-decoration: none; white-space: nowrap;
    background: var(--paper-2);
    border: 1px solid var(--edge); border-bottom-color: var(--ink-2);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .tabs a:hover { background: var(--paper-3); color: var(--ink); }
  .tabs a[aria-current="page"] {
    background: var(--paper); font-weight: 700;
    border-color: var(--ink-2); border-bottom-color: var(--paper);
    box-shadow: inset 0 3px 0 var(--margin);
  }
  .tabs__no { color: var(--margin-text); margin-right: .45em; }
  @media (max-width: 40rem) {
    .masthead__inner { padding-block: .9rem .7rem; gap: .6rem; }
    .masthead__meta { gap: .35rem; font-size: .75rem; }
    .masthead__meta span { border: 1px solid var(--edge); border-radius: 3px; padding: 0 .4rem; background: var(--paper-2); }
    .masthead__meta span + span::before { content: none; }
    .tabs ul { margin-bottom: 0; padding-bottom: .7rem; gap: .35rem; }
    .tabs a, .tabs a[aria-current="page"] {
      border-radius: var(--radius); border-bottom-color: var(--edge);
      padding: .4rem .6rem; font-size: .75rem;
    }
    .tabs a[aria-current="page"] { border-color: var(--ink-2); }
    .tabs__no { display: none; }
  }

  /* sheet + entries: gutter | body (red margin rule) | margin notes */
  .sheet { padding-block: 2.5rem 4rem; }
  .sheet__head {
    display: grid; grid-template-columns: var(--gutter) minmax(0, var(--measure));
    column-gap: 1.5rem; row-gap: .6rem; margin-bottom: 3rem;
  }
  .sheet__head > * { grid-column: 2; }
  .sheet__head > .folio {
    grid-column: 1; grid-row: 1 / span 2; justify-self: end; padding-top: .2rem;
    font-family: var(--mono); font-size: var(--step--1); color: var(--margin-text); white-space: nowrap;
  }
  .kicker, .crumbs {
    font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2);
    text-transform: uppercase; letter-spacing: .1em;
  }
  .crumbs ol { display: flex; flex-wrap: wrap; list-style: none; }
  .crumbs li + li::before { content: "/"; content: "/" / ""; margin-inline: .5rem; color: var(--margin-text); }
  .lede { font-size: var(--step-1); line-height: 1.5; max-width: 40rem; margin-top: .4rem; }

  .entry {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, var(--measure)) minmax(0, var(--notes));
    column-gap: 1.5rem; margin-bottom: 3.25rem;
  }
  .entry__meta {
    display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; padding-top: .3rem;
    font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2); text-align: right; line-height: 1.35;
  }
  .entry__no { color: var(--margin-text); font-weight: 700; font-size: .95rem; white-space: nowrap; }
  .entry__body { border-left: 2px solid var(--margin); padding-left: 1.5rem; min-width: 0; }
  .entry__body > * + * { margin-top: 1rem; }
  .entry__body > h3 { margin-top: 1.75rem; }
  .entry__body ul:not([class]), .entry__body ol:not([class]) { padding-left: 1.25rem; }
  .entry__body ul:not([class]) > li + li, .entry__body ol:not([class]) > li + li { margin-top: .45rem; }
  .entry__note {
    font-family: var(--mono); font-size: var(--step--1); line-height: 1.55; color: var(--ink-2);
    padding-top: .35rem;
  }
  .note-label {
    display: block; margin-bottom: .3rem;
    color: var(--margin-text); text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  }
  .note-label::before { content: "\21B3\00a0"; content: "\21B3\00a0" / ""; }

  @media (max-width: 70rem) {
    .entry { grid-template-columns: 5.5rem minmax(0, 1fr); }
    .sheet__head { grid-template-columns: 5.5rem minmax(0, 1fr); }
    .entry__note {
      grid-column: 2; margin-top: 1rem; margin-left: 1.5rem;
      padding: .75rem 1rem; background: var(--paper-2);
      border: 1px dashed var(--edge); border-radius: var(--radius);
    }
  }
  @media (max-width: 40rem) {
    .sheet { padding-top: 1.75rem; }
    .entry, .sheet__head { grid-template-columns: minmax(0, 1fr); }
    .sheet__head > *, .sheet__head > .folio { grid-column: 1; grid-row: auto; justify-self: start; }
    .entry__meta { flex-direction: row; align-items: baseline; gap: .75rem; padding: 0 0 .4rem 1.1rem; text-align: left; }
    .entry__body { padding-left: 1rem; }
    .entry__note { grid-column: 1; margin-left: 0; }
  }

  /* colophon */
  .colophon { background: var(--paper-2); border-top: 1px solid var(--ink-2); font-size: .9375rem; }
  .colophon__inner {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem 3rem;
    padding-block: 2rem 2.5rem;
  }
  .colophon__about > * + * { margin-top: .6rem; }
  .colophon__title { font-family: var(--mono); font-weight: 700; }
  .colophon__links ul { list-style: none; display: grid; gap: .45rem; }
  .colophon__links a { font-family: var(--mono); font-size: var(--step--1); }
  @media (max-width: 48rem) { .colophon__inner { grid-template-columns: minmax(0, 1fr); } }
}

/* ------------------------------------------------------------- components */
@layer components {
  /* rubber stamp */
  .stamp-line { margin-top: 1rem; }
  .stamp {
    display: inline-block; transform: rotate(-1.5deg);
    font-family: var(--mono); font-weight: 700; font-size: var(--step--1);
    text-transform: uppercase; letter-spacing: .14em; color: var(--margin-text);
    border: 2px solid currentColor; border-radius: 4px; padding: .35rem .7rem;
    box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px currentColor;
  }

  /* spec sheet */
  .spec {
    display: grid; grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
    border-top: 1px solid var(--ink-2);
  }
  .spec dt, .spec dd { padding-block: .65rem; border-bottom: 1px dashed var(--edge); }
  .spec dt {
    font-family: var(--mono); font-size: var(--step--1); color: var(--ink-2);
    text-transform: uppercase; letter-spacing: .08em; padding-right: 1rem; padding-top: .8rem;
  }
  .spec--compact dt, .spec--compact dd { padding-block: .45rem; }
  .spec--compact dt { padding-top: .55rem; }
  @media (max-width: 30rem) {
    .spec { grid-template-columns: minmax(0, 1fr); }
    .spec dt { border-bottom: 0; padding-bottom: 0; }
    .spec dd { padding-top: .15rem; }
  }

  /* table of contents */
  .toc { list-style: none; border-top: 1px solid var(--ink-2); }
  .toc li { border-bottom: 1px dashed var(--edge); }
  .toc a {
    display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: .75rem; row-gap: .15rem;
    padding-block: .85rem; color: var(--ink); text-decoration: none;
  }
  .toc__no { grid-row: span 2; font-family: var(--mono); font-weight: 700; color: var(--margin-text); padding-top: .05rem; }
  .toc__title {
    font-family: var(--mono); font-weight: 700; color: var(--accent);
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
  }
  .toc__sum { color: var(--ink-2); font-size: .9375rem; }
  .toc a:hover .toc__title { color: var(--accent-hover); text-decoration-thickness: 2px; }
  .toc a:hover { background: var(--paper-2); }

  /* numbered rules */
  .rules { list-style: none; counter-reset: rule; }
  .rules li { counter-increment: rule; position: relative; padding-left: 2.6rem; }
  .rules li + li { margin-top: .9rem; }
  .rules li::before {
    content: counter(rule, decimal-leading-zero);
    position: absolute; left: 0; top: .05rem;
    font-family: var(--mono); font-size: var(--step--1); font-weight: 700; color: var(--paper);
    background: var(--ink); border-radius: 3px; padding: .05rem .35rem;
  }

  /* crossed-out list: things deliberately not done */
  .crossed { list-style: none; }
  .crossed li { position: relative; padding-left: 1.75rem; }
  .crossed li + li { margin-top: .55rem; }
  .crossed li::before {
    content: "\00d7"; content: "\00d7" / ""; position: absolute; left: .1rem; top: -.1rem;
    font-family: var(--mono); font-weight: 700; font-size: 1.15rem; color: var(--margin-text);
  }

  /* notebook code cells */
  .cell {
    display: grid; grid-template-columns: 4.75rem minmax(0, 1fr);
    background: var(--code-bg); border: 1px solid var(--edge); border-radius: var(--radius);
    overflow: hidden;
  }
  .cell__prompt {
    padding: .85rem .6rem; text-align: right;
    font-family: var(--mono); font-size: .75rem; color: var(--accent);
    border-right: 1px solid var(--edge); user-select: none; white-space: nowrap;
  }
  .cell--out .cell__prompt { color: var(--margin-text); }
  .cell pre { min-width: 0; padding: .85rem 1rem; overflow-x: auto; line-height: 1.6; font-size: .8125rem; }
  .cell pre:focus-visible { outline-offset: -3px; }
  .cell figcaption {
    grid-column: 1 / -1; padding: .4rem .8rem;
    font-family: var(--mono); font-size: .75rem; color: var(--ink-2);
    background: var(--paper-2); border-top: 1px solid var(--edge);
  }
  @media (max-width: 30rem) {
    .cell { grid-template-columns: minmax(0, 1fr); }
    .cell__prompt { text-align: left; border-right: 0; border-bottom: 1px solid var(--edge); padding: .35rem .8rem; }
  }

  /* tables */
  .table-wrap {
    overflow-x: auto; background: var(--paper);
    border: 1px solid var(--edge); border-radius: var(--radius);
  }
  .ledger { width: 100%; font-size: .9375rem; }
  .ledger--wide { min-width: 36rem; }
  .ledger th, .ledger td { text-align: left; vertical-align: top; padding: .55rem .75rem; border-bottom: 1px solid var(--edge); }
  .ledger tbody tr:last-child td { border-bottom: 0; }
  .ledger thead th {
    font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--ink-2);
    text-transform: uppercase; letter-spacing: .07em; background: var(--paper-2);
  }
  .ledger tbody tr:hover { background: var(--paper-2); }
  .ledger .num { font-family: var(--mono); font-size: .875rem; white-space: nowrap; }
  .ledger caption {
    caption-side: bottom; text-align: left; padding: .55rem .75rem;
    font-size: var(--step--1); color: var(--ink-2); border-top: 1px solid var(--edge);
  }
  .area { font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); }

  /* wide ledgers turn into stacked cards on phones (cells carry data-label) */
  @media (max-width: 40rem) {
    .ledger--stack, .ledger--stack tbody, .ledger--stack tr, .ledger--stack td, .ledger--stack caption { display: block; }
    .ledger--wide.ledger--stack { min-width: 0; }
    .ledger--stack thead {
      position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
    }
    .ledger--stack caption { border-top: 0; border-bottom: 1px solid var(--ink-2); }
    .ledger--stack tr { padding: .55rem .75rem .6rem; border-bottom: 1px dashed var(--edge); }
    .ledger--stack tbody tr:last-child { border-bottom: 0; }
    .ledger--stack td {
      display: grid; grid-template-columns: 6.75rem minmax(0, 1fr); column-gap: .75rem;
      padding: .18rem 0; border-bottom: 0;
    }
    .ledger--stack td::before {
      content: attr(data-label); content: attr(data-label) / "";
      font-family: var(--mono); font-size: .6875rem; font-weight: 700; line-height: 1.5;
      color: var(--ink-2); text-transform: uppercase; letter-spacing: .07em; padding-top: .15rem;
    }
    .ledger--stack td:first-child { font-weight: 700; }
    .ledger--stack td > * { justify-self: start; }
    .ledger--stack .num { white-space: normal; }
  }

  /* tags */
  .tag {
    display: inline-block; vertical-align: .12em; white-space: nowrap;
    font-family: var(--mono); font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    border: 1px solid currentColor; border-radius: 3px; padding: .05rem .4rem;
  }
  .tag--done { color: var(--ok); }
  .tag--now { color: var(--margin-text); }
  .tag--plan { color: var(--ink-2); }
  .tag--open { color: var(--warn); }

  .checklist { list-style: none; }
  .checklist li + li { margin-top: .7rem; }

  /* runtime status chip (filled by notebook.js; honest "unknown" fallback) */
  .chip {
    display: inline-flex; align-items: center; gap: .4rem; min-width: 9.5rem; vertical-align: .05em;
    font-family: var(--mono); font-size: .8125rem; line-height: 1.3; color: var(--ink);
    background: var(--paper-2); border: 1px solid var(--edge); border-radius: 999px; padding: .1rem .6rem;
  }
  .chip__dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink-2); flex: none; }
  .chip[data-tone="ok"] .chip__dot { background: var(--ok); }
  .chip[data-tone="info"] .chip__dot { background: var(--accent); }
  .chip[data-tone="build"] .chip__dot { background: var(--warn); }
  .chip[data-tone="soon"] .chip__dot { background: transparent; border: 2px solid var(--ink-2); }
  .chip[data-tone="off"] .chip__dot { background: var(--margin); }
  .chip[data-tone="unknown"] .chip__dot { background: transparent; border: 2px dashed var(--ink-2); }

  /* architecture stack (HTML + CSS diagram) */
  .stack {
    display: grid; gap: .6rem; padding: 1rem;
    background: var(--paper); border: 1px solid var(--edge); border-radius: var(--radius);
  }
  .stack__layer {
    display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; align-items: stretch;
  }
  .stack__label {
    align-self: center;
    font-family: var(--mono); font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em;
  }
  .stack__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; }
  .node {
    display: flex; flex-direction: column; gap: .15rem; padding: .55rem .65rem;
    background: var(--paper-2); border: 1px solid var(--ink-2); border-radius: 4px; min-width: 0;
  }
  .node strong { font-family: var(--mono); font-size: .8125rem; overflow-wrap: anywhere; }
  .node span { font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
  .node--wide { grid-column: 1 / -1; }
  .node--seam { border: 2px dashed var(--margin); background: var(--paper); }
  .node--seam strong { color: var(--margin-text); }
  .stack__layer--rust .node { border-color: var(--rust); }
  .stack__layer--rust .node strong { color: var(--rust); }
  .stack figcaption { font-size: var(--step--1); color: var(--ink-2); padding-top: .4rem; border-top: 1px dashed var(--edge); }
  @media (max-width: 34rem) {
    .stack { padding: .75rem; }
    .stack__layer { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
    .stack__row { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
  }

  /* charts drawn in inline SVG */
  .plot { background: var(--paper); border: 1px solid var(--edge); border-radius: var(--radius); padding: 1rem; }
  .plot svg { width: 100%; height: auto; max-width: 30rem; }
  .plot figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: .5rem; }
  .plot .gridline { stroke: var(--grid-strong); stroke-width: 1; fill: none; }
  .plot .ax { stroke: var(--ink-2); stroke-width: 1.25; fill: none; }
  .plot .lbl { fill: var(--ink-2); font-family: var(--mono); font-size: 12px; }
  .plot .lbl-strong { fill: var(--ink); font-weight: 700; }
  .plot .lbl--tick, .plot .lbl--axis { text-anchor: middle; }
  .plot .lbl--y { text-anchor: end; }
  .plot .lbl--end { text-anchor: end; }
  .plot .lbl--on { fill: var(--paper); font-weight: 700; }
  .plot .lbl--laptop { fill: var(--margin-text); font-weight: 700; }
  .plot .lbl--note { fill: var(--margin-text); font-style: italic; }
  .plot .bar { fill: var(--bar); }
  .plot .bar--range { fill: var(--bar-soft); }
  .plot .bar--beyond { fill: var(--bar); }
  .plot .laptop { stroke: var(--margin); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }
  .plot .line-dash { stroke: var(--margin); stroke-width: 2; stroke-dasharray: 7 6; fill: none; }
  .plot .pt { fill: var(--paper); stroke: var(--margin); stroke-width: 3; }

  .caveat {
    padding: .8rem 1rem; background: var(--paper-2);
    border: 1px solid var(--edge); border-left: 4px solid var(--warn); border-radius: 4px;
    font-size: .9375rem;
  }

  /* roadmap timeline */
  .timeline { list-style: none; position: relative; }
  .timeline__item { position: relative; padding: 0 0 1.4rem 1.75rem; }
  .timeline__item::before {
    content: ""; position: absolute; left: .32rem; top: .55rem; bottom: -.45rem;
    border-left: 2px solid var(--edge);
  }
  .timeline__item:last-child::before { display: none; }
  .timeline__item::after {
    content: ""; position: absolute; left: 0; top: .3rem; width: .85rem; height: .85rem;
    border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-2);
  }
  .timeline__item--done::after { background: var(--ok); border-color: var(--ok); }
  .timeline__item--now::after { background: var(--margin); border-color: var(--margin); box-shadow: 0 0 0 4px var(--paper-3); }
  .timeline__item h3 { font-size: var(--step-0); }
  .timeline__item h3 .tag { margin-right: .4rem; }
  .timeline__item p { margin-top: .35rem; color: var(--ink); }

  .sessions { list-style: none; counter-reset: s; }
  .sessions li { counter-increment: s; position: relative; padding: .55rem 0 .55rem 2.6rem; border-bottom: 1px dashed var(--edge); }
  .sessions li:first-child { border-top: 1px solid var(--ink-2); }
  .sessions li::before {
    content: "S" counter(s); position: absolute; left: 0; top: .62rem;
    font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--margin-text);
  }

  /* research log */
  .log { list-style: none; border-top: 1px solid var(--ink-2); }
  .log__item {
    display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: 1rem;
    padding-block: .9rem; border-bottom: 1px dashed var(--edge);
  }
  .log__item > * { grid-column: 2; }
  .log__item > .log__date {
    grid-column: 1; grid-row: 1 / span 2;
    font-family: var(--mono); font-size: var(--step--1); color: var(--margin-text); padding-top: .1rem;
  }
  .log__item h3 { font-size: var(--step-0); }
  .log__item p:not(.log__date) { margin-top: .3rem; }
  .log__item:target { background: var(--paper-2); }
  @media (max-width: 34rem) {
    .log__item { grid-template-columns: minmax(0, 1fr); }
    .log__item > *, .log__item > .log__date { grid-column: 1; grid-row: auto; }
  }

  /* a blinking cursor after the brand, only when motion is welcome */
  @media (prefers-reduced-motion: no-preference) {
    .brand__name::after {
      content: "_"; content: "_" / ""; color: var(--margin-text); margin-left: .05em;
      animation: blink 1.2s steps(1, end) infinite;
    }
    @keyframes blink { 50% { opacity: 0; } }
  }
}

/* ------------------------------------------------------------------ print */
@layer print {
  @media print {
    body { background: #fff; color: #000; }
    .tabs, .skip, .colophon__links { display: none; }
    .entry, .sheet__head { grid-template-columns: minmax(0, 1fr); }
    .entry__meta { flex-direction: row; gap: .75rem; }
    a { color: #000; }
  }
}
