/* ThumbGate long-form article template. Style guide: docs/BLOG_STYLE_GUIDE.md */
:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #0f1520;
  --panel-2: #131b28;
  --text: #eef1f6;
  --body: #d3d9e3;
  --muted: #95a1b3;
  --line: #243045;
  --cyan: #38d7ff;
  --green: #56e39f;
  --amber: #f5c451;
  --red: #ff6b81;
  --measure: 40rem;
  --wide: 55rem;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 18px/1.62 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
a { color: var(--cyan); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 3px; }

/* Top bar */
.site-bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 11, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.site-bar .inner {
  max-width: 72rem; margin: 0 auto; padding: 0 20px; min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-bar .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 15px; text-decoration: none; }
.site-bar .brand img { width: 24px; height: 24px; }
.site-bar .section-now { flex: 1; min-width: 0; color: var(--muted); font: 600 12px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; opacity: 0; transition: opacity 0.2s; }
.site-bar .section-now.on { opacity: 1; }
.site-bar nav { display: flex; gap: 16px; align-items: center; font-size: 14px; font-weight: 700; }
.site-bar nav a { color: var(--muted); text-decoration: none; }
.site-bar nav a:hover { color: var(--text); }
.site-bar nav a.cta { color: #06130d; background: var(--green); padding: 7px 12px; border-radius: 9px; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--cyan); }

/* Article column */
.post { max-width: var(--measure); margin: 0 auto; padding: 56px 20px 40px; }
.post-head { margin-bottom: 36px; }
.eyebrow { margin: 0 0 14px; color: var(--green); font: 700 12px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--text); text-wrap: balance; }
h1 { margin: 0 0 16px; font-size: clamp(32px, 5.4vw, 46px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.dek { margin: 0 0 22px; color: var(--text); font-size: 21px; line-height: 1.5; }
.byline { margin: 0 0 10px; color: var(--muted); font: 500 14px/1.5 var(--sans); }
.byline b { color: var(--text); font-weight: 700; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.topics li { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 600 12px/1.6 var(--sans); }

/* The short version */
.summary { margin: 0 0 32px; padding: 20px 22px 8px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 12px; background: var(--panel); }
.summary h2 { margin: 0 0 8px; font: 700 12px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); }
.summary ul { padding-left: 20px; margin: 0 0 12px; }
.summary li { margin: 0 0 8px; font-size: 17px; }

/* Contents */
.toc { margin: 0 0 40px; padding: 0 0 24px; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.toc h2 { margin: 0 0 10px; font: 700 12px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 12px; padding: 5px 0; color: var(--body); text-decoration: none; font-size: 15px; line-height: 1.45; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font: 600 13px/1.6 var(--mono); }
.toc a:hover, .toc a.active { color: var(--cyan); }
.toc a.active::before { color: var(--cyan); }

/* Body */
.post section { counter-increment: sec; }
.post { counter-reset: sec; }
.post section > h2 { margin: 56px 0 14px; font-size: 27px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 750; }
.post section > h2::before { content: counter(sec, decimal-leading-zero); display: block; margin-bottom: 6px; color: var(--muted); font: 600 13px/1 var(--mono); letter-spacing: 0.08em; }
.post section.unnumbered { counter-increment: none; }
.post section.unnumbered > h2::before { content: none; }
h3 { margin: 32px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 20px; }
ul, ol { margin: 0 0 20px; padding-left: 24px; }
li { margin: 0 0 8px; }
li::marker { color: var(--muted); }
strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }
blockquote { margin: 28px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--cyan); color: var(--text); font-size: 21px; line-height: 1.5; }
blockquote p:last-child { margin-bottom: 0; }

code { padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font: 0.84em/1.5 var(--mono); }
pre { margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--text); }
pre code { padding: 0; border: 0; background: none; font: inherit; }
pre .c { color: var(--muted); }
pre .ok { color: var(--green); }
pre .no { color: var(--red); }
pre .warn { color: var(--amber); }

.table-wrap { margin: 0 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font: 15px/1.5 var(--sans); }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Figures break out of the text column */
figure { margin: 36px 0; }
.figure-wide { width: min(var(--wide), calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%); }
.figure-frame { overflow-x: auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.figure-frame svg { display: block; width: 100%; height: auto; }
figcaption { max-width: calc(var(--measure) - 40px); margin: 12px auto 0; color: var(--muted); font: 14px/1.55 var(--sans); }
figcaption b { color: var(--text); }

/* Notes and callouts */
.note { margin: 28px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font: 16px/1.6 var(--sans); }
.note p:last-child { margin-bottom: 0; }
.note.limit { border-left: 3px solid var(--amber); }
.note .label { display: block; margin-bottom: 6px; color: var(--amber); font: 700 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* Footnotes */
sup.fn a { padding: 0 2px; font: 700 12px/1 var(--sans); text-decoration: none; }
.footnotes { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font: 15px/1.6 var(--sans); color: var(--muted); }
.footnotes h2 { margin: 0 0 12px; font-size: 16px; }
.footnotes ol { padding-left: 20px; }
.footnotes a.back { margin-left: 4px; text-decoration: none; }
.post-end { margin-top: 40px; font: 15px/1.6 var(--sans); color: var(--muted); }
.post-end h2 { margin: 0 0 10px; font-size: 16px; color: var(--text); }

/* Related + CTA */
.related { max-width: var(--wide); margin: 24px auto 0; padding: 0 20px; font-family: var(--sans); }
.related h2 { margin: 0 0 14px; font: 700 12px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; }
.related-grid a { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); text-decoration: none; }
.related-grid a:hover { border-color: rgba(56, 215, 255, 0.45); }
.related-grid small { display: block; margin-bottom: 6px; color: var(--muted); font: 600 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.related-grid b { display: block; font-size: 17px; line-height: 1.3; }
.try { max-width: var(--measure); margin: 40px auto 0; padding: 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-family: var(--sans); }
.try p { margin: 0 0 10px; font-size: 16px; }
.try pre { margin: 0 0 10px; }
.site-foot { max-width: 72rem; margin: 56px auto 0; padding: 24px 20px 48px; border-top: 1px solid var(--line); color: var(--muted); font: 14px/1.6 var(--sans); }
.site-foot a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .post { padding-top: 36px; }
  .dek { font-size: 19px; }
  .site-bar nav a:not(.cta) { display: none; }
  .site-bar .section-now { display: none; }
  .figure-frame { padding: 14px; }
  .figure-frame svg { min-width: 600px; }
  .figure-wide figcaption { padding: 0 2px; }
  .post section > h2 { margin-top: 44px; font-size: 24px; }
  .try { margin-left: 20px; margin-right: 20px; }
}
@media (prefers-reduced-motion: reduce) { .site-bar .section-now { transition: none; } }
@media print {
  .site-bar, .related, .try, .site-foot { display: none; }
  body { background: #fff; color: #111; }
}
