:root {
  --ink: #11151b;
  --graphite: #2a313b;
  --slate: #5b6573;
  --mist: #d9dde2;
  --paper: #f5f6f4;
  --white: #ffffff;
  --shu: #e0452b;       /* the end node and graphic accents, never text */
  --shu-deep: #b8361f;  /* accent text, links and the primary button on a light ground, 5.4:1 on paper */
  --shu-light: #f47a60; /* accent text on a dark ground, 4.9:1 on graphite */
  --kon: #2b4c7e;
  --kon-tint: #e6edf6;
  --muted-on-dark: #aeb6c1;

  --bg: var(--paper);
  --surface: var(--white);
  --text: var(--ink);
  --text-2: var(--slate);
  --line: var(--mist);
  --link: var(--shu-deep);
  --code-bg: var(--ink);

  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 24px;
  --content: 1200px;
  --prose: 72ch;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --surface: var(--graphite);
    --text: var(--paper);
    --text-2: var(--muted-on-dark);
    --line: #3a424d;
    --link: var(--shu-light);
    --kon-tint: #1c2b42;
    --code-bg: var(--graphite);
  }
}

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

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

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(44px, 7vw, 80px); letter-spacing: -0.04em; line-height: 1.02; }
h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; }
h3 { font-size: 24px; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.1em 0.35em; }
pre {
  background: var(--code-bg);
  color: var(--paper);
  border-radius: var(--radius-m);
  padding: 24px 28px;
  line-height: 1.7;
  overflow-x: auto;
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }
.table-wrap { overflow-x: auto; }

.container { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); }

.label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
}
.button.primary { background: var(--shu-deep); color: var(--white); }
.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  .button { background: var(--paper); color: var(--ink); }
  .button.primary { background: var(--shu-deep); color: var(--white); }
  .button.secondary { background: var(--surface); color: var(--text); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 28px;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--link); }

.grid-2, .grid-3 { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.note { background: var(--kon-tint); border-radius: var(--radius-s); padding: 16px 20px; }
.note > :last-child { margin-bottom: 0; }
