/* ============================================================
   PAPYROS — typographic system.

   Warm research paper. Archive white, graphite ink, brass accents.
   Editorial serif headlines, clean sans body, mono apparatus.
   ============================================================ */

:root {
  /* — surface: warm paper — */
  --paper:        #F6F3EC;
  --paper-raised: #FAF8F3;
  --paper-sunk:   #EDE8DC;
  --paper-deep:   #E3DDD0;

  /* — ink: graphite on paper — */
  --ink:        #2A2E32;
  --ink-soft:   #4A5058;
  --ink-muted:  #6B7280;
  --ink-faint:  #9CA3AF;

  /* — accents — */
  --rubric:       #9A7B2F;
  --rubric-d:     #7A6225;
  --gold:         #9A7B2F;
  --indigo:       #3D5A80;
  --accent-navy:  #1E3A5F;
  --accent-olive: #4A5D3A;
  --accent-blue:  #3D5A80;

  /* — structure — */
  --rule:       rgba(42, 46, 50, 0.12);
  --rule-soft:  rgba(42, 46, 50, 0.06);
  --shadow:     rgba(42, 46, 50, 0.08);
  --shadow-lg:  rgba(42, 46, 50, 0.14);

  /* — type — */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           "Hoefler Text", Georgia, Cambria, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Source Sans 3", system-ui, -apple-system,
          "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Berkeley Mono", "SF Mono", ui-monospace,
          "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 2rem);
  --page: 72rem;
  --masthead-h: 2.75rem;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    url("/static/plate-grid.svg"),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(154, 123, 47, 0.05), transparent 60%);
  background-size: 28px 28px, auto;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: rgba(154, 123, 47, 0.2); color: var(--ink); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--rubric); color: var(--paper-raised);
  padding: 0.5rem 1rem; font-family: var(--mono); font-size: 0.8rem; z-index: 100;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; }

/* ---------- shared atoms ---------- */
.section-mark {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 400; margin: 0 0 0.85rem;
}
.section-mark::before { content: ""; }

.textlink {
  color: var(--rubric);
  border-bottom: 1px solid rgba(154, 123, 47, 0.35);
  transition: color 0.15s, border-color 0.15s;
}
.textlink:hover { color: var(--rubric-d); border-color: var(--rubric); }

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

.tag {
  display: inline-block;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em;
  color: var(--ink-muted); padding: 0.12em 0.5em;
  border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper-raised); white-space: nowrap;
}
a.tag:hover { color: var(--rubric); border-color: var(--rubric); }
.tag--active { color: var(--rubric); border-color: var(--rubric); background: rgba(154,123,47,0.08); }

.button {
  display: inline-block;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--paper-raised); background: var(--rubric);
  padding: 0.65em 1.3em; border-radius: 2px;
  border: 1px solid var(--rubric-d);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 0 var(--shadow);
}
.button:hover { background: var(--rubric-d); transform: translateY(-1px); box-shadow: 0 3px 8px var(--shadow); }

.button--ghost {
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--rule);
}
.button--ghost:hover { background: var(--paper-sunk); color: var(--rubric); border-color: var(--rubric); }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.masthead--story {
  position: fixed; left: 0; right: 0;
  background: rgba(246, 243, 236, 0.88);
}
.masthead__inner {
  max-width: var(--page); margin: 0 auto;
  padding: 0.55rem var(--gutter);
  min-height: var(--masthead-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-family: var(--serif); font-size: 0.95rem; letter-spacing: 0.02em;
  font-weight: 400; color: var(--ink);
  flex-shrink: 0;
}
.nav {
  display: flex; gap: 0.75rem; align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  padding: 0.1rem 0;
}
.nav::-webkit-scrollbar { display: none; }
.nav__item {
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.01em;
  color: var(--ink-muted); transition: color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
a.nav__item:hover { color: var(--ink); }
.nav__item.is-active { color: var(--rubric); }

.nav__cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--paper-raised) !important;
  background: var(--rubric);
  padding: 0.4em 0.85em;
  border-radius: 2px;
  margin-left: 0.15rem;
  transition: background 0.15s, transform 0.15s;
}
a.nav__cta:hover {
  color: var(--paper-raised) !important;
  background: var(--rubric-d);
}
.nav__cta.is-active {
  background: var(--rubric-d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ---------- main rhythm ---------- */
main { display: block; }
section {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) var(--gutter);
}

/* homepage sections manage their own vertical rhythm */
section.atrium,
section.plates,
section.register {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
section.atrium {
  max-width: var(--page);
  margin: 0 auto;
  padding-top: clamp(2.5rem, 8vh, 4.5rem);
  padding-bottom: clamp(1.75rem, 4vh, 2.5rem);
}
section.plates {
  max-width: var(--page);
  margin: 0 auto;
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
section.register {
  max-width: var(--page);
  margin: 0 auto;
  padding-top: clamp(1.25rem, 2.5vw, 1.75rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule); }
.hero__kicker {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 1.4rem;
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.04; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 1.6rem; max-width: 16ch;
}
.hero__title em { font-style: italic; color: var(--rubric); }
.hero__lede {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.6;
  color: var(--ink-soft); max-width: 52ch; margin: 0 0 2.2rem;
}
.hero__actions { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }

/* ---------- manifesto ---------- */
.manifesto {
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 38ch) minmax(0, var(--measure));
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.manifesto__epigraph {
  margin: 0;
  border-left: 2px solid var(--rubric);
  padding-left: 1.4rem;
}
.manifesto__epigraph p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 0.9rem;
}
.manifesto__epigraph cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.manifesto__epigraph cite em { font-style: italic; }
.manifesto__body p {
  font-size: 1.12rem; line-height: 1.78; margin: 0 0 1.2rem; color: var(--ink-soft);
}
.manifesto__body p:last-child { margin: 0; }

/* ---------- cards ---------- */
.stacks__head, .catalogue__head { margin-bottom: 2rem; }
.stacks__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stacks__head .section-mark { margin: 0; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  box-shadow: 0 1px 3px var(--shadow);
}
.card { background: var(--paper-raised); transition: background 0.2s; }
.card:hover { background: var(--paper-raised); }
.card__link { display: block; padding: 1.5rem; height: 100%; }
.card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 1rem;
}
.card__kind { color: var(--rubric); }
.card__title { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.2; color: var(--ink); margin: 0 0 0.4rem; }
.card__byline { font-size: 0.92rem; font-style: italic; color: var(--ink-muted); margin: 0 0 0.9rem; }
.card__summary { font-size: 0.95rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 1.1rem; }
.card__foot { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card__time { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); }

/* ---------- section tiles ---------- */
.sections__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule); box-shadow: 0 1px 3px var(--shadow);
}
.tile { background: var(--paper-raised); padding: 1.7rem 1.5rem; display: block; }
.tile--ready { transition: background 0.2s; }
.tile--ready:hover { background: var(--paper-raised); }
.tile--ready:hover .tile__title { color: var(--rubric); }
.tile__num { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); letter-spacing: 0.12em; }
.tile__title {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--ink);
  margin: 0.5rem 0 0; line-height: 1.2; transition: color 0.15s;
}
.tile__soon {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--rule); padding: 0.1em 0.4em; border-radius: 2px;
}
.tile__desc { font-size: 0.95rem; line-height: 1.55; color: var(--ink-muted); margin: 0.4rem 0 0; }

/* ---------- motion (CSS-only) ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes stageGlow {
  from { box-shadow: 0 0 0 rgba(154, 123, 47, 0); }
  to   { box-shadow: 0 0 20px rgba(154, 123, 47, 0.08), 0 2px 8px var(--shadow-lg); }
}

@media (prefers-reduced-motion: no-preference) {
  .atrium__title {
    animation: fadeUp 1.2s ease both;
  }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .plate {
      animation: revealUp 0.9s ease forwards;
      animation-timeline: view();
      animation-range: entry 5% cover 35%;
    }
    .plate:nth-child(2) {
      animation-range: entry 10% cover 40%;
    }
    .register__row {
      animation: revealUp 0.55s ease forwards;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
    .register__row:nth-child(2) { animation-range: entry 3% cover 28%; }
    .register__row:nth-child(3) { animation-range: entry 6% cover 31%; }
    .register__row:nth-child(4) { animation-range: entry 9% cover 34%; }
    .register__row:nth-child(5) { animation-range: entry 12% cover 37%; }
    .register__row:nth-child(6) { animation-range: entry 15% cover 40%; }
  }
}

/* ---------- atrium (homepage hero) ---------- */
.atrium {
  min-height: auto;
  display: block;
  border-bottom: 1px solid var(--rule);
}
.atrium__mark {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rubric);
  margin: 0 0 1rem;
}
.atrium__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw + 0.25rem, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  max-width: 18em;
}
.atrium__title em { font-style: italic; color: var(--rubric); }

/* ---------- plates (formulas) ---------- */
.plates {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
}
.plate {
  width: 100%;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2.5vw, 1.75rem);
  text-align: center;
  margin: 0;
  background-image: url("/static/plate-grid.svg");
  background-size: 28px 28px;
  background-position: center;
  overflow: hidden;
}
.plate__math {
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  color: var(--ink);
  overflow-x: auto;
  max-width: 100%;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}
.plate__math .katex { font-size: 1em; max-width: 100%; }
.plate__caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-top: 1.2rem;
}
.plate__caption a { color: var(--rubric); border-bottom: 1px solid rgba(154,123,47,0.4); }
.plate__caption a:hover { color: var(--rubric-d); border-color: var(--rubric); }

/* ---------- register (recent works index) ---------- */
.register {
  border-bottom: none;
}
.register__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.register__row {
  border-bottom: 1px solid var(--rule);
}
.register__row a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem 1.5rem;
  padding: 0.75rem 0.1rem;
  transition: background 0.15s;
}
.register__row a:hover { background: var(--paper-raised); }
.register__title {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.35;
  color: var(--ink);
  transition: color 0.15s;
  min-width: 0;
}
.register__row a:hover .register__title { color: var(--rubric); }
.register__year {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ---------- index (section threshold) ---------- */
nav.index {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5rem) var(--gutter);
}
nav.index .section-mark { margin-bottom: 1.2rem; }
nav.index .index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 36rem;
  border-top: 1px solid var(--rule);
}
nav.index .index__row {
  border-bottom: 1px solid var(--rule);
}
nav.index .index__row a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0.4rem;
  transition: background 0.15s;
}
nav.index .index__row a:hover { background: var(--paper-raised); }
nav.index .index__name {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  transition: color 0.15s;
}
nav.index .index__row a:hover .index__name { color: var(--rubric); }
nav.index .index__path {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ---------- catalogue ---------- */
.page-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  color: var(--ink); margin: 0 0 0.35rem; letter-spacing: -0.015em; line-height: 1.1;
}
.page-sub {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--ink-muted); margin: 0;
}

.catalogue__layout { display: grid; grid-template-columns: 13rem 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 2.5rem; }
.index { align-self: start; position: sticky; top: calc(var(--masthead-h) + 0.75rem); }
.index__list { list-style: none; margin: 0; padding: 0; }
.index__item {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-muted);
  padding: 0.32rem 0; border-bottom: 1px solid var(--rule-soft); transition: color 0.15s;
}
.index__item:hover { color: var(--ink); }
.index__item.is-active { color: var(--rubric); }
.index__count { color: var(--ink-faint); }

.records { border-top: 1px solid var(--rule); }
.record {
  display: grid; grid-template-columns: 5rem 1fr; gap: 1.5rem; align-items: baseline;
  padding: 1rem 0.2rem; border-bottom: 1px solid var(--rule); transition: background 0.15s;
}
.record:hover { background: var(--paper-raised); }
.record__meta { font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; }
.record__year { color: var(--ink-muted); letter-spacing: 0.04em; }
.record__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.25; color: var(--ink); margin: 0;
}
.record:hover .record__title { color: var(--rubric); }

/* ---------- reader ---------- */
.reader { max-width: var(--page); }
.reader__head { max-width: var(--measure); margin: 0 auto; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.reader__breadcrumb { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-faint); margin: 0 0 1.4rem; }
.reader__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  line-height: 1.1; letter-spacing: -0.015em;
  color: var(--ink); margin: 0 0 0.85rem;
}
.reader__byline { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-muted); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.reader__sep { color: var(--ink-faint); }
.epigraph { font-style: italic; font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); border-left: 2px solid var(--rubric); margin: 1.8rem 0 0; padding-left: 1.2rem; max-width: 50ch; }

.reader__layout { display: grid; grid-template-columns: 11rem minmax(0, var(--measure)); gap: clamp(1.5rem, 3vw, 2.5rem); justify-content: center; margin-top: 2.5rem; }
.reader__margin { align-self: start; position: sticky; top: calc(var(--masthead-h) + 0.75rem); font-size: 0.92rem; }
.colophon-card { margin: 0 0 1.2rem; font-family: var(--mono); font-size: 0.72rem; }
.colophon-card dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; margin-top: 0.9rem; }
.colophon-card dt:first-child { margin-top: 0; }
.colophon-card dd { margin: 0.2rem 0 0; color: var(--ink-soft); line-height: 1.45; }
.reader__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* prose — the printed page */
.prose { max-width: var(--measure); }
.prose > * { margin: 0 0 1.4rem; }
.prose p { font-size: 1.12rem; line-height: 1.78; color: var(--ink-soft); }
.prose > p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--ink);
}
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.2; color: var(--rubric); margin: 2.6rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--rule-soft); }
.prose h3 { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--ink); margin: 2rem 0 0.8rem; }
.prose a { color: var(--rubric); border-bottom: 1px solid rgba(154,123,47,0.4); }
.prose a:hover { color: var(--rubric-d); border-color: var(--rubric); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.4rem 0; line-height: 1.7; }
.prose li::marker { color: var(--rubric); }
.prose blockquote { border-left: 2px solid var(--rule); margin-left: 0; padding-left: 1.3rem; font-style: italic; color: var(--ink-muted); }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose code { font-family: var(--mono); font-size: 0.86em; color: var(--rubric-d); background: var(--paper-sunk); padding: 0.12em 0.4em; border-radius: 2px; border: 1px solid var(--rule-soft); }
.prose pre { background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: 3px; padding: 1.1rem 1.3rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.6; }
.prose pre code { color: var(--ink); background: none; border: none; padding: 0; font-size: 1em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-family: var(--mono); }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
.prose th { color: var(--ink); font-weight: 600; }
.prose td { color: var(--ink-soft); }
.prose sup a { font-size: 0.7em; }
.footnote-definition { font-size: 0.88rem; color: var(--ink-muted); display: flex; gap: 0.5rem; }
.footnote-definition p { font-size: 0.88rem; margin: 0; }

/* wikilink (notes) */
.wikilink { color: var(--indigo); border-bottom: 1px solid rgba(74,124,181,0.4); }
.wikilink:hover { color: var(--rubric); border-color: var(--rubric); }
.wikilink--missing { color: var(--ink-muted); border-bottom: 1px dashed var(--ink-faint); cursor: help; }

.reader__foot { max-width: var(--measure); margin: 3rem auto 0; padding-top: 2rem; border-top: 1px solid var(--rule); }
.reader__return { font-family: var(--mono); font-size: 0.8rem; margin: 0; }

/* ---------- backlinks panel ---------- */
.backlinks {
  max-width: var(--measure); margin: 3rem auto 0;
  border-top: 1px solid var(--rule); padding-top: 2rem;
}
.backlinks__head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.3rem;
}
.backlinks__label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-muted);
}
.backlinks__count { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); }
.backlinks__list { list-style: none; margin: 0; padding: 0; }
.backlinks__item {
  padding: 0.85rem 0 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 2px solid var(--paper-deep);
  transition: border-left-color 0.15s;
}
.backlinks__item:hover { border-left-color: var(--rubric); }
.backlinks__item--note    { border-left-color: rgba(74,180,74,0.3); }
.backlinks__item--paper,
.backlinks__item--article,
.backlinks__item--essay,
.backlinks__item--work    { border-left-color: rgba(154,123,47,0.35); }
.backlinks__item--builder { border-left-color: rgba(74,124,181,0.4); }
.backlinks__body { }
.backlinks__row { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.2rem; }
.backlinks__title {
  font-family: var(--serif); font-size: 1.05rem; color: var(--ink);
  transition: color 0.12s;
}
.backlinks__title:hover { color: var(--rubric); }
.backlinks__kind {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
}
.backlinks__ctx { font-size: 0.9rem; color: var(--ink-muted); font-style: italic; margin: 0; line-height: 1.5; }

/* ---------- graph ---------- */
.graph__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.graph__legend {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  padding-top: 0.6rem;
}
.legend__dot {
  display: inline-block; width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
}

/* toolbar: search input */
.graph__toolbar { margin-bottom: 0.8rem; }
.graph__search {
  font-family: var(--mono); font-size: 0.84rem; color: var(--ink);
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.45em 0.9em; width: min(20rem, 100%);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.graph__search:focus {
  outline: none; border-color: var(--rubric);
  box-shadow: 0 0 0 3px rgba(154,123,47,0.12);
}
.graph__search::placeholder { color: var(--ink-faint); }

/* stage + panel wrapper */
.graph__wrap {
  position: relative; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
  .graph__wrap { animation: stageGlow 1.4s ease both; }
}
.graph__stage {
  width: 100%; height: min(80vh, 780px);
  background: var(--paper-raised);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(154,123,47,0.03) 0%, transparent 60%),
    radial-gradient(var(--rule-soft) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}
.graph__stage svg { display: block; width: 100%; height: 100%; cursor: grab; }
.graph__stage svg:active { cursor: grabbing; }
.graph__hint {
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); margin-top: 0.7rem;
}

/* SVG node and edge classes */
.gedge { stroke: rgba(42,46,50,0.12); stroke-width: 1; fill: none; }
.gedge--active { stroke: var(--rubric); stroke-width: 1.8; opacity: 0.65; }
.gedge--dim { opacity: 0.05; }

.gnode { cursor: pointer; }
.gnode--dim circle { opacity: 0.1; }
.gnode--dim .gnode-lbl text { opacity: 0.07; }
.gnode--dim .gnode-lbl rect { opacity: 0; }
.gnode--focus circle { }
.gnode--nbr circle { opacity: 1; }

/* node labels */
.gnode-ltxt {
  font-family: var(--mono); font-size: 9.5px;
  fill: var(--ink-soft); pointer-events: none; user-select: none;
}
.gnode-lbg {
  fill: var(--paper-raised); opacity: 0.78;
  pointer-events: none;
}

/* ---------- graph side panel ---------- */
.graph-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; overflow: hidden;
  transition: width 0.22s ease;
  background: rgba(250,248,243,0.97);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--rule);
  z-index: 5;
}
.graph-panel--on { width: 22rem; }

.gp-inner {
  padding: 1.6rem 1.4rem; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0;
}
.gp-kind {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem;
}
.gp-kind--work    { color: var(--rubric); }
.gp-kind--builder { color: var(--indigo); }
.gp-kind--note    { color: #5a9a5a; }
.gp-kind--concept { color: var(--gold); }

.gp-title {
  font-family: var(--serif); font-weight: 400; font-size: 1.25rem; line-height: 1.2;
  color: var(--ink); margin: 0 0 0.75rem;
}
.gp-title a { color: inherit; transition: color 0.12s; }
.gp-title a:hover { color: var(--rubric); }

.gp-summary {
  font-size: 0.88rem; line-height: 1.55; color: var(--ink-muted);
  font-style: italic; margin: 0 0 1.1rem;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule-soft);
}

.gp-section { margin-bottom: 1rem; }
.gp-section-lbl {
  font-family: var(--mono); font-size: 0.63rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.45rem;
}
.gp-list { list-style: none; margin: 0; padding: 0; }
.gp-link {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.88rem; color: var(--ink-soft);
  padding: 0.28rem 0; border-bottom: 1px solid var(--rule-soft);
  transition: color 0.12s;
}
.gp-link:hover { color: var(--rubric); }
.gp-dot {
  flex-shrink: 0; width: 0.45em; height: 0.45em;
  border-radius: 50%; background: var(--ink-faint);
}
.gp-link--work .gp-dot    { background: var(--rubric); }
.gp-link--builder .gp-dot { background: var(--indigo); }
.gp-link--note .gp-dot    { background: #5a9a5a; }
.gp-link--concept .gp-dot { background: var(--gold); }
.gp-more { font-size: 0.78rem; color: var(--ink-faint); font-family: var(--mono); padding: 0.2rem 0; }
.gp-foot { margin-top: auto; padding-top: 1.2rem; }
.gp-open {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--rubric); border-bottom: 1px solid rgba(154,123,47,0.35);
  transition: color 0.15s, border-color 0.15s;
}
.gp-open:hover { color: var(--rubric-d); border-color: var(--rubric); }

/* ---------- builders ---------- */
.builders__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); box-shadow: 0 1px 3px var(--shadow); margin-top: 2rem; }
.builder-card { background: var(--paper-raised); padding: 1.6rem; display: block; transition: background .2s; }
.builder-card:hover { background: var(--paper-raised); }
.builder-card__name { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; color: var(--ink); margin: 0 0 0.2rem; }
.builder-card:hover .builder-card__name { color: var(--rubric); }
.builder-card__life { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); margin: 0 0 0.4rem; }
.builder-card__fields { font-style: italic; color: var(--ink-muted); font-size: 0.92rem; margin: 0 0 0.8rem; }
.builder-card__known { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.builder__head { max-width: var(--measure); margin: 0 auto; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.builder__life { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-muted); margin: 0.6rem 0 0; }
.builder__fields { font-style: italic; color: var(--rubric); margin: 0.4rem 0 0; }

/* ---------- search ---------- */
.search__form { display: flex; gap: 0.6rem; margin: 1.5rem 0 2.5rem; max-width: 44rem; }
.search__input {
  flex: 1; font-family: var(--mono); font-size: 1rem; color: var(--ink);
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px;
  padding: 0.7em 1em;
}
.search__input:focus { outline: none; border-color: var(--rubric); box-shadow: 0 0 0 3px rgba(154,123,47,0.15); }
.search__results { border-top: 1px solid var(--rule); }
.search__hit { display: block; padding: 1.3rem 0.5rem; border-bottom: 1px solid var(--rule); transition: background .15s; }
.search__hit:hover { background: var(--paper-raised); }
.search__hit-kind { font-family: var(--mono); font-size: 0.68rem; color: var(--rubric); letter-spacing: 0.06em; }
.search__hit-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin: 0.2rem 0; }
.search__hit:hover .search__hit-title { color: var(--rubric); }
.search__hit-ctx { font-size: 0.95rem; color: var(--ink-muted); margin: 0; }
.search__hit-ctx mark { background: rgba(154,123,47,0.25); color: var(--ink); padding: 0 0.1em; }
.search__empty { color: var(--ink-muted); font-style: italic; }

/* ---------- void / 404 ---------- */
.void { text-align: center; min-height: 50vh; }
.void__code { font-family: var(--mono); font-size: 0.9rem; color: var(--rubric); letter-spacing: 0.2em; margin: 0 0 1rem; }
.void__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.8rem); color: var(--ink); margin: 0 0 1rem; }
.void__body { max-width: 46ch; margin: 0 auto 2rem; color: var(--ink-muted); }

/* ---------- colophon / footer ---------- */
.colophon { border-top: 1px solid var(--rule); margin-top: 2rem; }
.colophon__line {
  max-width: var(--page); margin: 0 auto; padding: 1.25rem var(--gutter);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ---------- responsive ---------- */

/* tablet */
@media (max-width: 860px) {
  .atrium { padding-top: 2rem; padding-bottom: 1.5rem; }
  .manifesto { grid-template-columns: 1fr; }
  .manifesto__epigraph { border-left: none; border-top: 2px solid var(--rubric); padding-left: 0; padding-top: 1.2rem; }
  .catalogue__layout { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1.75rem; }
  .catalogue__layout .index { position: static; top: auto; }
  .catalogue__layout .index__list { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; }
  .catalogue__layout .index__item { border: none; padding: 0.2rem 0; }
  .reader__layout { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1.75rem; }
  .reader__margin { position: static; border-bottom: 1px solid var(--rule); padding-bottom: 1.25rem; }
  .graph-panel--on { width: min(20rem, 75vw); }
  .graph__stage { height: min(65vh, 620px); }
}

/* mobile */
@media (max-width: 540px) {
  :root { --gutter: 1rem; --masthead-h: 5.25rem; }
  .masthead__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .nav {
    margin: 0 calc(-1 * var(--gutter));
    padding: 0.15rem var(--gutter) 0.25rem;
    gap: 0.5rem 0.65rem;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav__item {
    font-size: 0.78rem;
  }
  .nav__cta {
    margin-left: auto;
    padding: 0.5em 0.95em;
    font-size: 0.65rem;
  }
  .atrium__title {
    font-size: clamp(1.65rem, 7.5vw, 2rem);
    max-width: none;
  }
  .plate { padding: 1rem 0.65rem; }
  .plate__math .katex { font-size: 0.82em; }
  .plate__caption { font-size: 0.68rem; margin-top: 0.85rem; }
  .register__row a {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.7rem 0.05rem;
  }
  .register__year { font-size: 0.68rem; }
  .record { grid-template-columns: 1fr; gap: 0.25rem; padding: 0.75rem 0.1rem; }
  .graph-panel--on { width: 100%; }
  .graph__stage { height: min(55vh, 420px); }
  .void__title { font-size: clamp(1.5rem, 6vw, 2rem); }
  .prose p { font-size: 1.05rem; line-height: 1.72; }
  .prose > p:first-of-type { font-size: 1.1rem; }
}

/* desktop: comfortable reading size */
@media (min-width: 900px) {
  html { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
