/* Let's Think Through the Possibilities — academic theme.
   Matches the ppl-gym APP aesthetic (wide, dense, two-column grids, mono
   uppercase section labels), not its narrow docs pages. */

:root {
  --bg: #f8f4ea;
  --bg-elev: #fdf9ef;
  --bg-elev-2: #f1ead8;
  --fg: #1c1812;
  --fg-mid: #443a2b;
  --fg-dim: #756954;
  --fg-faint: #b3a989;
  --border: #d7ccb1;
  --border-strong: #b4a784;
  --accent: #883a18;
  --accent-bg: rgba(136, 58, 24, .08);
  --code-bg: #f0e9d4;
  --sidebar-w: 288px;
  --font-ui: "Iowan Old Style", "Hoefler Text", "Charter", Georgia, "Cambria", serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font-ui);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Shell: sidebar (left) + content (middle) + equal empty spacer (right).
   The symmetric gutters put the content column's center on the PAGE center,
   not the center of the space left of the sidebar. */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--sidebar-w); }

.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 1.8rem 1.3rem;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
}
.brand { display: inline-flex; align-items: baseline; gap: 0.5rem; color: inherit; text-decoration: none; margin-bottom: 2rem; }
.brand-mark { font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent); letter-spacing: -0.08em; }
.brand-name { font-size: 1.2rem; font-weight: 600; }

.side-nav, .side-sub { list-style: none; margin: 0; padding: 0; }
.side-nav > li { margin-bottom: 0.1rem; }
.side-link {
  display: block;
  padding: 0.36rem 0.6rem;
  border-radius: 5px;
  color: var(--fg-mid);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1.04rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.side-link:hover { background: var(--accent-bg); color: var(--fg); }
.side-link.active { background: var(--accent-bg); color: var(--accent); }
.side-link.sub {
  text-transform: none; letter-spacing: 0;
  font-size: 0.98rem; color: var(--fg-dim); padding-left: 1rem;
}
.side-sub { margin: 0.1rem 0 0.5rem 0.65rem; border-left: 1px solid var(--border); }

/* Content — fills the page-centered middle column (capped on ultrawide) */
.docs-prose {
  margin: 0 auto;
  padding: 2.8rem 3.2rem 6rem;
  max-width: 1080px;
  font-size: 1.2rem;
  line-height: 1.7;
}
.docs-prose h1 { font-size: 2.3rem; margin: 0 0 1.4rem; letter-spacing: -0.01em; }
.docs-prose h2 {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg);
  margin: 2.8rem 0 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.docs-prose h3 { font-size: 1.3rem; margin: 1.7rem 0 0.5rem; }
.docs-prose p, .docs-prose li { color: var(--fg-mid); }
.docs-prose strong { color: var(--fg); }
.docs-prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.docs-prose a:hover { border-bottom-color: var(--accent); }
.docs-prose code {
  font-family: var(--font-mono); font-size: 0.8em;
  background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px;
}
.docs-prose pre { padding: 0.9rem 1rem; border-radius: 6px; overflow-x: auto; }
.docs-prose pre.astro-code { background: var(--code-bg) !important; }
.docs-prose pre code { background: none; padding: 0; }
.docs-prose table { border-collapse: collapse; margin: 1.3rem 0; font-size: 1.04rem; width: 100%; }
.docs-prose th, .docs-prose td { border: 1px solid var(--border); padding: 0.55rem 0.9rem; text-align: left; vertical-align: top; }
.docs-prose th { background: var(--bg-elev); font-family: var(--font-mono); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; }
.docs-prose blockquote {
  border-left: 3px solid var(--border-strong);
  margin: 1rem 0; padding: 0.1rem 0 0.1rem 1rem;
}
.docs-prose .katex-display { text-align: center; font-size: 1.12em; margin: 1.5rem 0; overflow-x: auto; overflow-y: hidden; padding: 0.2rem 0; }
.docs-prose figure { margin: 1.8rem 0; }
.docs-prose figure img { max-width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.docs-prose figcaption { font-size: 0.92rem; color: var(--fg-dim); line-height: 1.5; margin-top: 0.55rem; }
.docs-prose figcaption a { color: var(--accent); border-bottom: 1px solid var(--border-strong); text-decoration: none; }
.docs-prose figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.docs-prose svg text { font-family: var(--font-mono); }
.docs-prose svg .fig-lbl { font-size: 13px; fill: var(--fg-mid); }
.docs-prose svg .fig-ax { font-size: 12px; fill: var(--fg-dim); }
/* KaTeX glyphs are real characters; never let an ancestor text-transform
   (e.g. uppercase th) mangle them — σ would become Σ. */
.docs-prose .katex { text-transform: none; }
.docs-prose .stub {
  background: var(--accent-bg); border: 1px dashed var(--border-strong);
  border-radius: 6px; padding: 0.8rem 1.1rem;
  font-size: 0.95em; color: var(--fg-dim);
}

/* Two-column content row — fills width with two readable columns */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 1.3rem 0; }
.row2 > * { max-width: none !important; }

/* Card grid (capabilities, domain tiles) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.9rem; margin: 1.3rem 0; }
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  padding: 1rem 1.1rem;
}
.card-tag {
  font-family: var(--font-mono); font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
  margin-bottom: 0.4rem;
}
.card-title { font-weight: 600; font-size: 1.12rem; color: var(--fg); margin-bottom: 0.35rem; }
.card p { color: var(--fg-mid); font-size: 1.04rem; margin: 0; max-width: none; }

/* Mid widths: drop the right spacer so content uses the room (still left-nav). */
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}
@media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .docs-prose { padding: 2rem 1.5rem 4rem; }
}
