/* =============================================================
   Exit Engine — blog
   Index, category archive and post. Tokens mirror the site's
   :root block; chrome comes from /nav.js and /footer.js.
   ============================================================= */
:root {
  --ee-blue: #1E54F2;
  --ee-blue-600: #1A48D6;
  --ee-blue-700: #163CB5;
  --ee-blue-100: #E5ECFE;
  --ee-blue-50: #F2F5FE;
  --ee-ink: #0E1116;
  --ee-ink-2: #2A2F38;
  --ee-ink-3: #5A616E;
  --ee-ink-4: #8A909C;
  --ee-bg: #FFFFFF;
  --ee-bg-soft: #FAFAFB;
  --ee-bg-mute: #F2F3F5;
  --ee-line: #E6E8EC;
  --ee-line-strong: #C9CDD4;
  --ee-font: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --ee-font-display: "Archivo Black", "Archivo", sans-serif;
  --ee-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ee-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { color: var(--ee-ink); background: var(--ee-bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--ee-font); -webkit-font-smoothing: antialiased; }
a { color: var(--ee-blue); text-decoration: none; transition: color 120ms var(--ee-ease); }
a:hover { color: var(--ee-blue-600); }
img { max-width: 100%; }

.bl-wrap { max-width: 1140px; margin: 0 auto; padding: 0 32px; }

/* ---- intro block (index + category) ---- */
.bl-intro { padding: 72px 0 48px; border-bottom: 1px solid var(--ee-line); display: flex; flex-direction: column; gap: 24px; }
.bl-intro-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; }
.bl-intro-main { flex: 1 1 520px; display: flex; flex-direction: column; gap: 20px; }
.bl-h1 { font-family: var(--ee-font-display); font-weight: 400; font-size: clamp(48px, 7vw, 88px); line-height: 1; letter-spacing: -0.03em; margin: 0; }
.bl-desc { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ee-ink-2); max-width: 58ch; text-wrap: pretty; }
.bl-stats { flex: 0 0 auto; display: flex; gap: 40px; }
.bl-stat { display: flex; flex-direction: column; gap: 6px; }
.bl-stat-n { font-family: var(--ee-font-display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.bl-stat:last-child .bl-stat-n { color: var(--ee-blue); }
.bl-stat-l { font-family: var(--ee-font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ee-ink-3); }

/* ---- breadcrumb ---- */
.bl-crumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: var(--ee-font-mono); font-size: 12px; color: var(--ee-ink-3); }
.bl-crumb a { color: var(--ee-ink-3); }
.bl-crumb a:hover { color: var(--ee-blue); }
.bl-crumb .bl-crumb-cur { color: var(--ee-ink); }
.bl-crumb .bl-crumb-cat { color: var(--ee-blue); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- category tabs ---- */
.bl-tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; border-bottom: 1px solid var(--ee-line); font-size: 14px; font-weight: 500; }
.bl-tabs a { padding: 18px 0; color: var(--ee-ink-3); border-bottom: 2px solid transparent; }
.bl-tabs a:hover { color: var(--ee-ink); }
.bl-tabs a.bl-tab-on { color: var(--ee-ink); font-weight: 700; border-bottom-color: var(--ee-blue); }

/* ---- grid + cards ---- */
.bl-grid-wrap { padding: 48px 0 96px; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.bl-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--ee-line); border-radius: 12px; color: var(--ee-ink); background: #fff; transition: border-color 120ms var(--ee-ease); }
.bl-card:hover { border-color: var(--ee-line-strong); color: var(--ee-ink); }
.bl-meta { font-family: var(--ee-font-mono); font-size: 12px; color: var(--ee-ink-3); }
.bl-meta-cat { color: var(--ee-blue); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.bl-card-t { font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
.bl-card-x { font-size: 15px; line-height: 1.55; color: var(--ee-ink-3); flex: 1; }
.bl-read { font-size: 14px; font-weight: 600; color: var(--ee-blue); }

.bl-feat { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 32px; padding: 32px; border: 1px solid var(--ee-line); border-radius: 20px; color: var(--ee-ink); background: #fff; transition: border-color 120ms var(--ee-ease); }
.bl-feat:hover { border-color: var(--ee-line-strong); color: var(--ee-ink); }
.bl-feat-img { flex: 1 1 380px; align-self: center; min-width: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; object-fit: cover; object-position: center; background: var(--ee-bg-soft); }
.bl-feat-ph { flex: 1 1 380px; align-self: center; min-width: 0; aspect-ratio: 16 / 9; border-radius: 12px; background: repeating-linear-gradient(135deg, #FAFAFB 0 10px, #F2F3F5 10px 20px); display: flex; align-items: center; justify-content: center; font-family: var(--ee-font-mono); font-size: 12px; color: var(--ee-ink-4); }
.bl-feat-body { flex: 1 1 360px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.bl-feat-eyebrow { font-family: var(--ee-font-mono); font-size: 12px; color: var(--ee-blue); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.bl-feat-t { font-family: var(--ee-font-display); font-weight: 400; font-size: clamp(28px, 3.2vw, 36px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.bl-feat-x { font-size: 16px; line-height: 1.6; color: var(--ee-ink-2); }

.bl-empty { grid-column: 1 / -1; padding: 56px 0; font-family: var(--ee-font-mono); font-size: 13px; color: var(--ee-ink-3); }

/* ---- pagination ---- */
.bl-pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--ee-line); font-family: var(--ee-font-mono); font-size: 13px; }
.bl-pager-off { color: var(--ee-ink-4); }
.bl-pager a { color: var(--ee-ink); }
.bl-pager a:hover { color: var(--ee-blue); }
.bl-pages { display: flex; gap: 4px; }
.bl-pages a, .bl-pages span { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ee-ink); }
.bl-pages a:hover { background: var(--ee-bg-mute); color: var(--ee-ink); }
.bl-pages .bl-page-on { background: var(--ee-ink); color: #fff; }

/* =============================================================
   Post
   ============================================================= */
.bp-head { padding: 72px 0 48px; max-width: 880px; display: flex; flex-direction: column; gap: 24px; }
.bp-h1 { font-family: var(--ee-font-display); font-weight: 400; font-size: clamp(40px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.bp-dek { margin: 0; font-size: 21px; line-height: 1.5; color: var(--ee-ink-2); max-width: 62ch; text-wrap: pretty; }
.bp-by { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 8px; }
.bp-av { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; background: repeating-linear-gradient(135deg, #F2F3F5 0 6px, #E6E8EC 6px 12px); flex: 0 0 auto; }
.bp-by-n { font-size: 15px; font-weight: 700; }
.bp-row { display: flex; flex-wrap: wrap; gap: 64px; padding: 48px 0 96px; border-top: 1px solid var(--ee-line); align-items: flex-start; }

.bp-toc { flex: 0 0 220px; position: sticky; top: 96px; display: flex; flex-direction: column; gap: 4px; }
.bp-toc-l { font-family: var(--ee-font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ee-ink-3); margin-bottom: 12px; }
.bp-toc a { font-size: 14px; line-height: 1.4; padding: 8px 0 8px 14px; border-left: 2px solid var(--ee-line); color: var(--ee-ink-3); }
.bp-toc a:hover { color: var(--ee-ink); }
.bp-toc a.bp-toc-on { border-left-color: var(--ee-blue); color: var(--ee-ink); font-weight: 600; }
/* The rail must not be sticky once it wraps above the article. */
@media (max-width: 909px) { .bp-toc { position: static; flex: 1 1 100%; } }

.bp-article { flex: 1 1 560px; max-width: 700px; font-size: 18px; line-height: 1.7; color: var(--ee-ink-2); }
.bp-article h2 { font-family: var(--ee-font-display); font-weight: 400; font-size: 30px; line-height: 1.2; letter-spacing: -0.015em; color: var(--ee-ink); margin: 56px 0 20px; scroll-margin-top: 88px; }
.bp-article > h2:first-child { margin-top: 0; }
.bp-article p { margin: 0 0 24px; text-wrap: pretty; }
.bp-article a { color: var(--ee-blue); text-decoration: underline; text-underline-offset: 3px; }
.bp-article strong { color: var(--ee-ink); }
.bp-article ol, .bp-article ul { margin: 0 0 32px; padding-left: 28px; display: flex; flex-direction: column; gap: 12px; }
.bp-article li { padding-left: 6px; }
.bp-article blockquote { margin: 40px 0; padding: 0 0 0 28px; border-left: 3px solid var(--ee-blue); font-size: 26px; font-weight: 800; line-height: 1.3; letter-spacing: -0.015em; color: var(--ee-ink); text-wrap: balance; }
.bp-article pre { margin: 0 0 16px; padding: 24px; background: var(--ee-ink); color: var(--ee-line); border-radius: 12px; font-family: var(--ee-font-mono); font-size: 14px; line-height: 1.65; overflow-x: auto; }
.bp-article h3 { font-family: var(--ee-font-display); font-weight: 400; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; color: var(--ee-ink); margin: 36px 0 14px; scroll-margin-top: 88px; }
.bp-article table { width: 100%; border-collapse: collapse; margin: 0 0 32px; font-size: 15px; line-height: 1.45; }
.bp-article caption { caption-side: top; text-align: left; font-family: var(--ee-font-mono); font-size: 13px; color: var(--ee-ink-3); padding: 0 0 10px; }
.bp-article th, .bp-article td { padding: 12px 14px; border: 1px solid var(--ee-line); vertical-align: top; text-align: left; }
.bp-article th { background: var(--ee-bg-soft); font-weight: 600; color: var(--ee-ink); white-space: normal; }
.bp-article td:first-child { font-weight: 600; color: var(--ee-ink-2); white-space: nowrap; }
.bp-article .bp-note { margin: 0 0 32px; font-family: var(--ee-font-mono); font-size: 13px; color: var(--ee-ink-3); }
.bp-article figure { margin: 40px 0; display: flex; flex-direction: column; gap: 12px; }
.bp-article figure img { border-radius: 12px; border: 1px solid var(--ee-line); }
.bp-article figcaption { font-family: var(--ee-font-mono); font-size: 13px; line-height: 1.5; color: var(--ee-ink-3); }

/* responsive video embed — <div class="bp-embed"><iframe …></iframe></div>
   aspect-ratio on the wrapper means the player reserves its height before
   the iframe loads, so embedding a video doesn't shift the layout (CLS). */
.bp-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--ee-line); overflow: hidden; background: var(--ee-bg-mute); }
.bp-embed iframe, .bp-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.bp-embed-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--ee-font-mono); font-size: 12px; color: var(--ee-ink-4); background: repeating-linear-gradient(135deg, #FAFAFB 0 10px, #F2F3F5 10px 20px); }

/* FAQ — generated from the post's "faq" front matter, which also feeds
   FAQPage schema, so the visible text and the markup can't drift apart. */
.bp-faq { display: flex; flex-direction: column; margin: 0 0 40px; border-top: 1px solid var(--ee-line); }
.bp-faq-q { border-bottom: 1px solid var(--ee-line); }
.bp-faq-q > summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 0; font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--ee-ink); }
.bp-faq-q > summary::-webkit-details-marker { display: none; }
.bp-faq-q > summary:hover { color: var(--ee-blue); }
.bp-faq-plus { flex: 0 0 auto; font-family: var(--ee-font-mono); font-size: 20px; line-height: 1.2; color: var(--ee-ink-4); transition: transform var(--ee-dur-fast, 120ms) ease, color var(--ee-dur-fast, 120ms) ease; }
.bp-faq-q[open] .bp-faq-plus { transform: rotate(45deg); color: var(--ee-blue); }
.bp-faq-q > p { padding: 0 0 24px; margin: 0; max-width: 68ch; }

/* stat strip — <div class="bp-stats"><div><b>31</b><span>label</span></div>…</div> */
.bp-stats { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--ee-line); border-radius: 12px; margin: 0 0 40px; }
.bp-stats > div { flex: 1 1 180px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.bp-stats > div + div { border-left: 1px solid var(--ee-line); }
.bp-stats b { font-family: var(--ee-font-display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--ee-ink); font-variant-numeric: tabular-nums; }
.bp-stats .bp-stat-hi { color: var(--ee-blue); }
.bp-stats span { font-size: 14px; line-height: 1.4; color: var(--ee-ink-3); }

.bp-tags { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 32px; margin-top: 48px; border-top: 1px solid var(--ee-line); }
.bp-tag { font-family: var(--ee-font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px; border-radius: 3px; background: #fff; color: var(--ee-ink-2); border: 1px solid var(--ee-ink-2); }

.bp-author { display: flex; gap: 20px; align-items: flex-start; padding: 28px; margin-top: 32px; border: 1px solid var(--ee-line); border-radius: 12px; flex-wrap: wrap; }
.bp-author-av { width: 64px; height: 64px; border-radius: 999px; object-fit: cover; background: repeating-linear-gradient(135deg, #F2F3F5 0 6px, #E6E8EC 6px 12px); flex: 0 0 auto; }
.bp-author-b { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
.bp-author-n { font-size: 17px; font-weight: 800; color: var(--ee-ink); }
.bp-author-x { font-size: 15px; line-height: 1.6; color: var(--ee-ink-3); }
.bp-author a { font-size: 14px; font-weight: 600; color: var(--ee-blue); margin-top: 4px; cursor: pointer; }

.bp-rel { padding: 0 0 96px; }
.bp-rel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--ee-ink); margin-bottom: 24px; flex-wrap: wrap; }
.bp-rel-h h2 { font-family: var(--ee-font-display); font-weight: 400; font-size: 28px; letter-spacing: -0.015em; margin: 0; }
.bp-rel-h a { font-size: 14px; font-weight: 600; color: var(--ee-blue); }
.bp-rel-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.bp-rel-c { display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--ee-line); border-radius: 12px; color: var(--ee-ink); transition: border-color 120ms var(--ee-ease); }
.bp-rel-c:hover { border-color: var(--ee-line-strong); color: var(--ee-ink); }
.bp-rel-t { font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }

.bp-cta { background: var(--ee-bg-soft); border-top: 1px solid var(--ee-line); padding: 96px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.bp-cta h2 { font-family: var(--ee-font-display); font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 0; }
.bp-cta p { margin: 0 0 16px; font-size: 17px; line-height: 1.55; color: var(--ee-ink-2); max-width: 50ch; }

.bl-btn { background: var(--ee-blue); color: #fff; font-weight: 600; font-size: 15px; padding: 14px 22px; border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; line-height: 1; cursor: pointer; transition: background 120ms var(--ee-ease), box-shadow 120ms, transform 120ms; }
.bl-btn:hover { background: var(--ee-blue-600); color: #fff; box-shadow: 0 8px 24px rgba(30, 84, 242, 0.18); }
.bl-btn:active { background: var(--ee-blue-700); transform: translateY(1px); }

@media (max-width: 720px) {
  .bl-wrap { padding: 0 24px; }
  .bl-intro { padding: 48px 0 32px; }
  .bl-stats { gap: 28px; }
  .bp-row { gap: 40px; padding: 40px 0 72px; }
  .bp-cta { padding: 72px 24px; }
  /* The stat strip stacks here, so the divider has to turn with it. */
  .bp-stats > div + div { border-left: 0; border-top: 1px solid var(--ee-line); }
}

/* The author's name is a link to /about/ now, but it should still read as a
   name — inheriting the article link style would make the byline look like
   body copy with a stray link in it. */
.bp-by-n a, .bp-author-n a { color: inherit; text-decoration: none; }
.bp-by-n a:hover, .bp-author-n a:hover { color: var(--ee-blue); text-decoration: underline; text-underline-offset: 3px; }

/* One thumbnail rule for the index grid and the related-post cards, so the
   same cover reads identically everywhere it appears. height: auto is not
   optional — without it the img's own height attribute beats aspect-ratio
   and the picture renders at full size. object-fit crops, never stretches. */
.bl-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  background: var(--ee-bg-soft);
  margin-bottom: 2px;
}
.bl-card { padding-top: 20px; }
.bp-rel-c { padding-top: 20px; }

/* Nothing in the blog is ever scaled past its own pixels. */
.bp-article img { max-width: 100%; height: auto; }
