/* lucida render-socratique-wiki-site — multi-page palette + typography.
 *
 * Palette inherited from the cosmon pitch deck Leanear charter
 * (theater/pitch-cecile-leanear/slides.md). Five modes, one hue each ;
 * the cross-surface invariant is the colour code — a #8aef9b idée
 * looks the same on S1 (single-file wiki), S2 (this site), S3 (LaTeX)
 * and S4 (audio voice timbre, equivalent only).
 */

:root {
  --color-idee:     #8aef9b;
  --color-pourquoi: #8abbef;
  --color-outil:    #b08aef;
  --color-formule:  #e8d28a;
  --color-piege:    #ef8a8a;
  --color-ink:      #101824;
  --color-paper:    #fcfcfa;
  --color-paper-2:  #f3f3ee;
  --color-rule:     #d8d8d2;
  --max-width:      42rem;
  --rhythm:         1.5rem;
  --radius:         0.4rem;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  background: var(--color-paper);
  color: var(--color-ink);
}

body {
  margin: 0;
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  line-height: 1.55;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--rhythm) * 2) 1rem calc(var(--rhythm) * 4);
}

h1, h2, h3 {
  font-family: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  line-height: 1.2;
  margin-top: calc(var(--rhythm) * 1.5);
  margin-bottom: calc(var(--rhythm) * 0.5);
}

h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 var(--rhythm); }

a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.18em; }

code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--color-paper-2);
  padding: 0.05em 0.3em;
  border-radius: 0.2em;
}

pre {
  background: var(--color-paper-2);
  padding: var(--rhythm);
  border-radius: var(--radius);
  overflow-x: auto;
}

/* ── Site header / index ────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: var(--rhythm);
  margin-bottom: calc(var(--rhythm) * 1.5);
}
.site-header .lead {
  font-size: 1.05rem;
  color: #36404a;
}

.toc.fy8a {
  /* The TOC is rendered as the fy8a register — short, image-first.
   * The container picks up a faint idée-tinted left rail to signal the
   * mode without overwhelming the type. */
  border-left: 0.3rem solid var(--color-idee);
  padding-left: var(--rhythm);
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li {
  padding: var(--rhythm) 0;
  border-bottom: 1px dashed var(--color-rule);
}
.toc li:last-child { border-bottom: none; }
.toc .concept-link {
  text-decoration: none;
  display: inline-block;
}
.toc .pos {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6470;
  margin-right: 0.5rem;
}
.toc .title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.toc .preview {
  margin: 0.4rem 0 0;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.toc .filters {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #5a6470;
}
.toc .filters a {
  margin-right: 0.7rem;
  color: #5a6470;
  text-decoration: none;
  border-bottom: 1px dotted #5a6470;
}
.toc .filters a:hover { color: var(--color-ink); border-bottom-color: var(--color-ink); }

.about-link {
  margin-top: calc(var(--rhythm) * 2);
  font-size: 0.95rem;
}

/* ── Concept header ─────────────────────────────────────────────── */

.concept-header {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: var(--rhythm);
  margin-bottom: var(--rhythm);
}
.concept-header h1 { margin-top: 0.2rem; }
.concept-header .spine-number {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6470;
}

.filter-nav {
  margin-top: var(--rhythm);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-nav a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.88rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-rule);
  text-decoration: none;
  background: var(--color-paper);
}
.filter-nav a.active {
  background: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}

/* ── Mode blocks — palette gradient ─────────────────────────────── */

.mode {
  /* Ten-percent-tinted background per mode + matching left rail. */
  margin: var(--rhythm) 0;
  padding: var(--rhythm);
  border-radius: var(--radius);
  border-left: 0.3rem solid var(--color-rule);
}
.mode .mode-label {
  margin-top: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6470;
}
.mode-body p:last-child { margin-bottom: 0; }

.mode-idee     { background: rgba(138, 239, 155, 0.18); border-left-color: var(--color-idee); }
.mode-pourquoi { background: rgba(138, 187, 239, 0.18); border-left-color: var(--color-pourquoi); }
.mode-outil    { background: rgba(176, 138, 239, 0.16); border-left-color: var(--color-outil); }
.mode-formule  { background: rgba(232, 210, 138, 0.20); border-left-color: var(--color-formule); }
.mode-piege    { background: rgba(239, 138, 138, 0.15); border-left-color: var(--color-piege); }
.mode-diagram  { background: var(--color-paper-2);       border-left-color: var(--color-rule); }

.mode .mode-label::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.mode-idee     .mode-label::before { background: var(--color-idee); }
.mode-pourquoi .mode-label::before { background: var(--color-pourquoi); }
.mode-outil    .mode-label::before { background: var(--color-outil); }
.mode-formule  .mode-label::before { background: var(--color-formule); }
.mode-piege    .mode-label::before { background: var(--color-piege); }

/* fy8a "formule-numbers" — the formula block on the fy8a page is
 * rendered with a tighter, more graphical look. We keep the same hue
 * but drop the prose padding and surface the equation. */
.mode-formule.formule-numbers {
  font-size: 1.05rem;
  text-align: center;
}
.mode-formule.formule-numbers .mode-body p {
  margin: 0.4rem 0;
}

/* fy8a page — slight tightening of vertical rhythm so the four
 * blocks read on one screen on a phone. */
.filter-fy8a .mode {
  margin: calc(var(--rhythm) * 0.7) 0;
  padding: calc(var(--rhythm) * 0.7);
}

/* ── Concept nav (prev / next) ──────────────────────────────────── */

.concept-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  margin: calc(var(--rhythm) * 1.5) 0 var(--rhythm);
  padding-top: var(--rhythm);
  border-top: 1px solid var(--color-rule);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
}
.concept-nav .prev { text-align: left;   }
.concept-nav .up   { text-align: center; }
.concept-nav .next { text-align: right;  }
.concept-nav a {
  text-decoration: none;
  color: #5a6470;
}
.concept-nav a:hover { color: var(--color-ink); }

/* ── Footer signature (godin) ───────────────────────────────────── */

.site-footer {
  margin-top: calc(var(--rhythm) * 3);
  padding-top: var(--rhythm);
  border-top: 1px solid var(--color-rule);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  color: #5a6470;
  font-style: italic;
}
.site-footer p { margin: 0; }

/* ── About page — palette key ───────────────────────────────────── */

.palette-key { list-style: none; padding: 0; }
.palette-key li {
  padding: 0.5rem 0.8rem;
  margin: 0.3rem 0;
  border-radius: var(--radius);
  border-left: 0.3rem solid var(--color-rule);
}
.palette-key .mode-idee     { background: rgba(138, 239, 155, 0.18); border-left-color: var(--color-idee); }
.palette-key .mode-pourquoi { background: rgba(138, 187, 239, 0.18); border-left-color: var(--color-pourquoi); }
.palette-key .mode-outil    { background: rgba(176, 138, 239, 0.16); border-left-color: var(--color-outil); }
.palette-key .mode-formule  { background: rgba(232, 210, 138, 0.20); border-left-color: var(--color-formule); }
.palette-key .mode-piege    { background: rgba(239, 138, 138, 0.15); border-left-color: var(--color-piege); }

/* ── Mermaid container ──────────────────────────────────────────── */

.mode-diagram pre.mermaid {
  background: transparent;
  padding: 0;
  text-align: center;
}

/* ── Print + dark-mode trims ───────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  :root {
    --color-paper:   #181f29;
    --color-paper-2: #232b37;
    --color-rule:    #3a4350;
    --color-ink:     #f3f3ee;
  }
  body { color: var(--color-ink); }
  .filter-nav a {
    background: var(--color-paper);
    color: var(--color-ink);
  }
  .filter-nav a.active {
    background: var(--color-ink);
    color: var(--color-paper);
  }
}
