/* ============================================================
   blog.css: the zerosettle.io/blog stylesheet.

   Self-contained: blog pages load this file and nothing else from
   /css/. It carries the homepage's tokens (landing.css, arc-concept
   values), the Söhne faces, the floating nav pill, the footer and
   every article component. Markup conventions live in the comment
   at the top of research/template-post.html.

   Theme: js/landing-theme.js sets <html data-theme="light|dark">.
   Without JS the system preference applies through the
   prefers-color-scheme block, which an explicit data-theme overrides.
   ============================================================ */

/* ---------- fonts (same files and weights as the homepage) ---------- */
@font-face { font-family:'Söhne'; src:url('/fonts/sohne-buch.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Söhne'; src:url('/fonts/sohne-kraftig.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Söhne'; src:url('/fonts/sohne-halbfett.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }

/* ---------- tokens: light ---------- */
:root {
  --font: 'Söhne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Roboto Mono', Menlo, monospace;
  --ios: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Söhne', 'Segoe UI', sans-serif;

  --canvas: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f5f6;
  --ink: #24262c;
  --ink-strong: #101210;
  --text: #3b3e45;          /* article body copy */
  --ink-2: #5b5f67;
  --ink-3: #686c75;         /* meta text; 4.9:1 on canvas */
  --hairline: #e8e9eb;
  --hairline-2: #d6d8dd;

  --accent: #3266d8;
  --accent-deep: #244fae;
  --accent-tint: #dce8ff;
  --on-accent: #ffffff;
  --link: #2469c7;

  --wash: linear-gradient(120deg, #edf1fa, #f7f3ea 55%, #edf6f1);
  --wash-cool: linear-gradient(145deg, #f2f4fc, #edf4f2);

  --note-bg: #eef3fd;  --note-bd: #cfdcf7;  --note-ink: #1d4396;
  --warn-bg: #fdf5e6;  --warn-bd: #f0d9a8;  --warn-ink: #7a4a00;

  --code-bg: #17191e;  --code-bd: #17191e;  --code-ink: #e6e8ee;  --code-muted: #a3aab6;
  --inline-code-bg: #eef0f3;

  --exchange-bg: #ffffff;
  --bubble-out: #0a6cff;  --bubble-out-ink: #ffffff;
  --bubble-in: #e9e9eb;   --bubble-in-ink: #000000;
  --bubble-meta: #6c6c70;

  --nav-bg: rgba(255,255,255,.88);
  --nav-bd: rgba(32,40,50,.10);
  --nav-shadow: 0 8px 30px rgba(28,39,48,.07), 0 1px 3px rgba(28,39,48,.03);
  --pill-bg: rgba(255,255,255,.72);
  --pill-bd: rgba(23,20,13,.18);
  --menu-shadow: 0 24px 48px rgba(11,11,12,.10), 0 48px 96px rgba(11,11,12,.10);
  --card-shadow: 0 1px 2px rgba(16,18,24,.04);
  --card-shadow-hover: 0 10px 30px rgba(28,39,48,.08);

  --gutter: 16px;
  --col: 720px;
  --wide: 1120px;
  --nav-h: 96px;
  color-scheme: light;
}

/* ---------- tokens: dark (explicit toggle) ---------- */
:root[data-theme="dark"] {
  --canvas: #141518;
  --surface: #1b1d21;
  --surface-2: #22252a;
  --ink: #f0f1f4;
  --ink-strong: #f6f7f9;
  --text: #d0d4dc;
  --ink-2: #b9bdc7;
  --ink-3: #a0a6b2;
  --hairline: #30343c;
  --hairline-2: #454a54;

  --accent: #a8c9ff;
  --accent-deep: #e4edff;
  --accent-tint: #31476c;
  --on-accent: #182b50;
  --link: #9dc3ff;

  --wash: linear-gradient(120deg, #252d40, #2e2b28 55%, #21342d);
  --wash-cool: linear-gradient(145deg, #242938, #202c2b);

  --note-bg: #1c2638;  --note-bd: #31476c;  --note-ink: #c6dcff;
  --warn-bg: #2d2516;  --warn-bd: #5c4720;  --warn-ink: #f3d49a;

  --code-bg: #0e0f12;  --code-bd: #2c3038;  --code-ink: #e6e8ee;  --code-muted: #a3aab6;
  --inline-code-bg: #262a31;

  --exchange-bg: #0b0b0c;
  --bubble-in: #26252a;   --bubble-in-ink: #ffffff;
  --bubble-meta: #98989f;

  --nav-bg: rgba(26,28,32,.90);
  --nav-bd: rgba(255,255,255,.086);
  --nav-shadow: 0 8px 28px rgba(0,0,0,.2);
  --pill-bg: rgba(27,29,33,.72);
  --pill-bd: #454a54;
  --menu-shadow: 0 30px 70px rgba(0,0,0,.55);
  --card-shadow: none;
  --card-shadow-hover: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* ---------- tokens: dark (system preference, no explicit choice / no JS) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #141518;
    --surface: #1b1d21;
    --surface-2: #22252a;
    --ink: #f0f1f4;
    --ink-strong: #f6f7f9;
    --text: #d0d4dc;
    --ink-2: #b9bdc7;
    --ink-3: #a0a6b2;
    --hairline: #30343c;
    --hairline-2: #454a54;

    --accent: #a8c9ff;
    --accent-deep: #e4edff;
    --accent-tint: #31476c;
    --on-accent: #182b50;
    --link: #9dc3ff;

    --wash: linear-gradient(120deg, #252d40, #2e2b28 55%, #21342d);
    --wash-cool: linear-gradient(145deg, #242938, #202c2b);

    --note-bg: #1c2638;  --note-bd: #31476c;  --note-ink: #c6dcff;
    --warn-bg: #2d2516;  --warn-bd: #5c4720;  --warn-ink: #f3d49a;

    --code-bg: #0e0f12;  --code-bd: #2c3038;  --code-ink: #e6e8ee;  --code-muted: #a3aab6;
    --inline-code-bg: #262a31;

    --exchange-bg: #0b0b0c;
    --bubble-in: #26252a;   --bubble-in-ink: #ffffff;
    --bubble-meta: #98989f;

    --nav-bg: rgba(26,28,32,.90);
    --nav-bd: rgba(255,255,255,.086);
    --nav-shadow: 0 8px 28px rgba(0,0,0,.2);
    --pill-bg: rgba(27,29,33,.72);
    --pill-bd: #454a54;
    --menu-shadow: 0 30px 70px rgba(0,0,0,.55);
    --card-shadow: none;
    --card-shadow-hover: 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent-tint); color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:where(a[href], button:not(:disabled), summary, [role="button"]) { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 2000;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* light/dark logo swap (both mechanisms) */
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block !important; }
}

/* ============================================================
   Nav: the homepage's floating pill (data-nav="minimal")
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; gap: 8px;
  max-width: 1408px; min-height: 66px; margin: 0 auto;
  padding: 10px 12px 10px 14px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-bd);
  border-radius: 999px;
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
.nav-logo { display: inline-flex; align-items: center; margin-right: auto; text-decoration: none; border-radius: 8px; }
.nav-logo img { width: 120px; height: 28px; object-fit: contain; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions > a { display: none; }
.nav-link {
  padding: 6px 10px; border-radius: 16px;
  font-size: 14.5px; font-weight: 500; line-height: 1.6; color: var(--ink); text-decoration: none;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-link[aria-current] { color: var(--accent-deep); background: var(--accent-tint); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font); font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 5px 16px rgba(50,102,216,.11); }
.btn-secondary { background: var(--pill-bg); border-color: var(--pill-bd); color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.nav-login-pill { min-height: 40px; padding: 12px 18px; font-size: 14.5px; }
.nav-get-started { padding: 13px 24px; font-size: 15.5px; }
@media (hover: hover) {
  .nav-link:hover, .nav-login-pill:hover { background: var(--accent-tint); color: var(--accent-deep); }
  .btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: translateY(-1px); }
  :root[data-theme="dark"] .btn-primary:hover { background: #c6dcff; border-color: #c6dcff; }
  .btn-ghost:hover { color: var(--link); }
}

/* the theme control landing-theme.js injects into .nav-actions */
.arc-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--surface); color: var(--ink);
}
.arc-theme-toggle svg { width: 20px; height: 20px; }
.arc-theme-toggle .arc-sun { display: none; }
:root[data-theme="dark"] .arc-theme-toggle .arc-sun { display: block; }
:root[data-theme="dark"] .arc-theme-toggle .arc-moon { display: none; }
@media (hover: hover) { .arc-theme-toggle:hover { background: var(--accent-tint); color: var(--accent-deep); } }

/* mobile menu: a <details> so it opens without JS */
.nav-more { position: static; }
.nav-more > summary {
  list-style: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 44px; height: 44px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface);
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary span { display: block; width: 16px; height: 1.5px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav-more[open] > summary span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-more[open] > summary span:nth-child(2) { opacity: 0; }
.nav-more[open] > summary span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.nav-mobile-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 18px;
  box-shadow: var(--menu-shadow);
}
.nav-mobile-item {
  display: flex; align-items: center; min-height: 44px; padding: 9px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.nav-mobile-item[aria-current] { background: var(--accent-tint); color: var(--accent-deep); }
.nav-mobile-menu .btn { width: 100%; margin-top: 8px; }
@media (min-width: 1150px) {
  .nav { padding: max(14px, env(safe-area-inset-top)) 32px 0; }
  .nav-inner { gap: 24px; padding: 10px 12px 10px 22px; }
  .nav-logo img { width: 137px; height: 32px; }
  .nav-actions { gap: 18px; }
  .nav-actions > a { display: inline-flex; }
  .nav-actions > .nav-link { margin-right: -6px; }
  .nav-more { display: none; }
}

/* ============================================================
   Page frame
   ============================================================ */
.blog-main { padding-top: var(--nav-h); }
@media (min-width: 1150px) { .blog-main { --nav-h: 112px; } }

.wrap-wide { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

/* ============================================================
   Post layout: a 720px reading column; at >=1200px the TOC
   moves into a sticky right rail.
   ============================================================ */
.post {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
}
.post > * { min-width: 0; }
@media (min-width: 1200px) {
  .post {
    display: grid;
    grid-template-columns: minmax(0, var(--col)) 240px;
    column-gap: 64px;
    justify-content: center;
    max-width: calc(var(--col) + 64px + 240px + 2 * var(--gutter));
  }
  .post > * { grid-column: 1; }
  .post > .toc {
    grid-column: 2; grid-row: 1 / span 24; align-self: start;
    position: sticky; top: 112px;
    margin: 4px 0 0; padding: 0 0 0 20px;
    background: none; border: 0; border-left: 1px solid var(--hairline); border-radius: 0;
  }
  .post > .toc ol { font-size: 14px; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--hairline-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.crumbs a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.crumbs li:last-child { flex: 1 1 0; min-width: 6em; }
.crumbs [aria-current="page"] { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
@media (max-width: 599px) { .post .crumbs li:last-child { display: none; } }

/* ---------- post header ---------- */
.post-header { margin: 0 0 24px; }
.post-kicker {
  display: inline-flex; align-items: center; min-height: 32px; margin: 0 0 18px; padding: 4px 12px;
  border: 1px solid var(--hairline-2); border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; background: var(--surface);
}
.post-kicker:hover { color: var(--accent-deep); border-color: var(--accent); }
.post-header h1 {
  margin: 0;
  font-size: clamp(2.05rem, 1.35rem + 3.1vw, 3.4rem);
  font-weight: 400; line-height: 1.08; letter-spacing: -0.035em;
  color: var(--ink-strong);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
  margin: 20px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-3);
}
.byline > span + span::before { content: "\00B7"; margin: 0 10px; color: var(--hairline-2); }
.byline a { color: var(--ink); text-decoration: none; font-weight: 500; }
.byline a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.byline time { color: var(--ink-2); }
@media (max-width: 599px) {
  .byline { flex-direction: column; align-items: flex-start; gap: 2px; }
  .byline > span + span::before { content: none; }
}
.post-disclosure {
  margin: 14px 0 0; padding: 10px 14px;
  border: 1px dashed var(--hairline-2); border-radius: 12px;
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
}

/* ---------- answer-first lede ---------- */
.post-lede { margin: 0 0 28px; }
.post-lede p { margin: 0 0 14px; font-size: 19px; line-height: 1.6; color: var(--ink); letter-spacing: -0.005em; }
.post-lede p:last-child { margin-bottom: 0; }
@media (min-width: 768px) { .post-lede p { font-size: 20.5px; } }

/* ---------- key takeaways ---------- */
.takeaways {
  margin: 0 0 24px; padding: 22px 20px 20px;
  border: 1px solid var(--hairline); border-radius: 24px;
  background: var(--wash-cool);
}
.takeaways h2 {
  margin: 0 0 12px; font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: 0; color: var(--ink-strong);
}
.takeaways ul { margin: 0; padding: 0; list-style: none; }
.takeaways li {
  position: relative; margin: 0; padding: 7px 0 7px 30px;
  font-size: 16px; line-height: 1.55; color: var(--ink);
}
.takeaways li + li { border-top: 1px solid var(--hairline); }
.takeaways li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
}
.takeaways li::after {
  content: ""; position: absolute; left: 7px; top: 15px;
  width: 6px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.takeaways strong { color: var(--ink-strong); font-weight: 600; }
.takeaways a { color: var(--link); text-underline-offset: 3px; }
@media (min-width: 768px) { .takeaways { padding: 26px 28px 24px; } }

/* ---------- table of contents ---------- */
.toc {
  margin: 0 0 36px; padding: 18px 20px;
  border: 1px solid var(--hairline); border-radius: 20px; background: var(--surface);
}
.toc-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; font-size: 15px; line-height: 1.45; }
.toc li { counter-increment: toc; }
.toc li a {
  display: flex; gap: 10px; padding: 7px 0; color: var(--ink-2); text-decoration: none;
}
.toc li a::before { content: counter(toc, decimal-leading-zero); flex: 0 0 auto; min-width: 1.6em; font-family: var(--mono); font-size: .82em; line-height: 1.75; color: var(--ink-3); }
.toc li a:hover, .toc li a[aria-current="true"] { color: var(--link); }

/* ============================================================
   Prose (BODY and FAQ)
   ============================================================ */
.prose { font-size: 17px; line-height: 1.72; color: var(--text); overflow-wrap: break-word; }
@media (min-width: 768px) { .prose { font-size: 18px; } }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  margin: 56px 0 16px; scroll-margin-top: 110px;
  font-size: 1.5rem; font-weight: 500; line-height: 1.22; letter-spacing: -0.02em; color: var(--ink-strong);
  text-wrap: balance;
}
.prose h3 {
  margin: 36px 0 10px; scroll-margin-top: 110px;
  font-size: 1.15rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink-strong);
}
.prose h4 { margin: 28px 0 8px; font-size: 1rem; font-weight: 600; color: var(--ink-strong); }
@media (min-width: 768px) { .prose h2 { font-size: 1.75rem; } .prose h3 { font-size: 1.22rem; } }
.prose p { margin: 0 0 20px; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--ink-strong); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 1.4em; }
.prose li { margin: 0 0 8px; padding-left: .2em; }
.prose li::marker { color: var(--ink-3); }
.prose ol > li::marker { font-weight: 500; font-variant-numeric: tabular-nums; }
.prose li > ul, .prose li > ol { margin: 8px 0 0; }
.prose hr { margin: 48px 0; border: 0; border-top: 1px solid var(--hairline); }
.prose blockquote {
  margin: 28px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--ink); font-size: 1.05em;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: 8px; font-size: .85em; font-style: normal; color: var(--ink-3); }
.prose figure { margin: 32px 0; }
.prose figure img { border-radius: 16px; border: 1px solid var(--hairline); }
.prose figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.prose dl { margin: 0 0 22px; }
.prose dt { font-weight: 600; color: var(--ink-strong); }
.prose dd { margin: 2px 0 14px; }

/* inline code + keyboard */
.prose :not(pre) > code, .takeaways code, .faq-item code, .callout code {
  padding: .1em .36em; border-radius: 6px;
  background: var(--inline-code-bg); color: var(--ink-strong);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere;
}
.prose kbd { padding: .1em .4em; border: 1px solid var(--hairline-2); border-bottom-width: 2px; border-radius: 6px; font-family: var(--mono); font-size: .85em; }

/* ---------- code blocks ---------- */
.code-block { margin: 28px 0; border: 1px solid var(--code-bd); border-radius: 16px; background: var(--code-bg); overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 6px 8px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--mono); font-size: 12.5px; color: var(--code-muted);
}
.code-copy {
  min-height: 30px; padding: 4px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: transparent; color: var(--code-ink); font-family: var(--font); font-size: 12.5px; font-weight: 500;
}
.code-copy:hover { background: rgba(255,255,255,.08); }
.prose pre, .code-block pre {
  margin: 28px 0; padding: 16px 18px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--code-bg); color: var(--code-ink);
  border: 1px solid var(--code-bd); border-radius: 16px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65; tab-size: 2;
}
.code-block pre { margin: 0; border: 0; border-radius: 0; }
.prose pre code { font: inherit; color: inherit; background: none; padding: 0; white-space: pre; }
.prose pre:focus-visible { outline-offset: -2px; }
.code-comment { color: var(--code-muted); }

/* ---------- tables: scroll inside .table-wrap, never the page ---------- */
.table-wrap {
  margin: 28px 0; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hairline); border-radius: 16px;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) right / 12px 100% no-repeat scroll,
    var(--surface);
}
.table-wrap:focus-visible { outline-offset: 2px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; color: var(--text); }
.table-wrap caption {
  caption-side: top; text-align: left; padding: 14px 16px 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-strong);
}
.table-wrap th, .table-wrap td { min-width: 7.5rem; padding: 11px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--hairline); }
.table-wrap thead th { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline-2); font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.table-wrap tbody th { font-weight: 600; color: var(--ink-strong); }
.table-wrap td.num, .table-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap .yes { color: #1f7a45; font-weight: 600; }
.table-wrap .no { color: #b3261e; font-weight: 600; }
:root[data-theme="dark"] .table-wrap .yes { color: #7fd6a2; }
:root[data-theme="dark"] .table-wrap .no { color: #ff9a92; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .table-wrap .yes { color: #7fd6a2; }
  :root:not([data-theme="light"]) .table-wrap .no { color: #ff9a92; }
}
.table-wrap a { color: var(--link); }
.table-wrap code { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 599px) {
  .table-wrap table { font-size: 14.5px; }
  .table-wrap th, .table-wrap td { min-width: 6.5rem; padding: 10px 12px; }
  .table-wrap caption { padding: 12px 12px 8px; }
}
.table-note { margin: -16px 0 24px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }

/* ---------- callouts ---------- */
.callout {
  position: relative; margin: 28px 0; padding: 16px 18px 16px 50px;
  border: 1px solid var(--note-bd); border-radius: 16px;
  background: var(--note-bg); color: var(--text);
  font-size: .95em; line-height: 1.6;
}
.callout::before {
  content: "i"; position: absolute; left: 16px; top: 17px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--note-ink); color: var(--note-bg);
  font-family: Georgia, 'Times New Roman', serif; font-size: 14px; font-weight: 700; font-style: italic; line-height: 1;
}
.callout-title { margin: 0 0 4px !important; font-weight: 600; color: var(--note-ink); }
.callout p { margin: 0 0 10px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { margin: 0 0 10px; }
.callout-warning { border-color: var(--warn-bd); background: var(--warn-bg); }
.callout-warning::before { content: "!"; background: var(--warn-ink); color: var(--warn-bg); font-family: var(--font); font-style: normal; }
.callout-warning .callout-title { color: var(--warn-ink); }

/* ---------- iMessage example exchange (plain HTML, no images) ---------- */
.exchange { margin: 32px 0; }
.exchange-screen {
  max-width: 420px; margin: 0 auto; padding: 0 0 18px;
  border: 1px solid var(--hairline); border-radius: 28px;
  background: var(--exchange-bg); overflow: hidden;
  box-shadow: 0 12px 36px rgba(37,42,57,.08);
}
.exchange-head {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 16px 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--ios); text-align: center;
}
.exchange-avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(180deg, #a5abb8, #858b98); color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: .02em;
}
.exchange-name { font-size: 13px; font-weight: 500; color: var(--ink-strong); line-height: 1.3; }
.exchange-kind { font-size: 11.5px; color: var(--bubble-meta); line-height: 1.2; }
.exchange-thread {
  display: flex; flex-direction: column;
  margin: 0; padding: 4px 16px 0; list-style: none;
  font-family: var(--ios); font-size: 16px; line-height: 1.34; letter-spacing: -0.01em;
}
.exchange .msg {
  position: relative; max-width: 78%; margin: 2px 0 0; padding: 8px 13px;
  border-radius: 19px; white-space: pre-line; overflow-wrap: anywhere; text-align: left;
}
.exchange .msg-out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-ink); }
.exchange .msg-in { align-self: flex-start; background: var(--bubble-in); color: var(--bubble-in-ink); }
.exchange .msg-out + .msg-in, .exchange .msg-in + .msg-out { margin-top: 10px; }
.exchange .msg a { color: inherit; text-decoration: underline; }
/* tails on the last bubble of a run */
.exchange .msg-out:not(:has(+ .msg-out))::before,
.exchange .msg-in:not(:has(+ .msg-in))::before { content: ""; position: absolute; bottom: 0; width: 20px; height: 20px; }
.exchange .msg-out:not(:has(+ .msg-out))::after,
.exchange .msg-in:not(:has(+ .msg-in))::after { content: ""; position: absolute; bottom: 0; width: 10px; height: 20px; background: var(--exchange-bg); }
.exchange .msg-out:not(:has(+ .msg-out))::before { right: -7px; background: var(--bubble-out); border-bottom-left-radius: 16px 14px; }
.exchange .msg-out:not(:has(+ .msg-out))::after { right: -10px; border-bottom-left-radius: 10px; }
.exchange .msg-in:not(:has(+ .msg-in))::before { left: -7px; background: var(--bubble-in); border-bottom-right-radius: 16px 14px; }
.exchange .msg-in:not(:has(+ .msg-in))::after { left: -10px; border-bottom-right-radius: 10px; }
/* a timestamp row and a small status row */
.exchange .msg-time { align-self: center; margin: 12px 0 6px; font-size: 11.5px; color: var(--bubble-meta); }
.exchange .msg-time:first-child { margin-top: 4px; }
.exchange .msg-note { align-self: flex-end; margin: 3px 2px 0; font-size: 11px; color: var(--bubble-meta); }
.exchange .msg-in + .msg-note { align-self: flex-start; }
/* tapback badge on a bubble */
.exchange .msg.has-tapback { margin-top: 18px; }
.exchange .msg-tapback {
  position: absolute; top: -16px; z-index: 1;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--exchange-bg); background: var(--bubble-in);
  font-size: 14px; line-height: 1;
}
.exchange .msg-out .msg-tapback { left: -14px; }
.exchange .msg-in .msg-tapback { right: -14px; background: var(--bubble-out); }
/* typing bubble */
.exchange .msg-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.exchange .msg-typing i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #8e8e93; }
@media (prefers-reduced-motion: no-preference) {
  .exchange .msg-typing i { animation: blog-typing 1.2s ease-in-out infinite; }
  .exchange .msg-typing i:nth-child(2) { animation-delay: .15s; }
  .exchange .msg-typing i:nth-child(3) { animation-delay: .3s; }
}
@keyframes blog-typing { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.exchange figcaption { max-width: 420px; margin: 12px auto 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.exchange figcaption strong { color: var(--ink-2); font-weight: 600; }

/* ---------- sources + changelog ---------- */
.prose .sources ol, .prose ol.sources { font-size: 15px; line-height: 1.6; }
.prose .sources li { margin-bottom: 10px; }
.prose .sources .src-date { color: var(--ink-3); }
.prose .changelog { padding-left: 0; list-style: none; font-size: 15px; }
.prose .changelog time { font-family: var(--mono); font-size: .9em; color: var(--ink-3); margin-right: 8px; }

/* ---------- FAQ (always visible: no accordion) ---------- */
.post-faq { margin: 56px 0 0; scroll-margin-top: 110px; }
.post-sources { margin-top: 8px; }
.post-sources > h2:first-child { margin-top: 56px; }
.post-faq > h2 {
  margin: 0 0 8px; scroll-margin-top: 110px;
  font-size: 1.5rem; font-weight: 500; line-height: 1.22; letter-spacing: -0.02em; color: var(--ink-strong);
}
@media (min-width: 768px) { .post-faq > h2 { font-size: 1.75rem; } }
.faq-item { padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.faq-item:first-of-type { border-top: 1px solid var(--hairline); margin-top: 16px; }
.faq-item h3 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; color: var(--ink-strong); scroll-margin-top: 110px; }
.faq-item p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.68; color: var(--text); }
.faq-item p:last-child { margin-bottom: 0; }
.faq-item a { color: var(--link); text-underline-offset: 3px; }

/* ---------- post footer: author + AI note ---------- */
.post-footer {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 48px 0 0; padding: 20px 0 0; border-top: 1px solid var(--hairline);
  font-size: 14.5px; line-height: 1.6; color: var(--ink-2);
}
.post-footer img { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hairline); padding: 6px; object-fit: contain; }
.post-footer p { margin: 0 0 4px; }
.post-footer strong { color: var(--ink-strong); font-weight: 600; }
.post-footer a { color: var(--link); text-underline-offset: 3px; }

/* ============================================================
   Cards (related posts + blog index)
   ============================================================ */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  min-width: 0; padding: 22px 22px 20px;
  border: 1px solid var(--hairline); border-radius: 24px;
  background: var(--surface); box-shadow: var(--card-shadow);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card-cat { font-size: 13px; font-weight: 500; color: var(--accent-deep); }
:root[data-theme="dark"] .card-cat { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card-cat { color: var(--accent); } }
.card h3 { margin: 0; font-size: 1.1rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.015em; color: var(--ink-strong); text-wrap: balance; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.card-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--ink-3); }
@media (hover: hover) {
  .card:hover { border-color: var(--hairline-2); box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
  .card:hover h3 a { color: var(--link); }
}
@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } .card:hover, .btn-primary:hover { transform: none; } }

/* related */
.related { margin-top: 72px; }
.related h2 { margin: 0 0 20px; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; color: var(--ink-strong); }
.related-more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-size: 15px; }
.related-more a { color: var(--link); text-underline-offset: 3px; }

/* ============================================================
   CTA panel
   ============================================================ */
.cta-panel { margin-top: 72px; }
.cta-panel-inner {
  position: relative; overflow: hidden;
  padding: 36px 22px; border-radius: 28px;
  background: var(--wash); border: 1px solid var(--hairline);
  text-align: center;
}
.cta-panel h2 {
  margin: 0 auto; max-width: 20ch;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.035em; color: var(--ink-strong);
  text-wrap: balance;
}
.cta-panel p { margin: 16px auto 0; max-width: 52ch; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.cta-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 26px auto 0; max-width: 360px; }
.cta-actions .btn { min-height: 48px; }
.cta-fine { font-size: 13.5px !important; color: var(--ink-3) !important; }
@media (min-width: 640px) {
  .cta-panel-inner { padding: 56px 40px; border-radius: 32px; }
  .cta-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: none; }
}

/* ============================================================
   Blog index
   ============================================================ */
.blog-hero {
  position: relative; overflow: hidden;
  margin: 0 0 32px; padding: 40px 20px 32px; border-radius: 28px;
  background: var(--wash); border: 1px solid var(--hairline);
}
.blog-hero h1 {
  margin: 0; max-width: 18ch;
  font-size: clamp(2.3rem, 1.4rem + 4vw, 4.25rem); font-weight: 400; line-height: 1.05; letter-spacing: -0.045em; color: var(--ink-strong);
  text-wrap: balance;
}
.blog-hero .blog-intro { margin: 18px 0 0; max-width: 60ch; font-size: 17.5px; line-height: 1.6; color: var(--ink-2); }
.blog-hero .blog-intro + .blog-intro { margin-top: 10px; }
.blog-hero .blog-intro a { color: var(--link); text-underline-offset: 3px; }
@media (min-width: 768px) { .blog-hero { padding: 72px 56px 56px; border-radius: 34px; } .blog-hero .blog-intro { font-size: 19px; } }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--pill-bd); border-radius: 999px; background: var(--pill-bg);
  font-size: 14.5px; font-weight: 500; color: var(--ink); text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.chip:hover { background: var(--accent-tint); color: var(--accent-deep); border-color: transparent; }
.chip[aria-current="true"] { background: var(--ink-strong); color: var(--canvas); border-color: var(--ink-strong); }

.blog-section { margin: 0 0 56px; scroll-margin-top: 110px; }
.blog-section[hidden] { display: none; }
.blog-section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 8px 20px; margin: 0 0 18px; }
.blog-section-head h2 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 400; line-height: 1.15; letter-spacing: -0.03em; color: var(--ink-strong); }
.blog-section-head p { grid-column: 1 / -1; margin: 0; max-width: 64ch; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.blog-section-head .hub-link { font-size: 15px; font-weight: 500; color: var(--link); text-underline-offset: 3px; white-space: nowrap; }
.blog-empty { margin: 0; padding: 22px; border: 1px dashed var(--hairline-2); border-radius: 20px; font-size: 15px; color: var(--ink-3); }

/* ============================================================
   Footer (homepage markup)
   ============================================================ */
.footer { margin-top: 88px; padding: 56px 0 40px; border-top: 1px solid var(--hairline); background: var(--canvas); }
.footer .container { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.footer-logo img { width: 171px; height: auto; }
.footer-tagline { margin: 10px 0 14px; max-width: 24ch; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.footer-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.footer-column h2, .footer-column h4 { margin: 0 0 16px; font-size: 12px; font-weight: 600; letter-spacing: .07em; line-height: 1.6; color: var(--ink-3); }
.footer-column a { display: flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); text-decoration: none; transition: color .15s; }
.footer-column a:hover { color: var(--link); }
.footer-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--ink-3); }
.footer-bottom p { margin: 0; }
@media (min-width: 900px) {
  .footer { padding: 88px 0 40px; }
  .footer .container { padding: 0 40px; }
  .footer-grid { grid-template-columns: 1.4fr 3fr; gap: 48px; }
  .footer-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   Print: the article only
   ============================================================ */
@media print {
  .nav, .footer, .cta-panel, .related, .toc, .code-copy, .skip-link { display: none !important; }
  .blog-main { padding-top: 0; }
  body { background: #fff; color: #000; }
  .prose a::after { content: " (" attr(href) ")"; font-size: .85em; }
}
