/* On Blind Gods — single-essay layout. (Not named style.css: the github-pages default theme writes that path.)
   Narrow reading column; figures/videos may break out wider with .wide. */

:root {
  color-scheme: light dark;   /* also tells embedded SVG diagrams which palette to use */
  --bg: #fbfaf7;
  --fg: #1d1c1a;
  --muted: #6b6760;
  --rule: #e4e0d8;
  --accent: #b5482b;          /* ember, matches the trailer's orbital-strike glow */
  --trace-bg: #f1eee8;
  --trace-fg: #3a3733;
  --col: 680px;
  --wide: 1040px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d;
    --fg: #e9e6df;
    --muted: #9a958c;
    --rule: #2a2826;
    --accent: #e0774f;
    --trace-bg: #191816;
    --trace-fg: #d8d3c9;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.post { padding: 0 16px 120px; }

/* Every direct child sits in the reading column; .wide children break out. */
.post-header,
.post-body > * {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}

.post-body > .wide { max-width: var(--wide); }

/* ---------- header ---------- */
.post-header { padding: 14vh 0 48px; text-align: center; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}
.post-header h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.subtitle { font-style: italic; color: var(--muted); margin: 18px 0 0; }
.byline { font-size: 16px; color: var(--muted); margin: 28px 0 0; }
.byline .sep { margin: 0 0.5em; }

/* ---------- text ---------- */
.post-body p { margin-top: 0; margin-bottom: 1.15em; }
.post-body h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2.6em;
  margin-bottom: 0.7em;
}
.post-body h3 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.post-body a { color: var(--accent); text-underline-offset: 0.15em; }
.post-body strong { font-weight: 600; }
.post-body ul { padding-left: 1.2em; margin-top: 0; margin-bottom: 1.15em; }
.post-body li { margin-bottom: 0.5em; }
.post-body li > p { margin: 0; }
.post-body hr {
  border: 0;
  text-align: center;
  margin: 3em auto;
}
.post-body hr::after { content: "· · ·"; color: var(--muted); letter-spacing: 0.5em; }

/* Ordinary quotes */
.post-body blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 1em;
  margin-top: 0;
  margin-bottom: 1.15em;
  color: var(--muted);
  font-style: italic;
}

/* Model reasoning traces: {: .trace} after a blockquote */
.post-body blockquote.trace {
  font-family: var(--mono);
  font-style: normal;
  font-size: 15px;
  line-height: 1.6;
  color: var(--trace-fg);
  background: var(--trace-bg);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  padding: 14px 18px;
}
.post-body blockquote.trace p { margin: 0; }
.post-body blockquote.trace cite {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}

/* ---------- media ---------- */
figure.media { margin-top: 2.2em; margin-bottom: 2.2em; }
figure.media video,
figure.media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #000;
}
/* Tall or square diagrams: keep the image small, caption at column width */
figure.media.narrow img { max-width: 460px; margin: 0 auto; background: transparent; }
@media (prefers-color-scheme: dark) {
  figure.media.narrow img { border-radius: 8px; }   /* white diagrams read as a card in dark mode */
}
/* SVG diagrams carry their own light/dark palette; no backing card */
figure.media.diagram img { background: transparent; border-radius: 0; }
figure.media figcaption {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

/* ---------- inline spoilers ----------
   Trigger: <a href="#ID" class="spoiler-trigger" role="button" aria-expanded="false" aria-controls="ID">phrase</a>
   (an <a>, not a <button>: buttons can't wrap across lines)
   Hidden text: <div class="spoiler-box" id="ID" hidden markdown="1"> … </div>  (toggled by the script in default.html) */
.post-body a.spoiler-trigger {
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
.spoiler-trigger::after {
  content: "spoiler";
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: 3px;
  display: inline-block;
  line-height: 1.5;
}
.spoiler-trigger[aria-expanded="true"]::after { content: "hide"; }
.spoiler-trigger:hover { text-decoration-style: solid; }
.spoiler-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.post-body .spoiler-box {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px 2px;
  margin-top: -0.4em;
  margin-bottom: 1.4em;
  font-size: 17px;
  animation: spoiler-in 0.2s ease-out;
}
.post-body .spoiler-box[hidden] { display: none; }
.post-body .spoiler-box p { margin-bottom: 0.8em; }
@keyframes spoiler-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .post-body .spoiler-box { animation: none; } }
.spoiler-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border-radius: 3px;
  padding: 2px 6px;
  margin-right: 6px;
  vertical-align: 2px;
}

/* ---------- the research question ----------
   <div class="question" markdown="1"> … </div> */
.post-body .question {
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  padding: 22px 0 6px;
  margin-top: 2.2em;
  margin-bottom: 2.2em;
}
.post-body .question .q-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.post-body .question .q-text {
  font-size: 27px;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 0.7em;
}

/* ---------- formal statements ----------
   <div class="statement" markdown="1"> **Proposition 2.** … </div>
   Proofs: <details class="proof" markdown="1"><summary>Proof</summary> … </details> */
.post-body .statement {
  border-left: 2px solid var(--accent);
  background: var(--trace-bg);
  border-radius: 2px;
  padding: 14px 18px 2px;
  margin-top: 1.4em;
  margin-bottom: 1.15em;
}
.post-body .statement p { margin-bottom: 0.75em; }
.post-body details.proof {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 8px 16px;
  margin-top: -0.4em;
  margin-bottom: 1.4em;
  font-size: 17px;
}
.post-body details.proof summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-body details.proof summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.post-body details.proof[open] summary { margin-bottom: 10px; }
.post-body details.proof p { margin-bottom: 0.8em; }

/* ---------- math (MathJax) ---------- */
.post-body mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
/* display math is a direct child of .post-body: keep it in the reading column (MathJax sets margin: 1em 0) */
.post-body > mjx-container[display="true"] { margin: 1em auto !important; }

/* ---------- tables ---------- */
.post-body table {
  display: block;            /* lets a wide table scroll by itself on a phone */
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
}
.post-body th,
.post-body td {
  text-align: left;
  vertical-align: top;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--rule);
}
.post-body th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.post-body td:first-child { font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) {
  /* narrow screens: let the table scroll sideways with readable columns */
  .post-body td { min-width: 9em; }
  .post-body td:first-child { white-space: normal; min-width: 7em; }
}

/* ---------- footnotes (kramdown) ---------- */
.footnotes { font-size: 16px; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 4em; padding-top: 1em; }

@media (max-width: 600px) {
  body { font-size: 18px; }
  .post-header { padding-top: 10vh; }
  .post-body h2 { font-size: 25px; }
  .post-body blockquote.trace { font-size: 13.5px; padding: 12px 14px; }
}
