/* Archiboard
   An architect's drawing board. Cream paper with a faint drafting grid,
   ink-blue lines, one red pencil for emphasis. There is one palette and
   it does not follow the system theme: the paper is always paper.       */

:root {
  --paper: #f5f0e6;
  --paper-2: #fcfaf5;
  --paper-3: #ece5d6;
  --ink: #1c2b3a;
  --ink-soft: #34465a;
  --muted: #6b7684;
  --pencil: #a2aab3;
  --accent: #c8442a;
  --accent-soft: rgba(200, 68, 42, 0.09);
  --zone: rgba(28, 43, 58, 0.045);
  --rule: #d8d0bf;
  --grid: rgba(28, 43, 58, 0.055);
  --code-bg: #f0ebe0;
  --shadow: 0 1px 0 rgba(28, 43, 58, 0.06), 0 12px 30px -18px rgba(28, 43, 58, 0.35);

  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, 'SFMono-Regular', Menlo, monospace;

  --measure: 66ch;
  --wide: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

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

html {
  color-scheme: light only;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-feature-settings: 'kern', 'liga', 'onum';
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--pencil);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--accent);
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--paper-2);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 96;
}

.sep {
  color: var(--pencil);
  margin: 0 0.45em;
}

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

/* ---------- title-block vocabulary ---------- */

.tb-label,
.eyebrow,
.sheet-tag,
.sheet-no,
.sheet-dates,
.topnav,
.toc,
.index-table th,
.set-range,
.year-count,
.gallery-link,
.src-host,
.tag,
.colophon,
.note-title,
.sheet-nav .tb-label {
  font-family: var(--font-mono);
}

.tb-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.eyebrow a {
  text-decoration: none;
}

.eyebrow a:hover {
  color: var(--accent);
}

.sheet-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem 0.12rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  line-height: 1.4;
  vertical-align: 0.1em;
  background: var(--paper-2);
}

.titleblock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 0;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.titleblock .tb-cell {
  padding: 0.7rem 0.9rem 0.75rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.titleblock dd {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.35;
}

.titleblock dd a {
  text-decoration: none;
}

.titleblock dd a:hover {
  color: var(--accent);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  max-width: var(--wide);
  width: 100%;
  margin: 0 auto;
  padding: 1.1rem var(--gutter) 1rem;
  border-bottom: 1.5px solid var(--ink);
  position: relative;
}

.masthead::after {
  content: '';
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: -5px;
  border-bottom: 1px solid var(--ink);
  opacity: 0.55;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.mark-svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-pivot {
  fill: var(--accent);
  stroke: none;
}

.mark-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  font-variation-settings: 'opsz' 48;
}

.mark-accent {
  color: var(--accent);
  font-style: italic;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topnav a {
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

.topnav a:hover,
.topnav a[aria-current] {
  border-bottom-color: var(--accent);
}

/* ---------- cover (home) ---------- */

.cover {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 3rem;
  max-width: 54rem;
}

.cover-title {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 300;
  line-height: 1.05;
  margin: 0 0 1.4rem;
  max-width: 16ch;
}

.cover-title em,
.page-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: var(--measure);
  margin: 0 0 2.2rem;
  color: var(--ink-soft);
}

.cover-block {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
  .cover-block {
    grid-template-columns: repeat(2, 1fr);
  }
}

.section-h {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 1.55rem;
  margin: 3.5rem 0 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
}

.section-h-no {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.section-intro {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: -0.4rem 0 1.2rem;
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.set-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 0.9rem;
  row-gap: 0.25rem;
  padding: 1.1rem 1.1rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.set-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.set-glyph {
  grid-row: 1 / 4;
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.set-glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.set-card:hover .set-glyph {
  color: var(--accent);
}

.set-glyph.big {
  display: inline-block;
  width: 40px;
  height: 40px;
  vertical-align: -6px;
  margin-right: 0.6rem;
}

.set-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.15;
}

.set-blurb {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.set-range {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ---------- sheet lists ---------- */

.sheet-list {
  display: flex;
  flex-direction: column;
}

.sheet-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.sheet-row:first-child {
  border-top: 1px solid var(--rule);
}

.thumb {
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 6px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.thumb:hover {
  border-color: var(--ink);
}

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

.sheet-no {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-set {
  margin-left: 0.4rem;
}

.sheet-title {
  font-size: 1.45rem;
  margin: 0 0 0.4rem;
}

.sheet-title a {
  text-decoration: none;
}

.sheet-title a:hover {
  color: var(--accent);
}

.sheet-summary {
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.sheet-dates {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.more {
  margin: 1.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .sheet-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .thumb {
    max-width: 260px;
  }
}

/* ---------- margin notes (home) ---------- */

.margin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.margin-note {
  margin: 0;
  padding: 1.1rem 1.2rem 1rem 1.3rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  font-size: 0.98rem;
  line-height: 1.5;
  position: relative;
  transform: rotate(-0.35deg);
  box-shadow: var(--shadow);
}

.margin-note:nth-child(2) {
  transform: rotate(0.3deg);
}

.margin-note:nth-child(3) {
  transform: rotate(-0.15deg);
}

.margin-note p {
  margin: 0 0 0.6rem;
}

.margin-note footer {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.margin-note footer a {
  text-decoration: none;
  color: var(--muted);
}

.margin-note footer a:hover {
  color: var(--accent);
}

.note-title {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.45rem;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.plain-list a {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0.4rem;
}

.plain-list a:hover {
  color: var(--accent);
}

.plain-list .dim {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* ---------- set / index / gallery heads ---------- */

.set-head {
  padding: clamp(2rem, 5vw, 3.5rem) 0 1.6rem;
  max-width: 54rem;
}

.page-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 300;
  margin: 0 0 1rem;
}

.year-block {
  margin: 2.4rem 0;
}

.year-h {
  font-size: 2.2rem;
  font-weight: 300;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.3rem;
  margin-bottom: 0.6rem;
}

.year-count {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.index-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.index-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 0.6rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}

.index-table td {
  padding: 0.6rem 0.6rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.index-table td a {
  text-decoration: none;
}

.index-table td a:hover {
  color: var(--accent);
}

.index-table .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  color: var(--muted);
}

@media (max-width: 640px) {
  .index-table th:nth-child(3),
  .index-table td:nth-child(3) {
    display: none;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 1.6rem;
}

.gallery-item {
  margin: 0;
}

.gallery-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--muted);
}

.gallery-link:hover {
  color: var(--accent);
}

/* ---------- article (sheet) ---------- */

.sheet-head {
  padding: clamp(2rem, 5vw, 3.5rem) 0 2rem;
  max-width: 54rem;
}

.sheet-h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 300;
  margin: 0 0 1rem;
  max-width: 20ch;
}

.deck {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0;
  font-variation-settings: 'opsz' 40;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.sheet-meta {
  min-width: 0;
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.sheet-block {
  grid-template-columns: 1fr;
}

.sheet-block .tb-cell {
  border-right: 0;
}

.sheet-block .tb-cell:last-child {
  border-bottom: 0;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 0.2rem;
}

.tag::before {
  content: '#';
  color: var(--pencil);
}

.revision {
  padding: 0.85rem 0.95rem 0.9rem;
  border: 1px dashed var(--pencil);
  background: var(--accent-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  font-family: var(--font-sans);
  color: var(--ink-soft);
}

.revision p {
  margin: 0;
}

.revision .tb-label {
  margin-bottom: 0.4rem;
}

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  padding: 0 0.3rem;
  transform: rotate(-4deg);
  margin-right: 0.3rem;
  letter-spacing: 0.06em;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 0.6rem;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  flex: none;
}

.toc a {
  text-decoration: none;
  font-family: var(--font-sans);
}

.toc a:hover {
  color: var(--accent);
}

@media (max-width: 860px) {
  .sheet-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .sheet-meta {
    position: static;
  }

  .sheet-block {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .sheet-block .tb-cell {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }

  .toc {
    display: none;
  }
}

/* ---------- prose ---------- */

.prose {
  min-width: 0;
  max-width: var(--measure);
  font-size: 1.0625rem;
}

.prose > p:first-child {
  font-size: 1.16rem;
  line-height: 1.55;
}

.prose > p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  line-height: 0.8;
  float: left;
  padding: 0.12em 0.14em 0 0;
  color: var(--accent);
  font-weight: 300;
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose h2 {
  font-size: 1.65rem;
  margin: 2.6rem 0 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
  position: relative;
}

.prose h2::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  border-top: 3px solid var(--accent);
}

.prose h3 {
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.08em 0.35em;
  border-radius: 3px;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0 0 0 1.2rem;
  border-left: 2px solid var(--pencil);
  color: var(--ink-soft);
  font-style: italic;
}

.prose .table-scroll {
  overflow-x: auto;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  font-family: var(--font-sans);
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.prose th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.prose img {
  max-width: 100%;
  height: auto;
}

/* code blocks */

pre.code {
  position: relative;
  margin: 1.6rem 0;
  padding: 1.1rem 1.2rem 1.1rem;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  tab-size: 4;
}

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

pre.code::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.35rem;
  right: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.tok-c {
  color: var(--muted);
  font-style: italic;
}

.tok-s {
  color: var(--accent);
}

.tok-k {
  color: var(--ink);
  font-weight: 500;
}

.tok-t {
  color: var(--ink-soft);
}

.tok-n {
  color: var(--ink-soft);
}

.tok-a {
  color: var(--muted);
}

/* the personal note in the margin */

.prose aside.note {
  margin: 2rem 0 2rem -1.5rem;
  padding: 1.2rem 1.4rem 1.1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  transform: rotate(-0.4deg);
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .prose aside.note {
    margin-left: 0;
  }
}

.prose aside.note p {
  margin: 0 0 0.6rem;
}

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

.prose aside.note .note-title {
  margin-bottom: 0.5rem;
}

/* ---------- drawings ---------- */

figure.drawing {
  margin: 2rem 0 2.2rem;
  padding: 0;
  max-width: none;
}

.prose figure.drawing {
  width: min(100%, 860px);
}

figure.drawing svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  padding: 10px;
  font-family: var(--font-sans);
  stroke-linecap: round;
  stroke-linejoin: round;
  box-shadow: var(--shadow);
}

figure.drawing figcaption {
  margin-top: 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: var(--measure);
}

/* drawing vocabulary: the only classes an article's SVG may use */

.drawing .box {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.drawing .box.accent {
  stroke: var(--accent);
  stroke-width: 1.8;
}

.drawing .box.muted {
  stroke: var(--pencil);
  fill: var(--paper);
}

.drawing .zone {
  fill: var(--zone);
  stroke: var(--pencil);
  stroke-width: 1;
  stroke-dasharray: 6 4;
}

.drawing .cyl {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.drawing .pill {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 1.5;
  rx: 14;
}

.drawing .line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.drawing .line.accent {
  stroke: var(--accent);
}

.drawing .line.dashed {
  stroke-dasharray: 5 4;
}

.drawing .line.pencil {
  stroke: var(--pencil);
  stroke-width: 1;
}

.drawing .line.thick {
  stroke-width: 2.5;
}

.drawing .ah {
  fill: none;
  stroke: var(--ink);
  stroke: context-stroke;
  stroke-width: 1.5;
}

.drawing .hatch-line {
  stroke: var(--pencil);
  stroke-width: 1;
}

.drawing .txt {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--ink);
}

.drawing .txt.small {
  font-size: 11px;
  fill: var(--muted);
}

.drawing .txt.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.drawing .txt.bold {
  font-weight: 600;
}

.drawing .txt.accent {
  fill: var(--accent);
}

.drawing .txt.muted {
  fill: var(--muted);
}

.drawing .txt.title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
}

.drawing .txt.white {
  fill: var(--paper-2);
}

.drawing .fill-accent {
  fill: var(--accent);
  stroke: none;
}

.drawing .fill-ink {
  fill: var(--ink);
  stroke: none;
}

.drawing .dot {
  fill: var(--ink);
  stroke: none;
}

.drawing .dot.accent {
  fill: var(--accent);
}

/* thumbnails keep the vocabulary but lose the frame */

.thumb svg {
  border: 0;
  outline: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

/* ---------- sources ---------- */

.sources {
  margin-top: 3rem;
}

.sources h2 {
  font-size: 1.1rem;
  border-top: 1px solid var(--ink);
}

.sources h2::before {
  display: none;
}

.sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sources li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.sources li a {
  text-decoration: none;
}

.sources li a:hover {
  color: var(--accent);
}

.src-host {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- neighbouring sheets ---------- */

.sheet-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  border-top: 1.5px solid var(--ink);
  padding-top: 1.2rem;
}

.sheet-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.sheet-nav a:hover {
  color: var(--accent);
}

.sheet-nav-next {
  text-align: right;
  align-items: flex-end;
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.portrait {
  margin: 0;
  position: sticky;
  top: 1.5rem;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 4px;
  background: var(--paper-2);
  padding: 8px;
  box-shadow: var(--shadow);
  filter: saturate(0.85);
}

.portrait figcaption {
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.about-prose > p:first-child::first-letter {
  float: none;
  font-size: inherit;
  color: inherit;
  padding: 0;
  font-family: inherit;
}

.about-block {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portrait {
    position: static;
    max-width: 260px;
  }
}

/* ---------- colophon ---------- */

.colophon {
  max-width: var(--wide);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.colophon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
}

.colophon-cell {
  padding: 0.7rem 0.9rem 0.8rem;
  border-right: 1px solid var(--rule);
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.colophon-cell:last-child {
  border-right: 0;
}

.colophon a {
  text-decoration: none;
  color: var(--ink);
}

.colophon a:hover {
  color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
}

/* On a narrow screen the index stops being a table and becomes a list of
   sheets, each with its two dates underneath. Same information, no sideways
   scrolling. */
@media (max-width: 560px) {
  .index-table,
  .index-table tbody,
  .index-table tr,
  .index-table td {
    display: block;
    width: 100%;
  }

  .index-table thead {
    display: none;
  }

  .index-table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .index-table td {
    border: 0;
    padding: 0.1rem 0;
  }

  .index-table td:nth-child(2) a {
    font-family: var(--font-display);
    font-size: 1.15rem;
  }

  .index-table td:nth-child(3) {
    display: none;
  }

  .index-table .num {
    display: inline-block;
    width: auto;
    margin: 0.2rem 1.1rem 0 0;
  }

  .index-table .num::before {
    content: attr(data-label) ' ';
    color: var(--pencil);
  }
}

/* ---------- narrow screens ---------- */

@media (max-width: 520px) {
  :root {
    --gutter: 1.1rem;
  }

  body {
    font-size: 1rem;
  }

  .mark-word {
    font-size: 1.2rem;
  }

  .topnav {
    font-size: 0.68rem;
    gap: 0.4rem 1.1rem;
  }

  .lede {
    font-size: 1.08rem;
  }

  .deck {
    font-size: 1.12rem;
  }

  .prose > p:first-child {
    font-size: 1.06rem;
  }

  .prose > p:first-child::first-letter {
    font-size: 3em;
  }

  .sheet-nav {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .sheet-nav-next {
    text-align: left;
    align-items: flex-start;
  }

  pre.code {
    font-size: 0.78rem;
    padding: 1rem 0.9rem;
  }

  .year-h {
    font-size: 1.8rem;
  }
}

/* ---------- print ---------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .masthead,
  .topnav,
  .colophon,
  .sheet-nav,
  .toc,
  .skip {
    display: none;
  }

  .sheet-grid {
    grid-template-columns: 1fr;
  }

  figure.drawing svg {
    box-shadow: none;
  }

  a {
    text-decoration: none;
  }
}
