:root {
  --ink: #130e30;
  --slate: #5f5c6e;
  --canvas: #f9fbf2;
  --meadow: #eff2e5;
  --yellow: #ffe228;
  --line: rgba(19, 14, 48, 0.12);
  --serif: "Hedvig Letters Serif", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }

/* header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* matches .article so the logo lines up with the headline */
  max-width: 1064px;
  margin: 0 auto;
  padding: 20px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { height: 30px; width: auto; }
.brand mark { background: var(--yellow); border-radius: 4px; padding: 0 2px; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--yellow); color: var(--ink);
  font-weight: 600; text-decoration: none;
  padding: 12px 22px; border-radius: 999px;
  transition: filter .15s;
}
.btn:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.head-links { display: flex; align-items: center; gap: 20px; }
.head-links > a:not(.btn) { font-weight: 500; font-size: 15px; text-decoration: none; color: var(--slate); }
.head-links > a:not(.btn):hover { color: var(--ink); }

/* article */
.article { max-width: 1064px; margin: 0 auto; padding: 24px 24px 40px; }
.eyebrow {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 12px; color: var(--slate); margin: 24px 0 12px;
}
.article h1 {
  font-family: var(--serif); font-weight: 700; line-height: 1.15;
  font-size: clamp(34px, 6vw, 52px); letter-spacing: -0.02em; margin: 0 0 20px;
}
.lede { font-size: 20px; color: var(--slate); margin: 0 0 8px; }
.article h2 {
  font-family: var(--serif); font-weight: 700; line-height: 1.2;
  font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.01em; margin: 48px 0 14px;
}
.article h3 { font-size: 20px; font-weight: 700; margin: 32px 0 10px; }
.article p, .article li { font-size: 17px; color: #29283a; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 6px 0; }
.article a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.article strong { color: var(--ink); }
mark { background: var(--yellow); color: var(--ink); padding: 0 3px; border-radius: 3px; }

.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; color: var(--slate); }

/* wide matrices scroll inside their own box rather than breaking the page */
.table-wrap { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; min-width: 660px; }
.article td.num, .article th.num { font-family: var(--mono); white-space: nowrap; }
.article tr.hl td { background: rgba(255, 226, 40, 0.18); }

/* index / table of contents */
.article h2 { scroll-margin-top: 20px; }
.toc { border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px 22px; margin: 36px 0 44px; background: #fff; }
.toc > p.eyebrow { margin: 0 0 10px; padding-left: 6px; }
.toc ol {
  list-style: none; margin: 0; padding: 0; counter-reset: toc;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); column-gap: 22px; row-gap: 2px;
}
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: grid; grid-template-columns: 30px 1fr; align-items: baseline;
  padding: 10px 8px; border-radius: 10px; text-decoration: none;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono); font-size: 12px; color: var(--slate);
}
.toc a b { font-size: 16px; font-weight: 600; }
.toc a span { grid-column: 2; display: block; font-size: 13px; color: var(--slate); margin-top: 2px; }
.toc a:hover { background: var(--meadow); }
.toc a:hover b { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 2px; }

/* inline tokenisation demo — shows what a token is rather than describing it */
.tokens-demo { margin: 20px 0 8px; line-height: 2.4; }
.tokens-demo span {
  font-family: var(--mono); font-size: 15px;
  background: var(--meadow); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 9px; margin-right: 5px; white-space: pre;
}
.tokens-demo span.split { background: var(--yellow); border-color: rgba(19, 14, 48, 0.25); }

/* definition / big-statement callout */
.define {
  border-left: 4px solid var(--yellow); background: var(--meadow);
  border-radius: 0 14px 14px 0; padding: 18px 22px; margin: 26px 0;
}
.define b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.25; margin-bottom: 6px; }
.define span { font-size: 15px; color: var(--slate); }

/* key-number callout row */
.keynums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0; }
.keynums div { background: var(--meadow); border-radius: 14px; padding: 16px 18px; }
.keynums b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.keynums span { display: block; font-size: 13px; color: var(--slate); margin-top: 6px; }

code { font-family: var(--mono); font-size: 0.9em; background: var(--meadow); padding: 2px 6px; border-radius: 5px; }
figure { margin: 32px 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 16px; border: 1px solid var(--line); background: var(--meadow); }
figcaption { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); margin-top: 10px; text-align: center; }

blockquote {
  margin: 24px 0; padding: 16px 20px; background: var(--meadow);
  border-radius: 14px; font-size: 18px; color: var(--ink);
}
.faq dt { font-weight: 700; margin-top: 20px; }
.faq dd { margin: 6px 0 0; color: #29283a; }

/* blog index */
.index-head { max-width: 1064px; margin: 0 auto; padding: 24px 24px 8px; }
.index-head h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 6vw, 52px); letter-spacing: -0.02em; margin: 0 0 16px; }
.index-head .lede { max-width: 620px; }
.cards { max-width: 1064px; margin: 0 auto; padding: 24px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  display: flex; flex-direction: column; text-decoration: none;
  border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px 26px;
  background: #fff; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: rgba(19, 14, 48, 0.3); transform: translateY(-2px); }
.card .eyebrow { margin: 0 0 10px; flex: none; }
.card h2 { font-family: var(--serif); font-size: 24px; line-height: 1.2; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
/* :not(.eyebrow) — the eyebrow is also a <p>, and giving it flex:1 made it
   stretch to absorb each card's leftover height, so titles never lined up. */
.card p:not(.eyebrow) { font-size: 15px; color: var(--slate); margin: 0; flex: 1; }
.card .meta { margin-top: 18px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate); }
.card.feature { grid-column: 1 / -1; background: var(--meadow); border-color: transparent; }
.card.feature h2 { font-size: clamp(26px, 3.4vw, 34px); max-width: 18ch; }
.card.feature p { font-size: 17px; max-width: 62ch; }

/* cta + related */
.cta { max-width: 1064px; margin: 48px auto 0; padding: 40px 32px; text-align: center; background: var(--ink); border-radius: 24px; color: #fff; }
.cta h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 16px; color: #fff; }
.cta .btn.ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.cta .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.related { max-width: 1064px; margin: 40px auto 0; }
.related p.eyebrow { margin-top: 0; }
.related a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; margin-bottom: 10px; font-weight: 600; }
.related a:hover { background: var(--meadow); }
.related a span { display: block; font-weight: 400; font-size: 14px; color: var(--slate); margin-top: 2px; }

.site-footer { max-width: 1064px; margin: 56px auto 0; padding: 24px; border-top: 1px solid var(--line); color: var(--slate); font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--ink); text-decoration: none; }
