@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Geist';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/geist-latin-wght-italic.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('./fonts/newsreader-latin-opsz-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url('./fonts/newsreader-latin-opsz-italic.woff2') format('woff2-variations');
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --ink: #091120;
  --ink-body: rgba(9, 17, 32, 0.88);
  --ink-soft: #5b6472;
  --ink-faint: #78808d;
  --rule: rgba(9, 17, 32, 0.09);
  --rule-strong: rgba(9, 17, 32, 0.22);
  --cobalt: #1148f7;
  --link: #175cd4;
  --link-underline: rgba(23, 92, 212, 0.3);
  --pale: #d7e7ff;
  --tint: #f4f8ff;
  --teal: #0f8a7b;
  --teal-wash: #e5f6f3;
  --ember: #d45224;
  --card-shadow: 0 0 0 1px rgba(9, 17, 32, 0.06), 0 8px 28px rgba(9, 17, 32, 0.08);
  --dialog-shadow: 0 0 0 1px rgba(9, 17, 32, 0.08), 0 24px 64px -12px rgba(9, 17, 32, 0.24);

  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, 'Iowan Old Style', serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sidebar-w: 228px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f14;
  --surface: #12161d;
  --surface-subtle: #171c25;
  --ink: #f3f5f8;
  --ink-body: rgba(243, 245, 248, 0.86);
  --ink-soft: #9aa3b2;
  --ink-faint: #7c8696;
  --rule: rgba(243, 245, 248, 0.1);
  --rule-strong: rgba(243, 245, 248, 0.24);
  --cobalt: #5c94ff;
  --link: #78aaff;
  --link-underline: rgba(120, 170, 255, 0.35);
  --pale: #19315e;
  --tint: #131f36;
  --teal: #3dc7b5;
  --teal-wash: #112d2a;
  --ember: #f27c52;
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px rgba(0, 0, 0, 0.42);
  --dialog-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 28px 72px rgba(0, 0, 0, 0.65);
}

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

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  caret-color: var(--cobalt);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* Mobile Header (hidden on desktop to preserve pure gallery canvas) */
.mobile-topbar {
  display: none;
}

/* Floating Borderless Left Navigation (Supermemory Research Style) */
.left-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 56px 20px 28px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  overflow-y: auto;
  z-index: 20;
}

.rail-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  flex-shrink: 0;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-group-label {
  font-family: var(--mono);
  font-size: 0.65625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 4px 0 4px;
}

.rail-link {
  display: block;
  padding: 3px 0;
  font-family: var(--sans);
  font-size: 0.84375rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}

.rail-link:hover {
  color: var(--ink);
}

.rail-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 560;
}

.rail-link--concept {
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 2.5px 0;
}

.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 24px;
}

.rail-util-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}

.rail-icon-btn:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.rail-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78125rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.rail-status:hover {
  color: var(--ink);
}

.status-square {
  width: 5px;
  height: 5px;
  background: var(--cobalt);
  display: inline-block;
  flex-shrink: 0;
}

/* Main Reading Stage — Generous Gallery Whitespace + Room for Right Margin Notes */
.paper-stage {
  margin-left: var(--sidebar-w);
  padding: 56px 280px 120px 88px;
  min-height: 100vh;
}

.paper-stage--atlas {
  padding: 56px 56px 110px 72px;
}

.paper-col {
  max-width: 640px;
  margin-inline: auto;
  position: relative;
}

/* Top Breadcrumb Back Link */
.paper-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 140ms var(--ease-out);
}

.paper-back:hover {
  color: var(--cobalt);
}

/* Monograph Header */
.paper-header {
  margin-bottom: 36px;
}

.paper-header h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(2.35rem, 4.4vw, 3.05rem);
  line-height: 1.06;
  letter-spacing: -0.026em;
  color: var(--ink);
  text-wrap: balance;
}

.paper-dek {
  margin: 0 0 20px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.09375rem, 1.8vw, 1.21875rem);
  line-height: 1.48;
  color: var(--ink-soft);
  max-width: 34em;
  text-wrap: pretty;
}

.paper-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-family: var(--sans);
  font-size: 0.84375rem;
  color: var(--ink-soft);
}

.paper-byline a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}

.paper-byline a:hover {
  color: var(--cobalt);
  text-decoration-color: var(--cobalt);
}

.byline-sep {
  color: var(--ink-faint);
}

.byline-mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* Reading Trail (shown quietly when traversing multiple nodes) */
.trail-strip {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -14px 0 32px;
  font-family: var(--mono);
  font-size: 0.71875rem;
  color: var(--ink-faint);
}

.trail-strip[data-has-trail="true"] {
  display: flex;
}

.trail-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.trail-link:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

.trail-current {
  color: var(--ink);
  font-weight: 500;
}

/* 4-Panel Editorial Archival Hero Collage (Exact Supermemory Proportions) */
.hero-mosaic {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  grid-template-rows: 176px 198px;
  gap: 8px;
  margin: 0 0 54px;
}

.mosaic-tile {
  margin: 0;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: 2px;
}

.mosaic-tile--tall {
  grid-column: 1;
  grid-row: 1 / 3;
}

.mosaic-tile--wide {
  grid-column: 2 / 4;
  grid-row: 1;
}

.mosaic-tile--mid {
  grid-column: 2;
  grid-row: 2;
}

.mosaic-tile--end {
  grid-column: 3;
  grid-row: 2;
}

.mosaic-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Editorial Prose Typography */
.prose {
  font-family: var(--sans);
  font-size: 1.03125rem;
  line-height: 1.72;
  color: var(--ink-body);
}

.prose p {
  margin: 0 0 22px;
  text-wrap: pretty;
}

/* Signature Serif Opening Lede Paragraph */
.prose .lede-p {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(1.375rem, 2.3vw, 1.625rem);
  line-height: 1.38;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 36px;
}

/* Regular-weight Serif Section Headings */
.prose h2 {
  margin: 76px 0 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(1.75rem, 2.8vw, 2.0625rem);
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
  scroll-margin-top: 32px;
}

.prose h3 {
  margin: 44px 0 12px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.32;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
  scroll-margin-top: 32px;
}

.prose strong {
  font-weight: 600;
  color: var(--ink);
}

.prose ul, .prose ol {
  margin: 0 0 24px;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 10px;
}

.prose hr {
  display: none;
}

/* Clean Editorial Blockquote / Thesis Statement */
.prose blockquote {
  margin: 34px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--ink);
  color: var(--ink);
}

.prose blockquote p {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.48;
  margin-bottom: 10px;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* Highlighted Key Sentence Sweep */
.prose mark {
  color: var(--ink);
  background: linear-gradient(var(--pale), var(--pale)) 0 58% / 100% 78% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  margin: 0 -2px;
  padding: 0 2px;
}

/* End-of-Article Cobalt QED Tombstone */
.prose .final-p::after {
  content: "";
  display: inline-block;
  width: 0.52em;
  height: 0.52em;
  margin-left: 0.48em;
  background: var(--cobalt);
  vertical-align: baseline;
}

/* Inline OKF Links — Subtle, Calm, Never Cluttered */
.okf-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 140ms var(--ease-out), text-decoration-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.okf-link:hover,
.okf-link[data-active="true"] {
  color: var(--cobalt);
  text-decoration-color: var(--cobalt);
  background: var(--tint);
}

/* Tuftian Aligned Right-Margin OKF Sidenotes (.wn = With Note) */
.wn {
  display: block;
  position: relative;
}

.wn > .margin-notes {
  float: right;
  clear: right;
  width: 214px;
  margin: 5px -260px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.margin-note {
  position: relative;
  padding-left: 14px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.52;
  color: var(--ink-soft);
  transition: color 180ms var(--ease-out);
}

.margin-note::before {
  content: "";
  position: absolute;
  top: 0.52em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--cobalt);
  transition: transform 180ms var(--ease-out);
}

.margin-note-title {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.margin-note-title:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

.margin-note-more {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  margin-left: 4px;
  white-space: nowrap;
}

.margin-note-more:hover {
  color: var(--cobalt);
  text-decoration-color: var(--cobalt);
}

.wn:has(> p:hover) .margin-note,
.margin-note[data-active="true"] {
  color: var(--ink);
}

.wn:has(> p:hover) .margin-note::before,
.margin-note[data-active="true"]::before {
  transform: scale(1.6);
}

.wn > p {
  transition: background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.wn:has(.margin-note:hover) > p {
  background-color: var(--tint);
  box-shadow: 0 0 0 8px var(--tint);
  border-radius: 3px;
}

/* Inline Code, Math, & Tables */
.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 1px 5px;
  background: var(--surface-subtle);
  border-radius: 4px;
}

.katex-display {
  margin: 28px 0;
  padding: 18px 20px;
  background: var(--surface-subtle);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.prose th, .prose td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.prose th {
  font-family: var(--mono);
  font-size: 0.71875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-strong);
}

/* Interactive Supermemory-Style Figure Plate (Asymmetry-Legibility Explorer) */
.figure-card {
  margin: 40px 0;
  padding: 24px 26px 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.figure-title {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.figure-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.fig-btn {
  padding: 5px 11px;
  font-family: var(--sans);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.fig-btn:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.fig-btn[aria-pressed="true"] {
  color: var(--cobalt);
  background: var(--tint);
  border-color: var(--cobalt);
}

.figure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.78125rem;
  color: var(--ink-soft);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  width: 16px;
  height: 2px;
  display: inline-block;
}

.legend-line--frontier {
  background: var(--cobalt);
}

.legend-line--naive {
  border-top: 2px dashed var(--ink-faint);
  height: 0;
}

.explorer-svg {
  display: block;
  width: 100%;
  height: auto;
}

.figure-readout {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.readout-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 132px;
}

.readout-value {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.readout-label {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.readout-copy {
  margin: 0;
  font-size: 0.84375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.readout-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.figure-caption {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.78125rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* Supermemory-Style Editorial Colophon & Bidirectional Backlinks */
.paper-colophon {
  margin-top: 76px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 10.5em minmax(0, 1fr);
  gap: 18px 20px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.paper-colophon dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}

.paper-colophon dd {
  margin: 0;
  color: var(--ink);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.colophon-links a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
}

.colophon-links a:hover {
  color: var(--cobalt);
  text-decoration-color: var(--cobalt);
}

.backlink-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.backlink-item {
  display: block;
  text-decoration: none;
  padding-left: 14px;
  position: relative;
}

.backlink-item::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--cobalt);
  transition: transform 160ms var(--ease-out);
}

.backlink-item:hover::before {
  transform: scale(1.6);
}

.backlink-source {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.875rem;
  display: inline;
}

.backlink-item:hover .backlink-source {
  color: var(--cobalt);
}

.backlink-quote {
  margin: 3px 0 0;
  font-size: 0.84375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.backlink-quote mark {
  background: linear-gradient(var(--pale), var(--pale)) 0 58% / 100% 78% no-repeat;
  color: var(--ink);
  padding: 0 2px;
}

/* Compact Local Graph Figure inside Footer */
.local-graph-card {
  margin-top: 44px;
  padding: 20px 22px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}

.local-graph-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.local-graph-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.local-graph-head a {
  font-family: var(--mono);
  font-size: 0.71875rem;
  color: var(--link);
  text-decoration: none;
}

.local-graph-head a:hover {
  text-decoration: underline;
}

.local-graph-svg {
  display: block;
  width: 100%;
  height: 210px;
}

/* Knowledge Graph Atlas Page (/graph.html) */
.atlas-wrap {
  max-width: 1080px;
  margin-inline: auto;
}

.atlas-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.atlas-top h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 3.8vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.atlas-top p {
  margin: 0;
  font-size: 0.96875rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.atlas-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}

.atlas-canvas {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
}

.atlas-svg {
  display: block;
  width: 100%;
  height: 540px;
}

.atlas-inspector {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px;
}

.atlas-inspector h2 {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.2;
}

.atlas-inspector p {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.btn-cobalt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--link);
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}

.btn-cobalt:hover {
  background: var(--cobalt);
}

.atlas-edge-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.atlas-edge-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.atlas-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-pill {
  padding: 3px 8px;
  font-size: 0.78125rem;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--rule);
  border-radius: 5px;
  text-decoration: none;
}

.atlas-pill:hover {
  color: var(--cobalt);
  border-color: var(--cobalt);
}

.atlas-table-wrap {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}

.atlas-table-wrap h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.625rem;
}

.atlas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.atlas-table th, .atlas-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.atlas-table th {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.atlas-table td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.atlas-row-title {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.atlas-row-title:hover {
  color: var(--cobalt);
  text-decoration: underline;
}

.atlas-row-desc {
  margin-top: 3px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* Minimal Command Search Dialog */
.search-dialog {
  width: min(580px, 92vw);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--dialog-shadow);
}

.search-dialog::backdrop {
  background: rgba(9, 17, 32, 0.34);
}

.search-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}

.search-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.96875rem;
  outline: none;
}

.search-kbd {
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-faint);
}

.search-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.search-hit:hover,
.search-hit[data-active="true"] {
  background: var(--tint);
}

.search-hit-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.search-hit-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
}

.search-hit-kind {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--cobalt);
}

.search-hit-desc {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* Responsive: Tablet & Compact Desktop (Fold Margin Notes Inline) */
@media (max-width: 1240px) {
  .paper-stage {
    padding: 52px 44px 100px 44px;
  }
  .wn > .margin-notes {
    float: none;
    width: auto;
    margin: -6px 0 24px;
    padding: 10px 14px;
    background: var(--surface-subtle);
    border-radius: 8px;
    gap: 10px;
  }
  .atlas-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive: Mobile (Supermemory Mobile Topbar + Clean Flow) */
@media (max-width: 900px) {
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
  }
  .left-rail {
    display: none;
    top: 56px;
    width: 100%;
    padding: 24px 20px 32px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--card-shadow);
  }
  .left-rail[data-open="true"] {
    display: flex;
  }
  .paper-stage,
  .paper-stage--atlas {
    margin-left: 0;
    padding: 32px 20px 80px;
  }
  .hero-mosaic {
    grid-template-rows: 130px 146px;
    gap: 6px;
    margin-bottom: 36px;
  }
  .paper-colophon {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .paper-colophon dd {
    margin-bottom: 14px;
  }
  .figure-readout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .atlas-svg {
    height: 390px;
  }
}

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