/* platform.recursiveselves.com — the developer surface.

   The same design language as the workspace: a white ground, #1a1a1a ink,
   hairline rules, Instrument Sans with emphasis carried by size rather than
   weight, Geist Mono for labels and figures, 4px corners, and nothing raised
   off the page — no shadows, no gradients. Lime is the hover fill on solid
   controls and the mark under the current view; it never carries text on
   white, where --signal-deep does.

   This file is the console's own, and deliberately short: a workspace page is
   an application, and this is a handful of forms and one chart. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --paper: #ffffff;
  --paper-dim: #f5f5f4;
  --paper-deep: #ebebea;
  --rule: #e3e4e5;
  --rule-strong: #c4c5c7;
  --quiet: #6b6b6b;
  --faint: #a8a8a8;
  --signal: #c6ff3d;
  --signal-deep: #4b6a00;
  --signal-wash: #f2fdd8;
  --danger: #c1272d;
  --danger-wash: #fbeceb;
  --ok: #2e7d4f;
  --warn: #9a5b00;
  --warn-wash: #fdf3e2;
  --band: #0e0e0f;
  --band-ink: #f2f2f0;
  --band-quiet: #8f8f8f;
  --band-rule: #2a2a2c;

  --display: "Instrument Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "Instrument Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 4px;
  --col: 66rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 2.75rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }
h1 { font: 400 2.25rem/1.15 var(--display); margin: 0 0 .75rem; letter-spacing: -.02em; }
h2 { font: 500 1.125rem/1.3 var(--display); margin: 0 0 1rem; }
p { margin: 0 0 1rem; }
a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal-deep); }
code, pre, .mono, .fig { font-family: var(--mono); }
.quiet { color: var(--quiet); }
.lede { color: var(--ink-soft); max-width: 44rem; }
.idx { font: 400 .75rem/1 var(--mono); color: var(--faint); margin: 0 0 1rem; letter-spacing: .04em; }

/* Shell */
.shell {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.5rem; height: 3.5rem; border-bottom: 1px solid var(--rule);
  position: sticky; top: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 5;
}
.mark { display: flex; align-items: center; gap: .5rem; font: 500 .95rem/1 var(--display); text-decoration: none; }
.mark-sub { color: var(--quiet); font-weight: 400; }
.glyph { width: 14px; height: 14px; background: var(--ink); display: inline-block; position: relative; }
.glyph::after { content: ""; position: absolute; inset: 4px; background: var(--signal); }
.shell nav { display: flex; align-items: center; gap: 1rem; font-size: .875rem; }
.nav { text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav-here { border-bottom-color: var(--signal); }
.who { color: var(--quiet); font-family: var(--mono); font-size: .8rem; }
.foot {
  border-top: 1px solid var(--rule); padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; font-size: .8rem;
}

/* Controls */
:where(button, .button) {
  font: 500 .875rem/1 var(--display); padding: .6rem .9rem; border: 1px solid var(--ink);
  border-radius: var(--r); background: var(--paper); color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-block; transition: background .12s var(--ease);
}
:where(button, .button):hover { background: var(--signal-wash); }
.button.solid { background: var(--ink); color: var(--paper); }
.button.solid:hover { background: var(--signal); color: var(--ink); }
.bare { border: 0; padding: .35rem 0; background: none; font-size: .8rem; text-decoration: underline; text-decoration-color: var(--rule-strong); }
.bare:hover { background: none; text-decoration-color: var(--signal-deep); }
.bare.danger { color: var(--danger); }
.inline { display: inline; }
.form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin: 1.25rem 0 0; }
.form label { display: flex; flex-direction: column; gap: .35rem; font: 400 .75rem/1 var(--mono); color: var(--quiet); text-transform: uppercase; letter-spacing: .04em; }
.form :where(input, select) {
  font: 400 .95rem/1 var(--body); padding: .6rem .7rem; border: 1px solid var(--rule-strong);
  border-radius: var(--r); background: var(--paper); color: var(--ink); min-width: 14rem;
}
.form :where(input, select):focus-visible { outline: 2px solid var(--signal-deep); outline-offset: 1px; }
.error { color: var(--danger); background: var(--danger-wash); border: 1px solid var(--danger); border-radius: var(--r); padding: .7rem .8rem; }

/* Rows — an index, not cards */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.row-main { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; flex: 1 1 14rem; }
.row-title { font-size: 1rem; }
.row-facts { display: flex; align-items: center; gap: 1rem; font-size: .8rem; color: var(--quiet); flex-wrap: wrap; }
.row-gone { opacity: .55; }
.row.empty { color: var(--quiet); }
.chip {
  font: 400 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--rule-strong); border-radius: var(--r); padding: .25rem .4rem; color: var(--ink-soft);
}
.chip-warn { border-color: var(--warn); color: var(--warn); background: var(--warn-wash); }
.chip-gone { border-color: var(--rule-strong); color: var(--faint); }

/* Facts and tables */
.facts { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 1.5rem 0 0; }
.facts dt { font: 400 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--quiet); margin-bottom: .35rem; }
.facts dd { margin: 0; font-size: 1.25rem; }
.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid :where(th, td) { text-align: left; padding: .65rem .75rem .65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.grid th { font: 400 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--quiet); }
.grid .fig { text-align: right; padding-right: 1.5rem; font-variant-numeric: tabular-nums; }
.row-here { background: var(--signal-wash); }

/* The chart: one series, thin marks, a 2px gap, one number */
.chart { list-style: none; display: flex; align-items: flex-end; gap: 2px; height: 140px; margin: 0; padding: 0; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-fill { display: block; width: 100%; height: var(--h); background: var(--ink); border-radius: var(--r) var(--r) 0 0; }
.bar:hover .bar-fill { background: var(--signal-deep); }
.bar-over .bar-fill { background: var(--warn); }
.bar-label { position: absolute; top: -1.15rem; font-size: .7rem; color: var(--quiet); }
.axis { display: flex; justify-content: space-between; font-size: .7rem; margin-top: .5rem; }

/* Code and keys */
.code { background: var(--paper-dim); border: 1px solid var(--rule); border-radius: var(--r); padding: .9rem 1rem; overflow-x: auto; font-size: .8rem; line-height: 1.6; }
.key { display: block; font-size: .85rem; word-break: break-all; background: var(--paper); border: 1px solid var(--ink); border-radius: var(--r); padding: .7rem .8rem; }
.minted { border: 1px solid var(--signal-deep); background: var(--signal-wash); border-radius: var(--r); padding: 1rem; margin-bottom: 1.25rem; }
.minted p { margin-bottom: .6rem; }

/* Landing */
.hero { padding-top: 3.5rem; }
.hero h1 { font-size: 2.75rem; max-width: 20ch; }
.band { background: var(--band); color: var(--band-ink); border-bottom: 0; margin: 0 -1.5rem; padding: 2.75rem 1.5rem; }
.band .idx { color: var(--band-quiet); }
.band a { color: var(--band-ink); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { display: flex; gap: .75rem; align-items: start; }
.steps p { color: var(--band-quiet); margin: .35rem 0 0; font-size: .9rem; }
.step-n { font: 400 .75rem/1 var(--mono); color: var(--band); background: var(--signal); width: 1.4rem; height: 1.4rem; display: grid; place-items: center; flex: none; }

@media (max-width: 640px) {
  h1, .hero h1 { font-size: 2rem; }
  .facts { gap: 1.5rem; }
  .shell { flex-wrap: wrap; height: auto; padding-block: .75rem; }
  .grid { display: block; overflow-x: auto; }
}

/* A pool and what is drawn against it. A thin rule, not a rounded pill: the
   figure beside it is the number people read, and this is only its shape. */
.meter { display: block; height: 3px; background: var(--paper-deep); margin-top: .5rem; width: 12rem; max-width: 100%; }
.meter-fill { display: block; height: 100%; width: var(--w); background: var(--ink); }
.hint { font: 400 .7rem/1.3 var(--mono); color: var(--faint); text-transform: none; letter-spacing: 0; }
.form label .hint { margin-top: .1rem; }

/* A ceiling about to bite says so in words as well as colour. */
.near-ceiling { color: var(--warn); }
.at-ceiling { color: var(--danger); }
.notice { border-left: 2px solid var(--warn); background: var(--warn-wash); padding: .7rem .9rem; margin-top: 1.25rem; }
