/* brainhuman.com — projects to help humanity. Calm, readable, light or dark as the visitor's
   system says. No fonts or scripts from anywhere else. */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #5b6878;
  --line: #e2e7ee;
  --brand: #1f7a8c;
  --brand-2: #3aa5a0;
  --soft: #e8f4f4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --card: #17202a;
    --text: #e6edf3;
    --muted: #9aa8b6;
    --line: #26323f;
    --brand: #4fb8c6;
    --brand-2: #6fd0c4;
    --soft: #15303a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
img, svg { max-width: 100%; height: auto; }
.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
select.lang { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }

/* Sections */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.02em; }
.hero p { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 760px; margin: 0 0 24px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--text); font-size: 14px; }
section { padding: 32px 0; }
h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 800px; }

/* Cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.card .head { display: flex; align-items: center; gap: 12px; }
.card .head img { width: 48px; height: 48px; border-radius: 12px; }
.card .tag { align-self: flex-start; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.card .go { margin-top: auto; font-weight: 600; text-decoration: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; border: 0; font: inherit; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

/* How it works: one diagram per idea */
.how { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
.how .card svg { width: 100%; height: auto; display: block; background: var(--soft); border-radius: 12px; }
.diagram text { font: 13px system-ui, sans-serif; fill: var(--text); }
.diagram .muted { fill: var(--muted); }
.diagram .node { fill: var(--card); stroke: var(--brand); stroke-width: 2; }
.diagram .relay { fill: var(--card); stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; }
.diagram .flow { stroke: var(--brand); stroke-width: 2.5; fill: none; marker-end: url(#arrow); }
.diagram .flow2 { stroke: var(--brand-2); stroke-width: 2.5; fill: none; marker-end: url(#arrow2); }
.diagram .lock { fill: var(--brand); }

/* Downloads */
.dl { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.dl .card.mine { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.dl code { font-size: 12px; word-break: break-all; color: var(--muted); }
.soon { color: var(--muted); font-style: italic; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
details pre { overflow-x: auto; background: var(--soft); padding: 10px; border-radius: 8px; font-size: 13px; }

/* Lists of what it does and what's coming */
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
ul.ticks { margin: 0; padding-left: 1.2em; }
ul.ticks li { margin: 4px 0; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

/* Four ways to communicate: 2 × 2 on a wide screen, not 3 + 1. */
#ways .cols { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (min-width: 900px) { #ways .cols { grid-template-columns: repeat(4, 1fr); } }

/* On a phone the header keeps the name and the language; the sections are a scroll away. */
@media (max-width: 640px) {
  .nav a { display: none; }
  .hero { padding: 36px 0 24px; }
  .hero .btn { margin-bottom: 8px; }
}

/* Questions: one under another, open one at a time as needed. */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* Keyboard: always visible where you are; and a way to skip the header. */
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--card); color: var(--text); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Modules: search, categories and cards. */
.hint-line { font-size: 16px !important; }
.filters { display: grid; gap: 12px; margin-bottom: 16px; }
.filters input[type=search] { font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.chip.active { background: var(--brand); border-color: transparent; color: #fff; }
.mod .head img { width: 44px; height: 44px; border-radius: 10px; background: var(--soft); padding: 6px; }
.mod .pkg { font-size: 12px; color: var(--muted); }
.mod .dlrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.mod .dlrow .btn { padding: 8px 12px; font-size: 14px; }
.mod code { font-size: 11px; word-break: break-all; color: var(--muted); }
.mod-more summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--brand); }
.mod-more > p { margin: 8px 0 0; font-size: 15px; }
.mod-cmds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mod-cmds li { display: grid; gap: 1px; padding: 6px 8px; border-radius: 8px; background: var(--soft); font-size: 14px; }
.mod-cmds code { font-weight: 600; color: var(--text); }
.mod-cmds span { color: var(--muted); }
.mod-cmds small { color: var(--muted); font-style: italic; }
