/* (c) 2026 Trotta. The essay pages (/essay, /essay/short, /film): a paper document
   in the house style of trotta.io: the same face, chrome, blue and footer as the
   landing page. Plain on purpose: one measure of text, nothing decorative. */

@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/dm-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/dm-mono-latin-500-normal.woff2') format('woff2');
}
@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;
  --font: 'Manrope Variable', Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --paper: #f5f6f3;
  --ink: #0a101b;
  --text: #1f2633;
  --muted: #5d6675;
  --rule: rgb(10 16 27 / 0.16);
  --rule-strong: rgb(10 16 27 / 0.3);
  --night: #07090d;
  --night-text: #a9b2c1;
  --night-border: rgb(204 216 235 / 0.17);
  --white: #f3f5f8;
  --blue: #2d68f6;
  --blue-hover: #2457d2;
  --measure: 46rem;
  --gutter: 1.25rem;
  --line: 1.7;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: var(--line);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blue-hover); }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* ---- The house chrome: the landing page's nav band and footer ---- */
.site-nav {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 4rem;
  border-bottom: 1px solid var(--night-border);
  background: rgb(7 9 13 / 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--white);
}
.site-nav-inner,
.site-foot-inner {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.site-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
  text-decoration: none;
}
.brand:hover { color: var(--white); }
.brand-mark,
.brand-mark img { display: block; width: 1.75rem; height: 1.75rem; }
.brand-mark img { object-fit: contain; }
.brand-word {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

/* One button, the landing page's: the nav, 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,
.floater {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--blue);
  border-radius: 0.2rem;
  padding: 0.8rem 1.2rem;
  background: var(--blue);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.btn:visited, .floater:visited { color: var(--white); }
.btn:hover, .floater:hover { border-color: var(--blue-hover); background: var(--blue-hover); color: var(--white); }
.btn:active, .floater:active { transform: translateY(1px); }
.btn:focus-visible, .floater:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn .arrow, .floater .arrow { font-weight: 400; }

.site-foot {
  margin-top: 4rem;
  border-top: 1px solid var(--night-border);
  background: var(--night);
  color: var(--night-text);
  padding: 2rem 0;
  font-size: 0.8125rem;
}
.site-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--night-text); text-decoration: none; font-weight: 650; }
.site-foot a:hover { color: var(--white); }
.site-foot .brand a, .site-foot a.brand { font-weight: 500; }
.site-foot .copy { margin-left: auto; }

/* ---- The document ---- */
.sheet {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 2rem;
}

.titleblock { margin: 0 0 2.5rem; }
h1 {
  font-size: clamp(2.125rem, 1.5rem + 2.4vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.subtitle {
  font-size: 1.1875rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin: 0;
}

p { margin: 0 0 1.25rem; text-wrap: pretty; }
h2 {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 3rem 0 0.75rem;
}
strong { color: var(--ink); font-weight: 700; }
.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink); }

.thesis {
  margin: 2rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--blue);
  font-size: 1.1875rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.epigraph {
  margin: 1.5rem 0 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule-strong);
}
.epigraph p { margin: 0 0 0.25rem; color: var(--text); }
.epigraph .who { font-size: 0.875rem; color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* The essay read aloud: the player styles live with its script, src/listen/listen.css */

/* Figures: full bleed so the exhibits render near 1:1. Their labels stay in the
   mono face: the columns inside them are aligned by character. */
figure {
  margin: 3rem calc(-1 * var(--gutter));
  overflow-x: auto;
}
figure svg {
  width: 100%;
  min-width: 600px;
  height: auto;
  display: block;
  color: var(--ink);
  overflow: visible; /* a centred label wider than the viewBox was losing its first and last words */
}
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: 500; letter-spacing: 0.06em; }
figure svg .soft { fill: var(--muted); }
figure svg .dim { fill: var(--muted); }
figure svg .ln { stroke: currentColor; fill: none; stroke-width: 1.25; }
figure svg .ln-soft { stroke: var(--muted); fill: none; stroke-width: 1; }
figure svg .ln-rule { stroke: var(--rule-strong); 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.875rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.6rem var(--gutter) 0;
}
figcaption .fig-no { font-family: var(--mono); font-weight: 500; color: var(--ink); letter-spacing: 0.06em; font-size: 0.75rem; }

/* Spec box: machine output in the mono face, on a slightly raised card */
.spec {
  margin: 3rem calc(-1 * var(--gutter));
  padding: 1.1rem var(--gutter);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  background: #ffffff;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--ink);
  overflow-x: auto;
}
.spec pre { margin: 0; font-family: inherit; }
.spec .cm { color: var(--muted); }
.spec .kw { font-weight: 500; color: var(--blue-hover); }
.spec .spec-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* Signature */
.signoff { margin: 3rem 0 0; }
.sig-ink {
  font-family: 'Trotta Signature', cursive;
  font-size: 2rem;
  /* the script ascenders overflow a line-height of 1 and get clipped */
  line-height: 1.45;
  color: var(--blue-hover);
  transform: rotate(-1.5deg);
  transform-origin: left bottom;
  margin: 0 0 0.5rem 2px;
  width: fit-content;
}
.signoff .typed { margin: 0; color: var(--ink); }
.signoff .role { color: var(--muted); }
.signoff .backline { font-size: 0.875rem; margin-top: 0.75rem; }

/* Read-on block (one-pager) */
.readon {
  margin: 3rem 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
.readon .facts { font-size: 0.9375rem; color: var(--text); margin: 0 0 1.5rem; }
.readon .action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0 0 1rem;
}
.readon .action:last-child { margin-bottom: 0; }
.readon .note { font-size: 0.875rem; color: var(--muted); }

/* About + sources */
.about { font-size: 0.9375rem; }
.about strong { color: var(--ink); }
.sources { font-size: 0.875rem; line-height: 1.55; }
.sources ol { padding-left: 1.6rem; margin: 1.25rem 0 0; }
.sources li { margin-bottom: 0.5rem; }

@media (max-width: 480px) {
  :root { --gutter: 1rem; }
  body { font-size: 1rem; }
  .site-nav { height: 3.5rem; }
  .site-nav-inner, .site-foot-inner { padding: 0 1rem; }
  .sheet { padding: 2.5rem var(--gutter) 1.5rem; }
  .subtitle { font-size: 1.0625rem; }
  h2 { font-size: 1.1875rem; }
  .thesis, .lede { font-size: 1.0625rem; }
  .sig-ink { font-size: 1.75rem; }
  .btn, .floater { min-height: 2.75rem; padding: 0.7rem 1rem; }
  .site-foot .copy { margin-left: 0; }
}

@media print {
  .site-nav, .site-foot, .readon, .floater { display: none; }
  body { background: #ffffff; }
  a { color: #000000; text-decoration: none; }
  figure, .spec { break-inside: avoid; overflow-x: visible; }
  figure svg { min-width: 0; }
}

/* The link to the other version rides along at the foot of the viewport while
   the reader is in the document, inside the text column, and scrolls away with
   the document's end so it never sits on the footer. No JS needed. */
.floater-dock {
  position: sticky;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  pointer-events: none;
}
.floater {
  pointer-events: auto;
  box-shadow: 0 8px 24px rgb(7 9 13 / 0.18);
}

/* The film page */
figure.film { margin: 0 calc(-1 * var(--gutter)) 2.5rem; overflow: visible; }
figure.film video { display: block; width: 100%; height: auto; background: #000000; border-radius: 0.4rem; }
