/* ========== 1. reset ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.85;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
::selection { background: var(--seal); color: #fff; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 12px 16px; background: var(--ink); color: var(--paper);
}
.skip:focus { left: 12px; top: 12px; }

/* ========== 2. type ========== */
.serif { font-family: var(--font-serif); }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

.display { font-family: var(--font-serif); font-size: var(--t-display); line-height: 1.18; font-weight: 600; letter-spacing: .01em; }
.h1 { font-family: var(--font-serif); font-size: var(--t-h1); line-height: 1.3; font-weight: 600; }
.h2 { font-family: var(--font-serif); font-size: var(--t-h2); line-height: 1.4; font-weight: 600; }
.h3 { font-family: var(--font-serif); font-size: var(--t-h3); line-height: 1.5; font-weight: 600; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--t-2xs); letter-spacing: .24em; color: var(--ink-3);
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--line-2); }

.muted { color: var(--ink-3); }
.lede { font-size: 1.0625rem; line-height: 1.85; color: var(--ink-2); }

/* ========== 3. layout ========== */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.page-head + .section { padding-top: var(--s-7); }
.doc { max-width: 44rem; margin: 0 auto; }
.doc .page-head { border-bottom: 1px solid var(--line); }
.doc .section { border-bottom: 0; }
.doc .prose > h2:first-child { margin-top: 0; }
.section:last-of-type { border-bottom: 0; }
.section-head {
  display: flex; align-items: baseline; gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.section-num { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--seal); letter-spacing: .08em; }
.section-title { font-family: var(--font-serif); font-size: 1.4375rem; font-weight: 600; letter-spacing: .02em; }
.section-more { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); }
.section-more:hover { color: var(--seal); }

/* ========== 4. header ========== */
.site-head {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__in { display: flex; align-items: center; gap: var(--s-7); height: 76px; }

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  border: 1.5px solid var(--seal); color: var(--seal);
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 19px; line-height: 1;
  border-radius: var(--r-1);
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name { font-family: var(--font-serif); font-size: 1.1875rem; line-height: 1.2; letter-spacing: .06em; }
.brand-sub { font-size: 10px; letter-spacing: .26em; color: var(--ink-3); line-height: 1.4; }

.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav a {
  font-size: var(--t-sm); color: var(--ink-2); padding: 6px 0;
  border-bottom: 2px solid transparent; transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal); }

.head-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-1); color: var(--ink-2);
  transition: border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

.menu-btn { display: none; }

/* mobile panel */
.mnav {
  display: none; border-top: 1px solid var(--line); background: var(--paper);
  padding: var(--s-4) 0 var(--s-5);
}
.mnav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.mnav[data-open="true"] { display: block; }

/* ========== 5. hero ========== */
.hero { padding: var(--s-9) 0 var(--s-8); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: var(--s-8); align-items: center; }
.hero h1 { margin-top: var(--s-5); }
.hero .lede { margin-top: var(--s-5); max-width: 31em; }
.hero h1 .u { border-bottom: 2px solid var(--seal); padding-bottom: 2px; }

.searchbar {
  margin-top: var(--s-6); display: flex; height: 54px;
  background: var(--card); border: 1px solid var(--ink); border-radius: var(--r-1);
  max-width: 520px;
}
.searchbar input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0 18px;
  font-family: var(--font-sans); font-size: .9375rem; color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar button {
  width: 54px; flex: none; border-left: 1px solid var(--ink);
  display: grid; place-items: center; color: var(--ink);
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.searchbar button:hover { background: var(--ink); color: var(--paper); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.chip {
  font-size: var(--t-xs); letter-spacing: .04em; padding: 7px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-1); color: var(--ink-2);
  transition: all var(--d-fast) var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s-7); border-top: 1px solid var(--line); }
.stat { padding: var(--s-4) var(--s-4) 0 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: var(--s-4); }
.stat b { display: block; font-family: var(--font-mono); font-size: 1.375rem; font-weight: 500; line-height: 1.2; }
.stat span { font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .08em; }

/* --- index card stack --- */
.stack { position: relative; height: 372px; }
.stack-card {
  position: absolute; inset: 0; margin: auto;
  width: 316px; height: 236px; padding: 22px;
  background: var(--card); border: 1px solid var(--line-2);
  display: flex; flex-direction: column;
}
.stack-card:nth-child(1) { transform: translate(-26px, 30px) rotate(-3.2deg); background: var(--paper-2); }
.stack-card:nth-child(2) { transform: translate(16px, 8px) rotate(1.6deg); }
.stack-card:nth-child(3) { transform: translate(-4px, -18px) rotate(-.6deg); }
.stack-card .sc-id { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .08em; }
.stack-card .sc-title { font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.45; margin-top: var(--s-4); font-weight: 600; }
.sk { display: block; height: 6px; background: #E4DBC9; margin-bottom: 12px; }
.sk--t { height: 9px; background: #D3C7B2; margin-bottom: 22px; }
.stack-card .sc-rule { margin-top: auto; border-top: 1px dotted var(--line-2); padding-top: var(--s-3); display: flex; justify-content: space-between; font-size: var(--t-2xs); color: var(--ink-3); }

.stack-cap { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .08em; }
.seal {
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--seal); color: var(--seal);
  font-family: var(--font-serif); font-size: 11px; letter-spacing: .18em;
  padding: 4px 6px 4px 8px; border-radius: var(--r-1);
  transform: rotate(-3deg);
}

/* ========== 6. index rows ========== */
.rows { border-top: 1px solid var(--ink); }
.row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 108px 116px;
  gap: var(--s-5); align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: box-shadow var(--d-base) var(--ease), background var(--d-base) var(--ease);
}
.row:hover { background: var(--paper-2); box-shadow: inset 2px 0 0 var(--seal); }
.row__id { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .04em; }
.row__main { min-width: 0; }
.row__title { font-family: var(--font-serif); font-size: 1.0313rem; line-height: 1.5; font-weight: 600; display: flex; align-items: baseline; gap: 12px; }
.row__title .leader { flex: 1; border-bottom: 1px dotted var(--line-2); transform: translateY(-5px); min-width: 24px; }
.row__sub { font-size: var(--t-xs); color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__age, .row__type { font-size: var(--t-xs); color: var(--ink-2); }
.row__type { text-align: right; font-family: var(--font-mono); }

/* ========== 7. domains ========== */
.domains { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.domain {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  transition: background var(--d-base) var(--ease);
}
.domain:nth-child(4n) { border-right: 0; padding-right: 0; }
.domain:hover { background: var(--paper-2); }
.domain svg { color: var(--ink-2); }
.domain:hover svg { color: var(--seal); }
.domain b { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; }
.domain span { font-size: var(--t-xs); color: var(--ink-3); }
.domain em { font-family: var(--font-mono); font-style: normal; font-size: var(--t-2xs); color: var(--ink-3); margin-top: auto; }

/* ========== 8. cards ========== */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
.card { display: flex; flex-direction: column; }
.card__thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--paper-2);
  border: 1px solid var(--line); overflow: hidden;
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__thumb .corner { position: absolute; width: 10px; height: 10px; border: 1px solid var(--line-2); }
.card__body { padding-top: var(--s-4); }
.card__id, .card__title, .card__sub, .card__meta { display: block; }
.card__id { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .06em; }
.card__title { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.5; font-weight: 600; margin-top: 6px; min-height: 3em; }
.card:hover .card__title { text-decoration: underline; text-decoration-color: var(--seal); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card__sub { font-size: var(--t-xs); color: var(--ink-3); margin-top: 6px; line-height: 1.7; min-height: 3.4em; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); font-size: var(--t-2xs); color: var(--ink-3); }
.card__meta span { border: 1px solid var(--line); padding: 2px 7px; border-radius: var(--r-1); }

/* ========== 9. topics ========== */
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.topic {
  position: relative; padding: var(--s-5); background: var(--paper-2);
  border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 240px;
  transition: border-color var(--d-base) var(--ease), background var(--d-base) var(--ease);
}
.topic:hover { border-color: var(--line-2); background: var(--paper-3); }
.topic__num { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--seal); letter-spacing: .08em; }
.topic__title { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 600; margin-top: var(--s-3); }
.topic__lede { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-3); line-height: 1.75; }
.topic__foot { margin-top: auto; padding-top: var(--s-4); display: flex; justify-content: space-between; align-items: center; font-size: var(--t-2xs); color: var(--ink-3); }

/* ========== 10. notes ========== */
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-7); border-top: 1px solid var(--ink); }
.note-item { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 72px minmax(0,1fr); gap: var(--s-5); }
.note-item__date { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); padding-top: 6px; }
.note-item h3 { font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 600; line-height: 1.55; }
.note-item p { font-size: var(--t-sm); color: var(--ink-3); margin-top: 6px; line-height: 1.75; }
.note-item:hover h3 { text-decoration: underline; text-decoration-color: var(--seal); text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ========== 11. lineage strip ========== */
.lineage { background: var(--paper-3); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.lineage__in { display: grid; grid-template-columns: 200px minmax(0,1fr) auto; gap: var(--s-6); align-items: center; padding: var(--s-6) 0; }
.lineage__mark { display: flex; align-items: center; gap: 12px; font-family: var(--font-serif); letter-spacing: .1em; }
.lineage p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.8; }
.lineage .section-more { color: var(--ink-2); }
.lineage .section-more:hover { color: var(--seal); }

/* ========== 12. footer ========== */
.site-foot { background: var(--paper-2); border-top: 1px solid var(--line); padding: var(--s-8) 0 var(--s-5); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: var(--s-6); }
.foot-brand p { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.9; margin-top: var(--s-4); max-width: 26em; }
.foot-col .foot-title { font-size: var(--t-2xs); letter-spacing: .18em; color: var(--ink-3); font-weight: 400; margin-bottom: var(--s-3); }
.foot-col a, .foot-col span { display: block; font-size: var(--t-sm); color: var(--ink-2); padding: 5px 0; }
.foot-col a:hover { color: var(--seal); }
.foot-legal { border-top: 1px solid var(--line); margin-top: var(--s-7); padding-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); font-size: var(--t-2xs); color: var(--ink-3); }
.foot-legal a { text-decoration: underline; text-underline-offset: 3px; }
.foot-legal a:hover { color: var(--seal); }
.icp { font-family: var(--font-mono); letter-spacing: .02em; }

/* ========== 13. library ========== */
.page-head { padding: var(--s-7) 0 var(--s-6); border-bottom: 1px solid var(--line); }
.crumbs { font-size: var(--t-xs); color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--s-4); }
.crumbs a:hover { color: var(--seal); }
.crumbs span { color: var(--line-2); }

.library { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: var(--s-7); padding: var(--s-7) 0 var(--s-9); }
.filters { position: sticky; top: 96px; align-self: start; }
.fgroup { border-top: 1px solid var(--ink); padding: var(--s-4) 0 var(--s-5); }
.fgroup .fgroup__title { font-size: var(--t-2xs); letter-spacing: .18em; color: var(--ink-3); font-weight: 400; margin-bottom: var(--s-3); }
.fopt { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--t-sm); color: var(--ink-2); width: 100%; text-align: left; }
.fopt:hover { color: var(--ink); }
.fopt em { font-family: var(--font-mono); font-style: normal; font-size: var(--t-2xs); color: var(--ink-3); margin-left: auto; }
.fopt.is-on { color: var(--seal); }
.fopt.is-on::before { content: "—"; margin-left: -18px; width: 18px; display: inline-block; }
.fclear { font-size: var(--t-xs); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

.result-bar { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--ink); margin-bottom: var(--s-5); }
.result-count { font-size: var(--t-sm); }
.result-count b { font-family: var(--font-mono); font-weight: 500; }
.result-sort { display: flex; gap: var(--s-3); font-size: var(--t-xs); color: var(--ink-3); }
.result-sort button.is-on { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.empty { padding: var(--s-8) 0; text-align: center; color: var(--ink-3); }
.empty b { display: block; font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink-2); margin-bottom: 8px; }

/* ========== 14. detail ========== */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--s-8); padding: var(--s-6) 0 var(--s-9); align-items: start; }
.preview { position: sticky; top: 100px; }
.preview__frame { border: 1px solid var(--line-2); background: var(--card); padding: var(--s-4); }
.preview__frame img { width: 100%; }
.preview__cap { display: flex; justify-content: space-between; margin-top: var(--s-3); font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); }

.detail h1 { margin-top: var(--s-3); }
.detail .sub { color: var(--ink-2); margin-top: var(--s-3); }
.spec { margin-top: var(--s-5); border-top: 1px solid var(--ink); }
.spec div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; text-align: right; }
.spec dd.src { color: var(--seal); }

.actions { margin-top: var(--s-5); display: flex; gap: var(--s-3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 var(--s-5); background: var(--seal); color: #fff;
  border: 1px solid var(--seal); border-radius: var(--r-1);
  font-size: .9375rem; letter-spacing: .04em;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.btn:hover { background: var(--seal-ink); border-color: var(--seal-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--sm { height: 40px; padding: 0 var(--s-4); font-size: var(--t-sm); }

.howto { margin-top: var(--s-6); }
.howto h2 { font-size: 13px; letter-spacing: .16em; color: var(--ink-3); font-weight: 400; border-top: 1px solid var(--ink); padding-top: var(--s-4); margin-bottom: var(--s-4); }
.howto ol { counter-reset: h; }
.howto li { counter-increment: h; position: relative; padding-left: 28px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.8; margin-bottom: 10px; }
.howto li::before { content: counter(h, decimal-leading-zero); position: absolute; left: 0; font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--seal); top: 4px; }

.notice { margin-top: var(--s-5); padding: var(--s-4); border-left: 2px solid var(--line-2); background: var(--paper-2); font-size: var(--t-xs); color: var(--ink-3); line-height: 1.8; }

/* ========== 15. article ========== */
.article { max-width: 38rem; margin: 0 auto; padding: var(--s-7) 0 var(--s-10); }
.article header { border-bottom: 1px solid var(--line); padding-bottom: var(--s-5); margin-bottom: var(--s-6); }
.article h1 { font-family: var(--font-serif); font-weight: 600; margin-top: var(--s-4); font-size: clamp(1.625rem, 3vw, 2.125rem); line-height: 1.35; }
.article__meta { margin-top: var(--s-4); display: flex; gap: var(--s-4); font-size: var(--t-xs); color: var(--ink-3); font-family: var(--font-mono); }
.article p { font-size: 1.0313rem; line-height: 1.95; color: #2A2823; margin-bottom: 1.1em; }
.article h2 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; margin: var(--s-7) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.article blockquote { border-left: 2px solid var(--seal); padding: 2px 0 2px var(--s-5); margin: var(--s-6) 0; }
.article blockquote p { font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.7; color: var(--ink); margin: 0; }
.article footer { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-3); }

/* ========== 16. search ========== */
.search-page { max-width: 780px; margin: 0 auto; padding: var(--s-8) 0 var(--s-9); }
.search-page .searchbar { max-width: none; margin-top: var(--s-5); }
.sr-item { display: block; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.sr-item:hover .sr-title { color: var(--seal); }
.sr-title { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; }
.sr-meta { font-size: var(--t-2xs); color: var(--ink-3); margin-top: 4px; font-family: var(--font-mono); }
.sr-hit { background: var(--seal-bg); color: var(--seal-ink); }

/* ========== 17. prose (about / legal) ========== */
.prose { max-width: 46rem; }
.prose h2 { font-family: var(--font-serif); font-size: 1.375rem; margin: var(--s-7) 0 var(--s-3); }
.prose h3 { font-family: var(--font-serif); font-size: 1.0625rem; margin: var(--s-5) 0 var(--s-2); }
.prose p { color: var(--ink-2); margin-bottom: var(--s-4); line-height: 1.95; }
.prose ul { margin: 0 0 var(--s-4); }
.prose li { position: relative; padding-left: 18px; color: var(--ink-2); line-height: 1.95; margin-bottom: 6px; }
.prose li::before { content: "·"; position: absolute; left: 4px; color: var(--seal); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.prose a:hover { text-decoration-color: var(--seal); color: var(--seal); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin-bottom: var(--s-4); }
.prose th, .prose td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink-3); font-weight: 400; font-size: var(--t-xs); }

.sites { border-top: 1px solid var(--ink); }
.site-row { display: grid; grid-template-columns: 168px minmax(0,1fr) auto; gap: var(--s-5); align-items: center; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.site-row b { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; }
.site-row p { font-size: var(--t-sm); color: var(--ink-3); }
.site-row em { font-size: var(--t-2xs); color: var(--ink-3); font-style: normal; font-family: var(--font-mono); }

/* ========== 18. 404 ========== */
.err { padding: var(--s-10) 0; text-align: center; }
.err b { display: block; font-family: var(--font-serif); font-size: clamp(4rem, 12vw, 8rem); line-height: 1; color: var(--line-2); }

/* ========== 19. motion ========== */
.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; }
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ========== 20. responsive ========== */
@media (max-width: 1080px) {
  .domains { grid-template-columns: repeat(2, 1fr); }
  .domain:nth-child(2n) { border-right: 0; padding-right: 0; }
  .domain:nth-child(4n) { border-right: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .foot-col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .hero__in { grid-template-columns: 1fr; gap: var(--s-7); }
  .stack { height: 278px; margin-top: var(--s-4); }
  .library { grid-template-columns: 1fr; gap: var(--s-5); }
  .filters { position: static; }
  .filters.is-collapsed .fgroup { display: none; }
  .detail { grid-template-columns: 1fr; gap: var(--s-6); }
  .preview { position: static; }
  .topics { grid-template-columns: 1fr; }
  .lineage__in { grid-template-columns: 1fr; gap: var(--s-4); }
  .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .section { padding: var(--s-8) 0; }
  .hero { padding: var(--s-7) 0 var(--s-7); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid var(--line); padding-top: var(--s-4); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .row { grid-template-columns: 1fr 64px; gap: var(--s-2) var(--s-4); }
  .row__id { grid-column: 1 / -1; }
  .row__age { display: none; }
  .row__type { text-align: left; }
  .cards { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .site-row { grid-template-columns: 1fr; gap: 4px; }
  .article { padding: var(--s-6) 0 var(--s-8); }
  .article p { font-size: 1rem; }
  .stack-card { width: 280px; height: 214px; }
  .stack-cap { display: none; }
}

/* ========== 21. print ========== */
@media print {
  .site-head, .site-foot, .lineage, .filters, .actions, .preview__cap { display: none !important; }
  body { background: #fff; }
  .article { max-width: none; padding: 0; }
  .article p { font-size: 11pt; line-height: 1.8; }
  a { text-decoration: none; }
}
/* ========== 22. picks ========== */
.pick-group { margin-bottom: var(--s-7); }
.pick-group__title {
  font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; letter-spacing: .08em;
  padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); color: var(--ink-2);
}
.picks { border-bottom: 1px solid var(--line); }
.pick {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 230px;
  gap: var(--s-5); padding: 20px 0; border-bottom: 1px solid var(--line);
  transition: background var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease);
}
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--paper-2); box-shadow: inset 2px 0 0 var(--seal); }
.pick__id { font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); }
.pick__main { min-width: 0; }
.pick__title { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pick__title svg { color: var(--ink-3); transition: transform var(--d-fast) var(--ease), color var(--d-fast) var(--ease); }
.pick:hover .pick__title { text-decoration: underline; text-decoration-color: var(--seal); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.pick:hover .pick__title svg { transform: translate(2px, -2px); color: var(--seal); }
.pick__desc { display: block; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.8; margin-top: 6px; }
.pick__meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; font-size: var(--t-2xs); color: var(--ink-3); text-align: right; }
.pick__site { font-family: var(--font-mono); }
.pick__lic { color: var(--ink-3); opacity: .85; }

@media (max-width: 720px) {
  .pick { grid-template-columns: 44px minmax(0, 1fr); gap: var(--s-3); }
  .pick__meta { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: center; text-align: left; margin-top: 2px; }
}

/* ========== 23. notes: tags, toc, relations ========== */
.tagbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s-5); }
.chip em { font-style: normal; font-family: var(--font-mono); font-size: 11px; opacity: .65; margin-left: 4px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-4); }
.tag {
  font-size: var(--t-2xs); color: var(--ink-3); padding: 2px 8px;
  border: 1px solid var(--line); border-radius: var(--r-1); letter-spacing: .04em;
}
a.tag:hover { color: var(--seal); border-color: var(--seal); }
.note-item__title { font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 600; line-height: 1.55; }
.note-item__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.note-item__foot .mono { font-size: 11px; color: var(--ink-3); }
.toc {
  border: 1px solid var(--line); background: var(--card); padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0 var(--s-6);
}
.toc b { display: block; font-size: 11px; letter-spacing: .2em; color: var(--ink-3); font-weight: 400; margin-bottom: 6px; }
.toc ol { counter-reset: t; }
.toc li { counter-increment: t; font-size: var(--t-sm); padding: 4px 0; color: var(--ink-2); }
.toc li::before { content: counter(t, decimal-leading-zero); font-family: var(--font-mono); font-size: 10px; color: var(--seal); margin-right: 10px; }
.toc a:hover { color: var(--seal); }
.note-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.note-link { display: block; border-top: 1px solid var(--line); padding-top: var(--s-3); }
.note-link b { display: block; font-family: var(--font-serif); font-size: .9375rem; line-height: 1.55; font-weight: 600; }
.note-link span { display: block; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.75; margin-top: 4px; }
.note-link:hover b { text-decoration: underline; text-decoration-color: var(--seal); text-underline-offset: 4px; }
@media (max-width: 900px) { .note-links { grid-template-columns: 1fr; } }
