:root {
  --ink: #0e0e0e;
  --paper: #ffffff;
  --whisper: #8a857d;
  --note: #a09990;
}

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  padding: clamp(24px, 5vh, 44px) clamp(24px, 5vw, 60px);
}
.site-back {
  font-family: 'Jost', 'Futura', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--whisper);
  text-decoration: none;
  transition: color .2s ease;
}
.site-back:hover { color: var(--ink); }

/* ── Essay layout ───────────────────────────────────────────── */
.essay-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 60px) clamp(80px, 12vh, 140px);
}

/* ── Head ───────────────────────────────────────────────────── */
.essay-head {
  max-width: 600px;
  margin-bottom: clamp(48px, 8vh, 80px);
}

.essay-title {
  font-family: 'Jost', 'Futura', sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1.1em;
  color: var(--ink);
}

.essay-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--whisper);
  margin: 0;
  display: flex;
  gap: 0.7em;
  align-items: center;
}
.essay-meta .sep { opacity: 0.4; }
.essay-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 2px;
  text-transform: lowercase;
  background: #f0ede8;
  color: #6a5a48;
}

/* ── Body rows ──────────────────────────────────────────────── */
.essay-body {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.row {
  display: grid;
  grid-template-columns: minmax(auto, 600px) 1fr;
  column-gap: clamp(36px, 5vw, 64px);
  align-items: start;
}

/* ── Prose ──────────────────────────────────────────────────── */
.prose {
  min-width: 0;
}
.prose p {
  font-family: 'Bodoni Moda', 'Didot', Georgia, serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.78;
  letter-spacing: -0.003em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 18;
}

.prose a {
  color: var(--ink);
  text-decoration: none;
  background: rgba(100, 149, 220, 0.12);
  border-radius: 2px;
  padding: 0 2px;
  transition: background .2s ease;
}
.prose a:hover {
  background: rgba(100, 149, 220, 0.28);
}

/* ── Margin notes ───────────────────────────────────────────── */
.marginnote {
  padding-top: 0.35em; /* optical alignment with cap-height */
}

.marginnote a {
  display: block;
  font-family: 'Bodoni Moda', 'Didot', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--note);
  text-decoration: none;
  font-variation-settings: "opsz" 14;
  transition: color .25s ease;
  cursor: pointer;
  position: relative;
}
.marginnote a::after {
  content: '';
  display: block;
  height: 1px;
  background: currentColor;
  margin-top: 3px;
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
}
.marginnote a:hover {
  color: var(--ink);
}
.marginnote a:hover::after {
  transform: scaleX(1);
}

/* ── Spacer rows (no note) ──────────────────────────────────── */
.row .spacer {
  /* empty right cell — nothing */
}

/* ── Narrow screens ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .row {
    grid-template-columns: 1fr;
  }
  .marginnote {
    padding-top: 0;
    margin-top: 0.6em;
    margin-bottom: 1.55em;
    padding-left: 1em;
    border-left: 1px solid rgba(0,0,0,0.1);
  }
}
