/* ==========================================================================
   OpenAdLibrary blog — standalone stylesheet for statically generated pages.
   Monochrome zinc palette + Geist, matched to the marketing landing. No
   framework: these pages are pure HTML served by nginx (no React, no Tailwind).
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-alt: #f4f4f5;
  --fg: #18181b;
  --fg-2: #3f3f46;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --border: #e4e4e7;
  --border-2: #d4d4d8;
  --accent: #18181b;
  --ink: #0e0e10;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --readw: 720px;
  --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.b-body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--fg); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------- nav ------------------------------------ */
.b-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, #fff 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.b-nav-in { max-width: var(--maxw); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 22px; }
.b-brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.b-brand:hover { text-decoration: none; }
.b-brand b { font-weight: 700; }
.b-brand img { display: block; border-radius: 6px; }
.b-nav-links { display: flex; gap: 22px; margin-left: 8px; }
.b-nav-links a { color: var(--fg-2); font-size: 14.5px; font-weight: 500; }
.b-nav-links a:hover { color: var(--fg); text-decoration: none; }
.b-nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ------------------------------ buttons --------------------------------- */
.b-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: .15s ease; line-height: 1; }
.b-btn:hover { text-decoration: none; }
.b-btn-lg { font-size: 15px; padding: 13px 22px; }
.b-btn-primary { background: var(--ink); color: #fff; }
.b-btn-primary:hover { background: #000; transform: translateY(-1px); }
.b-btn-ghost { color: var(--fg-2); }
.b-btn-ghost:hover { background: var(--bg-alt); color: var(--fg); }
.b-btn-line { border-color: var(--border-2); color: var(--fg); background: #fff; }
.b-btn-line:hover { background: var(--bg-alt); }
.b-btn-invert { background: #fff; color: var(--ink); }
.b-btn-invert:hover { background: #f0f0f1; transform: translateY(-1px); }
.b-btn-line-invert { border-color: rgba(255, 255, 255, .35); color: #fff; }
.b-btn-line-invert:hover { background: rgba(255, 255, 255, .1); }

/* ------------------------------ layout ---------------------------------- */
.b-main { min-height: 60vh; }
.b-shell { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.b-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
a.b-eyebrow:hover { color: var(--fg); text-decoration: none; }

/* breadcrumb */
.b-crumb { padding: 22px 0 4px; }
.b-crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.b-crumb a { color: var(--muted); }
.b-crumb a:hover { color: var(--fg); }
.b-crumb [aria-current] { color: var(--fg-2); max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-crumb-sep { color: var(--muted-2); }

/* ----------------------------- article ---------------------------------- */
.b-article-head { max-width: 820px; margin: 18px 0 8px; }
.b-article-head h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; margin: 14px 0 0; }
.b-dek { font-size: 20px; line-height: 1.5; color: var(--muted); margin: 18px 0 0; max-width: 64ch; }
.b-article-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 24px 0 0; }
.b-byline { display: flex; align-items: center; gap: 10px; }
.b-avatar { border-radius: 50%; object-fit: cover; }
.b-byline-name { font-weight: 600; font-size: 14.5px; display: block; }
.b-byline-title { font-size: 13px; color: var(--muted); }
.b-dateline { font-size: 13.5px; color: var(--muted); }

.b-hero { margin: 30px 0 0; }
.b-hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); aspect-ratio: 1200 / 630; object-fit: cover; }

.b-article-grid { display: grid; grid-template-columns: 1fr; gap: 32px; margin-top: 36px; }
.b-has-toc .b-article-grid { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 940px) { .b-has-toc .b-article-grid { grid-template-columns: 1fr; } }

/* TOC */
.b-toc { align-self: start; position: sticky; top: 84px; font-size: 13.5px; }
@media (max-width: 940px) { .b-toc { position: static; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--bg-soft); } }
.b-toc-h { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.b-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; border-left: 2px solid var(--border); }
.b-toc li a { color: var(--muted); padding-left: 14px; margin-left: -2px; border-left: 2px solid transparent; display: block; line-height: 1.35; }
.b-toc li a:hover { color: var(--fg); text-decoration: none; border-left-color: var(--fg); }

/* prose */
.b-prose { max-width: var(--readw); font-size: 17.5px; }
.b-prose > *:first-child { margin-top: 0; }
.b-prose p { margin: 0 0 20px; color: var(--fg-2); }
.b-prose h2.b-h { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 48px 0 16px; scroll-margin-top: 90px; color: var(--fg); }
.b-prose h3.b-h { font-size: 21px; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; margin: 34px 0 12px; scroll-margin-top: 90px; }
.b-prose h4 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.b-anchor { opacity: 0; margin-left: 8px; color: var(--muted-2); font-weight: 400; text-decoration: none; }
.b-h:hover .b-anchor { opacity: 1; }
.b-prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; transition: .15s; }
.b-prose a:hover { text-decoration-color: var(--fg); }
.b-prose ul, .b-prose ol { margin: 0 0 22px; padding-left: 24px; color: var(--fg-2); }
.b-prose li { margin: 0 0 9px; padding-left: 4px; }
.b-prose li::marker { color: var(--muted-2); }
.b-prose strong { color: var(--fg); font-weight: 650; }
.b-prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 12px 0; box-shadow: var(--shadow-sm); }
.b-prose figure { margin: 28px 0; }
.b-prose figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 10px; }
/* Real captured-ad creatives embedded in body copy. Native ad images are small,
   so frame them on a soft canvas, capped width, centered, with a caption. */
.b-prose figure.b-fig { margin: 30px auto; text-align: center; max-width: 460px; }
.b-prose figure.b-fig img { display: inline-block; max-height: 360px; width: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); padding: 8px; box-shadow: var(--shadow-sm); margin: 0; }
.b-prose figure.b-fig figcaption { margin-top: 10px; font-style: normal; }
.b-prose blockquote { margin: 28px 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--ink); font-size: 19px; line-height: 1.5; color: var(--fg); font-style: normal; }
.b-prose blockquote p { color: var(--fg); }
.b-prose code { font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--bg-alt); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); }
.b-prose pre { background: var(--ink); color: #f4f4f5; padding: 18px 20px; border-radius: var(--radius-sm); overflow-x: auto; margin: 0 0 22px; font-size: 14px; line-height: 1.6; }
.b-prose pre code { background: none; border: none; padding: 0; color: inherit; }
.b-prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.b-prose table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 15px; display: block; overflow-x: auto; }
.b-prose th, .b-prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.b-prose thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--border-2); }
.b-prose tbody tr:hover { background: var(--bg-soft); }

/* tags */
.b-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }
.b-tag, .b-chip { display: inline-block; font-size: 13px; color: var(--fg-2); background: var(--bg-alt); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.b-tag:hover, .b-chip:hover { background: var(--fg); color: #fff; text-decoration: none; }
.b-chiprow { display: flex; flex-wrap: wrap; gap: 9px; }

/* ----------------------------- FAQ -------------------------------------- */
.b-faq { max-width: 820px; margin: 56px 0 0; }
.b-faq-item { border-bottom: 1px solid var(--border); }
.b-faq-item summary { cursor: pointer; list-style: none; padding: 20px 0; font-size: 18px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.b-faq-item summary::-webkit-details-marker { display: none; }
.b-faq-item summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 22px; }
.b-faq-item[open] summary::after { content: '−'; }
.b-faq-a { padding: 0 0 22px; color: var(--fg-2); font-size: 16.5px; line-height: 1.6; max-width: 70ch; }
.b-faq-a a { text-decoration: underline; text-underline-offset: 3px; }

/* author box */
.b-authorbox { max-width: 820px; margin: 56px 0 0; }
.b-authorbox-in { display: flex; gap: 18px; padding: 26px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.b-authorbox-in img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.b-authorbox-name { font-size: 18px; font-weight: 700; display: block; margin-top: 4px; }
.b-authorbox-title { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.b-authorbox p { font-size: 15px; color: var(--fg-2); margin: 8px 0 0; }
.b-authorbox-social { display: flex; gap: 14px; margin-top: 12px; }
.b-authorbox-social a { font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.b-authorbox-social a:hover { color: var(--fg); }

/* ---------------------------- cards / grid ------------------------------ */
.b-section { margin: 56px 0 0; }
.b-section-h { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 22px; }
.b-related { max-width: var(--maxw); margin: 64px 0 0; }
.b-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .b-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .b-grid { grid-template-columns: 1fr; } }
.b-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: .18s ease; }
.b-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-2); }
.b-card-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.b-card-img img { width: 100%; height: 100%; object-fit: cover; transition: .3s ease; }
.b-card:hover .b-card-img img { transform: scale(1.03); }
.b-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.b-card h3 { font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.b-card h3 a:hover { text-decoration: none; color: var(--muted); }
.b-card p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.5; flex: 1; }
.b-card-meta { font-size: 12.5px; color: var(--muted-2); margin-top: 4px; }

/* hub heads */
.b-hub-head { max-width: 760px; margin: 22px 0 14px; }
.b-hub-head h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; margin: 14px 0 0; }
.b-hub-head p { font-size: 18.5px; color: var(--muted); line-height: 1.55; margin: 16px 0 0; }
.b-hub-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* category grid */
.b-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 880px) { .b-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .b-cat-grid { grid-template-columns: 1fr; } }
.b-cat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: #fff; transition: .18s ease; display: block; }
.b-cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.b-cat-card h3 { font-size: 18px; font-weight: 650; margin: 0 0 8px; }
.b-cat-card p { font-size: 14px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.b-cat-card span { font-size: 13px; font-weight: 600; color: var(--fg); }

/* glossary */
.b-az { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 8px; position: sticky; top: 64px; background: color-mix(in srgb, #fff 88%, transparent); backdrop-filter: blur(8px); padding: 10px 0; z-index: 10; }
.b-az a { font-size: 13px; font-weight: 600; color: var(--fg-2); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; }
.b-az a:hover { background: var(--fg); color: #fff; text-decoration: none; }
.b-az-group { margin: 36px 0 0; }
.b-az-group h2 { font-size: 24px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--border-2); scroll-margin-top: 110px; }
.b-deflist { margin: 0; }
.b-defrow { display: grid; grid-template-columns: 250px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 680px) { .b-defrow { grid-template-columns: 1fr; gap: 4px; } }
.b-defrow dt { margin: 0; }
.b-defrow dt a { font-size: 16.5px; font-weight: 650; }
.b-defrow dd { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }

/* author head */
.b-author-head { display: flex; gap: 22px; align-items: flex-start; margin: 24px 0 8px; max-width: 820px; }
.b-author-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.b-author-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 0; }
.b-author-title { font-size: 16px; color: var(--muted); margin: 6px 0 0; }
.b-author-head p { font-size: 16.5px; color: var(--fg-2); margin: 14px 0 0; line-height: 1.6; }
.b-empty { color: var(--muted); }

/* ------------------------------- CTA ------------------------------------ */
.b-cta { max-width: var(--maxw); margin: 64px auto 0; padding: 0 24px; }
.b-cta-in { background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(40px, 6vw, 72px) clamp(26px, 5vw, 64px); text-align: center; }
.b-cta-in h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.b-cta-in p { font-size: 18px; color: #d4d4d8; margin: 16px auto 0; max-width: 60ch; line-height: 1.55; }
.b-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 28px 0 0; }
.b-cta-fine { font-size: 13px !important; color: #a1a1aa !important; margin-top: 20px !important; }

/* ------------------------------ footer ---------------------------------- */
.b-foot { margin-top: 80px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.b-foot-in { max-width: var(--maxw); margin: 0 auto; padding: 54px 24px 40px; }
.b-foot-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .b-foot-cols { grid-template-columns: 1fr 1fr; gap: 28px; } }
.b-foot-brand p { font-size: 13.5px; color: var(--muted); line-height: 1.55; max-width: 300px; margin: 14px 0 0; }
.b-foot h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 14px; }
.b-foot a { display: block; font-size: 14px; color: var(--fg-2); margin-bottom: 9px; }
.b-foot a:hover { color: var(--fg); }
.b-foot-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

/* ------------------------------ mobile --------------------------------- */
@media (max-width: 760px) {
  /* Nav wraps: brand + CTA on row 1, section links scroll on row 2 (never hidden). */
  .b-nav-in { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .b-nav-cta { margin-left: auto; }
  .b-nav-links { order: 3; width: 100%; margin-left: 0; gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
  .b-nav-links::-webkit-scrollbar { display: none; }
  .b-nav-links a { white-space: nowrap; font-size: 14px; }
}
@media (max-width: 640px) {
  body.b-body { font-size: 16px; }
  .b-prose { font-size: 16.5px; }
  .b-shell { padding: 0 16px; }
  .b-crumb { padding: 16px 0 2px; }
  .b-crumb [aria-current] { max-width: 38ch; }
  .b-article-head h1, .b-hub-head h1 { font-size: clamp(26px, 8vw, 34px); }
  .b-dek { font-size: 17px; }
  .b-hub-head p { font-size: 16px; }
  .b-article-meta { gap: 10px 14px; }
  .b-hero { margin-top: 22px; }
  .b-article-grid { gap: 22px; margin-top: 26px; }
  .b-prose h2.b-h { font-size: 23px; margin: 36px 0 12px; }
  .b-prose h3.b-h { font-size: 19px; }
  .b-prose blockquote { font-size: 17px; padding-left: 16px; }
  .b-prose figure.b-fig { max-width: 100%; }
  .b-section { margin-top: 40px; }
  .b-faq, .b-authorbox, .b-article-head, .b-faq-item summary { } /* keep defaults */
  .b-faq-item summary { font-size: 16.5px; }
  /* Author header + author box stack vertically on small screens. */
  .b-author-head { flex-direction: column; gap: 14px; }
  .b-authorbox-in { flex-direction: column; gap: 14px; }
  .b-cta-in { border-radius: 18px; }
  .b-hub-cta .b-btn, .b-cta-row .b-btn { flex: 1 1 auto; justify-content: center; }
  .b-az { top: 56px; }
  .b-az a { width: 28px; height: 28px; font-size: 12px; }
}
@media (max-width: 420px) {
  .b-brand span { font-size: 15px; }
  .b-btn { padding: 8px 13px; font-size: 13.5px; }
  .b-nav-cta { gap: 6px; }
}
