/* (c) 2026 Trotta. The essay pages (/ and /essay), set as a plain monospace document. */

@font-face {
  font-family: 'Trotta Signature';
  font-style: normal;
  font-display: block;
  font-weight: 400;
  src: url('/fonts/TrottaSignature.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 70ch;
  --gutter: 20px;
  --line: 24px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #ffffff;
  color: #111111;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  font-size-adjust: ex-height 0.53;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* Prose tracking: monospace word spacing is gappy at this measure.
   Never let it reach pre, .spec or svg text, where columns must align. */
p, li, .thesis, .lede { letter-spacing: -0.01em; }

.sheet {
  max-width: min(calc(var(--measure) + 2 * var(--gutter)), 700px);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
}

/* Booking link, hard right against the page edge, not the text column.
   Bordered to match the floater, so the two fixed affordances read as one system. */
.topbar {
  text-align: right;
  padding: 20px max(20px, env(safe-area-inset-right, 0px)) 0 20px;
}
.topbar a { display: inline-block; }

/* One button, used by the masthead link, the floater and the closing actions.
   :visited is pinned because the browser default turns a visited link purple,
   which makes the page's main actions look broken once anyone has used them. */
.btn,
.topbar a,
.floater {
  display: inline-block;
  border: 1px solid #111111;
  background: #ffffff;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #111111;
  text-decoration: none;
  white-space: nowrap;
}
.btn:visited, .topbar a:visited, .floater:visited { color: #111111; }
.btn:hover, .topbar a:hover, .floater:hover { background: #111111; color: #ffffff; }
.btn:focus-visible, .topbar a:focus-visible, .floater:focus-visible {
  outline: 2px solid #1e3d9c; outline-offset: 2px;
}

/* Title block */
.titleblock { margin: 0 0 40px; }
h1 {
  font-size: 1.625rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #000000;
  margin: 0 0 8px;
}
.subtitle {
  font-size: 0.9375rem;
  color: #333333;
  margin: 0 0 8px;
}
.dateline {
  font-size: 0.8125rem;
  color: #555555;
  margin: 0;
}
.dateline span { white-space: nowrap; }

/* Body copy */
p { margin: 0 0 var(--line); text-wrap: pretty; }
h2 {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000000;
  margin: 48px 0 8px;
}

.thesis {
  margin: 32px 0;
  padding-left: 16px;
  border-left: 2px solid #000000;
  font-size: 1.0625rem;
  font-weight: 700;
}

.epigraph {
  margin: var(--line) 0 0;
  padding-left: 16px;
  border-left: 1px solid #999999;
}
.epigraph p { margin: 0 0 4px; color: #222222; }
.epigraph .who { font-size: 0.8125rem; color: #555555; }

hr { border: 0; border-top: 1px solid #999999; margin: 40px 0; }

/* Figures: full bleed so the exhibits render near 1:1 */
figure {
  margin: 48px calc(-1 * var(--gutter));
  overflow-x: auto;
}
figure svg {
  width: 100%;
  min-width: 600px;
  height: auto;
  display: block;
  color: #000000;
}
figure svg text { font-family: var(--mono); letter-spacing: 0; fill: currentColor; }
figure svg .lbl { font-size: 11.5px; }
figure svg .lbl-s { font-size: 10.5px; }
figure svg .cap { font-size: 10px; letter-spacing: 0.06em; }
figure svg .strong { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
figure svg .soft { fill: #555555; }
figure svg .dim { fill: #555555; }
figure svg .ln { stroke: currentColor; fill: none; stroke-width: 1.25; }
figure svg .ln-soft { stroke: #555555; fill: none; stroke-width: 1; }
figure svg .ln-rule { stroke: #999999; fill: none; stroke-width: 1; }
figure svg .dot { fill: currentColor; stroke: none; }
figure svg .ring { fill: none; stroke: currentColor; stroke-width: 1.5; }
figure svg .dash { stroke-dasharray: 3 4; }
figcaption {
  font-size: 0.8125rem;
  line-height: 20px;
  color: #555555;
  margin: 8px var(--gutter) 0;
}
figcaption .fig-no { font-weight: 700; color: #000000; letter-spacing: 0.06em; }

/* Spec box: machine output, carried by ground and rhythm, not by family */
.spec {
  margin: 48px calc(-1 * var(--gutter));
  padding: 16px var(--gutter);
  border: 0;
  border-top: 1px solid #999999;
  border-bottom: 1px solid #999999;
  background: #fafafa;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 20px;
  letter-spacing: 0;
  overflow-x: auto;
}
.spec pre { margin: 0; font-family: inherit; }
.spec .cm { color: #666666; }
.spec .kw { font-weight: 700; }
.spec .spec-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

/* Signature */
.signoff { margin: 40px 0 0; }
.sig-ink {
  font-family: 'Trotta Signature', cursive;
  font-size: 1.875rem;
  /* the script ascenders overflow a line-height of 1 and get clipped */
  line-height: 1.45;
  color: #1e3d9c;
  transform: rotate(-1.5deg);
  transform-origin: left bottom;
  margin: 0 0 8px 2px;
  width: fit-content;
}
.signoff .typed { margin: 0; }
.signoff .role { color: #555555; }
.signoff .backline { font-size: 0.8125rem; margin-top: 12px; }

/* Read-on block (one-pager) */
.readon {
  margin: 48px 0 0;
  border-top: 1px solid #999999;
  padding-top: var(--line);
}
.readon .facts { font-size: 0.875rem; color: #111111; margin: 0 0 var(--line); }
.readon .action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
}
.readon .action:last-child { margin-bottom: 0; }
.readon .note { font-size: 0.8125rem; color: #555555; }

/* About + sources */
.about { font-size: 0.875rem; }
.about strong { color: #000000; }
.sources { font-size: 0.8125rem; line-height: 20px; letter-spacing: 0; }
.sources ol { padding-left: 4ch; margin: var(--line) 0 0; }
.sources li { margin-bottom: 8px; }

/* Footer */
footer.colophon {
  border-top: 1px solid #999999;
  margin-top: 48px;
  padding-top: 16px;
  font-size: 0.8125rem;
  color: #555555;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
footer.colophon a { color: inherit; text-decoration: none; }
footer.colophon a:visited { color: inherit; }
footer.colophon a:hover { color: #111111; text-decoration: underline; text-underline-offset: 3px; }
footer.colophon .spacer { flex: 1; }

@media (max-width: 480px) {
  :root { --gutter: 16px; --line: 23px; }
  body { font-size: 0.875rem; line-height: 1.65; }
  .sheet { padding: 40px var(--gutter) 40px; }
  h1 { font-size: 1.375rem; }
  h2 { font-size: 0.9375rem; }
  .thesis { font-size: 0.9375rem; }
  .sig-ink { font-size: 1.625rem; }
}

@media print {
  .readon, footer.colophon { display: none; }
  a { color: #000000; text-decoration: none; }
  figure, .spec { break-inside: avoid; overflow-x: visible; }
  figure svg { min-width: 0; }
}

/* Floating link to the full essay, one-pager only. The page has no JS, so it
   is always present; .sheet-floater reserves room so it never covers the end. */
.floater {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 10;
}
.sheet-floater { padding-bottom: 104px; }

@media print { .floater { display: none; } }
