/* fathom design v2.0 — paper register · research-paper layout */
/* see darkflobi-site/design-v2/SYSTEM.md */

:root {
  --paper:#F4F1EA;
  --ink:#1A1814;
  --graphite:#4A463E;
  --rule:#D9D3C5;
  --pale:#ECE7DB;
  --archive:#6B6759;
  --signal:#E63946;
  --signal-hover:#C12A37;
  --serif:"Source Serif 4","Iowan Old Style",Georgia,serif;
  --sans:"Inter Tight",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,monospace;
  --ease:cubic-bezier(.16,1,.3,1);
  --duration:200ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "liga" 1, "dlig" 1, "onum" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--signal); color: var(--paper); }

/* ── header ─────────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 2rem;
  position: sticky; top: 0; background: var(--paper); z-index: 50;
}
header.site .top {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.6rem; max-width: 1200px; margin-left: auto; margin-right: auto;
}
header.site .wordmark {
  font-family: var(--serif); font-style: italic; font-size: 28px;
  font-weight: 500; letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
}
header.site nav { font-family: var(--sans); font-size: 12px; letter-spacing: 0.04em; }
header.site nav a {
  margin-left: 1.5rem; color: var(--graphite); text-decoration: none;
  transition: color var(--duration) var(--ease);
}
header.site nav a:hover, header.site nav a.current { color: var(--signal); }
header.site .scores {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--graphite); display: flex; gap: 0.4em; flex-wrap: wrap;
  align-items: center; max-width: 1200px; margin: 0 auto;
}
header.site .scores strong { color: var(--ink); font-weight: 500; font-feature-settings: "tnum" 1; }
header.site .scores .stamp { margin-left: auto; color: var(--archive); }

/* breath plot */
.breath { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; margin-left: 0.6rem; }
.breath span { display: inline-block; width: 4px; background: var(--signal); opacity: 0.55; animation: breath 6s ease-in-out infinite; }
.breath span:nth-child(1){animation-delay:0s;height:30%}
.breath span:nth-child(2){animation-delay:.15s;height:45%}
.breath span:nth-child(3){animation-delay:.3s;height:60%}
.breath span:nth-child(4){animation-delay:.45s;height:75%}
.breath span:nth-child(5){animation-delay:.6s;height:90%}
.breath span:nth-child(6){animation-delay:.75s;height:100%}
.breath span:nth-child(7){animation-delay:.9s;height:100%}
.breath span:nth-child(8){animation-delay:1.05s;height:90%}
.breath span:nth-child(9){animation-delay:1.2s;height:75%}
.breath span:nth-child(10){animation-delay:1.35s;height:60%}
.breath span:nth-child(11){animation-delay:1.5s;height:45%}
.breath span:nth-child(12){animation-delay:1.65s;height:30%}
@keyframes breath { 0%,100% { transform: scaleY(0.4); opacity: 0.35; } 50% { transform: scaleY(1); opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) { .breath span { animation: none; } }

/* ── article (research-paper) ────────────────────── */
article.paper { max-width: 720px; margin: 0 auto; padding: 5rem 2rem 0; }
article.paper .crumb {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--archive); font-weight: 500;
  margin-bottom: 2rem;
}
article.paper .crumb a { color: var(--archive); text-decoration: none; }
article.paper .crumb a:hover { color: var(--signal); }

article.paper .instrument-tag {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--signal); font-weight: 600;
  margin-bottom: 1rem;
}

article.paper h1 {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.05;
  letter-spacing: -0.02em; color: var(--ink); margin: 0 0 2rem 0;
}

article.paper .byline {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--archive); font-weight: 500;
  padding-bottom: 1.5rem; margin-bottom: 3rem;
  border-bottom: 1px solid var(--ink);
}
article.paper .byline a { color: var(--archive); text-decoration: none; }

article.paper .scope-warn {
  background: var(--signal); color: var(--paper);
  padding: 1rem 1.5rem; border-radius: 2px; margin: 0 0 2rem 0;
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
}
article.paper .scope-warn .label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; opacity: 0.85; margin-bottom: 0.4rem;
}
article.paper .scope-warn strong { font-weight: 700; }

article.paper .headline-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  margin: 0 0 3rem 0;
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
@media (min-width: 700px) {
  article.paper .headline-stats { grid-template-columns: repeat(4, 1fr); }
}
article.paper .headline-stats .stat {
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 1.25rem 1rem;
}
article.paper .headline-stats .val {
  font-family: var(--sans); font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  font-feature-settings: "tnum" 1;
  display: block; line-height: 1; margin-bottom: 0.5rem;
}
article.paper .headline-stats .lbl {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.05em;
  color: var(--graphite); line-height: 1.4; font-weight: 500;
}

article.paper .abstract {
  background: var(--pale); border: 1px solid var(--rule);
  padding: 1.5rem 1.75rem; margin: 0 0 3rem 0;
  border-radius: 2px; font-size: 16px; line-height: 1.65;
}
article.paper .abstract .label {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--signal); font-weight: 600;
  margin-bottom: 0.6rem; display: block;
}
article.paper .abstract strong { font-weight: 600; }

article.paper .lede {
  font-family: var(--serif); font-style: italic;
  font-size: 22px; line-height: 1.5; letter-spacing: -0.005em;
  color: var(--ink); margin: 0 0 2.5rem 0;
}

article.paper p {
  font-family: var(--serif); font-size: 17px; line-height: 1.7;
  color: var(--ink); margin: 0 0 1.5rem 0;
}
article.paper p em { font-style: italic; }
article.paper p strong { font-weight: 600; }

article.paper h2 {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(24px, 3vw, 32px); line-height: 1.15;
  letter-spacing: -0.015em; color: var(--ink);
  margin: 4rem 0 1.5rem 0;
}
article.paper h2 .num {
  font-family: var(--mono); font-size: 14px; color: var(--archive);
  font-weight: 500; margin-right: 0.5em; letter-spacing: 0;
  font-feature-settings: "tnum" 1;
}
article.paper h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 18px; line-height: 1.4; letter-spacing: -0.01em;
  color: var(--ink); margin: 2rem 0 0.6rem 0;
}

article.paper a.inline {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(to right, var(--signal), var(--signal));
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--duration) var(--ease), color var(--duration) var(--ease);
}
article.paper a.inline:hover { color: var(--signal); background-size: 100% 1px; }

article.paper code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--pale); padding: 0.1em 0.35em; border-radius: 2px;
}
article.paper pre {
  background: var(--pale); border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem; font-family: var(--mono); font-size: 14px;
  line-height: 1.65; border-radius: 2px; overflow-x: auto;
  margin: 2rem 0; max-width: 720px;
}
article.paper pre code { background: none; padding: 0; }
article.paper pre .kw { color: var(--graphite); }

/* ── stat block ──────────────────────────────────── */
.stat-block { border-top: 1px solid var(--rule); margin: 1.5rem 0 2rem 0; }
.stat-block .row {
  display: grid; grid-template-columns: 160px 1fr; gap: 1.25rem;
  border-bottom: 1px solid var(--rule); padding: 0.7rem 0; align-items: baseline;
}
.stat-block .val {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  color: var(--signal); font-feature-settings: "tnum" 1;
}
.stat-block .label {
  font-family: var(--serif); font-size: 15px; line-height: 1.5;
  color: var(--graphite);
}

/* ── pipeline list (cognometry.html only) ────────── */
.pipeline { margin: 1.5rem 0 2rem; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.pipeline li {
  display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--rule);
  font-family: var(--serif); font-size: 16px; line-height: 1.55;
}
.pipeline li .name { font-family: var(--mono); font-size: 14px; color: var(--ink); font-weight: 500; }
.pipeline li .desc { color: var(--graphite); }

/* ── example callouts ────────────────────────────── */
.example {
  border-left: 3px solid var(--signal);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
}
.example .label {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--signal); font-weight: 500;
  margin-bottom: 0.4rem;
}
.example .text {
  font-family: var(--serif); font-style: italic;
  font-size: 16px; line-height: 1.6; color: var(--ink);
}
.example .meta {
  font-family: var(--sans); font-size: 12px; color: var(--archive);
  margin-top: 0.5rem; letter-spacing: 0.02em;
}

/* ── bio-note callout ────────────────────────────── */
.bio-note {
  background: var(--pale); border-left: 3px solid var(--ink);
  padding: 1.25rem 1.5rem; margin: 1.5rem 0;
  font-family: var(--serif); font-size: 16px; line-height: 1.6;
}
.bio-note .label {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--archive); font-weight: 600;
  margin-bottom: 0.6rem; display: block;
}
.bio-note strong { font-weight: 600; }

/* ── related-essay card ──────────────────────────── */
.related-card {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); padding: 1.5rem 1.75rem;
  margin: 2rem 0; border-radius: 2px;
  transition: border-color var(--duration) var(--ease);
}
.related-card:hover { border-color: var(--signal); }
.related-card .tag {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--signal); font-weight: 500;
  margin-bottom: 0.5rem;
}
.related-card h4 {
  font-family: var(--serif); font-style: italic; font-size: 24px;
  font-weight: 400; letter-spacing: -0.015em; color: var(--ink);
  margin: 0 0 0.4rem 0;
}
.related-card .sub {
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--graphite); margin: 0 0 0.8rem 0;
}
.related-card .arrow {
  font-family: var(--sans); font-size: 12px; color: var(--signal);
  letter-spacing: 0.04em;
}

/* ── install block ───────────────────────────────── */
.install {
  background: var(--pale); border: 1px solid var(--rule);
  padding: 2rem 2rem 1.5rem; border-radius: 2px;
  margin: 4rem 0 0; text-align: center;
}
.install h3 {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; font-weight: 400; letter-spacing: -0.015em;
  margin: 0 0 0.6rem 0;
}
.install p {
  font-family: var(--serif); font-size: 15px; color: var(--graphite);
  margin: 0 auto 1.5rem auto;
}
.install pre {
  font-family: var(--mono); background: var(--paper);
  border: 1px solid var(--rule); padding: 1rem 1.25rem;
  border-radius: 2px; max-width: 480px; margin: 0 auto 1.5rem auto;
  text-align: left; font-size: 14px; line-height: 1.5;
  overflow-x: auto; color: var(--ink);
}

/* ── paper nav ───────────────────────────────────── */
.paper-nav {
  margin: 5rem 0 0; padding: 2rem 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  font-family: var(--sans); font-size: 13px;
}
.paper-nav a { color: var(--ink); text-decoration: none; }
.paper-nav a:hover { color: var(--signal); }
.paper-nav .label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--archive); font-weight: 500; margin-bottom: 0.4rem;
}
.paper-nav .next { text-align: right; }

/* ── footer ──────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--rule); padding: 4rem 2rem 2rem;
  margin-top: 6rem; color: var(--archive);
  font-family: var(--sans); font-size: 13px;
}
footer.site .cols {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  max-width: 1200px; margin: 0 auto 3rem auto;
}
@media (min-width: 700px) {
  footer.site .cols { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}
footer.site h4 {
  font-family: var(--sans); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--archive); margin-bottom: 0.8rem;
  font-weight: 500;
}
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site ul li { margin-bottom: 0.4rem; }
footer.site ul li a { color: var(--ink); text-decoration: none; }
footer.site ul li a:hover { color: var(--signal); }
footer.site .colophon {
  max-width: 1200px; margin: 0 auto; padding-top: 2rem;
  border-top: 1px solid var(--rule); font-size: 12px;
  letter-spacing: 0.04em; color: var(--archive); text-align: center;
}

@media (max-width: 640px) {
  header.site { padding: 1rem 1.25rem; }
  header.site nav { display: none; }
  article.paper { padding: 3rem 1.25rem 0; }
}
