/* Deterministic static edition: no webfonts, scripts, or remote CSS. */
:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #191d21;
  --muted: #5a626a;
  --line: #d9d7d0;
  --accent: #9a3412;
  --accent-dark: #6f250e;
  --accent-soft: #fff1e8;
  --code: #f1efe9;
  --measure: 48rem;
  --shadow: 0 12px 34px rgb(23 30 36 / 8%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 1.075rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-dark);
  text-decoration-color: color-mix(in srgb, var(--accent) 48%, transparent);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

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

a:focus-visible,
summary:focus-visible {
  border-radius: .18rem;
  outline: .18rem solid #2563eb;
  outline-offset: .18rem;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: .5rem;
  left: .5rem;
  padding: .55rem .8rem;
  transform: translateY(-160%);
  background: var(--ink);
  color: #fff;
  font: 700 .9rem/1.2 system-ui, sans-serif;
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(251 250 247 / 95%);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(90rem, calc(100% - 2rem));
  min-height: 4rem;
  margin: 0 auto;
  gap: 1.25rem;
}

.archive-name,
.edition-links {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.archive-name {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-decoration: none;
  text-transform: uppercase;
}

.archive-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .35rem;
  background: var(--ink);
  color: #fff;
  font-size: .7rem;
  letter-spacing: .08em;
}

.edition-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3rem .9rem;
  font-size: .84rem;
  font-weight: 650;
}

.edition-links a { text-decoration: none; }

.page-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, var(--measure));
  justify-content: center;
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(90rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.4rem, 6vw, 5.5rem) 0 5rem;
}

.table-of-contents {
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 7.5rem);
  overflow: auto;
  border-left: .2rem solid var(--accent);
  padding-left: 1rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .79rem;
  line-height: 1.42;
}

.table-of-contents summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.table-of-contents .toc > ul {
  margin: .9rem 0 0;
  padding: 0;
  list-style: none;
}

.table-of-contents li { margin: 0 0 .6rem; }
.table-of-contents li li { margin: .4rem 0 0; }
.table-of-contents ul ul { padding-left: .8rem; }
.table-of-contents a { text-decoration: none; }

main { min-width: 0; }

.essay {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.essay > h1 {
  max-width: 15ch;
  margin: 0 0 1rem;
  font-size: clamp(2.45rem, 7vw, 4.8rem);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: .98;
  text-wrap: balance;
}

.essay > h1 + .edition-metadata { margin-top: 2rem; }

.edition-metadata {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-block: 1px solid var(--line);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.edition-metadata dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  gap: .9rem 1.5rem;
}

.edition-metadata dl > div { min-width: 0; }

.edition-metadata dt {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.edition-metadata dd {
  margin: .15rem 0 0;
  font-size: .82rem;
  font-weight: 600;
}

.edition-metadata code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.abstract {
  margin: 2rem 0 2.5rem;
  padding: 1.15rem 1.35rem 1.25rem;
  border-left: .28rem solid var(--accent);
  background: var(--accent-soft);
}

.abstract h2 {
  margin: 0 0 .45rem;
  font: 800 .72rem/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.abstract p { margin: 0; }

.source-hash {
  margin-top: .75rem !important;
  color: var(--muted);
  font: .7rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.source-hash span { font-weight: 800; }

.essay > p:nth-of-type(1) {
  color: #343b42;
  font-size: 1.22rem;
  line-height: 1.55;
}

h2,
h3 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.18;
  text-wrap: balance;
}

.essay h2 {
  margin: 3.8rem 0 1.15rem;
  padding-top: .4rem;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  letter-spacing: -.025em;
}

.essay h3 { margin-top: 2.4rem; font-size: 1.3rem; }

.essay p,
.essay li { hanging-punctuation: first last; }

.essay blockquote {
  margin: 1.8rem 0;
  padding: .2rem 0 .2rem 1.2rem;
  border-left: .22rem solid var(--line);
  color: #394149;
}

.essay img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 2.2rem auto .65rem;
  border: 1px solid #c8c6bf;
  border-radius: .2rem;
  background: #f4f3ef;
}

.essay p:has(> img) {
  margin-bottom: 0;
  break-inside: avoid;
}

.essay p:has(> img) + p {
  margin-top: .55rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.essay code,
.publication-footer code {
  padding: .08em .3em;
  border-radius: .2rem;
  background: var(--code);
  font: .83em/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.essay pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--code);
  font-size: .85rem;
}

.essay details {
  margin: 1.7rem 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: .25rem;
  background: #fcfbf8;
}

.essay summary {
  cursor: pointer;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.footnote {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: .18rem solid var(--ink);
  color: #30373e;
  font-size: .84rem;
  line-height: 1.55;
}

.footnote ol { padding-left: 1.35rem; }
.footnote li { margin-bottom: .85rem; }
.footnote-backref { margin-left: .25rem; text-decoration: none; }

.publication-footer {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font: .82rem/1.55 Inter, ui-sans-serif, system-ui, sans-serif;
}

.publication-footer p { margin: 0 0 .5rem; }
.publication-footer nav { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .9rem; }
.publication-footer nav a { font-weight: 700; text-decoration: none; }

@media (max-width: 62rem) {
  .page-grid {
    grid-template-columns: minmax(0, var(--measure));
    gap: 1.4rem;
  }

  .table-of-contents {
    position: static;
    max-height: none;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .table-of-contents .toc > ul { columns: 2 15rem; column-gap: 2rem; }
  .table-of-contents li { break-inside: avoid; }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .header-inner { align-items: flex-start; flex-direction: column; padding: .75rem 0; }
  .edition-links { justify-content: flex-start; }
  .page-grid { width: min(100% - 1rem, var(--measure)); padding-top: 1rem; }
  .essay { padding: 1.2rem; border-radius: 0; }
  .edition-metadata dl { grid-template-columns: 1fr; }
  .table-of-contents .toc > ul { columns: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  @page { size: A4; margin: 18mm 16mm; }

  :root {
    --paper: #fff;
    --surface: #fff;
    --ink: #000;
    --muted: #333;
    --line: #aaa;
    --accent: #000;
    --accent-dark: #000;
    --accent-soft: #fff;
    --code: #eee;
  }

  html { font-size: 10.5pt; }
  body { background: #fff; line-height: 1.5; }
  .site-header, .skip-link, .table-of-contents, .publication-footer nav { display: none; }
  .page-grid { display: block; width: auto; margin: 0; padding: 0; }
  .essay { width: auto; padding: 0; border: 0; box-shadow: none; }
  .essay > h1 { max-width: none; font-size: 28pt; }
  .essay h2 { break-after: avoid; margin-top: 2rem; }
  .essay img { max-height: 21cm; break-inside: avoid; }
  .essay a { color: #000; text-decoration: underline; }
  .publication-footer { break-inside: avoid; }
  details { break-inside: avoid; }
  details:not([open]) > *:not(summary) { display: block; }
}
