/* Altruistic AI — one page, no dependencies, no scripts.
   Ink-on-paper with a single viridian accent; deliberately NOT the visual
   language of any implementation. Dark mode follows the OS. */

:root {
  --paper: #FAF9F6;
  --ink: #1D201D;
  --muted: #5C635C;
  --accent: #2F5D50;
  --line: #DDDAD2;
  --card: #FFFFFF;
  --wash: #F0EEE7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131512;
    --ink: #E8EAE4;
    --muted: #9AA39A;
    --accent: #85BCA8;
    --line: #2C302B;
    --card: #1B1E1A;
    --wash: #1F231E;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 0;
}
.wordmark {
  font-family: Charter, Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.top nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.top a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}
.top a:hover { color: var(--accent); }

main { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem 4rem; }

h1, h2, figcaption {
  font-family: Charter, Georgia, "Times New Roman", serif;
}
.hero { padding: 4.5rem 0 1rem; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.18;
  margin: 0 0 1.2rem;
  letter-spacing: -0.01em;
}
.lede { font-size: 1.13rem; color: var(--muted); max-width: 38rem; }

section { padding: 2.6rem 0 0.4rem; }
h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.9rem;
}
.kicker {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}
p { margin: 0 0 1rem; }
a { color: var(--accent); }
strong { font-weight: 650; }

/* Diagrams */
figure { margin: 1.6rem 0 1.8rem; }
figure svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(0.4rem, 2vw, 1rem);
}
figcaption {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}
.d-solid rect, .d-dashed rect, .d-dotted rect {
  fill: var(--paper);
  stroke: var(--muted);
  stroke-width: 1.3;
}
.d-dashed rect { stroke-dasharray: 6 5; }
.d-dotted rect { stroke-dasharray: 2 4; }
.d-emph rect, rect.d-emph { stroke: var(--accent); stroke-width: 2; }
rect.d-nest { fill: none; }
.d-title {
  fill: var(--ink);
  font: 600 15px system-ui, sans-serif;
  text-anchor: middle;
}
.d-sub {
  fill: var(--muted);
  font: 12.5px system-ui, sans-serif;
  text-anchor: middle;
}
.d-note {
  fill: var(--muted);
  font: italic 12.5px Georgia, serif;
  text-anchor: middle;
}
.d-line { stroke: var(--muted); stroke-width: 1.3; }
.d-arrow {
  stroke: var(--muted);
  stroke-width: 1.3;
  marker-end: url(#arr);
}
marker#arr path { fill: var(--muted); }

/* Axioms */
.axioms {
  list-style: none;
  counter-reset: ax -1;   /* the founder counts from zero */
  margin: 1.4rem 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.axioms li {
  counter-increment: ax;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.2rem 1rem 3.4rem;
  position: relative;
}
.axioms li::before {
  content: counter(ax);
  position: absolute;
  left: 1.1rem;
  top: 1.05rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font: 600 0.85rem/1.5rem system-ui, sans-serif;
  text-align: center;
}
.axioms b { font-weight: 650; }

/* Primitive chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0;
}
.chips span {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.88rem;
  color: var(--ink);
}
.test {
  background: var(--wash);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 0.9rem 1.2rem;
  margin: 1.4rem 0;
}
.test p { margin: 0; }

/* Principles */
.principles { color: var(--ink); }
.never {
  font-family: Charter, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.1rem 0;
}

footer {
  border-top: 1px solid var(--line);
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 2.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 480px) {
  .top { flex-direction: column; gap: 0.5rem; }
  .hero { padding-top: 3rem; }
}

/* ---- v0.2: graph vocabulary, motion, subpages ---- */

a.wordmark { color: var(--ink); text-decoration: none; }
.top nav em, footer nav em {
  font-style: normal;
  font-size: 0.86rem;
  color: var(--ink);
  font-weight: 600;
}
footer nav { display: inline; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover { color: var(--accent); }
.jp { color: var(--muted); font-size: 0.98rem; }

/* Graph pieces (nodes, links, self-pointers) */
.g-link {
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  animation: flow 1.9s linear infinite;
}
.g-far { opacity: 0.55; }
.g-link-s { stroke: var(--muted); stroke-width: 1.3; }
.g-halo { fill: var(--wash); stroke: var(--muted); stroke-width: 1.2; }
.g-halo-s { fill: var(--paper); stroke: var(--muted); stroke-width: 1.1; }
.g-dot { fill: var(--muted); }
.g-me { fill: var(--accent); }
.g-loop {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  marker-end: url(#arr);
}
.g-eq {
  fill: var(--muted);
  font: 700 26px Charter, Georgia, serif;
  text-anchor: middle;
}
.g-you .g-me { animation: breathe 4.5s ease-in-out infinite; }

@keyframes flow { to { stroke-dashoffset: -18; } }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Enterprise: one node set, three generated structures crossfading */
.shape { opacity: 0; animation: shapecycle 13.5s linear infinite; }
.shape-b { animation-delay: 4.5s; }
.shape-c { animation-delay: 9s; }
@keyframes shapecycle {
  0% { opacity: 0; }
  3% { opacity: 1; }
  30.5% { opacity: 1; }
  33.5% { opacity: 0; }
  100% { opacity: 0; }
}

/* Enterprise: compounding chart draws itself in */
.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw 2.4s ease-out 0.3s forwards;
}
.chart-up { stroke: var(--accent); }
.chart-down { stroke: var(--muted); stroke-width: 1.8; }
.chart-label-up { fill: var(--accent); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Family: warmer palette + a breathing constellation */
.warm {
  --paper: #FBF7EF;
  --card: #FFFFFF;
  --wash: #F4ECE0;
  --line: #E5DCCB;
  --accent: #96581F;
}
@media (prefers-color-scheme: dark) {
  .warm {
    --paper: #17140F;
    --card: #201C15;
    --wash: #241F16;
    --line: #322B1F;
    --accent: #D9A968;
  }
}
.constellation { margin-top: 0.6rem; }
.c-node circle { animation: breathe 5.5s ease-in-out infinite; }
.c-d1 circle { animation-delay: -1.1s; }
.c-d2 circle { animation-delay: -2.2s; }
.c-d3 circle { animation-delay: -3.3s; }
.c-d4 circle { animation-delay: -4.4s; }
.c-link {
  stroke: var(--muted);
  stroke-width: 1.2;
  animation: linkpulse 5.5s ease-in-out infinite;
}
.c-soft { animation-delay: -2.75s; }
@keyframes linkpulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .g-link, .g-you .g-me, .c-node circle, .c-link, .shape, .chart-line {
    animation: none;
  }
  .chart-line { stroke-dashoffset: 0; }
  .shape-b, .shape-c { opacity: 0; }
  .shape-a { opacity: 1; }
}
