/* Shared styling for the content pages (index / install / docs).
   sim.html deliberately does NOT use this — it's published standalone as a Claude
   Artifact, a single self-contained file with nothing alongside it.

   The theme is the device: electronic paper. That means near-monochrome, high contrast,
   flat — no gradients, no glows, no coloured "primary" buttons. Emphasis comes from
   weight, rules and inversion, the way it does in print, because those are the only
   tools a 1-bit panel has either. Light mode is paper white, not cream. Dark mode is the
   same page read at night rather than a different design. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-2: #f6f6f4;      /* faint fill for panels — barely off the page */
  --ink: #14140f;
  --ink-2: #45453d;        /* secondary text */
  --ink-3: #74746a;        /* captions, meta */
  --rule: #dcdcd4;
  --rule-strong: #b4b4a8;
  --accent: #14140f;       /* deliberately ink: the only "colour" is contrast */
  --shadow: rgba(20, 20, 15, 0.10);
  /* The only two hues in the whole palette, and only because "this failed" shouldn't
     rely on weight alone. Muted enough not to break the page. */
  --good: #2f6b3f;
  --bad: #9c3024;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101010;
  --paper-2: #191918;
  --ink: #ececE6;
  --ink-2: #b6b6ad;
  --ink-3: #85857c;
  --rule: #2c2c29;
  --rule-strong: #4a4a44;
  --accent: #ececE6;
  --shadow: rgba(0, 0, 0, 0.5);
  --good: #7fb587;
  --bad: #e08c7f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

code, kbd {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05rem 0.32rem;
}

h1, h2, h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--paper);
  background: var(--ink);
  padding: 0.22rem 0.4rem;
  text-decoration: none;
}

.topbar .wordmark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav { display: flex; gap: 0.1rem; align-items: center; margin-left: auto; flex-wrap: wrap; }

.topbar nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border-bottom: 2px solid transparent;
}
.topbar nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.topbar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.theme-toggle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule-strong);
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  line-height: 1;
  margin-left: 0.35rem;
}
.theme-toggle:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }

/* ---- building blocks ---- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* Buttons are print blocks: solid ink or outlined, never a coloured pill. */
.btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--paper); color: var(--ink); }

.panel {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.3rem;
}

.legend {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-3);
  line-height: 1.65;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.7rem;
}

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
}
