/* FieldNotely — Computer Knowledge Library */

:root {
  color-scheme: light;
  --paper: #faf8f2;
  --surface: #fffdf8;
  --surface-2: #f3efe4;
  --surface-3: #e9e3d4;
  --ink: #202823;
  --ink-2: #46524b;
  --muted: #5f6a63;
  --line: #ddd7c8;
  --line-strong: #bfb8a7;
  --blue: #194a71;
  --blue-soft: #e5edf3;
  --green: #275746;
  --green-2: #1e4436;
  --green-soft: #e8efe9;
  --gold: #7f6224;
  --gold-soft: #f4eddc;
  --rust: #8a3b2e;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
  --measure: 70ch;
  --shadow: 0 1px 2px rgba(32, 40, 35, 0.05), 0 10px 30px rgba(32, 40, 35, 0.06);
  --shadow-lift: 0 2px 5px rgba(32, 40, 35, 0.07), 0 18px 44px rgba(32, 40, 35, 0.1);
  --radius: 10px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

::selection {
  background: var(--green-soft);
  color: var(--ink);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  width: min(calc(100% - 48px), var(--maxw));
  min-height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  border-radius: 8px;
}

.help-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.help-topic-card {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
}

.help-topic-card h3 {
  margin: 0 0 0.6rem;
  font: 600 1.5rem/1.25 var(--serif);
}

.help-topic-card p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.help-topic-card ul,
.help-start-links {
  padding-left: 1.2rem;
}

.help-topic-card li,
.help-start-links li {
  margin: 0.65rem 0;
}

.help-topic-card a,
.help-start-links a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@media (max-width: 960px) {
  .help-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .help-topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bibliography-section {
  max-width: 78ch;
  margin: 2.5rem 0;
  overflow-wrap: anywhere;
}

.bibliography-section h2 small {
  font: 0.8rem var(--sans);
  color: var(--muted);
}

.reference-list {
  list-style: none;
  padding: 0;
}

.reference-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 6rem;
}

.reference-list li:target {
  background: #f2eddf;
}

.reference-list cite {
  font: 600 1.12rem/1.4 var(--serif);
}

.reference-list p {
  margin: 0.35rem 0;
}

.record-link {
  font-size: 0.86rem;
  text-decoration: underline;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--green);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  flex: none;
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--green);
}

/* ---------- Navigation dropdowns ---------- */

.site-nav details {
  position: relative;
}

.site-nav summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav summary::-webkit-details-marker {
  display: none;
}

.site-nav summary::marker {
  content: "";
}

.site-nav summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.15s ease;
}

.site-nav summary:hover,
.site-nav details[open] summary,
.site-nav details.is-current summary {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav details[open] summary,
.site-nav details.is-current summary {
  box-shadow: inset 0 -2px 0 var(--green);
}

.site-nav details[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 210;
  width: 300px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.nav-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 22px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
  transform: rotate(45deg);
}

.nav-menu-label {
  margin: 0 0 8px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav .nav-menu a {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
}

.site-nav .nav-menu a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-menu-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.nav-menu-copy strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}

.nav-menu-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.nav-menu-num {
  flex: none;
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.nav-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
}

.nav-menu-collections {
  width: min(520px, calc(100vw - 48px));
}

.nav-menu-papers {
  width: 300px;
}

.nav-menu-papers a {
  padding: 10px;
}

.nav-menu-arrow {
  margin-left: auto;
  color: var(--line-strong);
}

.site-nav .nav-menu-all {
  margin-top: 10px;
  padding: 10px 9px 2px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}

.site-nav .nav-menu-all:hover {
  background: transparent;
  color: var(--green);
}

/* ---------- Page shell ---------- */

.site-main {
  width: min(calc(100% - 48px), var(--maxw));
  margin: 0 auto;
  padding-bottom: 96px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 28px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--ink-2);
}

.breadcrumb a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb .sep {
  color: var(--line-strong);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-rule {
  width: 28px;
  height: 1px;
  background: var(--green);
}

.text-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: var(--green);
}

.section {
  padding: 62px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-tight {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.section-head h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.section-note {
  max-width: 44ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: right;
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: center;
  padding: clamp(52px, 7vw, 92px) 0 clamp(56px, 7vw, 88px);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 16% 32%, rgba(39, 87, 70, 0.06), transparent 58%),
    radial-gradient(ellipse at 96% 8%, rgba(25, 74, 113, 0.045), transparent 52%);
  pointer-events: none;
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 24px;
  font-family: var(--serif);
  font-size: clamp(3rem, 6.6vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
  text-wrap: balance;
}

.hero h1 em {
  color: var(--green);
  font-style: normal;
}

.hero-lead {
  max-width: 58ch;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.65;
}

.search-form {
  display: flex;
  align-items: stretch;
  width: min(100%, 640px);
  margin-top: 30px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-form:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: 0;
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form button {
  flex: none;
  padding: 0 24px;
  border: 0;
  background: var(--green);
  color: var(--paper);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-form button:hover {
  background: var(--green-2);
}

.sample-queries {
  margin-top: 15px;
  color: var(--muted);
  font-size: 12.5px;
}

.sample-queries a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sample-queries a:hover {
  color: var(--green);
}

.sample-queries span {
  margin: 0 5px;
  color: var(--line-strong);
}

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.featured-card {
  position: relative;
  isolation: isolate;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--band, var(--green));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.featured-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.featured-mark {
  color: var(--surface-3);
  font-family: var(--serif);
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.8;
}

.exchange {
  margin: 22px 0 22px;
  padding: 16px 17px;
  border-radius: 7px;
  background: #1f2a24;
  color: #e8eee7;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  overflow-x: auto;
}

.exchange-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.exchange-method {
  color: #a8d8bd;
  font-weight: 700;
}

.exchange-field {
  color: #d9c38c;
}

.exchange-arrow {
  color: #7e9689;
}

.exchange-status {
  margin-left: auto;
  color: #e8eee7;
  font-weight: 700;
}

.exchange-status.muted {
  color: #a8d8bd;
}

.exchange code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.featured-card h2 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.featured-card h2 a:hover {
  color: var(--blue);
}

.featured-card p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.featured-card .text-link {
  display: inline-block;
  margin-top: 18px;
}


.featured-card::before {
  content: "";
  position: absolute;
  inset: 12px -11px -11px 12px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-stats > div {
  padding: 14px 16px 13px 0;
  border-right: 1px solid var(--line);
}

.hero-stats > div:last-child {
  border-right: 0;
  padding-left: 16px;
}

.hero-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Home paper shelf ---------- */

.paper-shelf-section {
  margin: 18px 0;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 72%, var(--surface)) 0%, var(--surface) 64%);
}

.paper-shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.paper-shelf-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--band, var(--green));
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.paper-shelf-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.paper-shelf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.paper-shelf-venue {
  color: var(--band, var(--green));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.paper-shelf-year {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.paper-shelf-card h3 {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.27;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.paper-shelf-card:hover h3 {
  color: var(--blue);
}

.paper-shelf-authors {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.paper-shelf-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.paper-shelf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.paper-shelf-open {
  color: var(--blue);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paper-shelf-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 24px;
}

/* ---------- Home task rail ---------- */

.home-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: start;
  padding: 18px 18px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-task-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.home-task-num {
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.home-task-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.home-task-body strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.home-task-body span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.home-task-arrow {
  align-self: center;
  color: var(--line-strong);
  font-size: 15px;
}

.home-task-card:hover .home-task-arrow {
  color: var(--band, var(--green));
}

/* ---------- Collection grid ---------- */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.collection-card {
  position: relative;
  min-height: 158px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--band, var(--green));
  border-radius: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.collection-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.collection-num {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.collection-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  font-size: 17px;
  transition: color 0.15s ease, transform 0.18s ease;
}

.collection-card:hover .collection-arrow {
  color: var(--band, var(--green));
  transform: translate(2px, -2px);
}

.collection-card h3 {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.collection-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.45;
}

.catalog-collection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-collection-grid .collection-card {
  min-height: 140px;
}

/* ---------- Recent changes ---------- */

.recent-list {
  border-top: 1px solid var(--line);
}

.recent-list li {
  border-bottom: 1px solid var(--line);
}

.recent-list a {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 24px;
  gap: 18px;
  align-items: baseline;
  padding: 17px 2px;
  transition: background 0.15s ease;
}

.recent-list a:hover {
  background: var(--surface);
}

.recent-list time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.recent-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recent-main strong {
  font-family: var(--serif);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.3;
}

.recent-list a:hover strong {
  color: var(--blue);
}

.recent-meta {
  color: var(--muted);
  font-size: 12px;
}

.recent-arrow {
  color: var(--line-strong);
  font-size: 16px;
}

/* ---------- Collection pages ---------- */

.collection-hero,
.paper-hero,
.topic-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 44px;
  align-items: end;
  margin-top: 24px;
  padding: 48px 0 42px;
  border-top: 4px solid var(--band, var(--green));
  border-bottom: 1px solid var(--line);
}

.collection-heading h1,
.paper-hero h1,
.topic-hero h1 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}

.collection-tagline {
  max-width: 55ch;
  color: var(--green);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  line-height: 1.5;
}

.collection-intro {
  max-width: 66ch;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}

.collection-aside {
  padding: 20px 0 4px;
  border-top: 1px solid var(--line);
}

.collection-count {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.collection-count strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}

.collection-aside .text-link {
  display: inline-block;
  margin-top: 14px;
}

.topic-strip {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--band, var(--green));
  border-radius: 0 8px 8px 0;
}

.topic-strip .eyebrow {
  padding-top: 3px;
}

.topic-strip a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 4px 12px;
  align-items: baseline;
}

.topic-strip a strong {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
}

.topic-strip a span:nth-child(2) {
  grid-column: 1;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.topic-strip a span:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 17px;
}

.topic-strip a:hover strong,
.topic-strip a:hover span:last-child {
  color: var(--blue);
}

.index-table,
.paper-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.index-table th,
.paper-table th {
  padding: 0 12px 10px 0;
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.index-table td,
.paper-table td {
  padding: 17px 12px 17px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13.5px;
  line-height: 1.5;
}

.index-table tr:hover td {
  background: var(--surface);
}

.index-name a,
.paper-title-cell > a {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.25;
}

.index-name a:hover,
.paper-title-cell > a:hover {
  color: var(--blue);
}

.kind-label,
.paper-authors {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.index-topic {
  width: 14%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.index-question {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.reading-path {
  margin: 52px 0;
  padding: 32px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--band, var(--green));
  border-radius: var(--radius);
}

.reading-path h2 {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.reading-path > p:not(.eyebrow) {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}

.path-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.path-list li {
  border-bottom: 1px solid var(--line);
}

.path-list a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 15px 0;
}

.path-list a:hover strong {
  color: var(--blue);
}

.path-number {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 4px;
}

.path-list strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.3;
}

.path-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.catalog-entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 36px;
}

.catalog-entries li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.catalog-entries a {
  display: block;
  font-family: var(--serif);
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.3;
}

.catalog-entries a:hover {
  color: var(--blue);
}

.catalog-entries span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Entry ---------- */

.entry {
  margin-top: 26px;
  border-top: 4px solid var(--band, var(--green));
}

.entry-header {
  padding: 44px 0 34px;
  border-bottom: 1px solid var(--line);
}

.entry-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-kicker a {
  color: var(--green);
}

.entry-kicker a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-header h1 {
  max-width: 900px;
  margin: 16px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-wrap: balance;
}

.entry-lead {
  max-width: 70ch;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: clamp(1.12rem, 1.7vw, 1.32rem);
  line-height: 1.6;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.entry-meta span {
  position: relative;
}

.entry-meta span + span::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.copy-link {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
  cursor: pointer;
}

.entry-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, var(--measure));
  gap: 48px;
  justify-content: center;
  padding: 44px 0 10px;
}

.entry-layout.no-toc {
  grid-template-columns: minmax(0, var(--measure));
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
}

.toc-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.toc-list .toc-list {
  margin: 2px 0 6px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 3px 0;
  color: var(--muted);
}

.toc a:hover,
.toc a.is-active {
  color: var(--blue);
}

.toc a.is-active {
  font-weight: 650;
}

.entry-body {
  min-width: 0;
}

.prose {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose dl {
  margin-bottom: 1.15em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}

.prose h2 {
  margin-top: 2.4em;
  font-size: 1.65rem;
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.24rem;
}

.prose h4 {
  margin-top: 1.5em;
  font-size: 1.06rem;
}

.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--green);
}

.prose strong {
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--gold);
}

.prose code {
  padding: 0.12em 0.34em;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84em;
}

.prose pre {
  position: relative;
  padding: 18px 20px;
  border-radius: 8px;
  background: #1f2a24;
  color: #e8eee7;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.prose blockquote {
  margin-left: 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--gold);
  color: var(--ink-2);
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
}

.table-scroll {
  width: 100%;
  margin-bottom: 1.15em;
  overflow-x: auto;
}

.table-scroll table {
  margin-bottom: 0;
}

.prose th {
  padding: 8px 12px 8px 0;
  border-bottom: 2px solid var(--ink);
  text-align: left;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.entry-section {
  margin-top: 3.2em;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.entry-section h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.source-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13.5px;
}

.revision-list {
  font-family: var(--sans);
  font-size: 13.5px;
}

.revision-list > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.revision-list dt {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.revision-list dd {
  margin: 0;
  color: var(--ink-2);
}

.source-list a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-list a:hover {
  color: var(--green);
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-list li {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.related-list a {
  display: block;
  padding: 15px 17px;
}

.related-list a:hover strong {
  color: var(--blue);
}

.related-collection {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.related-list strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 1.03rem;
  line-height: 1.3;
}

.related-list span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
}

.copy-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cdd8d0;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.prose pre:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Search ---------- */

.search-hero {
  padding: 54px 0 38px;
  border-bottom: 1px solid var(--line);
}

.search-hero h1 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.search-form-large {
  max-width: 760px;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  padding-top: 38px;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.results-head h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

#search-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-results {
  min-height: 120px;
}

.search-result {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.search-result .result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-result .result-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-strong);
}

.search-result h3 {
  margin: 5px 0 5px;
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.3;
}

.search-result h3 a:hover {
  color: var(--blue);
}

.search-result p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.search-result mark {
  padding: 0 0.12em;
  background: var(--gold-soft);
  color: inherit;
}

.search-empty {
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}

.search-fallback {
  align-self: start;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-fallback h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
}

.search-fallback p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.search-fallback ul {
  margin: 16px 0;
}

.search-fallback li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.search-fallback li a {
  display: block;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
}

.search-fallback li span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- Catalog ---------- */

.catalog-hero,
.simple-hero {
  padding: 54px 0 36px;
  border-bottom: 1px solid var(--line);
}

.catalog-hero h1,
.simple-hero h1 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.catalog-lead {
  max-width: 70ch;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.6;
}

.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 24px;
}

.anchor-nav a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.name-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.name-index li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.name-index a {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.name-index a:hover {
  color: var(--blue);
}

.name-index span {
  flex: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.task-grid,
.format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card,
.format-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--band, var(--green));
  border-radius: 8px;
}

.task-link {
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.task-link:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.task-link .text-link {
  display: inline-block;
  margin-top: 12px;
}

.task-card h3,
.format-card h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.3;
}

.task-card > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-card ul,
.format-card ul {
  margin-top: 12px;
}

.task-card li,
.format-card li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.4;
}

.task-card li a:hover,
.format-card li a:hover {
  color: var(--blue);
}

.format-card li span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.json-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.json-links li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}

.json-links a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Updates ---------- */

.updates-list {
  margin-top: 12px;
}

.updates-list > li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.updates-list time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.update-collection {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.update-main h2 {
  margin: 5px 0 8px;
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.update-main h2 a:hover {
  color: var(--blue);
}

.update-main > p:last-child {
  max-width: 70ch;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------- Paper hub ---------- */

.paper-hero {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.paper-hero h1 {
  font-size: clamp(2.8rem, 5.8vw, 4.6rem);
}

.library-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--band, var(--gold));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.library-count {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.library-count strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2.9rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.library-card > p:not(.eyebrow):not(.library-count) {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}

.library-card .btn {
  margin-top: 16px;
}

.library-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.paper-table .paper-title-cell {
  width: 38%;
}

.paper-table td {
  font-family: var(--sans);
}

.paper-table td:nth-child(3) {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-2);
}

.external-link {
  color: var(--blue);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.external-link:hover {
  color: var(--green);
}

.paper-byline {
  margin: 10px 0 16px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.citation-block .citation {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px 18px;
  border-left: 3px solid var(--green);
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary,
.library-card .btn {
  border-color: var(--green);
  background: var(--green);
  color: var(--paper);
}

.btn-primary:hover,
.library-card .btn:hover {
  border-color: var(--green-2);
  background: var(--green-2);
}

.btn-ghost {
  border-color: var(--line-strong);
}

.btn-small {
  margin-top: 10px;
  padding: 7px 11px;
  font-size: 10px;
}

/* ---------- Topic ---------- */

.topic-hero {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
}

.topic-path {
  margin-top: 0;
}

/* ---------- Simple pages ---------- */

.simple-body {
  max-width: 70ch;
  padding: 40px 0 0;
}

.simple-body h2:first-child {
  margin-top: 0;
}

.task-hero .task-intro {
  max-width: 70ch;
  margin-top: 20px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}

.task-path {
  margin-top: 0;
}

.task-path .related-collection {
  margin-bottom: 2px;
}

.task-path .path-list small {
  max-width: 70ch;
}

.task-check {
  max-width: 70ch;
  margin-top: 10px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
}

.task-check h2 {
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.task-check p:not(.eyebrow) {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.task-check .text-link {
  display: inline-block;
  margin-top: 14px;
}

/* ---------- 404 ---------- */

.not-found {
  padding: 70px 0 30px;
}

.not-found-code {
  margin-bottom: 8px;
  color: var(--surface-3);
  font-family: var(--serif);
  font-size: clamp(7rem, 20vw, 15rem);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  user-select: none;
}

.not-found h1 {
  margin: 12px 0 16px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: -0.045em;
}

.not-found .search-form {
  margin-top: 26px;
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 44px;
}

.not-found-collections {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.not-found-collections .collection-card {
  min-height: 118px;
}

.not-found-collections .collection-num {
  display: none;
}

.not-found-collections h3 {
  margin-top: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--green-2);
  color: #eef2e9;
}

.footer-inner {
  width: min(calc(100% - 48px), var(--maxw));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 40px;
}

.brand-footer .brand-mark {
  background: var(--paper);
  color: var(--green-2);
}

.brand-footer .brand-text strong {
  color: var(--paper);
}

.brand-footer .brand-text span {
  color: #a9bdb2;
}

.footer-brand > p {
  max-width: 42ch;
  margin-top: 18px;
  color: #b9c9c0;
  font-size: 12.5px;
  line-height: 1.6;
}

.footer-column h2 {
  margin-bottom: 12px;
  color: #a9bdb2;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-column li {
  padding: 4px 0;
  font-size: 12.5px;
}

.footer-column a {
  color: #eef2e9;
}

.footer-column a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-base {
  width: min(calc(100% - 48px), var(--maxw));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #9fb3a8;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.footer-base a {
  color: #eef2e9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .featured-card {
    max-width: 720px;
  }

  .collection-grid,
  .catalog-collection-grid,
  .not-found-collections,
  .task-grid,
  .format-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-hero,
  .paper-hero,
  .topic-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
  }

  .collection-aside {
    max-width: 320px;
  }

  .entry-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 34px;
  }

  .search-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .search-fallback {
    max-width: 620px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .brand {
    order: 1;
  }

  .site-nav {
    order: 2;
    flex: 1 1 100%;
    min-width: 0;
    margin-left: 0;
    flex-wrap: wrap;
    overflow: visible;
  }

  .site-nav a,
  .site-nav summary {
    padding: 7px 8px;
    font-size: 10.5px;
  }

  .nav-menu {
    width: min(520px, calc(100vw - 32px));
  }

  .nav-menu-collections {
    width: min(520px, calc(100vw - 32px));
  }

  .hero h1 {
    font-size: clamp(2.8rem, 11vw, 4.2rem);
  }

  .entry-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .toc {
    position: static;
    padding: 14px 0 14px 16px;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .toc-list {
    columns: 2;
    column-gap: 28px;
  }

  .toc-list .toc-list {
    columns: 1;
  }

  .entry-header h1 {
    font-size: clamp(2.2rem, 8vw, 3.2rem);
  }

  .updates-list > li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .name-index,
  .json-links {
    grid-template-columns: 1fr;
  }

  .catalog-entries {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-note {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .site-main,
  .header-inner,
  .footer-inner,
  .footer-base {
    width: calc(100% - 32px);
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 14vw, 3.5rem);
  }

  .hero-lead {
    font-size: 1.05rem;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-form input {
    flex-basis: 100%;
  }

  .search-form button {
    width: 100%;
    padding: 12px 18px;
  }

  .collection-grid,
  .catalog-collection-grid,
  .not-found-collections,
  .task-grid,
  .format-grid {
    grid-template-columns: 1fr;
  }

  .collection-card {
    min-height: 120px;
  }

  .featured-card {
    padding: 20px;
  }

  .featured-mark {
    font-size: 2.8rem;
  }

  .reading-path {
    padding: 24px 20px;
  }

  .topic-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .entry-header {
    padding-top: 30px;
  }

  .entry-meta {
    gap: 6px 16px;
  }

  .entry-meta span + span::before {
    left: -9px;
  }

  .copy-link {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }

  .entry-meta span + span::before {
    display: none;
  }

  .site-nav {
    flex-wrap: wrap;
    overflow: visible;
  }

  .prose {
    font-size: 17.5px;
  }

  .prose h2 {
    font-size: 1.45rem;
  }

  .recent-list a {
    grid-template-columns: 1fr 20px;
    gap: 6px;
  }

  .recent-list time {
    grid-column: 1;
  }

  .recent-main {
    grid-column: 1;
  }

  .recent-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .index-table,
  .paper-table {
    min-width: 620px;
  }

  .not-found-code {
    font-size: 7rem;
  }
}


@media (max-width: 820px) {
  .paper-shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats > div {
    padding: 12px 12px 11px 0;
    border-right: 1px solid var(--line);
  }

  .hero-stats > div:nth-child(2n) {
    border-right: 0;
    padding-left: 12px;
  }

  .hero-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .hero-stats > div:last-child {
    padding-left: 0;
  }

  .paper-shelf-section {
    margin: 12px 0;
    padding: 24px 18px;
  }

  .paper-shelf-grid,
  .home-task-grid {
    grid-template-columns: 1fr;
  }

  .paper-shelf-card {
    min-height: 0;
  }

  .paper-shelf-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    position: relative;
  }

  .site-nav details {
    position: static;
  }

  .nav-menu,
  .nav-menu-collections,
  .nav-menu-papers {
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    width: auto;
    max-height: calc(100vh - 150px);
    margin-top: 0;
    overflow-y: auto;
  }

  .nav-menu::before {
    display: none;
  }

  .nav-menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .brand-text span {
    display: none;
  }

  .site-nav a {
    padding-inline: 6px;
  }

  .toc-list {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .copy-link,
  .code-copy,
  .search-form,
  .sample-queries,
  .anchor-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-main {
    width: 100%;
  }

  .entry-layout {
    display: block;
  }

  .prose {
    font-size: 12pt;
  }

  .prose a {
    color: #000;
  }
}
