:root,
:root[data-theme="paper"] {
  --bg: #f7f3ec;
  --surface: #fffdf8;
  --text: #2b2926;
  --muted: #6c655d;
  --faint: #a59d93;
  --rule: #e4dccf;
  --accent: #8b2e25;
  --accent-ink: #fffaf4;
  --mark: rgba(139, 46, 37, 0.12);
  --shadow: 0 1px 2px rgba(43, 41, 38, 0.06), 0 8px 24px -8px rgba(43, 41, 38, 0.14);
  --logo-light: none;
  --logo-dark: inline-block;
  color-scheme: light;
}
:root[data-theme="sepia"] {
  --bg: #f1e5d1;
  --surface: #f8efe0;
  --text: #3a2d21;
  --muted: #6d5a46;
  --faint: #a8957d;
  --rule: #e0cfb4;
  --accent: #8b2e25;
  --accent-ink: #fff6ea;
  --mark: rgba(139, 46, 37, 0.13);
  --shadow: 0 1px 2px rgba(58, 45, 33, 0.07), 0 8px 24px -8px rgba(58, 45, 33, 0.18);
  --logo-light: none;
  --logo-dark: inline-block;
  color-scheme: light;
}
:root[data-theme="gray"] {
  --bg: #242322;
  --surface: #2e2d2b;
  --text: #ebe3d8;
  --muted: #aaa196;
  --faint: #6f6a63;
  --rule: #3a3936;
  --accent: #e57a68;
  --accent-ink: #1c1b1a;
  --mark: rgba(229, 122, 104, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -8px rgba(0, 0, 0, 0.55);
  --logo-light: inline-block;
  --logo-dark: none;
  color-scheme: dark;
}
:root[data-theme="contrast"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #262626;
  --faint: #595959;
  --rule: #000000;
  --accent: #9e0b0f;
  --accent-ink: #ffffff;
  --mark: rgba(158, 11, 15, 0.14);
  --shadow: 0 0 0 2px #000;
  --logo-light: none;
  --logo-dark: inline-block;
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #000000;
  --surface: #0d0d0d;
  --text: #ffe45c;
  --muted: #fff1a6;
  --faint: #bfae55;
  --rule: #ffe45c;
  --accent: #ffffff;
  --accent-ink: #000000;
  --mark: rgba(255, 228, 92, 0.2);
  --shadow: 0 0 0 2px #ffe45c;
  --logo-light: inline-block;
  --logo-dark: none;
  color-scheme: dark;
}

:root {
  --fs: 22px;
  --serif: "Alegreya", "Noto Sans Runic", Georgia, "Iowan Old Style", serif;
  --sans: "Alegreya Sans", "Noto Sans Runic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc: "Alegreya Sans SC", "Alegreya Sans", system-ui, sans-serif;
  --read: var(--serif);
  --measure: 31em;
  --header-h: 3.75rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
:root[data-font="atkinson"] {
  --read: "Atkinson Hyperlegible", "Noto Sans Runic", system-ui, sans-serif;
  --measure: 29em;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

::selection { background: var(--accent); color: var(--accent-ink); }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  text-decoration: none;
  border-radius: 0.4rem;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.rune { font-family: "Noto Sans Runic", var(--serif); font-weight: 400; }

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s var(--ease), border-color 0.3s, background-color 0.35s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }

.site-header__inner {
  height: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand img { width: 28px; height: 28px; }
.brand .brand__dark { display: var(--logo-dark); }
.brand .brand__light { display: var(--logo-light); }
.brand__name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 0.15rem;
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.98rem;
}
.nav a {
  position: relative;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: 0.4rem;
  transition: color 0.2s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.6rem; right: 0.6rem; bottom: 0.15rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.reader-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.35s;
}
.reader-toggle:hover { border-color: var(--faint); }
.reader-toggle[aria-expanded="true"] { border-color: var(--accent); }
.reader-toggle small { font-size: 0.75em; }

@media (max-width: 540px) {
  .brand__name { display: none; }
  .nav { font-size: 0.92rem; }
  .nav a { padding: 0.4rem 0.45rem; }
  .nav a[aria-current="page"]::after { left: 0.45rem; right: 0.45rem; }
  .site-header__inner { gap: 0.5rem; }
}

.reader-panel {
  position: fixed;
  z-index: 70;
  top: calc(var(--header-h) + 0.5rem);
  right: max(1rem, calc((100vw - 76rem) / 2 + 1rem));
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.25rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  font-family: var(--sans);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s;
}
.reader-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}
.reader-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--sc);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.reader-panel fieldset {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}
.reader-panel legend,
.reader-panel .label {
  display: block;
  margin-bottom: 0.6rem;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.themes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}
.theme-option { position: relative; }
.theme-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.theme-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
}
.theme-swatch {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s;
}
.theme-option input:checked + label .theme-swatch {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}
.theme-option input:checked + label { color: var(--text); }
.theme-option input:focus-visible + label .theme-swatch {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.sw-paper { background: #f7f3ec; color: #2b2926; }
.sw-sepia { background: #f1e5d1; color: #3a2d21; }
.sw-gray { background: #242322; color: #ebe3d8; }
.sw-contrast { background: #fff; color: #000; box-shadow: inset 0 0 0 2px #000 !important; }
.sw-night { background: #000; color: #ffe45c; }

.size-control {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.6rem;
}
.size-control button,
.seg button {
  height: 2.75rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text);
  border-radius: 0.6rem;
  cursor: pointer;
  font-family: var(--serif);
  transition: border-color 0.2s, background-color 0.2s;
}
.size-control button:hover:not(:disabled),
.seg button:hover { border-color: var(--faint); }
.size-control button:disabled { opacity: 0.35; cursor: not-allowed; }
.size-control .smaller { font-size: 0.95rem; }
.size-control .bigger { font-size: 1.4rem; }
.size-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.size-readout output {
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 0.9rem;
  color: var(--muted);
}
.size-readout input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.seg button { font-size: 1rem; line-height: 1.1; padding: 0 0.5rem; }
.seg button[data-font="atkinson"] { font-family: "Atkinson Hyperlegible", var(--sans); font-size: 0.92rem; }
.seg button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.switch-row p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.switch {
  position: relative;
  flex-shrink: 0;
  width: 3.1rem;
  height: 1.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--rule);
  cursor: pointer;
  transition: background-color 0.25s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 0.2rem; left: 0.2rem;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(1.3rem); background: var(--accent-ink); }

.reset {
  margin-top: 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.reset:hover { color: var(--text); }

.reading {
  display: grid;
  grid-template-columns: minmax(1.25rem, 1fr) minmax(0, var(--measure)) minmax(1.25rem, 1fr);
  font-size: var(--fs);
}
.reading > * { grid-column: 2; }

@media (min-width: 1100px) {
  :root[data-notes="on"] .reading.has-notes {
    grid-template-columns: minmax(2.5rem, 1fr) minmax(0, var(--measure)) minmax(calc(15rem + 5vw), 1fr);
  }
}

.essay-head {
  padding: clamp(3rem, 10vh, 7rem) 0 2.5rem;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  font-family: var(--sc);
  font-size: max(0.82rem, 0.62em);
  letter-spacing: 0.12em;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--accent);
}
.essay-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(4rem, 15vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
}
.essay-title .rune {
  color: var(--accent);
  font-weight: 400;
  letter-spacing: -0.06em;
  margin-right: 0.02em;
}

/* Wordmark: SVG ᚠunk with glitch + binary decode */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
}
.wordmark .essay-title,
.wordmark__mark { line-height: 0; }
.wordmark__svg {
  display: block;
  width: 3em;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
.wordmark__rune { fill: var(--accent); }
.wordmark__unk { fill: var(--text); color: var(--text); }
.wordmark__ghost { opacity: 0; transition: opacity 0.35s var(--ease); }
.wordmark.is-decoded .wordmark__ghost { opacity: 0.2; }
.wordmark__slices { display: none; }
.wordmark.is-glitching .wordmark__slices { display: inline; }
.wordmark__bits {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 2.6px;
  pointer-events: none;
}
.wordmark__bits .edge { fill: var(--accent); }

.wordmark__copy {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-0.5rem);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), color 0.15s, border-color 0.15s;
}
.wordmark:hover .wordmark__copy,
.wordmark:focus-within .wordmark__copy,
.wordmark.is-decoded .wordmark__copy {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.wordmark__copy:hover { color: var(--text); border-color: var(--accent); }
.wordmark__copy svg {
  grid-area: 1 / 1;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.15s, transform 0.2s var(--ease);
}
.wordmark__icon-done { opacity: 0; transform: scale(0.6); }
.wordmark__copy.is-copied { color: var(--accent); border-color: var(--accent); }
.wordmark__copy.is-copied .wordmark__icon-copy { opacity: 0; transform: scale(0.6); }
.wordmark__copy.is-copied .wordmark__icon-done { opacity: 1; transform: none; }
@media (hover: none) {
  .wordmark__copy { opacity: 0.7; transform: none; pointer-events: auto; }
}

/* Graphics: centered showcase with the binary decode. The left padding mirrors
   the copy button so the logo itself sits on the axis. */
.wordmark-showcase {
  display: flex;
  justify-content: center;
  margin: clamp(3rem, 8vw, 5rem) 0 1rem;
}
.wordmark-showcase .wordmark { padding-left: 3.5rem; }
.wordmark-showcase .wordmark__svg { width: min(26rem, 64vw); }
@media (max-width: 540px) {
  .wordmark-showcase .wordmark { padding-left: 0; }
}

.essay-subtitle {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 1.15em, 2.2rem);
  line-height: 1.25;
  color: var(--muted);
  text-wrap: balance;
}

.prose {
  font-family: var(--read);
  font-size: 1em;
  line-height: 1.62;
  font-feature-settings: "kern", "liga", "onum";
  hanging-punctuation: first;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  overflow-wrap: break-word;
}
:root[data-font="atkinson"] .prose { line-height: 1.68; font-feature-settings: "kern"; }

.prose p { margin: 0 0 1.05em; }

.prose a:not(.fn-ref) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.2s;
}
.prose a:not(.fn-ref):hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.prose em, .prose cite { font-style: italic; }

.prose .lead::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 -0.02em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3.55em;
  line-height: 0.82;
  color: var(--accent);
}

.prose h2 {
  margin: 3.2em 0 1.1em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5em;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
  -webkit-hyphens: manual;
  hyphens: manual;
}
:root[data-font="atkinson"] .prose h2 { font-family: var(--read); }
.prose h2 .num {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--sc);
  font-size: max(0.8rem, 0.42em);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.prose ul {
  margin: 0 0 1.2em;
  padding: 0;
  list-style: none;
}
.prose ul li {
  position: relative;
  margin: 0 0 0.35em;
  padding-left: 1.4em;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.78em;
  width: 0.6em;
  height: 2px;
  background: var(--accent);
}

.epigraph {
  margin: 0 0 3rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
}
.dialogue {
  margin: 0 0 1.4em;
  font-style: italic;
  font-size: 1.04em;
  line-height: 1.55;
}
.dialogue p { margin: 0 0 0.35em; }
.epigraph footer,
.prose blockquote footer {
  margin-top: 0.8em;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72em;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.epigraph footer cite { font-style: italic; }

.prose blockquote.quote {
  margin: 1.6em 0 1.8em;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 3px solid var(--accent);
  font-size: 1.1em;
  font-style: italic;
  line-height: 1.5;
}
.prose blockquote.quote p { margin: 0; }

.prose .callout {
  margin: 2em 0;
  font-size: 1.22em;
  line-height: 1.4;
  font-weight: 500;
  text-align: left;
  text-wrap: balance;
}

.manifesto {
  position: relative;
  margin: 3.5em 0 0;
}
.manifesto-question {
  margin: 1.8em 0 0 !important;
  padding-top: 1.2em;
  border-top: 1px solid var(--rule);
  font-size: 1.15em;
  font-style: italic;
}
.annex { margin-top: 1em; }
.annex h2 .num { color: var(--muted); }

.biblio ul li { font-size: 0.86em; line-height: 1.5; margin-bottom: 0.7em; }
.biblio ul li::before { top: 0.72em; background: var(--faint); }

.end-mark {
  display: flex;
  justify-content: center;
  margin: 3.5rem 0 1rem;
}
.end-mark img { width: 2.2rem; height: 2.2rem; opacity: 0.9; }
.end-mark .brand__dark { display: var(--logo-dark); }
.end-mark .brand__light { display: var(--logo-light); }

.prose sup {
  font-size: inherit;
  line-height: 0;
  vertical-align: baseline;
}
.fn-ref {
  display: inline;
  margin: 0 0.02em 0 0.1em;
  padding: 0 0.36em;
  font-family: var(--sans);
  font-size: 0.6em;
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  background: var(--mark);
  border-radius: 999px;
  vertical-align: 0.55em;
  transition: background-color 0.2s, color 0.2s;
}
.fn-ref:hover,
.fn-ref.is-hot {
  background: var(--accent);
  color: var(--accent-ink);
}
:root[data-notes="off"] .fn-ref {
  background: transparent;
  color: var(--muted);
  padding: 0 0.15em;
  font-weight: 500;
}
:root[data-notes="off"] .fn-ref:hover { color: var(--accent); background: transparent; }

.endnotes {
  margin: 4rem 0 0;
  padding: 2rem 0 0;
  border-top: 1px solid var(--rule);
  font-size: 0.82em;
}
:root[data-notes="on"] .endnotes.js-hide { display: none; }
.endnotes h2 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5em;
  line-height: 1.15;
}
.endnotes .endnotes__lede {
  margin: 0 0 1.75rem;
  font-family: var(--sans);
  font-size: 0.85em;
  color: var(--muted);
}
.endnotes ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: fn;
}
.endnotes li {
  position: relative;
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 0 0.6em;
  margin: 0 0 1em;
  font-family: var(--read);
  line-height: 1.5;
  overflow-wrap: anywhere;
  border-radius: 0.4rem;
  transition: background-color 0.6s;
}
.endnotes li:target { background: var(--mark); }
.endnotes .n {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}
.endnotes .back {
  margin-left: 0.35em;
  font-family: var(--sans);
  text-decoration: none;
  color: var(--muted);
}
.endnotes .back:hover { color: var(--accent); }

.note-rail {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: none;
  font-size: 1rem;
}
.note-rail__inner {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  width: min(20rem, 100%);
  margin-left: clamp(1rem, 2.5vw, 3rem);
  padding: 0.5rem 1rem 1.5rem 0.5rem;
}
.note-rail__inner::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) {
  :root[data-notes="on"] .note-rail { display: block; }
}

.note-rail .note {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-6px);
  transition: grid-template-rows 0.4s var(--ease), opacity 0.3s var(--ease), transform 0.4s var(--ease), margin 0.4s var(--ease);
}
.note-rail .note.is-on {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
  margin-bottom: 0.85rem;
}
.note__clip { overflow: hidden; min-height: 0; }
.note-card {
  position: relative;
  margin: 2px;
  padding: 0.95rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  font-family: var(--read);
  font-size: max(0.95rem, calc(var(--fs) * 0.72));
  line-height: 1.45;
  overflow-wrap: anywhere;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.note-card::before {
  content: "";
  position: absolute;
  left: -1px; top: 0.9rem; bottom: 0.9rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.note-card .note-num {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--sc);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.note-card a { text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 0.15em; }
.note.is-hot .note-card { border-color: var(--accent); }
.note.is-flash .note-card { animation: flash 1.1s var(--ease); }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 var(--accent); }
  30% { box-shadow: 0 0 0 4px var(--mark); }
  100% { box-shadow: var(--shadow); }
}

.note-tray {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  width: min(40rem, calc(100vw - 1.5rem));
  transform: translate(-50%, calc(100% + 2rem));
  transition: transform 0.4s var(--ease);
  pointer-events: none;
}
.note-tray.has-items { transform: translate(-50%, 0); }
.note-tray.has-items .note-tray__list { pointer-events: auto; }
@media (min-width: 1100px) { .note-tray { display: none; } }
:root[data-notes="off"] .note-tray { display: none; }

.note-tray__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 60vh;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tray-note {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s var(--ease), opacity 0.25s var(--ease);
}
.tray-note.is-on { grid-template-rows: 1fr; opacity: 1; }
.tray-note > .note__clip > div {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tray-note button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}
.tray-note .badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.8rem;
  font-variant-numeric: lining-nums;
}
.tray-note .preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}
.tray-note .chev {
  flex-shrink: 0;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-135deg) translate(-2px, -2px);
  transition: transform 0.25s var(--ease);
}
.tray-note button[aria-expanded="true"] .chev { transform: rotate(45deg); }
.tray-note .tray-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}
.tray-note button[aria-expanded="true"] + .tray-body { grid-template-rows: 1fr; }
.tray-note .tray-body > div { overflow: hidden; min-height: 0; }
.tray-note .tray-body p {
  margin: 0;
  padding: 0 1rem 1rem 3.05rem;
  font-family: var(--read);
  font-size: max(1rem, calc(var(--fs) * 0.8));
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.tray-note button[aria-expanded="true"] .preview { visibility: hidden; }

.page-head {
  padding: clamp(4rem, 12vh, 7.5rem) 0 2rem;
}
.page-byline {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-size: 0.85em;
  color: var(--muted);
}
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.page-lede {
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15em;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.wide {
  grid-column: 1 / -1 !important;
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1rem;
  /* Follows the reader's text size: 16px at the default 22px, never smaller */
  font-size: max(1rem, calc(var(--fs) * 0.7273));
}

.palette-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5em 0 2em;
  font-family: var(--sans);
}
.chip {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.chip__color { height: 5.5rem; }
.chip__body { padding: 0.7rem 0.85rem 0.85rem; font-size: 0.9em; line-height: 1.35; }
.chip__body strong { display: block; font-size: 1.11em; }
.chip__body code {
  display: block;
  margin-top: 0.35rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.89em;
  color: var(--muted);
}
.chip__body small { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.91em; }
.chip:hover { border-color: var(--faint); }
@media (max-width: 560px) {
  .palette-row { grid-template-columns: 1fr; }
  .chip { flex-direction: row; }
  .chip__color { width: 5.5rem; height: auto; flex-shrink: 0; }
}

.press-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.98em;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--text); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { border-color: var(--text); }
.btn svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.btn small { white-space: nowrap; font-weight: 400; opacity: 0.75; font-size: 0.82em; }

.sheet {
  margin: 2.5rem 0 4rem;
}
.sheet__frame {
  display: block;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.sheet__frame img { width: 100%; height: auto; }
.sheet figcaption,
.section-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.92em;
  color: var(--muted);
}
.sheet figcaption .links { display: flex; gap: 1rem; }
.sheet figcaption a { color: var(--text); text-underline-offset: 0.2em; }

.section-label {
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.section-label h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9em;
  color: var(--text);
  letter-spacing: -0.01em;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.25rem;
  margin: 0 0 4rem;
  padding: 0;
  list-style: none;
}
.asset {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.asset:hover { border-color: var(--faint); }
.asset__preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 1.5rem;
  background-color: #f2ece3;
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.035) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.035) 75%),
    linear-gradient(45deg, rgba(0,0,0,.035) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.035) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.asset__preview.on-dark { background-color: #1b1a19; background-image: none; }
.asset__preview img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
}
.asset:hover .asset__preview img { transform: scale(1.03); }
.asset__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  padding: 1rem 1.1rem 1.1rem;
  font-family: var(--sans);
}
.asset__body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2em;
  font-weight: 700;
}
.asset__body p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.92em; line-height: 1.4; }
.asset__dl {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.asset__dl .btn { min-height: 2.5rem; padding: 0.4rem 0.9rem; font-size: 0.9em; }

.usage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 0 0 4rem;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.98em;
  line-height: 1.5;
}
.usage strong { display: block; font-family: var(--serif); font-size: 1.17em; margin-bottom: 0.25rem; }
.usage p { margin: 0; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 80;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.92rem;
  transform: translate(-50%, 200%);
  transition: transform 0.35s var(--ease);
}
.toast.is-on { transform: translate(-50%, 0); }

.site-footer {
  margin-top: 5rem;
  padding: 2.5rem 1rem calc(3rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer__inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

/* Language switch: EN | ES */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, background-color 0.35s;
}
.lang-switch a {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current] {
  background: var(--rule);
  color: var(--text);
}
.lang-switch--footer { font-size: 0.78rem; }
.lang-switch--footer a { min-width: 2rem; height: 2rem; }
@media (max-width: 540px) {
  /* Header only has room for the language you can switch to */
  .site-header .lang-switch { padding: 0; }
  .site-header .lang-switch a[aria-current] { display: none; }
  .site-header .lang-switch a { min-width: 2.6rem; height: 2.6rem; }
}
:root[data-notes="on"] body.essay .site-footer { padding-bottom: 6rem; }
@media (min-width: 1100px) { :root[data-notes="on"] body.essay .site-footer { padding-bottom: 3rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .progress, .reader-panel, .note-rail, .note-tray, .site-footer, .wordmark__copy { display: none !important; }
  :root { --bg: #fff; --text: #000; }
  .endnotes { display: block !important; }
  .reading { font-size: 12pt; }
}

.page-head.wide { padding: clamp(4rem, 12vh, 7.5rem) 1rem 2rem; }
.page-head.wide .page-lede { max-width: 40rem; font-size: 1.3em; }

.sep {
  margin: 0 0.3em;
  color: var(--faint);
}
.btn--primary .sep { color: inherit; opacity: 0.6; }
