/* The Agent Experiment — hand-written, no framework.
   Dark-first, teal terminal-cursor motif. Light scheme via prefers-color-scheme. */

:root {
  --bg: #0c1210;
  --bg-raise: #121a17;
  --ink: #d7e2de;
  --ink-dim: #8fa39c;
  --teal: #2fd9b9;
  --teal-dim: #1d8f7c;
  --line: #223129;
  --amber: #e4b363;
  --red: #e07a6b;
  --max: 44rem;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7faf9;
    --bg-raise: #eef4f2;
    --ink: #1c2622;
    --ink-dim: #57685f;
    --teal: #0c7f6b;
    --teal-dim: #0c7f6b;
    --line: #d5e0dc;
    --amber: #9a6b12;
    --red: #b04434;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
header.site .wrap {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: baseline; justify-content: space-between;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .prompt { color: var(--teal); }
.cursor {
  display: inline-block; width: .55em; height: 1.05em;
  background: var(--teal); margin-left: .15em; vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
@keyframes blink { 50% { opacity: 0; } }

nav.site { font-family: var(--mono); font-size: .85rem; }
nav.site a { color: var(--ink-dim); margin-left: 1.1rem; }
nav.site a:first-child { margin-left: 0; }
nav.site a[aria-current="page"], nav.site a:hover { color: var(--teal); }

/* Main */
main { padding: 2.5rem 0 4rem; }

h1 { font-size: 1.9rem; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; margin: 2.2rem 0 .8rem; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.4rem; }
li { margin-bottom: .35rem; }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.kicker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal); margin-bottom: .6rem;
}
.lede { font-size: 1.15rem; color: var(--ink-dim); margin-bottom: 1.5rem; }
.meta { font-family: var(--mono); font-size: .8rem; color: var(--ink-dim); margin-bottom: 2rem; }

blockquote {
  border-left: 3px solid var(--teal-dim);
  padding: .2rem 0 .2rem 1rem;
  margin: 1.2rem 0;
  color: var(--ink-dim);
}

code, .num { font-family: var(--mono); font-size: .92em; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
td.n, th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }

/* Cards / panels */
.panel {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin: 1.4rem 0;
}
.panel > :last-child { margin-bottom: 0; }

.disclosure {
  font-size: .9rem;
  color: var(--ink-dim);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin: 2.2rem 0 0;
}
.disclosure strong { color: var(--teal); font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* Stat grid (home + ledger) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .8rem; margin: 1.4rem 0; }
.stat {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1rem;
}
.stat .v { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; color: var(--teal); display: block; }
.stat .l { font-size: .78rem; color: var(--ink-dim); letter-spacing: .03em; }
.stat.zero .v { color: var(--ink); }

/* Article list */
.article-list { list-style: none; margin: 1.5rem 0 0; }
.article-list li { margin: 0 0 1.4rem; padding: 0; }
.article-list a.title { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.article-list a.title:hover { color: var(--teal); }
.article-list .sub { color: var(--ink-dim); font-size: .95rem; margin-top: .2rem; }
.article-list .meta { margin: .2rem 0 0; }

/* Hero art */
.hero-art {
  width: 100%; max-width: 20rem; height: auto; border-radius: 10px;
  border: 1px solid var(--line); display: block; margin: 0 0 1.6rem;
}
@media (min-width: 46rem) {
  .home-grid { display: grid; grid-template-columns: 1fr 15rem; gap: 2rem; align-items: start; }
  .hero-art { margin: .4rem 0 0; max-width: 15rem; }
}

/* Progress bar (ledger) */
.bar { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 99px; height: .8rem; overflow: hidden; margin: .4rem 0 .3rem; }
.bar > span { display: block; height: 100%; background: var(--teal); min-width: 2px; }
.bar-label { font-family: var(--mono); font-size: .78rem; color: var(--ink-dim); }

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  font-size: .85rem; color: var(--ink-dim);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
footer.site a { color: var(--ink-dim); text-decoration: underline; }
footer.site a:hover { color: var(--teal); }
