/* The stylesheet of the site at fwdcentaur.dev: the look of the VS Code extension's guide
   (docs/guides/vscode-extension.html in the fwdcentaur repository), its colours, type and boxes,
   with a header and a footer that every page shares, in a light and a dark scheme that follow the
   reader's system. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1c2128;
  --muted: #57606a;
  --line: #d8dee4;
  --soft: #f6f8fa;
  --accent: #0b62d6;
  --accent-fg: #ffffff;
  --note-bg: #fff8e5;
  --note-line: #d4a72c;
  --code-bg: #f2f4f7;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --fg: #e4e8ee;
    --muted: #9ba5b0;
    --line: #2d343c;
    --soft: #161b21;
    --accent: #72aaff;
    --accent-fg: #0f1216;
    --note-bg: #2a2412;
    --note-line: #a8862a;
    --code-bg: #1a1f26;
  }
}
@media print {
  :root {
    --bg: #ffffff; --fg: #000000; --muted: #444c56; --line: #c9d1d9; --soft: #f6f8fa;
    --accent: #0b4fb0; --accent-fg: #ffffff; --note-bg: #fff8e5; --note-line: #d4a72c;
    --code-bg: #f2f4f7;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  /* A long word, such as the repository's address as a link's text, breaks rather than widening
     the page past a phone's screen. */
  overflow-wrap: break-word;
}

/* The header every page shares: the mark and the name, then the four pages. */
.site-header { border-bottom: 1px solid var(--line); background: var(--soft); }
.site-header .inner {
  max-width: 50rem; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem;
}
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 2rem; height: 2rem; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--accent); text-decoration: underline; }
.site-header nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }

main { max-width: 50rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 3rem 0 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.12rem; line-height: 1.35; margin: 2rem 0 0.5rem; }
p, ul, ol, dl { margin: 0 0 0.9rem; }
li { margin: 0.2rem 0; }
a { color: var(--accent); }
code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.08em 0.3em; border-radius: 4px; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3em; background: var(--soft); white-space: nowrap; }
pre { background: var(--code-bg); padding: 0.8rem 1rem; border-radius: 6px; overflow-x: auto; line-height: 1.5; margin: 0 0 1rem; }
pre code { background: none; padding: 0; font-size: 1em; overflow-wrap: normal; }
blockquote { margin: 0 0 1rem; padding: 0.1rem 1rem; border-left: 4px solid var(--line); color: var(--muted); }

.byline { color: var(--muted); margin: 0 0 1.5rem; }
.lead { font-size: 1.1rem; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem 0.2rem; margin: 1.2rem 0 1.5rem; background: var(--soft); }
.box h2, .box h3 { border: 0; margin: 0 0 0.5rem; padding: 0; font-size: 1.05rem; }
.note {
  padding: 0.7rem 1rem 0.1rem; border-radius: 0 6px 6px 0; margin: 1rem 0 1.2rem;
  border-left: 4px solid var(--note-line); background: var(--note-bg);
}
.note strong:first-child { display: block; margin-bottom: 0.2rem; }
nav.toc ol { padding-left: 1.4rem; }
nav.toc > ol > li { margin: 0.35rem 0; }
nav.toc ol ol { margin: 0.15rem 0 0.3rem; font-size: 0.95rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); }
th { background: var(--soft); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: anywhere; }
dl.defs dt { font-weight: 600; margin-top: 0.8rem; }
dl.defs dd { margin: 0.15rem 0 0 0; }
.muted { color: var(--muted); }
.top { font-size: 0.85rem; }

/* The front page's opening: the mark, the name, what it is, and where to go next. */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin: 0.5rem 0 1.5rem; }
.hero img { width: 8rem; height: 8rem; flex: none; }
.hero .words { flex: 1 1 18rem; }
.hero h1 { font-size: 2.2rem; margin: 0 0 0.3rem; }
.hero p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.5rem; }
.button {
  display: inline-block; padding: 0.5rem 0.95rem; border-radius: 6px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--accent);
}
.button.primary { background: var(--accent); color: var(--accent-fg); }
.button.secondary { color: var(--accent); }
.button:hover { text-decoration: underline; }
ul.next { list-style: none; padding: 0; }
ul.next li { border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 1rem; margin: 0 0 0.6rem; background: var(--soft); }
ul.next li a { font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.site-footer .inner { max-width: 50rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
.site-footer p { margin: 0 0 0.4rem; }

@media (max-width: 40rem) {
  main { padding: 1.2rem 1rem 2.5rem; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.25rem; }
  body { font-size: 15.5px; }
  .hero img { width: 6rem; height: 6rem; }
  .hero h1 { font-size: 1.8rem; }
}
@media print {
  body { font-size: 10.5pt; }
  .site-header nav, .top, .actions { display: none; }
  main { max-width: none; padding: 0; }
  h2, h3 { break-after: avoid; }
  .table-wrap, pre, .note, .box { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  pre, .table-wrap { overflow: visible; }
}
