/* NOOSPHERE site — brand tokens per noosphere/brand/README.md (binding).
   Palette: charcoal #0B0B0A, ivory #E8E1D5, copper #A86642 (single accent),
   mineral blue #344147 (charts only), ash #77736C.
   Motion: transform/opacity only; prefers-reduced-motion respected. */

:root {
  --charcoal: #0B0B0A;
  --ivory: #E8E1D5;
  --copper: #A86642;
  --mineral: #344147;   /* charts only */
  --ash: #77736C;
  --hairline: rgba(232, 225, 213, 0.14);
  --hairline-soft: rgba(232, 225, 213, 0.07);
  --panel: rgba(232, 225, 213, 0.03);
  --sans: "Satoshi", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ivory); text-decoration: none; }
a:hover { color: var(--copper); }
::selection { background: var(--copper); color: var(--charcoal); }

code, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--ivory);
}
code { background: var(--panel); border: 1px solid var(--hairline-soft); padding: 0.08em 0.35em; border-radius: 3px; }
pre { overflow-x: auto; background: var(--panel); border: 1px solid var(--hairline); padding: 1rem 1.25rem; border-radius: 4px; }
pre code { background: none; border: none; padding: 0; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(11, 11, 10, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.wordmark {
  font-weight: 700;
  letter-spacing: 0.24em; /* brand rule */
  font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 0.7rem;
  white-space: nowrap;
}
.wordmark svg { flex: none; }
.masthead nav {
  display: flex; gap: 1.4rem; margin-left: auto;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.masthead nav a { color: var(--ash); }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ivory); }
.masthead nav a[aria-current="page"] { border-bottom: 1px solid var(--copper); padding-bottom: 2px; }

/* ---------- layout ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
section { padding: clamp(3rem, 8vw, 6rem) 0; }
section + section { border-top: 1px solid var(--hairline-soft); }

.kicker {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--copper); margin: 0 0 1rem;
}
h1, h2, h3 { font-weight: 700; line-height: 1.08; margin: 0 0 1rem; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.15rem; }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ash); max-width: var(--measure); }
.lede b, .lede strong { color: var(--ivory); font-weight: 500; }

/* provenance labels */
.label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  border: 1px solid var(--hairline); border-radius: 3px;
  padding: 0.1em 0.45em; color: var(--ash); white-space: nowrap;
  vertical-align: 0.15em;
}
.label.measured { color: var(--copper); border-color: rgba(168, 102, 66, 0.55); }
.label.killed { color: var(--charcoal); background: var(--ash); border-color: var(--ash); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table {
  border-collapse: collapse; width: 100%;
  font-size: 0.86rem;
}
th, td {
  text-align: left; vertical-align: top;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--hairline-soft);
}
th {
  font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ash); font-weight: 500;
}
td .mono, td code { font-size: 0.78rem; }
tr:hover td { background: var(--hairline-soft); }

.verdict { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; }
.verdict.superior { color: var(--copper); }
.verdict.parity { color: var(--ivory); }
.verdict.behind { color: var(--ash); }
.status-pass { color: var(--copper); }
.status-killed { color: var(--ash); text-decoration: line-through; text-decoration-color: rgba(119,115,108,.6); }

/* ---------- cards / panels ---------- */
.grid { display: grid; gap: 1px; background: var(--hairline-soft); border: 1px solid var(--hairline-soft); }
.grid > * { background: var(--charcoal); padding: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
}

.panel-num {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 700;
  color: var(--copper); display: block; margin-bottom: 0.5rem;
}
.panel-label {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ash); display: block; margin-bottom: 0.75rem;
}
.panel p { margin: 0; font-size: 0.9rem; color: var(--ash); }
.panel p b { color: var(--ivory); font-weight: 500; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: baseline;
  font-family: var(--mono); font-size: 0.7rem; color: var(--ash);
}
footer .thesis { letter-spacing: 0.14em; text-transform: uppercase; }
footer nav { display: flex; gap: 1.2rem; margin-left: auto; }
footer a { color: var(--ash); }

/* ---------- motion (transform/opacity only) ---------- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
}

/* orbital mark breathing: 1–2% scale, 9–13 s nonuniform cycle */
@keyframes breathe {
  0% { transform: scale(1); }
  38% { transform: scale(1.016); }
  61% { transform: scale(1.004); }
  100% { transform: scale(1); }
}
.mark-breathe { animation: breathe 11s ease-in-out infinite; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .mark-breathe { animation: none; }
}

/* ---------- article shell (papers) ---------- */
article.paper { max-width: 78ch; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem); }
article.paper h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
article.paper h2 { font-size: 1.35rem; margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--hairline-soft); }
article.paper h3 { margin-top: 1.8rem; }
article.paper p, article.paper li { color: rgba(232, 225, 213, 0.86); font-size: 0.98rem; }
article.paper .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ash); margin-bottom: 2.5rem; }
article.paper table { font-size: 0.8rem; }
article.paper blockquote { border-left: 2px solid var(--copper); margin: 1.5rem 0; padding: 0.2rem 0 0.2rem 1.2rem; color: var(--ash); }

/* ---------- hero canvas ---------- */
.hero-canvas-frame {
  border: 1px solid var(--hairline);
  background: var(--panel);
  position: relative;
}
.hero-canvas-frame canvas { display: block; width: 100%; height: auto; }
.hero-canvas-caption {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em;
  color: var(--ash); padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--hairline-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.hero-canvas-caption b { color: var(--copper); font-weight: 500; }

.spine {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.22em;
  color: var(--ash);
}
.spine b { color: var(--ivory); font-weight: 500; }
.spine .sep { color: var(--copper); }

/* ---------- mermaid figures ---------- */
pre.mermaid {
  display: flex; justify-content: center;
  background: var(--panel); border: 1px solid var(--hairline);
  padding: 1.2rem; border-radius: 4px; overflow-x: auto;
}
article.paper p em:only-child { color: var(--ash); font-size: 0.85rem; }
