/* Shared article stylesheet. Every page built from site-src/ links this;
 * truly page-specific rules live in each article's `css:` front-matter block
 * and are emitted in an inline <style> AFTER this file, so they win ties. */

:root {
  --text: #28292C;
  --muted: #525760;
  --rule: #e6e2da;
  --bg: #fff;
  --accent: #FF6701;
  --code-bg: #f5f6f8;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { border-top: 5px solid #FF6701; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 56px 28px 96px; }
header.lede { margin-bottom: 48px; }
.kicker { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 40px; line-height: 1.15; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 24px; line-height: 1.3; margin: 56px 0 16px; letter-spacing: -0.005em; }
h3 { font-size: 18px; margin: 32px 0 8px; }

/* Linkable section headings: a #-anchor that appears on hover and sits in the
 * left gutter, plus scroll-margin so a deep-linked heading clears the top bar.
 * The id + anchor markup is injected by build.js's heading renderer. */
h2, h3, h4, h5, h6 { position: relative; scroll-margin-top: 24px; }
.heading-anchor {
  position: absolute;
  left: -0.85em;
  width: 0.85em;
  color: var(--rule);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}
.heading-anchor:hover { color: var(--accent); }
h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
h4:hover > .heading-anchor,
h5:hover > .heading-anchor,
h6:hover > .heading-anchor,
.heading-anchor:focus { opacity: 1; }
:target { scroll-margin-top: 24px; }
p { margin: 0 0 16px; }
p.standfirst { font-size: 20px; color: var(--muted); line-height: 1.5; }
ul { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 56px 0; }
figure { margin: 24px 0 32px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
}
figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
}
kbd { border: 1px solid var(--rule); }
.back { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 24px; padding: 4px 0; }
.back:hover { color: var(--accent); }
aside.callout { border-left: 3px solid var(--accent); background: #FFF4EC; padding: 16px 20px; margin: 28px 0; border-radius: 0 6px 6px 0; }
aside.callout h3 { margin-top: 0; font-size: 16px; }
aside.callout p:last-child { margin-bottom: 0; }
aside.warn { border-left: 3px solid #b45309; background: #fef3c7; padding: 16px 20px; margin: 28px 0; border-radius: 0 6px 6px 0; }
aside.warn h3 { margin-top: 0; font-size: 16px; color: #92400e; }
aside.warn p:last-child { margin-bottom: 0; }
footer.crumbs { margin-top: 56px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 18px; }
footer.crumbs a { color: var(--muted); }
.demo-tip {
  background: #fff8e1;
  border-left: 3px solid #d4a400;
  padding: 6px 12px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  line-height: 1.55;
}
.demo-tip::before {
  content: "Demo · ";
  color: #856404;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.tk-figure {
  border: 2px dashed var(--rule);
  border-radius: 6px;
  padding: 36px 24px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.tk-figure .tk-label {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tk-figure strong { color: var(--text); }
@media (max-width: 600px) {
  h1 { font-size: 30px; }
}

/* Tables — enumeration/reference style */
table { width: 100%; border-collapse: collapse; margin: 24px 0 32px; font-size: 15px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; }
thead th { font-weight: 600; border-bottom: 2px solid var(--text); }
tbody td, tbody th { border-bottom: 1px solid var(--rule); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
table code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
@media (max-width: 640px) { table { display: block; overflow-x: auto; } }
