/* jleemcf.dev: a typeset Markdown document.
   Newsreader (OFL) for text, Geist Mono (OFL) for the Markdown layer. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-wght-normal.62981321.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-wght-italic.48bc8861.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-mono-latin.b7ac144b.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-raised: #fbf8f1;
  --panel: #efe8da;
  --fg: #1f1c17;
  --muted: #5b5548;
  --faint: #8a8170;
  --rule: #ddd3c0;
  --accent: #9b2a1d;
  --accent-soft: rgb(155 42 29 / 0.12);
  --code-bg: #ebe3d3;
  --sel: rgb(155 42 29 / 0.18);
  --t-url: #2f5d50;
  --shadow: 0 1px 0 rgb(31 28 23 / 0.04), 0 8px 30px -12px rgb(31 28 23 / 0.18);

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 40rem;
  --bar-h: 3.25rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15140f;
  --bg-raised: #1b1a14;
  --panel: #1e1c16;
  --fg: #ece6d7;
  --muted: #aba391;
  --faint: #7d7566;
  --rule: #343027;
  --accent: #f0876b;
  --accent-soft: rgb(240 135 107 / 0.14);
  --code-bg: #26231c;
  --sel: rgb(240 135 107 / 0.25);
  --t-url: #8fc5b2;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.2), 0 10px 30px -12px rgb(0 0 0 / 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15140f;
    --bg-raised: #1b1a14;
    --panel: #1e1c16;
    --fg: #ece6d7;
    --muted: #aba391;
    --faint: #7d7566;
    --rule: #343027;
    --accent: #f0876b;
    --accent-soft: rgb(240 135 107 / 0.14);
    --code-bg: #26231c;
    --sel: rgb(240 135 107 / 0.25);
    --t-url: #8fc5b2;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.2), 0 10px 30px -12px rgb(0 0 0 / 0.6);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 1.25rem);
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: common-ligatures;
  overflow-wrap: break-word;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.1875rem;
  }
}

::selection {
  background: var(--sel);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease);
}

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

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

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--fg);
  color: var(--bg);
  font: 500 0.875rem/1.2 var(--mono);
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.6rem;
  color: var(--bg);
}

[hidden] {
  display: none !important;
}

/* ---------- Reading progress (scroll-driven, no JS) ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress linear both;
    animation-timeline: scroll(root block);
  }
}

@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

/* ---------- Top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 max(0.75rem, env(safe-area-inset-left)) 0 max(0.75rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.file {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0 0.25rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.file:hover {
  color: var(--fg);
}

.file-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-name b {
  font-weight: 500;
}

.file-name span {
  display: none;
  color: var(--muted);
}

@media (min-width: 40rem) {
  .file-name span {
    display: inline;
  }
}

.bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.btn,
.seg button,
.bar-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--fg);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.btn:hover,
.bar-link:hover,
.seg button:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  color: var(--fg);
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.btn-icon {
  padding: 0;
}

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--panel);
}

.seg button {
  min-height: calc(2.5rem - 6px);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0.7rem;
}

.seg button[aria-pressed="true"] {
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow);
}

.label-long {
  display: none;
}

@media (min-width: 30rem) {
  .label-long {
    display: inline;
  }
  .label-short {
    display: none;
  }
}

.theme-btn .i-sun {
  display: none;
}

:root[data-theme="dark"] .theme-btn .i-sun {
  display: block;
}

:root[data-theme="dark"] .theme-btn .i-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-btn .i-moon {
    display: none;
  }
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 1.25rem;
}

.page {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.25rem, 7vw, 5rem) 0 3rem;
}

@media (min-width: 75rem) {
  .layout {
    grid-template-columns: minmax(13rem, 1fr) minmax(0, var(--measure)) minmax(13rem, 1fr);
    column-gap: 3.5rem;
    padding: 0 2rem;
  }
  .layout .toc {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }
  .layout .page {
    grid-column: 2;
    grid-row: 1;
  }
  .layout .toc-mobile {
    display: none;
  }
}

/* ---------- Table of contents ---------- */

.toc {
  display: none;
  position: sticky;
  top: calc(var(--bar-h) + 2rem);
  align-self: start;
  justify-self: end;
  width: 100%;
  max-width: 15rem;
  margin-top: clamp(2.25rem, 7vw, 5rem);
  padding-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.35;
}

.toc-title,
.toc-mobile summary {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.toc li,
.toc-mobile li {
  counter-increment: toc;
}

.toc ol a,
.toc-mobile ol a {
  position: relative;
  display: flex;
  gap: 0.7rem;
  padding: 0.38rem 0 0.38rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--rule);
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.toc ol a::before,
.toc-mobile ol a::before {
  content: counter(toc, decimal-leading-zero) / "";
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.toc ol a:hover,
.toc-mobile ol a:hover {
  color: var(--fg);
}

.toc ol a[aria-current="true"] {
  color: var(--fg);
  border-left-color: var(--accent);
  border-left-width: 2px;
  padding-left: calc(0.85rem - 1px);
}

.toc ol a[aria-current="true"]::before {
  color: var(--accent);
}

.toc-foot {
  margin-top: 1.5rem;
  padding-left: 0.85rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

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

.toc-mobile {
  margin: 0 0 3rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-raised);
}

.toc-mobile summary {
  margin: 0;
  padding: 0.95rem 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-mobile summary::-webkit-details-marker {
  display: none;
}

.toc-mobile summary::after {
  content: "+" / "";
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0;
}

.toc-mobile[open] summary::after {
  content: "\2212" / "";
}

.toc-mobile ol {
  padding: 0 1rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.toc-mobile ol a {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

/* ---------- The document ---------- */

.doc {
  position: relative;
}

.doc h1,
.doc h2,
.doc h3,
.doc h4 {
  position: relative;
  font-family: var(--serif);
  color: var(--fg);
  text-wrap: balance;
}

.doc h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.75rem, 11vw, 4.6rem);
  line-height: 0.98;
  font-weight: 560;
  letter-spacing: -0.028em;
}

.md-mark {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.04em;
  text-decoration: none;
  user-select: none;
}

.doc h1 .md-mark {
  display: inline-block;
  margin-right: 0.45em;
  font-size: 0.34em;
  vertical-align: 0.95em;
}

@media (min-width: 52rem) {
  .doc h1 .md-mark {
    position: absolute;
    right: 100%;
    top: 0.5em;
    margin-right: 0.9rem;
    vertical-align: 0;
  }
}

.doc h2 {
  margin: 0 0 1rem;
  padding-top: 0.25rem;
  font-size: clamp(1.6rem, 5.2vw, 2.05rem);
  line-height: 1.12;
  font-weight: 560;
  letter-spacing: -0.018em;
}

.doc h3 {
  margin: 2.25rem 0 0.6rem;
  font-size: 1.32rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.008em;
}

.doc h4 {
  margin: 1.75rem 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 650;
}

.doc h2 .md-mark,
.doc h3 .md-mark {
  display: inline-block;
  margin-right: 0.55em;
  font-size: 0.55em;
  vertical-align: 0.3em;
  opacity: 0.85;
  transition: opacity 160ms var(--ease), transform 200ms var(--ease);
}

.doc h3 .md-mark {
  font-size: 0.62em;
  vertical-align: 0.18em;
  color: var(--faint);
}

.doc h2 a.md-mark:hover,
.doc h3 a.md-mark:hover {
  opacity: 1;
  color: var(--accent);
}

@media (min-width: 52rem) {
  /* Hang the Markdown markers in the margin, like a typesetter would. */
  .doc h2 .md-mark,
  .doc h3 .md-mark {
    position: absolute;
    right: 100%;
    top: 0.62em;
    margin-right: 0.9rem;
    vertical-align: 0;
  }
  .doc h2 .md-mark {
    top: 0.95em;
  }
  .doc h3 .md-mark {
    top: 0.6em;
  }
}

.doc p,
.doc ul,
.doc ol,
.doc blockquote,
.doc .table-wrap,
.doc pre {
  margin: 0 0 1.15rem;
}

.doc p {
  hanging-punctuation: first;
  text-wrap: pretty;
}

.doc strong {
  font-weight: 640;
}

.doc em {
  font-style: italic;
}

.doc hr {
  margin: 3rem 0;
  border: 0;
  height: 1px;
  background: var(--rule);
}

/* Lists: the Markdown dash, set in mono. */
.doc ul,
.doc ol {
  padding-left: 1.6rem;
}

.doc ul {
  list-style: none;
}

.doc ul > li {
  position: relative;
}

.doc ul > li::before {
  content: "-" / "";
  position: absolute;
  left: -1.35rem;
  top: 0.08em;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
}

.doc ul ul > li::before {
  color: var(--faint);
}

.doc ol > li::marker {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}

.doc li + li {
  margin-top: 0.4rem;
}

.doc li > ul,
.doc li > ol {
  margin: 0.4rem 0 0;
}

/* Blockquote: the '>' rule. */
.doc blockquote {
  position: relative;
  padding: 0.1rem 0 0.1rem 1.6rem;
  border-left: 0;
  color: var(--fg);
}

.doc blockquote::before {
  content: ">" / "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.95em;
  color: var(--accent);
}

.doc blockquote::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 1.9rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--rule);
}

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

/* The lede: the first blockquote under the name. */
.doc .lede {
  margin: 0 0 1.75rem;
  font-size: clamp(1.28rem, 3.6vw, 1.55rem);
  line-height: 1.38;
  font-style: italic;
  font-weight: 380;
  letter-spacing: -0.006em;
}

.doc .lede.long {
  font-size: clamp(1.14rem, 3vw, 1.32rem);
  line-height: 1.42;
}

.doc .lede::before {
  top: 0.45rem;
  font-style: normal;
  font-size: 0.75em;
}

.doc .lede::after {
  top: 2.4rem;
}

.doc .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font: 400 0.78rem/1.5 var(--mono);
}

.doc .meta-line em {
  font-style: normal;
}

.doc .meta-line a {
  color: var(--muted);
}

/* The intro block (preamble for agents). */
.doc-head {
  padding-bottom: 2.5rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--rule);
}

.doc-head > p:not(.meta-line) {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.doc-head > p:not(.meta-line):last-child {
  margin-bottom: 0;
}

/* Sections */
.doc section {
  margin: 0 0 3.25rem;
}

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

/* Agent-facing section: quieter, like a margin note. */
.doc section.agent {
  padding: 1.35rem 1.25rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-raised);
  font-size: 0.97rem;
}

.doc section.agent h2 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.doc section.agent h2 .md-mark {
  position: static;
  font-size: 1em;
  vertical-align: 0;
  margin-right: 0.6em;
}

.doc section.agent li + li {
  margin-top: 0.3rem;
}

/* Inline code and code blocks */
.doc code {
  font-family: var(--mono);
  font-variant-ligatures: none;
  font-size: 0.82em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
}

.doc pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: var(--code-bg);
  font-size: 0.85rem;
  line-height: 1.55;
}

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

/* External links get a quiet arrow. */
.doc a[href^="http"]:not([href^="https://jleemcf.dev"])::after {
  content: "\2197" / "";
  display: inline-block;
  margin-left: 0.1em;
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--faint);
  text-decoration: none;
  transform: translateY(-0.2em);
}

/* Tables: a ledger. */
.doc .table-wrap {
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.4;
  font-variant-numeric: lining-nums tabular-nums;
}

.doc th {
  padding: 0 0.6rem 0.6rem 0.25rem;
  text-align: left;
  vertical-align: bottom;
  color: var(--muted);
  font: 500 0.7rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--fg);
}

.doc td {
  padding: 0.7rem 0.6rem 0.7rem 0.25rem;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.doc td:first-child {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding-top: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.doc tbody tr {
  transition: background-color 160ms var(--ease);
}

.doc tbody tr:hover {
  background: var(--accent-soft);
}

.doc .align-right {
  text-align: right;
}

.doc .align-center {
  text-align: center;
}

@media (max-width: 37.5rem) {
  /* Reflow the ledger into stacked entries on phones. */
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
  }
  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .doc tr {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--rule);
  }
  .doc tbody tr:first-child {
    border-top: 1px solid var(--fg);
  }
  .doc td {
    padding: 0;
    border: 0;
  }
  .doc td:first-child {
    padding: 0 0 0.2rem;
    font-size: 0.74rem;
  }
  .doc td:nth-child(2) {
    font-weight: 600;
  }
  .doc td:nth-child(n + 3) {
    color: var(--muted);
  }
}

/* ---------- Markdown source view ---------- */

.source {
  position: relative;
}

.source-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  font: 400 0.78rem/1.4 var(--mono);
  color: var(--muted);
}

.source-head h1 {
  margin: 0;
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--fg);
}

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

.md-src {
  margin: 0 -0.5rem;
  padding: 1.1rem 0.5rem 1.25rem 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-raised);
  font: 400 0.8rem/1.7 var(--mono);
  color: var(--fg);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  counter-reset: line;
  tab-size: 2;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

@media (min-width: 48rem) {
  .md-src {
    margin: 0 -1.5rem;
    font-size: 0.82rem;
  }
}

.md-src code {
  font: inherit;
  background: none;
  padding: 0;
}

.md-src .l {
  display: block;
  position: relative;
  padding-left: 3.6rem;
  min-height: 1.7em;
  counter-increment: line;
}

.md-src .l::before {
  content: counter(line) / "";
  position: absolute;
  left: 0;
  width: 2.6rem;
  text-align: right;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.md-src .l:hover {
  background: var(--accent-soft);
}

.t-mark {
  color: var(--accent);
  font-weight: 600;
}

.t-heading {
  font-weight: 600;
}

.t-quote {
  font-style: italic;
}

.t-punct,
.t-comment {
  color: var(--muted);
}

.t-comment {
  font-style: italic;
}

.t-url {
  color: var(--t-url);
}

.t-linktext {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

.t-strong {
  font-weight: 650;
}

.t-em {
  font-style: italic;
}

.t-code {
  color: var(--accent);
}

/* ---------- Footer ---------- */

.foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.25rem calc(3rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 400 0.76rem/1.7 var(--mono);
}

.foot p {
  margin: 0 0 0.5rem;
}

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

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

.foot .contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.foot .contact a {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  color: var(--fg);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 70;
  transform: translate(-50%, 0.75rem);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 500 0.78rem/1.2 var(--mono);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 260ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Text paints immediately (good for LCP); only the Markdown layer animates in. */
  /* Section markers only: animating a marker inside the h1 or the lede would
     hold back Largest Contentful Paint until the animation ends. */
  .doc section .md-mark {
    animation: mark-in 900ms var(--ease) 120ms both;
  }
  .doc section:nth-of-type(1) .md-mark {
    animation-delay: 220ms;
  }
  .doc section:nth-of-type(2) .md-mark {
    animation-delay: 300ms;
  }
  .doc section:nth-of-type(n + 3) .md-mark {
    animation-delay: 380ms;
  }

  /* A cursor after the name that blinks a few times, then rests. */
  .doc h1 .caret {
    display: inline-block;
    width: 0.07em;
    height: 0.78em;
    margin-left: 0.08em;
    background: var(--accent);
    vertical-align: -0.04em;
    animation: blink 1.05s steps(1, end) 5 both;
  }

  .source:not([hidden]) {
    animation: fade 260ms var(--ease) both;
  }
  .doc:not([hidden]).swap-in {
    animation: fade 260ms var(--ease) both;
  }
}

.caret {
  display: none;
}

@keyframes mark-in {
  from {
    opacity: 0;
    translate: -0.4em 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}


@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ---------- 404 ---------- */

.lost {
  min-height: 70vh;
  display: grid;
  align-content: center;
}

/* ---------- Print ---------- */

@media print {
  :root {
    --bg: #fff;
    --fg: #000;
    --muted: #333;
    --rule: #bbb;
    --accent: #000;
  }
  .bar,
  .toc,
  .toc-mobile,
  .progress,
  .toast,
  .skip-link,
  .source {
    display: none !important;
  }
  .doc[hidden] {
    display: block !important;
  }
  body {
    font-size: 11pt;
  }
  .page {
    padding-top: 0;
  }
  .doc a[href^="http"]::after,
  .doc a[href^="mailto"]::after {
    content: " <" attr(href) ">";
    font-size: 0.8em;
    color: #333;
    transform: none;
  }
  .doc section {
    break-inside: avoid-page;
  }
}
