@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=DM+Serif+Display:ital@0;1&family=DM+Serif+Text:ital@0;1&display=swap");

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/@fontsource/geist-mono@5.2.7/files/geist-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --paper: #1c1b18;
  --ink: #ece8e0;
  --mute: #9a958c;
  --rule: rgba(236, 232, 224, 0.16);
  --accent: #7c322c;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page-pad-x: clamp(1.25rem, 4vw, 4rem);
  --page-measure: 68rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  background: var(--paper);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  max-width: var(--page-measure);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) var(--page-pad-x) 3.5rem;
}

.note-toolbar,
.print-help,
h1,
.prose {
  max-width: 42rem;
}

.back {
  font-size: 0.75rem;
  margin-bottom: 1.75rem;
}

.back a {
  color: var(--mute);
}

h1 {
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: "DM Serif Display", "Times New Roman", serif;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 1.75em;
}

.prose p,
.prose li {
  line-height: 1.6;
}

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

.prose li + li {
  margin-top: 0.35em;
}

.prose a {
  color: inherit;
  text-decoration: none;
}

.prose a:visited,
.back a:visited {
  color: inherit;
}

.prose a:hover,
.prose a:focus-visible,
.back a:hover,
.back a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25em 0;
}

.prose small,
.prose em,
.prose figcaption {
  color: var(--mute);
  font-style: normal;
  font-size: 0.8125rem;
}

.prose blockquote {
  border-left: 1px solid var(--rule);
  padding-left: 0.85rem;
  color: var(--mute);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.prose pre {
  overflow-x: auto;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.prose pre code {
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

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

.prose th {
  color: var(--mute);
  font-weight: 400;
}

.prose .project-image,
.prose .footnotes {
  margin-top: 1.5em;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 1.5em 0;
}

.prose .data-footnote-backref {
  text-decoration: none;
}

footer {
  margin-top: 5rem;
  margin-bottom: 3rem;
  font-size: 12px;
  color: var(--mute);
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover,
footer a:focus-visible {
  color: var(--accent);
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.social a {
  display: inline-flex;
  color: var(--mute);
}

.social svg {
  display: block;
}

.note-toolbar { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.note-toolbar .back { margin: 0; }
#print-note { font: 0.6875rem var(--mono); padding: 0.75rem; border: 1px solid var(--rule); color: var(--ink); background: transparent; cursor: pointer; }
#print-note:hover { color: #c65300; }
#print-note:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.print-help { color: var(--mute); font-size: 0.75rem; margin-bottom: 2rem; }
.print-masthead, .print-byline { display: none; }
.prose { overflow-wrap: anywhere; }
.prose table { display: block; overflow-x: auto; }

@media (max-width: 599px) {
  body { padding-top: 1.5rem; }
}

@page { size: A4; margin: 18mm 18mm 20mm; }
@media print {
  :root { --paper: #fff; --ink: #111; --mute: #444; --rule: #bbb; }
  html, body { background: white !important; color: #111 !important; }
  body { max-width: none; margin: 0; padding: 0; font-family: "DM Serif Text", "Times New Roman", serif; font-size: 11pt; line-height: 1.5; }
  .note-toolbar, .print-help, footer, .data-footnote-backref { display: none !important; }
  .print-masthead { display: block; font: 8pt Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8mm; }
  .print-byline { display: block; font: 9pt Arial, sans-serif; margin-bottom: 8mm; }
  h1 { font-size: 25pt; line-height: 1.15; margin-bottom: 3mm; padding-bottom: 4mm; }
  h1, h2, h3, h4, .print-byline { break-after: avoid; }
  .prose h2, .prose h3, .prose h4 { font-size: 14pt; }
  p, li { orphans: 3; widows: 3; }
  .prose p, .prose li { line-height: 1.5; }
  .prose img { max-height: 210mm; object-fit: contain; break-inside: avoid; }
  .prose figure, .prose blockquote { break-inside: avoid; }
  .prose a { text-decoration: underline; color: #111; }
  .prose pre { white-space: pre-wrap; overflow: visible; overflow-wrap: anywhere; font-size: 8pt; }
  .prose table { display: table; table-layout: fixed; font-size: 8pt; overflow: visible; }
  .prose thead { display: table-header-group; }
  .prose tr { break-inside: avoid; }
  .prose th, .prose td { overflow-wrap: anywhere; }
  .prose small, .prose figcaption { font-size: 8pt; }
}

@media screen {

:root {
  --beta-rule-inset: calc(var(--page-pad-x) / 2);
  --edge-bleed: var(--beta-rule-inset);
}

body {
  position: relative;
  min-height: 100svh;
  display: flow-root;
}

body::before,
body::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--rule) 0 2px, transparent 2px 6px);
  pointer-events: none;
}

body::before { left: var(--beta-rule-inset); }
body::after { right: var(--beta-rule-inset); }

}

@media screen {
  :root {
    --note-measure: 44rem;
    --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  body { padding-bottom: 2rem; }

  .note-toolbar,
  .print-help,
  body > article,
  body > footer {
    width: 100%;
    max-width: var(--note-measure);
    margin-inline: auto;
  }

  .note-toolbar {
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 0.75rem;
  }

  .back { font-size: 0.8125rem; }

  #print-note {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 3px;
  }

  .print-help {
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.13;
    letter-spacing: -0.025em;
    text-wrap: pretty;
    margin-bottom: 2rem;
    padding: 0;
    border: 0;
  }

  .prose {
    max-width: none;
    font-size: 1rem;
    line-height: 1.75;
  }

  .prose p,
  .prose li { line-height: 1.75; text-align: left; }
  .prose > * + * { margin-top: 1.25rem; }
  .prose li + li { margin-top: 0.5rem; }

  .prose h2,
  .prose h3,
  .prose h4 {
    margin: 2.5rem 0 1rem;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.015em;
  }

  .prose h2 { font-size: 1.625rem; }
  .prose h3 { font-size: 1.375rem; }
  .prose h4 { font-size: 1.125rem; }
  .prose em { color: inherit; font-size: inherit; font-style: italic; }
  .prose a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
  .prose .project-image { margin: 0 0 2rem; }
  .prose .project-image img { width: 100%; height: auto; margin: 0; }
  .prose blockquote { padding: 0.25rem 0 0.25rem 1.25rem; margin-block: 1.75rem; }
  .prose pre { padding: 1rem; border: 1px solid var(--rule); line-height: 1.6; }
  .prose th,
  .prose td { padding: 0.75rem; }

  body > footer {
    margin-top: 3rem;
    margin-bottom: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    line-height: 1.7;
  }

  @media (max-width: 599px) {
    .print-help { margin-bottom: 1.5rem; }
    h1 { margin-bottom: 1.5rem; }
    .prose { font-size: 0.9375rem; }
    .prose h2 { font-size: 1.375rem; }
    .prose h3 { font-size: 1.1875rem; }
  }
}
