/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }

  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* ================================================================
   TheRepodex — tokens
   ================================================================ */
:root {
  --paper: #F3F0E8;
  --paper-deep: #EAE5D9;
  --card: #FAF8F3;
  --card-hover: #FFFDF8;
  --ink: #17150F;
  --ink-2: #3F3B33;
  --muted: #6B665B;
  --faint: #8F8A7E;      /* catalog numbers only: deliberately quiet */
  --rule: #D8D2C4;
  --rule-soft: #E4DFD3;
  --accent: #B4431A;     /* rust: 30-day growth numbers and the Featured dot, nothing else */

  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-ui: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --t-h1: 40px;
  --t-h2: 24px;
  --t-h3: 18px;
  --t-lead: 17px;
  --t-body: 15px;
  --t-small: 13px;
  --t-cap: 12px;
  --t-micro: 11px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --page-max: 1280px;
  --page-pad: 80px;
  --radius: 4px;

  --dur: 180ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.page {
  width: 100%;
  max-width: calc(var(--page-max) + var(--page-pad) * 2);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
main.page { flex: 1 0 auto; }

/* ---------- serif: wordmark, H1, category names only ---------- */
.wordmark {
  margin: 0;
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 560;
  font-variation-settings: "opsz" 144;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .the { font-style: italic; font-weight: 380; margin-right: 0.02em; }

/* ---------- top-bar link ---------- */
.agent-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--t-small); font-weight: 520; letter-spacing: 0.01em;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
@media (hover: hover) { .agent-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; } }

/* ---------- search ---------- */
.search {
  position: relative;
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; height: 44px;
  padding: 0 var(--s-2) 0 var(--s-3);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease-out);
}
@media (hover: hover) { .search:hover { border-color: var(--muted); } }
.search:focus-within { border-color: var(--ink); outline: 1px solid var(--ink); }
.search > .od-icon { --od-icon-size: 16px; color: var(--muted); }
.search input {
  flex: 1 1 0; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  font-size: var(--t-body);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.kbd {
  flex: none; display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  font-family: var(--f-mono); font-size: var(--t-cap); color: var(--ink-2);
  border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px;
  background: var(--paper);
}
.search:focus-within .kbd { visibility: hidden; }
.search-clear {
  flex: none; display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 3px; background: transparent; cursor: pointer; color: var(--ink-2);
}
.search-clear .od-icon { --od-icon-size: 14px; }
@media (hover: hover) { .search-clear:hover { background: var(--paper-deep); color: var(--ink); } }
.search-hint { font-size: var(--t-cap); color: var(--muted); letter-spacing: 0.01em; }

/* ================================================================
   Landing hero — "noise becomes an index"
   ================================================================ */
.hero {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }
.hero-scrim {
  --copy-edge: calc((100% - min(100%, calc(var(--page-max) + var(--page-pad) * 2))) / 2 + var(--page-pad) + 720px);
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    rgb(243 240 232 / .95) 0,
    rgb(243 240 232 / .9) var(--copy-edge),
    rgb(243 240 232 / 0) calc(var(--copy-edge) + 240px));
}
.hero-inner { position: relative; z-index: 2; flex: 1 0 auto; display: flex; flex-direction: column; }
.hero-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  min-height: 72px;
  border-bottom: 1px solid var(--rule);
}
.hero-window { display: none; }
.hero-copy { max-width: 720px; padding-top: var(--s-7); }
.hero-eyebrow {           /* the one uppercase label on the page */
  margin: 0 0 var(--s-5);
  font-family: var(--f-mono); font-size: var(--t-cap); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.hero-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(40px, 4.2vw, 60px);
  font-weight: 540;
  font-variation-settings: "opsz" 144;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-title em { font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.hero-sub { margin: var(--s-5) 0 0; max-width: 60ch; font-size: var(--t-lead); line-height: 1.6; color: var(--ink-2); }
.proofs {
  list-style: none; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--s-2) 0; margin: var(--s-5) 0 0; padding: 0;
  font-family: var(--f-mono); font-size: var(--t-cap); color: var(--ink-2); letter-spacing: 0.01em;
}
.proofs li { white-space: nowrap; }
.proofs li + li::before { content: "·"; margin: 0 var(--s-3); color: var(--muted); }
.proofs a { color: var(--ink); text-underline-offset: 3px; }
.hero-search { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-6); }
.hero-search .search { width: 420px; flex: none; }

/* ---------- category index tabs ---------- */
.index-section { margin-top: auto; padding-top: var(--s-7); padding-bottom: var(--s-6); }
.section-label {
  margin: 0 0 var(--s-6);
  font-size: var(--t-body); font-weight: 560; letter-spacing: 0; color: var(--ink-2);
}
.cat-tabs {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-6) var(--s-3);
}
.cat-tab {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 168px;
  padding: var(--s-5);
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  color: var(--ink); text-decoration: none;
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.cat-tab > span { display: block; }
.cat-tab .cat-index {          /* the protruding divider tab */
  position: absolute; top: -27px; left: calc(-1px + var(--i, 0) * 12px);
  padding: 3px 12px 2px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--f-mono); font-size: var(--t-cap); line-height: 20px;
}
.cat-label > span { display: block; }
.cat-name {
  font-family: var(--f-display);
  font-size: var(--t-h1);
  font-weight: 520;
  font-variation-settings: "opsz" 96;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.cat-sub { margin-top: 6px; font-size: var(--t-small); color: var(--muted); }
.cat-foot { display: flex !important; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.cat-count { font-size: var(--t-small); color: var(--ink-2); }
.cat-count .num { font-size: var(--t-lead); color: var(--ink); margin-right: 6px; }
.cat-go { font-size: var(--t-small); color: var(--muted); transition: transform var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
@media (hover: hover) {
  .cat-tab:hover { transform: translateY(-4px); background: var(--card-hover); border-color: var(--muted); border-top-color: var(--ink); }
  .cat-tab:hover .cat-go { color: var(--ink); transform: translateX(4px); }
}
.cat-tab:focus-visible { outline-offset: 4px; border-radius: 0 var(--radius) var(--radius) var(--radius); }
.hero-results { padding-bottom: var(--s-7); }

/* ================================================================
   Use it from your agent
   ================================================================ */
.agent { padding-top: var(--s-9); scroll-margin-top: var(--s-5); }
.agent-head {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-5) var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--ink);
}
.agent-head h2 { margin: 0; font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.agent-pitch { margin: 0; max-width: 46ch; font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); }
.agent-body { grid-column: 2; }

.cmd {
  display: flex; align-items: center; gap: var(--s-3);
  margin-top: var(--s-6);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.cmd code {
  flex: 1 1 0; min-width: 0;
  font-family: var(--f-mono); font-size: var(--t-body); color: var(--ink);
  white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.cmd code::-webkit-scrollbar { display: none; }
.cmd .prompt { color: var(--muted); margin-right: 10px; user-select: none; }
.cmd-note { margin: var(--s-3) 0 0; font-size: var(--t-small); color: var(--muted); }

.copy-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; min-width: 88px; padding: 0 var(--s-4);
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); cursor: pointer;
  font-size: var(--t-small); font-weight: 520; letter-spacing: 0.01em;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.copy-btn .od-icon { --od-icon-size: 14px; }
.copy-btn .i-done { display: none; }
.copy-btn.is-done .i-copy { display: none; }
.copy-btn.is-done .i-done { display: inline-block; }
.copy-btn.is-done { border-color: var(--ink); }
@media (hover: hover) { .copy-btn:hover { border-color: var(--ink); background: var(--card-hover); } }

.agent-ways {
  list-style: none; margin: var(--s-7) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.way { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5) var(--s-5) var(--s-2) 0; }
.way + .way { padding-left: var(--s-5); border-left: 1px solid var(--rule); }
.way h3 { margin: 0; font-size: var(--t-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.way p { margin: 0; font-size: var(--t-small); color: var(--ink-2); line-height: 1.5; }
.way .cmd { margin-top: auto; padding: 4px 4px 4px var(--s-3); }
.way .cmd code { font-size: var(--t-small); }
.way .copy-btn { min-height: 36px; min-width: 76px; padding: 0 var(--s-3); }
.way-solo { margin-top: auto; align-self: flex-start; }
.way-preview {
  margin: 0; padding: var(--s-3) 0 0;
  font-family: var(--f-mono); font-size: var(--t-micro); line-height: 1.6; color: var(--muted);
  border-top: 1px dashed var(--rule);
}

.toast {
  position: fixed; left: 50%; bottom: var(--s-6); z-index: 50;
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 10px var(--s-4);
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font-size: var(--t-small); font-weight: 520; letter-spacing: 0.01em;
  box-shadow: 0 8px 24px -12px rgb(23 21 15 / .5);
  transform: translateX(-50%);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast .od-icon { --od-icon-size: 14px; }
.toast.is-leaving { opacity: 0; transform: translate(-50%, 6px); transition-duration: 130ms; transition-timing-function: var(--ease-in); }

/* ---------- footer ---------- */
.site-foot { margin-top: var(--s-9); border-top: 1px solid var(--rule); }
.site-foot .page {
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6);
  justify-content: space-between; align-items: center;
  padding-top: var(--s-5); padding-bottom: var(--s-6);
  font-size: var(--t-small); color: var(--muted);
}
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; margin: 0; padding: 0; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) { .foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }

/* ================================================================
   Category page
   ================================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-6);
  padding-top: var(--s-4); padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.back { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; text-decoration: none; color: var(--ink); }
.back .arrow { font-size: var(--t-lead); color: var(--ink-2); transition: transform var(--dur) var(--ease-out); }
@media (hover: hover) { .back:hover .arrow { transform: translateX(-4px); color: var(--ink); } }
.topbar-tools { display: flex; align-items: center; gap: var(--s-5); }
.topbar-tools .search { width: 380px; }

.scope {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-1);
  border: 0; background: transparent; cursor: pointer;
  font-size: var(--t-small); color: var(--ink-2); white-space: nowrap;
}
.scope .track {
  position: relative; flex: none; width: 30px; height: 18px; border-radius: 999px;
  border: 1px solid var(--ink-2); background: var(--card);
  transition: background-color var(--dur) var(--ease-out);
}
.scope .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink-2);
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.scope[aria-checked="true"] { color: var(--ink); }
.scope[aria-checked="true"] .track { background: var(--ink); border-color: var(--ink); }
.scope[aria-checked="true"] .track::after { transform: translateX(12px); background: var(--paper); }

.cat-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6);
  padding-top: var(--s-8); padding-bottom: var(--s-6);
}
.cat-pos { margin: 0 0 var(--s-3); font-family: var(--f-mono); font-size: var(--t-cap); color: var(--muted); }
.cat-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(56px, 7vw, 96px);
  font-weight: 540;
  font-variation-settings: "opsz" 144;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.cat-sub-lg { margin: var(--s-3) 0 0; font-size: var(--t-lead); color: var(--muted); }
.cat-count-lg { margin: 0; padding-bottom: 6px; font-size: var(--t-small); color: var(--muted); }
.cat-count-lg .num { display: inline-block; margin-right: 6px; font-size: var(--t-h2); color: var(--ink); line-height: 1; }

/* shelves */
.shelf { padding-top: var(--s-7); }
.shelf + .shelf { padding-top: var(--s-8); }
.shelf-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5);
  padding-top: var(--s-4); margin-bottom: var(--s-5);
  border-top: 1px solid var(--ink);
}
.shelf-title { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.shelf-title h2 { margin: 0; font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.shelf-no { font-family: var(--f-mono); font-size: var(--t-cap); color: var(--muted); }
.shelf-desc, .shelf-count { margin: 0; font-size: var(--t-small); color: var(--muted); }

.grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-featured { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s-4); }
.grid-dense { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--s-2); }

/* segmented sort */
.sort { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--ink); border-radius: 999px; background: var(--card); }
.seg button {
  min-height: 36px; padding: 0 var(--s-4);
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: var(--t-small); font-weight: 520; letter-spacing: 0.02em;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
@media (hover: hover) { .seg button:not([aria-pressed="true"]):hover { background: var(--paper-deep); color: var(--ink); } }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); cursor: default; }
.sort-note { margin: 0; font-size: var(--t-cap); color: var(--muted); }

/* ---------- repo card ---------- */
.card {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 100%;
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.card > span { display: block; }
@media (hover: hover) {
  .card:hover { border-color: var(--ink); background: var(--card-hover); }
  .card:hover .card-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
}
.card-top { display: flex !important; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.card-top > :first-child { flex: 1 1 0; min-width: 0; }
.card-no {
  flex: none;
  font-family: var(--f-mono); font-size: var(--t-micro); font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em; color: var(--faint); line-height: 1.4;
}
.card-name { font-size: var(--t-lead); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.card-owner { font-size: var(--t-small); color: var(--muted); line-height: 1.4; }
.card-note { margin-top: var(--s-2); font-size: var(--t-body); line-height: 1.5; color: var(--ink-2); }
.card-note:lang(zh) { line-height: 1.7; }
.card-meta {
  display: flex !important; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-4);
  margin-top: auto; padding-top: var(--s-3);
  font-size: var(--t-small); color: var(--muted);
}
.card-meta .stars .num { color: var(--ink); font-size: var(--t-small); }
.card-meta .unit { margin-left: 4px; font-size: var(--t-cap); color: var(--muted); }
.card-meta .growth .num { color: var(--accent); font-weight: 500; font-size: var(--t-small); }
.card-meta .in-cat { margin-left: auto; font-size: var(--t-cap); color: var(--ink-2); }

/* Featured: rust dot + sentence-case label */
.mark { display: inline-flex !important; align-items: center; gap: 7px; font-size: var(--t-small); font-weight: 520; color: var(--ink-2); }
.mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.mark-sm { font-size: var(--t-cap); gap: 6px; }
.mark-sm::before { width: 6px; height: 6px; }

.card-featured {
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-color: var(--rule);
  border-top: 2px solid var(--ink);
  background: var(--card-hover);
}
.card-featured .card-top { margin-bottom: var(--s-3); }
.card-featured .card-name { font-size: 22px; letter-spacing: -0.01em; line-height: 1.25; }
.card-featured .card-note { font-size: var(--t-lead); max-width: 46ch; }

.card-dense { padding: var(--s-3) var(--s-4); }
.card-dense .card-name { font-size: var(--t-body); }
.card-dense .card-owner { font-size: var(--t-cap); }
.card-dense .card-note { margin-top: 6px; font-size: var(--t-small); }
.card-dense .card-meta { padding-top: var(--s-2); gap: var(--s-1) var(--s-3); }

/* Rising: growth leads, under the catalog number */
.card-head { display: flex !important; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.card-id { flex: 1 1 0; min-width: 0; }
.card-id > span, .card-rise > span { display: block; }
.card-rise { flex: none; text-align: right; }
.card-rise .rise-num { margin-top: 2px; font-size: 20px; line-height: 1.15; font-weight: 500; color: var(--accent); letter-spacing: -0.01em; }
.card-rise .rise-unit { font-size: var(--t-micro); color: var(--muted); }

/* search results */
.results-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap;
  padding-top: var(--s-7); padding-bottom: var(--s-5); margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--ink);
}
.results-head h2 { margin: 0; font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.results-head .scope-note { margin: 4px 0 0; font-size: var(--t-small); color: var(--muted); }
.text-btn {
  min-height: 44px; padding: 0 var(--s-1);
  border: 0; background: transparent; cursor: pointer;
  font-size: var(--t-small); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.empty { max-width: 56ch; padding: var(--s-8) 0; }
.empty p { margin: 0 0 var(--s-3); font-size: var(--t-lead); color: var(--ink-2); }
.empty .actions { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .cat-tab:hover { transform: none; }
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1279px) { :root { --page-pad: 48px; } }

@media (max-width: 1023px) {
  .cat-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s-7); }
  .topbar { flex-wrap: wrap; }
  .topbar-tools { flex: 1 1 100%; flex-wrap: wrap; }
  .topbar-tools .search { flex: 1 1 320px; width: auto; }
  .hero-window { display: block; height: 240px; }
  .hero-copy { padding-top: 0; }
  .hero-scrim {
    background: linear-gradient(180deg, rgb(243 240 232 / 0) 0, rgb(243 240 232 / 0) 280px, rgb(243 240 232 / .93) 340px);
  }
  .agent-head { grid-template-columns: minmax(0, 1fr); }
  .agent-body { grid-column: 1; }
  .agent-ways { grid-template-columns: minmax(0, 1fr); }
  .way, .way + .way { padding: var(--s-5) 0; border-left: 0; }
  .way + .way { border-top: 1px solid var(--rule); }
  .way .cmd { margin-top: var(--s-2); }
}

@media (max-width: 767px) {
  :root { --page-pad: 20px; --t-h1: 30px; --t-h2: 20px; }
  .hero-bar { min-height: 56px; }
  .hero-window { height: 200px; }
  .hero-scrim {
    background: linear-gradient(180deg, rgb(243 240 232 / 0) 0, rgb(243 240 232 / 0) 236px, rgb(243 240 232 / .94) 290px);
  }
  .hero-eyebrow { margin-bottom: var(--s-4); }
  .hero-title { font-size: 36px; line-height: 1.08; }
  .hero-sub { font-size: var(--t-body); margin-top: var(--s-4); }
  .proofs { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: var(--s-4); }
  .proofs li { white-space: normal; }
  .proofs li + li::before { content: none; }
  .hero-search { margin-top: var(--s-5); }
  .hero-search .search { width: 100%; flex: 1 1 auto; }
  .search .kbd, .search-hint { display: none; }

  .index-section { padding-top: var(--s-7); padding-bottom: var(--s-5); }
  .section-label { margin-bottom: var(--s-5); }
  .cat-tabs { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-5); padding-top: var(--s-2); }
  .cat-tab { min-height: 0; flex-direction: row; align-items: center; gap: var(--s-4); padding: var(--s-4); }
  .cat-tab .cat-index { top: -23px; padding: 1px 10px 0; left: calc(-1px + var(--i, 0) * 8px); }
  .cat-label { flex: 1 1 0; min-width: 0; }
  .cat-sub { margin-top: 2px; font-size: var(--t-cap); }
  .cat-foot { flex: none; }
  .cat-count .num { margin-right: 4px; }
  .cat-go { display: none !important; }

  .agent { padding-top: var(--s-8); }
  .agent-pitch { font-size: var(--t-body); }
  .cmd { margin-top: var(--s-5); padding-left: var(--s-3); }
  .cmd code { font-size: var(--t-small); }

  .site-foot { margin-top: var(--s-8); }
  .site-foot .page { flex-direction: column; align-items: flex-start; }

  .topbar { padding-top: var(--s-2); padding-bottom: var(--s-3); gap: var(--s-2); }
  .topbar-tools { gap: var(--s-1) var(--s-4); }
  .topbar-tools .search { flex: 1 1 100%; }
  .wordmark { font-size: 22px; }
  .cat-head { flex-direction: column; align-items: flex-start; padding-top: var(--s-6); padding-bottom: var(--s-2); gap: var(--s-3); }
  .cat-title { font-size: 56px; }
  .shelf { padding-top: var(--s-6); }
  .shelf + .shelf { padding-top: var(--s-7); }
  .shelf-head { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .grid, .grid-featured, .grid-dense { grid-template-columns: minmax(0, 1fr); }
  .card-featured .card-name { font-size: 20px; }
  .card-featured .card-note { font-size: var(--t-body); }
  .sort { align-items: flex-start; width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 0; min-height: 44px; padding: 0 var(--s-2); }
  .card-rise .rise-num { font-size: 18px; }
  .results-head { padding-top: var(--s-6); }
  .toast { bottom: var(--s-5); max-width: calc(100% - 40px); }
}

.way p code.inline { font-family: var(--font-mono, "JetBrains Mono", monospace); font-size: 0.92em; overflow-wrap: anywhere; }

.cmd-alt { margin-top: 6px; font-size: var(--t-small); color: var(--muted); }
.cmd-alt .num { color: var(--ink-2); overflow-wrap: anywhere; }
