/*
 * help.frst.dev — shared styling for the download page and the capability page.
 *
 * Hand-written and deliberately small: the site is two pages of prose, and a build step
 * between the source and what a worried person reads would be one more thing that can be
 * out of date. The verb tables on /what-it-does/ ARE generated, from the agent's own
 * catalogue — see scripts/gen-capability-page.ts.
 */

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #61d095;
  --warn: #f0b45e;
  --alarm: #e2626b;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --line: #e2e5ec;
    --text: #14171d;
    --muted: #5c6472;
    --accent: #0f8f56;
    --warn: #9a6100;
    --alarm: #b3242e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 44rem; margin: 0 auto; padding: 3.5rem 1.25rem 6rem; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 3.5rem 0 1.25rem; }
h3 { font-size: 1.05rem; margin: 2rem 0 0.4rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); margin-bottom: 2rem; }
a { color: var(--accent); }

a.button {
  display: inline-block;
  background: var(--accent);
  color: #06120b;
  font-weight: 650;
  font-size: 1.1rem;
  padding: 0.95rem 1.5rem;
  border-radius: 11px;
  text-decoration: none;
}
a.button:hover { filter: brightness(1.08); }
.detected { color: var(--muted); font-size: 0.95rem; margin-top: 0.75rem; }

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.75rem 3.5rem;
  border-left: 2px solid var(--line);
  margin-left: 1.1rem;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1.15rem;
  top: -0.15rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #06120b;
  font-weight: 700;
  display: grid;
  place-items: center;
}
ol.steps strong { display: block; font-size: 1.15rem; margin-bottom: 0.2rem; }
ol.steps span { color: var(--muted); }

.code-demo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-top: 0.9rem;
  text-align: center;
}
.code-demo .label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.code-demo .digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
}

.promise { display: grid; gap: 0.9rem; }
.promise div { border-left: 2px solid var(--accent); padding-left: 1rem; }
.promise strong { display: block; }
.promise span { color: var(--muted); }

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  margin-bottom: 0.75rem;
}
details + h2 { margin-top: 3rem; }
summary { cursor: pointer; font-weight: 600; }
details p:first-of-type { margin-top: 0.9rem; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; }
pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.9rem;
  overflow-x: auto;
}
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain a { color: var(--text); text-decoration: none; }
ul.plain a:hover { color: var(--accent); }
ul.plain .arch { color: var(--muted); font-size: 0.85rem; }

.warn { color: var(--warn); }
footer { color: var(--muted); font-size: 0.9rem; margin-top: 4rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
footer a { color: var(--muted); }

/* ------------------------------------------------------- the capability page */

.backlink { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 1.5rem; font-size: 0.95rem; }
.backlink:hover { color: var(--accent); }

/* One verb. The badge row is the summary a hurried reader gets; the prose under it is
   for the one who wants the detail. */
.verb {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
}
.verb > h3 { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; }
.verb .means { margin: 0.45rem 0 0.7rem; }
.verb .exposes { color: var(--muted); margin: 0; font-size: 0.95rem; }
.verb .exposes b { color: var(--text); font-weight: 600; }

.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.55rem 0 0; }
.badge {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge.safe { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.badge.caution { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.badge.alarm { color: var(--alarm); border-color: color-mix(in srgb, var(--alarm) 55%, transparent); }

.legend { display: grid; gap: 0.5rem; margin: 0 0 1.5rem; }
.legend div { color: var(--muted); font-size: 0.95rem; }
.legend .badge { margin-right: 0.5rem; }

.callout {
  border-left: 3px solid var(--warn);
  background: var(--panel);
  border-radius: 0 12px 12px 0;
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.5rem;
}
.callout.alarm { border-left-color: var(--alarm); }
.callout p:last-child { margin-bottom: 0; }

.stamp { color: var(--muted); font-size: 0.85rem; }
