/* Extracted from the Field Notes template so case files share one stylesheet. */
/* ============================================================
   TOKENS — mirrors Reignance design system
============================================================ */
:root {
  --bg:        #0a0b0d;
  --bg-1:      #0f1115;
  --bg-2:      #14171c;
  --bg-3:      #1c2028;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);
  --fg:        #ecedf0;
  --fg-2:      #a0a4af;
  --fg-3:      #6b6f7a;
  --fg-4:      #43464d;

  --accent:      oklch(0.82 0.018 250);
  --accent-2:    oklch(0.91 0.012 250);
  --accent-soft: oklch(0.82 0.02 250 / 0.12);
  --accent-glow: oklch(0.86 0.02 250 / 0.26);

  --display: 'Archivo Expanded', 'Arial Narrow', sans-serif;
  --sans:    'Archivo', -apple-system, sans-serif;
  --serif:   'Newsreader', Georgia, serif;
  --mono:    'JetBrains Mono', 'Courier New', monospace;

  --rad:    4px;
  --rad-md: 8px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

/* ============================================================
   NAV
============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-bottom-color 0.4s var(--ease);
}
.nav.scrolled {
  background: var(--nav-bg, rgba(10,11,13,0.92));
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  color: var(--fg); text-decoration: none;
}
.brand-mark {
  width: 24px; height: 24px;
  background: var(--accent);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}
.brand-suffix { color: var(--fg-3); margin-left: 2px; }
.nav-back {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--fg-3); display: flex; align-items: center; gap: 8px;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--accent); text-decoration: none; }
.nav-back svg { transition: transform 0.2s var(--ease); }
.nav-back:hover svg { transform: translateX(-3px); }

/* ============================================================
   LAYOUT
============================================================ */
.container { max-width: 960px; margin: 0 auto; padding: 0 32px; }
.container--wide { max-width: 1280px; }

.kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; color: var(--accent);
  margin-bottom: 20px; display: inline-block;
}

/* ============================================================
   HERO — BLOG
============================================================ */
.blog-hero {
  padding: 112px 0 48px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 70% 40%, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.blog-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.blog-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  padding: 4px 10px; border-radius: var(--rad);
  text-transform: uppercase;
}
.blog-date { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.10em; }
.blog-readtime { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.10em; }
.blog-hero-title {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.blog-hero-title em { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--accent); }
.blog-hero-sub {
  font-size: 18px; color: var(--fg-2); max-width: 640px; line-height: 1.65;
  margin-bottom: 40px;
}
.blog-hero-author {
  display: flex; align-items: center; gap: 14px;
}
.author-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  font-weight: 700; flex-shrink: 0;
}
.author-info { display: flex; flex-direction: column; gap: 2px; }
.author-name { font-size: 14px; font-weight: 600; }
.author-title { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.08em; }

/* ============================================================
   ARTICLE LAYOUT
============================================================ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 64px;
  align-items: start;
  padding: 48px 0 120px;
}
/* Pin columns explicitly so the article (DOM-second) keeps the wide 1fr
   column and the sidebar (DOM-first) stays in the narrow right column. */
.blog-body { grid-column: 1; grid-row: 1; }
.blog-sidebar { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; gap: 0; padding: 48px 0 96px; }
  .blog-body { grid-column: 1; }
  .blog-sidebar {
    grid-column: 1;
    position: static; top: auto;
    margin-bottom: 32px; padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }
  .blog-sidebar .toc-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .blog-sidebar .toc-item {
    border-left: 0; border: 1px solid var(--line);
    border-radius: var(--rad); padding: 6px 10px;
  }
  .blog-sidebar .toc-item.active { border-color: var(--accent); }
  .sidebar-cta { display: none; }
}

/* ============================================================
   SIDEBAR — TOC
============================================================ */
.blog-sidebar { position: sticky; top: 88px; }
.toc-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--fg-4); text-transform: uppercase;
  margin-bottom: 16px;
}
.toc-list { display: flex; flex-direction: column; gap: 0; }
.toc-item {
  display: block; font-size: 12px; color: var(--fg-3);
  font-family: var(--mono); letter-spacing: 0.04em;
  padding: 8px 12px; border-left: 1px solid var(--line);
  transition: color 0.2s, border-left-color 0.2s;
  text-decoration: none; line-height: 1.4;
}
.toc-item:hover { color: var(--fg); border-left-color: var(--accent); text-decoration: none; }
.toc-item.active { color: var(--accent); border-left-color: var(--accent); }

.sidebar-cta {
  margin-top: 40px; padding: 20px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--rad-md);
}
.sidebar-cta-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--accent); margin-bottom: 10px;
  display: block;
}
.sidebar-cta p { font-size: 13px; color: var(--fg-2); margin-bottom: 16px; line-height: 1.55; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.10em;
  padding: 9px 16px; border-radius: var(--rad);
  background: var(--accent); color: #000; font-weight: 700;
  transition: opacity 0.2s;
}
.btn-sm:hover { opacity: 0.85; text-decoration: none; }

/* ============================================================
   ARTICLE BODY PROSE
============================================================ */
.blog-body { min-width: 0; }

.blog-body h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 64px 0 24px;
  padding-top: 24px;
  scroll-margin-top: 88px;
  color: var(--fg);
}
.blog-body h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--accent); }
.blog-body > h2:first-child { margin-top: 0; padding-top: 0; }

.blog-body h3 {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 40px 0 14px;
  scroll-margin-top: 88px;
}

.blog-body p {
  font-size: 16px; color: var(--fg-2); line-height: 1.8;
  margin-bottom: 20px; max-width: 68ch;
}
.blog-body p strong { color: var(--fg); font-weight: 600; }
.blog-body code {
  font-family: var(--mono); font-size: 0.86em;
  color: var(--accent-2); background: var(--bg-2);
  padding: 2px 6px; border-radius: var(--rad);
  border: 1px solid var(--line);
}

.blog-body ul {
  margin: 0 0 24px 0; display: flex; flex-direction: column; gap: 10px;
  max-width: 68ch;
}
.blog-body ul li {
  font-size: 15px; color: var(--fg-2); line-height: 1.7;
  padding-left: 20px; position: relative;
}
.blog-body ul li::before {
  content: '◆';
  position: absolute; left: 0; top: 2px;
  font-size: 7px; color: var(--accent);
}

/* ============================================================
   CODE BLOCKS
============================================================ */
.code-block {
  margin: 32px 0; border-radius: var(--rad-md);
  overflow: hidden; border: 1px solid var(--line-2);
  background: var(--bg-1);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-3); border-bottom: 1px solid var(--line);
}
.code-lang {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--accent); text-transform: uppercase; font-weight: 700;
}
.code-label {
  font-family: var(--mono); font-size: 10px; color: var(--fg-4);
  letter-spacing: 0.08em;
}
.code-block pre {
  padding: 24px 24px; overflow-x: auto; margin: 0;
}
.code-block code {
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
  color: var(--fg-2); display: block;
  background: none; border: 0; padding: 0;
}
.code-block code .kw  { color: oklch(0.78 0.13 295); }
.code-block code .ty  { color: oklch(0.80 0.13 205); }
.code-block code .fn  { color: oklch(0.85 0.15 85); }
.code-block code .cm  { color: var(--fg-4); font-style: italic; }
.code-block code .st  { color: oklch(0.80 0.13 140); }
.code-block code .nu  { color: oklch(0.80 0.14 55); }

/* ============================================================
   BENCHMARK / METRICS CARDS
============================================================ */
.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 32px 0;
}
.metric-card {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--rad-md); padding: 20px 18px;
  position: relative; overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
}
.metric-card.after::before { background: oklch(0.80 0.18 140); }
.metric-card.neutral::before { background: var(--fg-3); }
.metric-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--fg-3); text-transform: uppercase; margin-bottom: 10px;
}
.metric-val {
  font-family: var(--display); font-size: 36px; font-weight: 400;
  line-height: 1; margin-bottom: 6px;
  text-transform: uppercase;
}
.metric-card .metric-val { color: var(--accent); }
.metric-card.after .metric-val { color: oklch(0.80 0.18 140); }
.metric-card.neutral .metric-val { color: var(--fg-2); }
.metric-sub { font-size: 12px; color: var(--fg-3); line-height: 1.45; }

/* ============================================================
   CALLOUT BOXES
============================================================ */
.callout {
  margin: 32px 0; padding: 20px 22px;
  border-radius: var(--rad-md);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  max-width: 68ch;
}
.callout.warn { border-left-color: oklch(0.74 0.17 55); }
.callout.good { border-left-color: oklch(0.80 0.18 140); }
.callout-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 8px;
  display: block; font-weight: 700;
}
.callout.warn .callout-label { color: oklch(0.74 0.17 55); }
.callout.good .callout-label { color: oklch(0.80 0.18 140); }
.callout p { font-size: 14px; color: var(--fg-2); line-height: 1.7; margin: 0; max-width: none; }
.callout p strong { color: var(--fg); }

/* ============================================================
   COMPARISON TABLE
============================================================ */
.compare-table {
  width: 100%; border-collapse: collapse;
  margin: 32px 0; max-width: 68ch;
  font-size: 14px;
}
.compare-table th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--fg-3); text-transform: uppercase;
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.compare-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  color: var(--fg-2); vertical-align: top; line-height: 1.55;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { color: var(--fg); font-weight: 600; }
.compare-table td.bad  { color: oklch(0.74 0.17 55); font-family: var(--mono); font-size: 12px; }
.compare-table td.good { color: oklch(0.80 0.18 140); font-family: var(--mono); font-size: 12px; }

/* ============================================================
   DIVIDERS + MISC
============================================================ */
.section-rule {
  border: none; height: 1px; background: var(--line);
  margin: 0;
}
.pull-quote {
  margin: 40px 0;
  padding: 28px 32px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--rad-md) var(--rad-md) 0;
  max-width: 68ch;
}
.pull-quote p {
  font-family: var(--display); font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 400; line-height: 1.3; text-transform: uppercase;
  color: var(--fg); margin: 0; max-width: none; letter-spacing: -0.01em;
}
.pull-quote cite {
  display: block; font-family: var(--mono); font-size: 11px;
  color: var(--fg-3); letter-spacing: 0.10em; margin-top: 14px;
  font-style: normal;
}

/* ============================================================
   FIGURE / IMAGE PLACEHOLDERS
============================================================ */
.blog-figure {
  margin: 36px 0; max-width: none;
  border: 1px solid var(--line-2);
  border-radius: var(--rad-md);
  overflow: hidden; background: var(--bg-1);
}
.figure-frame {
  position: relative; aspect-ratio: 16 / 9;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background-color: var(--bg-2);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line);
}
.figure-frame::before {
  content: attr(data-shot);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase; text-align: center;
  padding: 0 24px;
}
.figure-frame::after {
  content: '◭';
  position: absolute; bottom: 12px; right: 14px;
  font-size: 13px; color: var(--fg-4);
}
.figure-filename {
  font-family: var(--mono); font-size: 12px; color: var(--fg-3);
  letter-spacing: 0.06em; border: 1px dashed var(--line-2);
  padding: 6px 14px; border-radius: var(--rad);
}
.blog-figure figcaption {
  padding: 13px 18px; font-family: var(--mono); font-size: 11px;
  color: var(--fg-3); letter-spacing: 0.03em; line-height: 1.55;
}
.blog-figure figcaption b { color: var(--accent); font-weight: 700; }
.blog-figure figcaption code {
  font-family: var(--mono); font-size: 0.92em; color: var(--accent-2);
  background: var(--bg-2); padding: 1px 5px; border-radius: var(--rad);
  border: 1px solid var(--line);
}

/* ============================================================
   PREV / NEXT POST NAV
============================================================ */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 960px; margin: 0 auto; padding: 56px 32px 96px;
}
.post-nav-link {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 24px; border: 1px solid var(--line-2);
  border-radius: var(--rad-md); background: var(--bg-2);
  transition: border-color 0.2s, background 0.2s;
}
.post-nav-link:hover {
  border-color: var(--accent); background: var(--bg-3); text-decoration: none;
}
.post-nav-link.next { text-align: right; align-items: flex-end; }
.post-nav-dir {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--fg-4); text-transform: uppercase;
}
.post-nav-link:hover .post-nav-dir { color: var(--accent); }
.post-nav-title { font-size: 15px; color: var(--fg); font-weight: 600; line-height: 1.4; }
.post-nav-link.disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   FOOTER STRIP
============================================================ */
.blog-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  background: var(--bg-1);
}
.blog-footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  max-width: 960px; margin: 0 auto; padding: 0 32px;
}
.blog-footer-brand {
  font-family: var(--mono); font-size: 12px; color: var(--fg-3); letter-spacing: 0.08em;
}
.blog-footer-cta {
  display: flex; align-items: center; gap: 14px;
}
.blog-footer-cta p { font-size: 14px; color: var(--fg-2); margin: 0; }
.btn-ghost-sm {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.10em;
  padding: 9px 16px; border-radius: var(--rad);
  border: 1px solid var(--line-2); color: var(--fg-2);
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-ghost-sm:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============================================================
   REVEAL ANIMATION
============================================================ */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   PROGRESS BAR
============================================================ */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); width: 0%;
  z-index: 200; transition: width 0.1s linear;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .blog-hero { padding: 110px 0 56px; }
  .blog-body h2 { margin-top: 48px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .code-block pre { padding: 18px 16px; }
  .code-block code { font-size: 12px; }
}
@media (max-width: 420px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ACCESSIBILITY
============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .reading-progress { display: none; }
}
