/*
 * Truvec blog. Same design language as the landing page and the dashboard (dashboard/DESIGN.md):
 * soft neutral canvas, white borderless cards, warm gold accent, light only.
 */
:root {
  --font-sans: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --canvas: #f4f5f7;
  --card: #ffffff;
  --ink: #111418;
  --ink-2: #3d4148;
  --muted: #6b6f76;
  --line: #eceef1;
  --line-2: #dcdfe3;
  --gold: #f5a623;
  --gold-soft: #feefd0;
  --gold-ink: #8c560c;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 4px 12px -2px rgb(17 20 24 / 0.05), 0 1px 2px 0 rgb(17 20 24 / 0.04);
  --prose: 720px;
  --wide: 1040px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.7 var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #fcdda0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
a { color: var(--gold-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header and footer */
.site-header { padding: 16px; }
.nav {
  max-width: var(--wide); margin: 0 auto; display: flex; align-items: center; gap: 20px;
  font-size: 15px;
}
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); margin-right: auto; }
.nav .button {
  background: var(--ink); color: #fff; padding: 7px 14px; border-radius: 999px; font-weight: 550;
}
.nav .button:hover { color: #fff; background: #24272c; }
.site-footer { max-width: var(--wide); margin: 64px auto 0; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line-2); }
.site-footer a { color: var(--muted); }

/* Post layout: prose column, wider benchmark */
main { padding: 0 16px; }
.post, .blog-index { max-width: var(--wide); margin: 0 auto; }
.post-header, .toc, .prose, .breadcrumb, .post > .sample-warning { max-width: var(--prose); margin-left: auto; margin-right: auto; }
.breadcrumb { margin-top: 24px; font-size: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a::before { content: "← "; }
.post-header { padding: 24px 0 8px; }
h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 700; }
.lead { font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 0 0 16px; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0; }
.tags { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; background: var(--card); border: 1px solid var(--line-2); color: var(--ink-2); padding: 2px 10px; border-radius: 999px; }

.toc { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 20px; margin-top: 24px; margin-bottom: 8px; font-size: 15px; }
.toc p { margin: 0 0 4px; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--gold-ink); text-decoration: underline; }

/* Article text */
.prose { padding-bottom: 16px; }
.prose h2, .benchmark h2 { font-size: 28px; line-height: 1.25; letter-spacing: -0.015em; margin: 48px 0 12px; }
.prose h3, .benchmark h3 { font-size: 20px; line-height: 1.35; margin: 32px 0 8px; }
h2, h3 { position: relative; }
.anchor { position: absolute; left: -1.1em; color: var(--line-2); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 0 0 18px; padding: 4px 20px; border-left: 3px solid var(--gold); color: var(--ink-2); background: var(--card); border-radius: 0 12px 12px 0; }
.prose code { font: 0.88em var(--font-mono); background: #eceef1; padding: 2px 5px; border-radius: 5px; }
.prose pre { background: #111418; color: #eceef1; padding: 16px 20px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 32px 0; }
.prose table { margin-bottom: 18px; }

/* Tables (article and benchmark) */
.table-wrap { overflow-x: auto; margin: 0 0 20px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.45; }
caption { caption-side: top; text-align: left; padding: 14px 16px 6px; font-size: 13px; color: var(--muted); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; vertical-align: bottom; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 500; }
.num { text-align: right; }
td.num { white-space: nowrap; }
.model { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.model-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; padding-left: 30px; }
.rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--line); font-size: 12px; font-weight: 650; flex: none; }
tbody tr:first-child .rank { background: var(--gold); color: #fff; }
.bar-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar { display: inline-block; width: 72px; height: 6px; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--gold); border-radius: 999px; }
.hit { color: var(--success); font-weight: 650; }
.miss { color: var(--danger); font-size: 12px; }
.examples th[scope="row"] { min-width: 280px; white-space: normal; }
details { margin-top: 6px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; }
details blockquote { margin: 6px 0 0; padding: 6px 10px; border-left: 2px solid var(--line-2); }

/* Benchmark section: the last section of every post */
.benchmark {
  margin-top: 56px; padding: 32px clamp(16px, 4vw, 40px) 24px;
  background: linear-gradient(180deg, #fff8eb, rgb(255 248 235 / 0) 320px), var(--canvas);
  border: 1px solid var(--gold-soft); border-radius: 24px;
}
.benchmark h2 { margin-top: 4px; }
.benchmark > p { max-width: var(--prose); color: var(--ink-2); }
.eyebrow { margin: 0; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 20px 0 8px; }
.facts div { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; line-height: 1.4; }
.takeaways { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 20px 16px 40px; margin: 0 0 8px; }
.takeaways li { margin-bottom: 6px; }
.definitions { display: grid; gap: 8px; margin: 0 0 20px; }
.definitions div { background: var(--card); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.definitions dt { font-weight: 650; }
.definitions dd { margin: 0; color: var(--ink-2); }
.downloads { border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 15px; }
.downloads p { margin: 8px 0; }
.cta a { font-weight: 600; }

.sample-warning { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 12px; padding: 10px 14px; font-size: 15px; }

/* Index */
.empty { max-width: var(--prose); margin: 24px auto 0; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; color: var(--muted); }
.post-list { list-style: none; padding: 0; margin: 24px auto 0; max-width: var(--prose); display: grid; gap: 16px; }
.post-list article { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; }
.post-list h2 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--gold-ink); }
.post-list p { margin: 0 0 8px; color: var(--ink-2); }
.badge { display: inline-block; font-size: 13px; background: var(--gold-soft); color: var(--gold-ink) !important; padding: 2px 10px; border-radius: 999px; margin: 8px 0 0 !important; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 14px; }
  .lead { font-size: 18px; }
  .anchor { display: none; }
  .benchmark { margin-left: -8px; margin-right: -8px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .toc, .cta { display: none; }
  body { background: #fff; }
  .table-wrap, .facts div, .takeaways { box-shadow: none; border: 1px solid var(--line-2); }
}

/* Related posts, after the benchmark */
.related { max-width: var(--prose); margin: 40px auto 0; }
.related h2 { font-size: 20px; margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.related li { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 20px; }
.related a { font-weight: 600; color: var(--ink); text-decoration: none; }
.related a:hover { color: var(--gold-ink); text-decoration: underline; }
.related p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
