/* Layout and components consume the per-site identity in generated tokens.css. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); font-weight: 600; line-height: 1.15; letter-spacing: -0.035em; overflow-wrap: break-word; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent-strong); color: var(--accent-ink); padding: .75rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; color: var(--accent-ink); }
/* Keep source imagery in its original colors, including licensed photographs. */
.img-duo { display: block; overflow: hidden; border-radius: var(--radius); }
.img-duo img { transition: opacity .15s ease; }
a.img-duo:hover img { opacity: .9; }
.post-meta, .byline, .section-label, .category-chip, .tag-pill, .pagination, .collection-count { font-family: var(--serif); font-size: .78rem; font-weight: 400; line-height: 1.6; letter-spacing: 0; }
.post-meta { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; color: var(--muted); }
.post-category, .category-chip { color: var(--brand); font-weight: 600; }
.post-category:hover, .category-chip:hover { color: var(--brand); }
.category-chip { display: inline-flex; align-items: center; min-height: 24px; }
.byline { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.byline-details, .byline-authors { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.byline-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.byline-by { display: none; }
.byline-date, .byline-and { color: var(--muted); }
.byline-name { display: inline-flex; align-items: center; min-height: 24px; }
.section-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--brand); }

/* ==========================================================================
   Charts — pipeline-authored bar comparisons inside article bodies.
   Colors are CVD/contrast-validated per mode (do not swap for --brand/--accent
   derived values without re-validating).
   ========================================================================== */


.article-body .chart {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3em 1.4em 1.1em;
  margin: 0 0 1.6em;
  position: relative;
}
.article-body .chart figcaption {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  margin: 0 0 0.9em;
  color: var(--ink);
}
.article-body .chart-dek {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.5;
  margin: -0.25em 0 1em;
}
.article-body .chart-data {
  margin-top: 1em;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.article-body .chart-data:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.article-body .chart-data table {
  font-size: 0.82rem;
  margin: 0;
  min-width: 30rem;
  width: 100%;
}
.article-body .chart-data caption {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0 0 0.55em;
  text-align: left;
  text-transform: uppercase;
}
.article-body .chart-method,
.article-body .chart-source {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.55;
  margin: 0.9em 0 0;
}
.article-body .chart-source ol { margin: 0.35em 0 0; padding-left: 2.2em; }
.article-body .chart-source li + li { margin-top: 0.25em; }
.article-body .chart-source a { color: var(--ink); text-decoration-color: var(--brand); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4em;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1em;
}
.chart-key { display: inline-flex; align-items: center; gap: 0.5em; }
.chart-key::before { content: ""; width: 10px; height: 10px; background: var(--chart-1); }
.chart-key.k2::before { background: var(--chart-2); }
.chart-key[data-chart-toggle] {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  min-height: 2rem;
  padding: 0.25rem 0;
  text-transform: inherit;
}
.chart-key[data-chart-toggle]:hover { color: var(--ink); }
.chart-key[data-chart-toggle]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.chart-key[data-chart-toggle][aria-pressed="false"] { opacity: 0.5; }
.chart-key[data-chart-toggle][aria-pressed="false"]::before {
  background: transparent;
  border: 2px solid currentColor;
  box-sizing: border-box;
}

.chart dl { margin: 0; display: flex; flex-direction: column; }
.chart dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4em;
}
.chart dt:not(:first-child) { margin-top: 1em; }
.chart dd {
  margin: 0 0 2px;                 /* 2px surface gap between adjacent bars */
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.chart[data-chart-enhanced="true"] dd { cursor: help; }
.chart[data-chart-enhanced="true"] dd:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.chart dd::before {
  content: "";
  height: 16px;                    /* thin mark */
  width: calc(var(--v) * 0.8%);   /* --v: 0-100, longest bar in chart = 100 */
  min-width: 2px;
  background: var(--chart-1);
  border-radius: 0 3px 3px 0;      /* rounded data-end, flat baseline end */
  flex-shrink: 0;
}
.chart dd.k2::before { background: var(--chart-2); }
.chart.chart-hide-l1 dd:not(.k2),
.chart.chart-hide-l2 dd.k2 { display: none; }
.chart-val {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);               /* values wear text tokens, not series color */
  white-space: nowrap;
}

/* Stat tiles — a row of headline numbers */
.article-body .stat-row {
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;                        /* hairline surface gaps */
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0 0 1.6em;
}
.article-body .stat {
  background: var(--paper);
  padding: 1.1em 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}
.stat-value {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* SVG line charts (change over time) */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart-svg .line.l1 { stroke: var(--chart-1); }
.chart-svg .line.l2 { stroke: var(--chart-2); }
.chart-svg .dot.l1 { fill: var(--chart-1); }
.chart-svg .dot.l2 { fill: var(--chart-2); }
.chart-svg .dot {
  cursor: help;
  paint-order: stroke;
  stroke: transparent;
  stroke-width: 16px;
}
.chart-svg .dot:focus-visible {
  outline: none;
  stroke: var(--ink);
  stroke-width: 3px;
}
.chart-svg .axis { stroke: var(--muted); stroke-width: 1; } /* --line axis was 1.24:1; --muted clears 3:1 */
.chart-svg .tick, .chart-svg .val {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}
.chart-svg .val { fill: var(--ink); font-family: var(--sans); font-size: 11px; }
.chart-svg .l1, .chart-svg .l2 { transition: opacity 0.15s ease; }
.chart.chart-hide-l1 .chart-svg .l1,
.chart.chart-hide-l2 .chart-svg .l2 {
  opacity: 0;
  pointer-events: none;
}
.chart-tooltip {
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 18%, transparent);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  left: 0;
  line-height: 1.4;
  max-width: min(18rem, calc(100% - 2rem));
  padding: 0.55rem 0.7rem;
  pointer-events: none;
  position: absolute;
  text-transform: none;
  top: 0;
  transform: translate(-50%, calc(-100% - 0.65rem));
  z-index: 2;
}
.chart-tooltip[hidden] { display: none; }

/* ==========================================================================
   Editorial blocks — pipeline-authored devices that break up article text
   ========================================================================== */

/* Pull quote: the article's own line, restyled big. */
.article-body .pullquote {
  margin: 2.2em 0;
  padding: 1.1em 0;
  border-top: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}

/* Source quote: real, attributed, linked. */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--ink);
  font-style: normal;
}
.article-body blockquote p { margin-bottom: 0.4em; }
.article-body blockquote cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Big-number callout */
.article-body .bignum {
  margin: 2em 0;
  padding: 1.4em 1.5em;
  background: var(--card-soft);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}
.bignum-value {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  line-height: 1;
}
.bignum-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Explainer aside */
.article-body .aside-box {
  margin: 2em 0;
  padding: 1.2em 1.4em;
  background: var(--card-soft);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.aside-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 0.5em;
}
.article-body .aside-box p { margin: 0 0 0.6em; }
.article-body .aside-box p:last-child { margin: 0; }

/* Verdict box (comparisons) */
.article-body .verdict-box {
  margin: 2.2em 0;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
}
.article-body .verdict-box > div { background: var(--paper); padding: 1.1em 1.3em; }
.verdict-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5em;
}
.article-body .verdict-box ul { margin: 0; padding-left: 1.1em; font-size: 0.93rem; }
.article-body .verdict-box li { margin-bottom: 0.4em; }
@media (max-width: 640px) { .article-body .verdict-box { grid-template-columns: 1fr; } }

/* Timeline */
.article-body .timeline { margin: 2em 0; padding: 0; list-style: none; }
.article-body .timeline li {
  position: relative;
  padding: 0 0 1.3em 1.6em;
  border-left: 2px solid var(--line);
  margin-left: 0.4em;
}
.article-body .timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.article-body .timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.25em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}
.timeline-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15em;
}

/* Prompt/output exchange (the AI-blog signature block) */
.article-body .exchange {
  margin: 2em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-body .exchange > div { padding: 1em 1.3em; }
.article-body .exchange-prompt { background: var(--card-soft); }
.article-body .exchange-output { border-top: 1px solid var(--line); }
.exchange-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5em;
}
.article-body .exchange p { margin: 0 0 0.6em; }
.article-body .exchange p:last-child { margin: 0; }
.article-body .exchange pre { margin: 0; background: none; padding: 0; white-space: pre-wrap; }

/* FAQ block */
.article-body .faq { margin: 2em 0; }
.article-body .faq-item {
  border-top: 1px solid var(--line);
  padding: 1em 0;
}
.article-body .faq-item:last-child { border-bottom: 1px solid var(--line); }
.article-body .faq-q {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.4em;
}
.article-body .faq-a { margin: 0; font-size: 0.97rem; }

/* Steps block (numbered process) */
.article-body ol.steps {
  margin: 2em 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.article-body ol.steps li {
  position: relative;
  padding: 0 0 1.2em 3em;
  counter-increment: step;
}
.article-body ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1em;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--brand);
  color: var(--accent-ink);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Changelog block (release notes) */
.article-body ul.changelog { margin: 2em 0; padding: 0; list-style: none; }
.article-body ul.changelog li {
  position: relative;
  padding: 0.35em 0 0.35em 2em;
  font-size: 0.97rem;
}
.article-body ul.changelog li::before {
  position: absolute;
  left: 0;
  top: 0.35em;
  font-family: var(--mono);
  font-weight: 500;
  width: 1.4em;
  text-align: center;
  border-radius: 4px;
  font-size: 0.85em;
}
.article-body ul.changelog li.add::before { content: "+"; color: var(--chg-add); background: color-mix(in srgb, var(--chg-add) 12%, transparent); }
.article-body ul.changelog li.change::before { content: "~"; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.article-body ul.changelog li.remove::before { content: "−"; color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ==========================================================================
   Ghost editor (Koenig) cards — content rendered inside article bodies
   ========================================================================== */

.article-body .kg-image { margin: 0 auto; }
.article-body .kg-card { margin: 0 0 1.4em; }

@media (min-width: 980px) {
  .article-body .kg-width-wide { margin-left: -70px; margin-right: -70px; }
}
.article-body .kg-width-full { width: 100%; }

.article-body .kg-image-card figcaption,
.article-body .kg-embed-card figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5em;
}

.article-body .kg-bookmark-card a { text-decoration: none; }
.article-body .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--line);
  color: var(--ink);
}
.article-body .kg-bookmark-content { padding: 1em 1.2em; flex-grow: 1; }
.article-body .kg-bookmark-title { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; }
.article-body .kg-bookmark-description {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-body .kg-bookmark-metadata {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.6em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.article-body .kg-bookmark-icon { width: 16px; height: 16px; }
.article-body .kg-bookmark-thumbnail { flex-shrink: 0; max-width: 200px; }
.article-body .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.article-body .kg-bookmark-author, .article-body .kg-bookmark-publisher { display: inline; }

.article-body .kg-callout-card {
  display: flex;
  gap: 0.8em;
  padding: 1.1em 1.3em;
  background: var(--code-bg);
  border-left: 3px solid var(--brand);
}
.article-body .kg-callout-card p { margin: 0; }

.article-body .kg-button-card { display: flex; }
.article-body .kg-btn {
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-strong);
  color: var(--accent-ink);
  padding: 0.6em 1.2em;
  text-decoration: none;
}

.article-body .kg-gallery-container { display: flex; flex-direction: column; gap: 0.6em; }
.article-body .kg-gallery-row { display: flex; gap: 0.6em; }
.article-body .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }


@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
