/* swarmecology.com · v0 · type and color follow the papers' figures */
@font-face { font-family: "Inter"; src: url("fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-Italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f4;
  --bg-tint: #ecf6f2;
  --ink: #1b1d1f;
  --ink-2: #3c4146;
  --muted: #646a70;
  --rule: #e2e4e6;
  --agent: #1f9d7d;        /* agents, as in the figures */
  --agent-ink: #137a60;
  --earn: #2a74b5;
  --persuade: #c4719f;
  --steal: #d4651c;
  --earn-ink: #22629a;     /* text-safe variants (4.5:1 or better on the page ground) */
  --persuade-ink: #974370;
  --steal-ink: #a3470c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 40rem;
  --wide: 68rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101315;
    --bg-soft: #171b1e;
    --bg-tint: #13231e;
    --ink: #e9ecee;
    --ink-2: #c9ced2;
    --muted: #9aa1a7;
    --rule: #2a3034;
    --agent: #3cc39f;
    --agent-ink: #5fd6b4;
    --earn-ink: #7fb3e6;
    --persuade-ink: #e3a2c6;
    --steal-ink: #f0a066;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.6;
  font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
a { color: var(--agent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--agent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
em { font-style: italic; }
.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* masthead */
.masthead { border-bottom: 1px solid var(--rule); font-family: var(--sans); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); z-index: 5; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.wordmark { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 1.05rem; }
.wordmark svg { width: 1.6rem; height: 1.6rem; flex: none; }
.nav { display: flex; gap: 1.25rem; font-size: .875rem; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav { display: none; } }

/* type */
h1, h2, h3, h4, .kicker, .label, figcaption, table, .meta, .badge, .btn, footer { font-family: var(--sans); }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.035em; margin: .3em 0 .25em; font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .6em; font-weight: 700; }
h3 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 .35em; font-weight: 650; }
p { margin: 0 0 1em; }
.kicker { text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 600; color: var(--agent-ink); margin: 0; }
.dek { font-size: clamp(1.2rem, 2.2vw, 1.42rem); line-height: 1.5; color: var(--ink-2); max-width: 44rem; }
.meta { font-size: .82rem; color: var(--muted); }
.lead::first-letter { }

/* sections */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
section.hero { border-top: 0; padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.section-head { display: grid; gap: .4rem; margin-bottom: 1.75rem; }
.section-head p { color: var(--ink-2); max-width: var(--measure); margin: 0; }

/* status panel */
.status { margin-top: 2.25rem; border: 1px solid var(--rule); border-left: 4px solid var(--agent); background: var(--bg-tint); padding: 1.25rem 1.4rem; max-width: 46rem; border-radius: 2px; }
.status .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--agent-ink); font-weight: 650; margin: 0 0 .5rem; }
.status p.big { font-family: var(--sans); font-size: 1.2rem; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .5rem; }
.status p { margin: 0; color: var(--ink-2); font-size: 1rem; }

/* figures */
figure { margin: 2rem 0; }
.fig-card { background: #fff; border: 1px solid var(--rule); padding: clamp(.6rem, 2vw, 1.25rem); border-radius: 3px; }
figcaption { font-size: .85rem; line-height: 1.5; color: var(--muted); margin-top: .75rem; max-width: 52rem; }
figcaption b { color: var(--ink-2); }

/* thresholds */
.thresholds { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); counter-reset: th; }
.thresholds li { border: 1px solid var(--rule); padding: 1.1rem 1.15rem 1.2rem; border-radius: 3px; background: var(--bg); position: relative; }
.thresholds li[data-status="partly"] { background: repeating-linear-gradient(135deg, var(--bg-tint) 0 6px, transparent 6px 12px); border-color: color-mix(in srgb, var(--agent) 55%, var(--rule)); }
.thresholds li[data-status="none"] { border-style: dashed; border-color: color-mix(in srgb, var(--muted) 55%, var(--rule)); }
.thresholds h3 { margin-bottom: .2rem; }
.thresholds .def { font-size: .98rem; color: var(--ink-2); margin: .3rem 0 .75rem; }
.thresholds .case { font-size: .9rem; color: var(--ink-2); margin: 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 2px; border: 1px solid currentColor; }
.badge.partly { color: var(--agent-ink); }
.badge.none { color: var(--muted); border-style: dashed; }
.badge.lab { color: var(--earn-ink); }
.badge.field { color: var(--steal-ink); }
.badge.event { color: var(--persuade-ink); }
.tag { font-family: var(--sans); font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* evidence glyphs, as in the figures */
.g { display: inline-block; width: .8em; height: .8em; border-radius: 50%; vertical-align: -0.06em; margin-right: .35em; flex: none; }
.g.auto { background: var(--agent); }
.g.dir { border: 2px solid var(--ink); background: radial-gradient(circle, var(--agent) 0 42%, transparent 46%); }
.g.hum { border: 2px solid var(--ink); }
.g.code { border: 2px dashed var(--muted); }
.g.rep { width: .62em; height: .62em; border-radius: 0; border: 1.6px solid var(--ink); transform: rotate(45deg); margin-right: .45em; }

/* tag explainer */
.tagbox { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); margin-top: 1.5rem; }
.tagbox > div { background: var(--bg); padding: 1.15rem 1.2rem; }
.tagbox h3 { font-size: 1rem; }
.tagbox dl { margin: .6rem 0 0; font-size: .95rem; }
.tagbox dt { font-family: var(--sans); font-weight: 600; font-size: .9rem; margin-top: .6rem; display: flex; align-items: center; }
.tagbox dd { margin: .1rem 0 0; color: var(--ink-2); line-height: 1.45; }
.example { font-family: var(--sans); font-size: .9rem; margin-top: 1.25rem; padding: .85rem 1rem; background: var(--bg-soft); border-radius: 3px; color: var(--ink-2); }
.example code { font-family: var(--sans); font-weight: 600; color: var(--ink); }

/* modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0 0; }
.mode { border-top: 4px solid var(--c); padding-top: .8rem; }
.mode h3 { color: var(--ci); margin-bottom: 0; }
.mode .greek { font-style: italic; color: var(--muted); font-size: .92rem; margin: 0 0 .4rem; }
.mode p { font-size: .98rem; color: var(--ink-2); margin: 0; }

/* framework */
.group { margin-top: 2.25rem; }
.group > h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin-bottom: 0; }
.principles { list-style: none; margin: 0; padding: 0; }
.principles li { display: grid; grid-template-columns: 3.2rem 13rem 1fr; gap: .25rem 1.25rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.principles .no { font-family: var(--sans); font-weight: 700; color: var(--agent-ink); font-size: .95rem; }
.principles .name { font-family: var(--sans); font-weight: 650; font-size: .98rem; }
.principles .def { color: var(--ink-2); font-size: 1rem; }
@media (max-width: 760px) { .principles li { grid-template-columns: 2.6rem 1fr; } .principles .def { grid-column: 2; } }

.conjectures { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.conj { border: 1px solid var(--rule); border-radius: 3px; padding: 1.15rem 1.2rem; background: var(--bg-soft); }
.conj .no { font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--agent-ink); letter-spacing: .06em; }
.conj p { font-size: .98rem; color: var(--ink-2); }
.conj .test { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 0; }

/* predictions */
.preds { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 1rem; }
.preds th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--ink); }
.preds td { vertical-align: top; padding: .85rem .75rem .85rem 0; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.preds td.n { font-weight: 700; color: var(--agent-ink); width: 2.2rem; }
.preds td.f { color: var(--ink-2); }
.preds td.t { white-space: nowrap; }
@media (max-width: 760px) {
  .preds thead { display: none; }
  .preds, .preds tbody, .preds tr, .preds td { display: block; width: 100%; }
  .preds tr { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
  .preds td { border: 0; padding: .15rem 0; }
  .preds td.f::before { content: "Falsified if: "; font-weight: 600; color: var(--muted); }
}

/* papers */
.papers { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); margin-top: 1.5rem; }
.paper { border: 1px solid var(--rule); border-radius: 3px; padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column; }
.paper .type { font-family: var(--sans); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.paper h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; margin: .35rem 0 .25rem; line-height: 1.25; }
.paper .authors { font-family: var(--sans); font-size: .85rem; color: var(--ink-2); margin-bottom: .9rem; }
.paper details { font-size: .98rem; color: var(--ink-2); margin-bottom: 1rem; }
.paper summary { font-family: var(--sans); font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--agent-ink); margin-bottom: .5rem; }
.paper .status-line { margin-top: auto; font-family: var(--sans); font-size: .82rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: .75rem; }
.deposit { margin-top: 1.25rem; font-family: var(--sans); font-size: .9rem; color: var(--ink-2); }

/* coming */
.coming { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.5rem; }
.coming > div { background: var(--bg); padding: 1.2rem 1.2rem 1.3rem; }
.coming p { font-size: .97rem; color: var(--ink-2); margin: 0; }

/* about + footer */
.about p { max-width: var(--measure); }
footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; font-size: .85rem; color: var(--muted); }
footer .wrap { display: grid; gap: .6rem; }
footer .reflexive { font-family: var(--serif); font-style: italic; font-size: .98rem; color: var(--ink-2); }

/* 404 */
.notfound { min-height: 60vh; display: grid; align-content: center; }
