/* PrismCore docs — 3-column docs layout (after doc.plasticity.xyz), Helvetica
   typography (after anduril.com — Helvetica Now Display; we fall back to system
   Helvetica Neue + Inter), in the kinogaki green palette. */
:root {
  --green: #627f64;
  --green-deep: #46603f;
  --ink: #1d211d;
  --muted: #5b6b5c;
  --line: #e7ebe7;
  --sans: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Monaco, monospace;
  --side-w: 244px;
  --toc-w: 220px;
  --header-h: 56px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--green); color: #fff;
  font-family: var(--sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: rgba(98, 127, 100, 0.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 1.02rem; }
.brand a { text-decoration: none; }
.brand .sep { opacity: 0.4; margin: 0 0.45em; font-weight: 400; }
.brand .cur { opacity: 0.85; }
.header-links { display: flex; align-items: center; gap: 22px; }
.header-links a { text-decoration: none; opacity: 0.85; font-size: 0.92rem; }
.header-links a:hover { opacity: 1; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 4px; }

/* 3-column grid */
.layout {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1340px; margin: 0 auto;
}
.sidebar, .toc {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 30px 18px;
}
.side-label { text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.09em; opacity: 0.55; margin: 0 0 14px; font-weight: 600; }

/* collapsible nav groups — the active group is expanded, the rest collapsed */
.navgroup { margin: 0 0 16px; }
.navgroup > .side-label { display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; }
.navgroup > .side-label:hover { opacity: 0.85; }
.navgroup .chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s ease; opacity: 0.8; margin-left: 8px; }
.navgroup.open .chev { transform: rotate(45deg); }
.navgroup .lib-nav { overflow: hidden; max-height: 0; transition: max-height 0.22s ease; }
.navgroup.open .lib-nav { max-height: 1200px; }

/* left nav */
.lib-nav { list-style: none; margin: 0; padding: 0; }
.lib-nav li { margin: 1px 0; }
.lib-nav a, .lib-nav span { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; text-decoration: none; font-size: 0.92rem; }
.lib-nav a:hover { background: rgba(255, 255, 255, 0.09); }
.lib-nav .active > a { background: rgba(255, 255, 255, 0.16); font-weight: 600; }
.lib-nav .soon span { opacity: 0.5; cursor: default; }
.lib-nav .tag { font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.8; border: 1px solid rgba(255, 255, 255, 0.3); padding: 1px 5px; border-radius: 4px; }
.side-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 0.82rem; opacity: 0.7; }

/* right on-this-page */
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 5px 12px; text-decoration: none; font-size: 0.82rem; opacity: 0.65; border-left: 2px solid transparent; line-height: 1.4; }
.toc a:hover { opacity: 1; }
.toc a.active { opacity: 1; border-left-color: #fff; font-weight: 600; }

/* content — white reading column */
.content {
  background: #fff; color: var(--ink); border-radius: 14px;
  margin: 26px 26px; padding: 52px 60px; min-width: 0;
  box-shadow: 0 6px 36px rgba(0, 0, 0, 0.13);
  overflow-wrap: break-word;
}
.eyebrow { color: var(--green); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 10px; }
.content h1 { font-size: 2.7rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; margin: 0 0 18px; }
.lead { font-size: 1.18rem; color: #404a41; line-height: 1.55; margin: 0 0 6px; }
.content h2 { font-size: 1.72rem; font-weight: 800; letter-spacing: -0.018em; margin: 52px 0 18px; padding-top: 28px; border-top: 1px solid var(--line); }
.content h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; margin: 34px 0 8px; }
.content p { margin: 16px 0; }
.content a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.content a:hover { color: var(--green-deep); }
.content strong { font-weight: 700; color: #16201a; }
.content em { font-style: italic; }
.content ul { padding-left: 1.25rem; margin: 16px 0; }
.content li { margin: 7px 0; }

/* definition list */
.deflist { margin: 18px 0; }
.deflist dt { font-weight: 700; color: var(--green-deep); margin-top: 16px; }
.deflist dd { margin: 3px 0 0 18px; color: #4b554c; }

/* code */
.content code { font-family: var(--mono); font-size: 0.86em; background: #eef1ee; padding: 0.12em 0.4em; border-radius: 4px; overflow-wrap: anywhere; }
.content pre { font-family: var(--mono); background: #f6f8fa; border: 1px solid #e8ebe8; border-radius: 10px; padding: 18px 20px; overflow-x: auto; font-size: 0.82rem; line-height: 1.6; margin: 18px 0; }
.content pre code { background: none; padding: 0; font-size: inherit; }

/* note callout */
.note { background: #f3f6f3; border-left: 3px solid var(--green); border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 24px 0; color: #2c3a2d; }

/* svg diagram — green wireframe on the white content */
.diagram-svg { margin: 26px 0; text-align: center; }
.diagram-svg figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
.d-box { fill: #f2f6f2; stroke: var(--green); stroke-width: 1.4; }
.d-box-accent { fill: #d7e3d8; stroke: var(--green); stroke-width: 1.8; }
.d-title { fill: #1d211d; font-weight: 700; }
.d-muted { fill: #5d6e5e; }
.d-flow { fill: none; stroke: var(--green); }
.d-dot { fill: var(--green); }
:root { --accent: #627f64; }

.docnav { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
.docnav a { display: inline-flex; align-items: center; padding: 10px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--green); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: border-color 0.15s, background 0.15s; }
.docnav a:hover { border-color: var(--green); background: #f4f7f4; }
.docnav .dn-next { margin-left: auto; }
.footer { text-align: center; padding: 16px 24px 40px; opacity: 0.65; font-size: 0.82rem; }

/* responsive */
@media (max-width: 1100px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; inset: var(--header-h) 0 0 0; height: auto;
    background: var(--green); transform: translateX(-100%);
    transition: transform 0.22s ease; z-index: 45; padding: 24px;
  }
  body.nav-open .sidebar { transform: none; }
  .content { margin: 14px 12px; padding: 30px 22px; border-radius: 12px; }
  .content h1 { font-size: 2.1rem; }
  .content h2 { font-size: 1.45rem; }
}
