/* the OtherAI — low-watt stylesheet.
   System fonts only, no images, no imports. Dark mode honours the OS
   setting (dark default saves energy on OLED panels). */

:root {
  --ink: #1d2326;
  --paper: #fbfaf7;
  --accent: #1f6e60;
  --accent-ink: #fbfaf7;
  --faint: #e7e4dc;
  --muted: #5b6468;
  --mark: #fff3c2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #d8d5cd;
    --paper: #15191b;
    --accent: #5cc0ab;
    --accent-ink: #10211d;
    --faint: #262d31;
    --muted: #93a09f;
    --mark: #4a4421;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

/* masthead */
.masthead {
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 2px solid var(--accent);
}
.wordmark {
  font-size: 1.45rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.wordmark strong { color: var(--accent); }
.tagline { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* layout */
.layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 44rem);
  gap: 2.5rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 3rem;
}
@media (max-width: 52rem) {
  .layout { grid-template-columns: 1fr; gap: 1rem; }
}

/* sidebar */
.sidebar {
  font-size: 0.94rem;
  border-right: 1px solid var(--faint);
  padding-right: 1.2rem;
  align-self: start;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
@media (max-width: 52rem) {
  .sidebar { position: static; border-right: none; border-bottom: 1px solid var(--faint); padding: 0 0 0.8rem; max-height: none; }
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul ul { padding-left: 0.9rem; border-left: 1px solid var(--faint); margin: 0.1rem 0 0.3rem; }
.sidebar li { margin: 0.18rem 0; }
.sidebar a { text-decoration: none; color: var(--ink); }
.sidebar a:hover { color: var(--accent); text-decoration: underline; }
.sidebar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.sidebar summary { cursor: pointer; list-style: none; }
.sidebar summary::after { content: " ▸"; color: var(--muted); font-size: 0.8em; }
.sidebar details[open] > summary::after { content: " ▾"; }

/* main content */
main { min-width: 0; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); }
h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 0.8rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; border-bottom: 1px solid var(--faint); padding-bottom: 0.25rem; }
h3 { font-size: 1.08rem; margin: 1.4rem 0 0.4rem; }
a { color: var(--accent); }
p.lede { font-size: 1.13rem; color: var(--muted); margin-top: 0; }
p.domicile { font-size: 0.9rem; color: var(--accent); margin: -0.3rem 0 1.2rem; letter-spacing: 0.01em; }

blockquote {
  margin: 1.2rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--faint);
  font-style: italic;
}
blockquote p { margin: 0.3rem 0; }

table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--faint); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--faint); }
.table-scroll { overflow-x: auto; }

code, pre {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--faint);
  border-radius: 3px;
}
code { padding: 0.08em 0.3em; }
pre { padding: 0.8rem 1rem; overflow-x: auto; line-height: 1.5; }
pre code { padding: 0; background: none; }

dl dt { font-weight: 700; margin-top: 0.9rem; }
dl dd { margin: 0.15rem 0 0 1.2rem; }

mark { background: var(--mark); color: inherit; padding: 0 0.15em; }

.term { border-bottom: 1px dotted var(--muted); text-decoration: none; color: inherit; }
.term:hover { color: var(--accent); }

/* embedded explainer video — kept modest so it supports the prose, not dominates it */
.video-embed { margin: 1.4rem auto 1.8rem; max-width: 27rem; }
.video-embed video { width: 100%; height: auto; display: block;
  border: 1px solid var(--faint); border-radius: 6px; background: var(--ink); }
.video-embed figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.45rem; text-align: center; }

/* boxes */
.note, .axiom {
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.7rem 1rem;
  margin: 1.2rem 0;
}
.axiom { text-align: center; font-style: italic; font-size: 1.08rem; }

.seealso { margin-top: 2.5rem; border-top: 1px solid var(--faint); padding-top: 0.6rem; }
.seealso h2 { border: none; font-size: 1rem; margin: 0 0 0.3rem; }
.seealso ul { margin: 0; padding-left: 1.2rem; }

/* tools */
.tool { border: 1px solid var(--faint); border-radius: 5px; padding: 1rem 1.2rem; margin: 1.4rem 0; }
.tool textarea, .tool input[type="text"], .tool select {
  width: 100%; font: inherit; color: inherit; background: var(--paper);
  border: 1px solid var(--muted); border-radius: 3px; padding: 0.4rem 0.55rem;
}
.tool textarea { min-height: 8rem; }
.tool button {
  font: inherit; cursor: pointer; margin-top: 0.6rem;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 3px; padding: 0.45rem 1rem;
}
.tool output { display: block; margin-top: 0.9rem; }
.tool .hits mark { display: inline; }
.tool label { display: block; margin-top: 0.7rem; font-weight: 600; font-size: 0.95rem; }
.tool input[type="range"] { width: 100%; }
.badge { display: inline-block; border: 1px solid var(--accent); border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.82rem; color: var(--accent); margin: 0 0.25rem 0.25rem 0; }

/* lens/diagnostic page header chips */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; font-size: 0.95rem; margin: 1rem 0; }
.kv dt { font-weight: 700; margin: 0; }
.kv dd { margin: 0; }

/* footer */
.sitefoot {
  border-top: 2px solid var(--accent);
  padding: 1rem 1.4rem 1.6rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.foot-axiom { font-style: italic; }

/* cards on home */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem; padding: 0; list-style: none; }
.cardgrid li { border: 1px solid var(--faint); border-radius: 5px; padding: 0.8rem 1rem; margin: 0; }
.cardgrid h3 { margin: 0 0 0.3rem; }
.cardgrid p { margin: 0; font-size: 0.92rem; color: var(--muted); }

@media print {
  .sidebar, .sitefoot, .crumbs { display: none; }
  .layout { display: block; }
}
