@import url('/styles/tokens.css');

/* Shared article layout. All colors and typefaces come from the personal site. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--sienna); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sienna-hover); }
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--sienna); outline-offset: 5px; }
.blog-page { max-width: 952px; padding: 40px 24px 0; margin: 0 auto; }
.site-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-bottom: 42px; font-size: 13px; color: var(--text-mid); }
.site-nav a { font-weight: 500; }
.blog-layout { display: grid; grid-template-columns: 220px minmax(0, 620px); gap: 64px; align-items: start; }
.blog-content { min-width: 0; }
.skip-link { position: absolute; top: 8px; left: 16px; padding: 8px 16px; background: var(--card); transform: translateY(-200%); z-index: 10; }
.skip-link:focus { transform: translateY(0); }
article > header { padding: 0 0 30px; }
.eyebrow { margin: 0 0 20px; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mid); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 400; }
h1 { font-size: clamp(32px, 3.6vw, 46px); line-height: 1.3; letter-spacing: -.018em; margin: 0 0 24px; text-wrap: balance; }
h2 { font-size: 28px; line-height: 1.4; letter-spacing: -.012em; margin: 0 0 22px; text-wrap: balance; }
h3 { font-size: 21px; line-height: 1.5; margin: 28px 0 12px; }
.dek { font-size: 18px; line-height: 1.8; color: var(--text-mid); margin-bottom: 16px; font-weight: 300; }
.article-intro { margin-top: 28px; }
.article-intro strong { color: var(--ink); }
.intro-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 28px 0 0; font-size: 13px; }
.scope, .small, figcaption, .context { font-size: 12px; line-height: 1.8; color: var(--text-mid); }
p { margin: 0 0 20px; }
strong, b { font-weight: 500; }
article > section { margin: 54px 0 0; }
article > h2 { margin-top: 54px; }
:where(article h2, article h3, article section[id], article) { scroll-margin-top: 32px; }
ul, ol { padding-left: 22px; }
li { margin: 8px 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 6px 0 18px; }
.metrics strong { display: block; font: 400 clamp(26px, 3vw, 34px)/1.4 var(--serif); color: var(--sienna); }
.metrics span { display: block; font-size: 11px; line-height: 1.6; color: var(--text-mid); margin-top: 5px; }
figure { margin: 26px 0; }
video, img { max-width: 100%; }
video { display: block; width: 100%; background: var(--surface); border-radius: 4px; }
figcaption { margin-top: 12px; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; font-size: 12px; }
.table-wrap { overflow-x: auto; margin: 24px 0; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.7; }
caption { text-align: left; font-size: 11px; color: var(--text-mid); padding-bottom: 12px; }
th, td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-mid); font-size: 11px; font-weight: 500; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
code, pre { font: 12px/1.7 ui-monospace, Menlo, monospace; }
code { background: var(--surface); padding: 2px 4px; border-radius: 2px; overflow-wrap: anywhere; }
pre { padding: 18px; background: var(--surface); color: var(--ink); border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre code { padding: 0; }
.repro { padding: 24px; background: var(--surface); border-radius: 4px; }
.repro h2 { font-size: 24px; }
.repro p:last-child { margin-bottom: 0; }
article details { border-top: 1px solid var(--border); padding: 14px 0; }
article summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; font-size: 13px; line-height: 1.7; list-style: none; }
article summary::-webkit-details-marker { display: none; }
article summary::before { content: '+'; color: var(--sienna); flex: 0 0 12px; }
article details[open] > summary::before { content: '−'; }
article summary > span:first-of-type { flex: 1; }
article summary b { flex-shrink: 0; font-size: 11px; }
.pass { color: var(--ink); }
.fail { color: var(--sienna-hover); }
.result-body { padding: 22px 0 8px; font-size: 14px; }
.result-body h3 { font: 500 11px/1.6 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-mid); }
.answer-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.answer-pair > div { background: var(--card); padding: 16px; border: 1px solid var(--border); border-radius: 4px; overflow-wrap: anywhere; }
.answer-pair h3 { margin: 0 0 12px; }
.context { white-space: pre-wrap; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 16px; }
.filters label { font-size: 11px; color: var(--text-mid); }
.filters label:last-child { grid-column: 1 / -1; }
.filters :where(input, select), button { width: 100%; min-height: 42px; display: block; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--text); font: 13px/1.5 var(--sans); }
input::placeholder { color: var(--text-mid); }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--sienna); color: var(--sienna-hover); }
button:disabled { opacity: .45; cursor: default; }
.pagination { display: flex; gap: 12px; margin-top: 18px; }
.pagination button { width: auto; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 48px 0; color: var(--text-mid); font-size: 12px; }

/* <blog-toc> owns navigation behavior; light DOM inherits the same site tokens. */
blog-toc { display: block; position: sticky; top: 32px; max-height: calc(100dvh - 64px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 3px 10px 10px 0; }
blog-toc .toc-heading { font: 500 10px/1.6 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-mid); margin: 0 0 20px; }
blog-toc summary { display: none; }
blog-toc ol { list-style: none; padding: 0; margin: 0; }
blog-toc li { margin: 0; }
blog-toc a { display: block; border-left: 1px solid var(--border); padding: 8px 0 8px 16px; font: 400 12px/1.55 var(--sans); color: var(--text-mid); text-decoration: none; }
blog-toc a:hover { color: var(--sienna); }
blog-toc a[aria-current='location'] { border-left: 2px solid var(--sienna); padding-left: 15px; color: var(--sienna-hover); font-weight: 500; }
blog-toc .toc-subheading a { padding-left: 28px; font-size: 11px; }
blog-toc .toc-subheading a[aria-current] { padding-left: 27px; }
blog-toc a:focus-visible { outline-offset: -2px; }
@media (max-width: 1050px) {
  .blog-page { max-width: 668px; padding-top: 28px; }
  .site-nav { padding-bottom: 26px; }
  .blog-layout { display: block; }
  blog-toc { position: static; max-height: none; overflow: visible; padding: 0; margin-bottom: 32px; }
  blog-toc .toc-heading { display: none; }
  blog-toc summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 12px; color: var(--sienna); list-style: none; padding: 10px 0; }
  blog-toc summary::-webkit-details-marker { display: none; }
  blog-toc summary::after { content: '+'; }
  blog-toc details[open] summary::after { content: '−'; }
  blog-toc nav { padding: 12px 0 4px; }
  h1 { font-size: clamp(32px, 6vw, 42px); }
}
@media (max-width: 480px) {
  .blog-page { padding-inline: 20px; }
  body { font-size: 15px; }
  h2 { font-size: 25px; }
  .dek { font-size: 17px; }
  .metrics { gap: 14px; }
  .metrics strong { font-size: 26px; }
  .metrics span { font-size: 10px; }
  .answer-pair { grid-template-columns: 1fr; }
  .repro { padding: 20px; }
  article summary { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: white; }
  .blog-page { max-width: none; padding: 0; }
  .blog-layout { display: block; }
  blog-toc, .skip-link, video, .downloads, .filters, .pagination { display: none; }
}
