/* The one stylesheet for every BotMaker page.
 *
 * SHARED ON PURPOSE. The organization page and the four project pages (each generated by its own
 * repository's build-repo.sh) link this file, so moving between them does not look like leaving the
 * project, and a change to the look is one edit rather than five copies drifting apart. Same origin
 * for all of them — botmakerdev.github.io — so linking it costs no availability a project page did
 * not already have.
 *
 * It therefore styles BOTH markups: the org page's hero and card grid, and a project page's plain
 * h1 / h2 / pre / footer column. Do not remove a rule because this page does not use it.
 */

:root {
  color-scheme: light dark;

  --fg: #17181c;
  --fg-strong: #000000;
  --muted: #5c6068;
  --bg: #ffffff;
  --bg-sunken: #f6f7f9;
  --card: #ffffff;
  --line: #e3e5ea;
  --code-bg: #f4f5f7;
  --code-fg: #17181c;

  /* One accent, used for links, focus rings and the primary button. A second accent would be a
     colour the reader has to learn the meaning of. */
  --accent: #3a5bd9;
  --accent-fg: #ffffff;
  --accent-soft: rgba(58, 91, 217, .1);

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 27, .04), 0 4px 16px rgba(16, 18, 27, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e8ec;
    --fg-strong: #ffffff;
    --muted: #9ba1ac;
    --bg: #101216;
    --bg-sunken: #0b0d10;
    --card: #171a1f;
    --line: #272b33;
    --code-bg: #0d0f13;
    --code-fg: #dfe3e8;

    --accent: #8ba4ff;
    --accent-fg: #0f1115;
    --accent-soft: rgba(139, 164, 255, .14);

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  color: var(--fg);
  background: var(--bg);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* A project page is a plain column with no wrappers of its own, so the column width lives on body
   there and on the wrappers here. */
body > h1,
body > h2,
body > p,
body > pre,
body > footer { max-width: 46rem; margin-left: auto; margin-right: auto; padding-inline: 1.25rem; }
body > h1:first-child { padding-top: 3rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── hero ────────────────────────────────────────────────────────────────────────────────────── */

header.hero {
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  padding: 4.5rem 1.25rem 3.5rem;
}

.hero .inner { max-width: 60rem; margin: 0 auto; }

.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--fg-strong);
}

.hero .tagline {
  margin: 0 0 2rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
}

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.button {
  display: inline-block;
  padding: .6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font-size: .95rem;
  font-weight: 500;
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button.primary:hover { filter: brightness(1.08); }

/* ── page body ───────────────────────────────────────────────────────────────────────────────── */

main { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem 4rem; }

h2 {
  margin: 3.5rem 0 .35rem;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  color: var(--fg-strong);
}

p.sub { margin: 0 0 1.5rem; color: var(--muted); }

/* A project page keeps the old rule: h2 is a section break with a line above it. */
body > h2 { padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ── cards ───────────────────────────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
}

article.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.15rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -.01em;
  color: var(--fg-strong);
}

.card .version {
  display: inline-block;
  margin: .45rem 0 .7rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.card .blurb { margin: 0 0 .9rem; color: var(--muted); font-size: .94rem; }
.card .note { margin: .65rem 0 0; color: var(--muted); font-size: .82rem; }

/* Pushes the link row to the bottom so cards of different heights still line their links up. */
.card .links { margin-top: auto; padding-top: 1rem; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .87rem;
}

/* The wide card: everything installed in one go, above the per-tool grid. */
article.card.wide { grid-column: 1 / -1; }
.card.wide .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; }
.card.wide h4 { margin: 0 0 .5rem; font-size: .88rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ── snippets ────────────────────────────────────────────────────────────────────────────────── */

.snippet { position: relative; }

pre {
  margin: 0;
  padding: .85rem 3.25rem .85rem 1rem;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--code-fg);
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, "Liberation Mono", monospace; }
p code, li code { background: var(--code-bg); border-radius: 4px; padding: .1rem .35rem; font-size: .88em; }

/* Written by copy.js; without JavaScript no button appears and the snippet is still selectable. */
.copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
.copy:hover { color: var(--fg); border-color: var(--accent); }
.copy[data-done="yes"] { color: var(--accent); border-color: var(--accent); }

/* ── footer ──────────────────────────────────────────────────────────────────────────────────── */

footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .87rem;
}
footer p { margin: 0 0 .6rem; }
