/*
 * Black, white, grey and one accent (a burnt orange). System fonts only.
 * No gradients, no shadows beyond a hairline, no JavaScript anywhere on the
 * page — the mind map in the hero is a real export doing the work.
 */

:root {
  --ink: #16181c;
  --ink-soft: #52565e;
  --ink-faint: #8a8f97;
  --rule: #e2e2df;
  --paper: #fdfdfc;
  --panel: #f5f4f1;
  --accent: #a8432c;

  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceae6;
    --ink-soft: #a9adb4;
    --ink-faint: #797e86;
    --rule: #2b2e33;
    --paper: #131416;
    --panel: #1b1d20;
    --accent: #e08063;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- bars ---------------------------------------------------------------- */

.bar {
  border-bottom: 1px solid var(--rule);
}

footer.bar {
  border-bottom: 0;
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
}

.bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.mark {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.bar nav {
  display: flex;
  gap: 1.25rem;
}

/* --- type ---------------------------------------------------------------- */

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 620;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 0.85rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1rem;
  font-weight: 620;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
  max-width: 46rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

.note {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.bar a,
.bar span {
  color: var(--ink-soft);
  text-decoration: none;
}

.bar a:hover {
  color: var(--accent);
}

em {
  font-style: italic;
}

/* --- sections ------------------------------------------------------------ */

section {
  margin: 3.5rem auto;
}

.hero {
  margin-top: 4.5rem;
}

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

.cols p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* The one outbound link on the page. A rule in the accent, not a call-out box. */
.editor > * {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

.editor h2 {
  border-top: 0;
  padding-top: 0;
}

/* --- code ---------------------------------------------------------------- */

code {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre code {
  font-size: 1em;
}

.cmd {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  max-width: 28rem;
}

.cmd code::before {
  content: "$ ";
  color: var(--ink-faint);
}

/* --- demo frame ---------------------------------------------------------- */

.demo {
  margin: 2.5rem 0 0;
}

.demo iframe {
  display: block;
  width: 100%;
  height: min(60vh, 460px);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
}

.demo figcaption {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--ink-faint);
  max-width: 44rem;
}

/* --- table --------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom-color: var(--ink-faint);
}

td:first-child {
  white-space: nowrap;
}

@media (max-width: 34rem) {
  td:first-child {
    white-space: normal;
  }
}
