/* ── Theme CSS variables ──────────────────────────────────── */
:root {
  --color-accessible-subtle: #7a8694;

  /* Surface scale */
  --surface-950: #080a0d;
  --surface-900: #0d0f12;
  --surface-800: #12151a;
  --surface-700: #181c23;
  --surface-600: #1e242e;
  --surface-500: #252d3a;
  --surface-400: #2e3847;

  /* Ink scale */
  --ink:         #f0f2f5;
  --ink-muted:   #8a96a8;
  --ink-subtle:  #7a8694;

  /* Brand */
  --brand-400:   #00c2ff;
  --brand-300:   #1ad4ff;

  /* Warning (file-size alert) */
  --warning:     #fbbf24;   /* 10.71:1 on surface-900 ✓ */

  /* Semantic */
  --border-color:      rgba(30,36,46,0.6);   /* surface-600/60 */
  --card-bg:           #12151a;
  --header-bg:         rgba(13,15,18,0.80);
  --footer-bg:         #12151a;
  --input-bg:          #181c23;
}

html.light {
  --surface-950: #f0f4f8;
  --surface-900: #f8f9fb;
  --surface-800: #ffffff;
  --surface-700: #f1f4f8;
  --surface-600: #e2e8f0;
  --surface-500: #cbd5e1;
  --surface-400: #94a3b8;

  --ink:         #0f172a;
  --ink-muted:   #475569;
  --ink-subtle:  #64748b;

  --brand-400:   #0284c7;
  --brand-300:   #0ea5e9;

  --warning:     #b45309;   /* 4.66:1 on white ✓ */

  --border-color:      rgba(203,213,225,0.6);
  --card-bg:           #ffffff;
  --header-bg:         rgba(248,249,251,0.90);
  --footer-bg:         #ffffff;
  --input-bg:          #f1f4f8;
}

/* ── Apply theme vars to Tailwind colour classes ─────────── */
/* Page background */
.bg-surface-900  { background-color: var(--surface-900)  !important; }
.bg-surface-800  { background-color: var(--surface-800)  !important; }
.bg-surface-700  { background-color: var(--surface-700)  !important; }
.bg-surface-600  { background-color: var(--surface-600)  !important; }
.bg-surface-500  { background-color: var(--surface-500)  !important; }
.bg-surface-950  { background-color: var(--surface-950)  !important; }

/* Text */
.text-ink        { color: var(--ink)        !important; }
.text-ink-muted  { color: var(--ink-muted)  !important; }
.text-ink-subtle { color: var(--ink-subtle) !important; }

/* Brand */
.text-brand-400  { color: var(--brand-400)  !important; }
.text-brand-300  { color: var(--brand-300)  !important; }
.bg-brand-400    { background-color: var(--brand-400) !important; }
.hover\:text-brand-400:hover { color: var(--brand-400) !important; }
.hover\:bg-brand-300:hover   { background-color: var(--brand-300) !important; }
.border-brand-400 { border-color: var(--brand-400) !important; }

/* Borders */
.border-surface-600\/40 { border-color: color-mix(in srgb, var(--surface-600) 40%, transparent) !important; }
.border-surface-600\/60 { border-color: color-mix(in srgb, var(--surface-600) 60%, transparent) !important; }
.border-surface-500\/40 { border-color: color-mix(in srgb, var(--surface-500) 40%, transparent) !important; }
.border-surface-500\/60 { border-color: color-mix(in srgb, var(--surface-500) 60%, transparent) !important; }
.border-surface-400     { border-color: var(--surface-400) !important; }

/* Header / footer special backgrounds */
header.sticky { background-color: var(--header-bg) !important; }
footer        { background-color: var(--footer-bg) !important; }

/* Backdrop blur bg on header */
.bg-surface-900\/80 { background-color: var(--header-bg) !important; }
.bg-surface-800\/60 { background-color: color-mix(in srgb, var(--surface-800) 60%, transparent) !important; }
.bg-surface-800\/40 { background-color: color-mix(in srgb, var(--surface-800) 40%, transparent) !important; }
.bg-surface-700\/50 { background-color: color-mix(in srgb, var(--surface-700) 50%, transparent) !important; }
.bg-surface-700\/60 { background-color: color-mix(in srgb, var(--surface-700) 60%, transparent) !important; }
.bg-surface-950\/90 { background-color: color-mix(in srgb, var(--surface-950) 90%, transparent) !important; }

/* Input / form backgrounds */
.bg-surface-800.shadow-card { background-color: var(--card-bg) !important; }

/* Light mode - swap processing overlay text */
html.light .text-ink-muted { color: var(--ink-muted) !important; }

/* Light mode - nav active state bg */
.bg-brand-400\/10  { background-color: color-mix(in srgb, var(--brand-400) 10%, transparent) !important; }
.bg-brand-400\/8   { background-color: color-mix(in srgb, var(--brand-400)  8%, transparent) !important; }
.bg-brand-400\/15  { background-color: color-mix(in srgb, var(--brand-400) 15%, transparent) !important; }
.border-brand-400\/30 { border-color: color-mix(in srgb, var(--brand-400) 30%, transparent) !important; }
.border-brand-400\/20 { border-color: color-mix(in srgb, var(--brand-400) 20%, transparent) !important; }
.border-brand-400\/40 { border-color: color-mix(in srgb, var(--brand-400) 40%, transparent) !important; }

/* Light mode - fid-prose colours */
html.light .fid-prose        { color: #334155; }
html.light .fid-prose h1,
html.light .fid-prose h2,
html.light .fid-prose h3,
html.light .fid-prose h4     { color: #0f172a; }
html.light .fid-prose code   { background: #f1f5f9; border-color: #e2e8f0; color: #0369a1; }
html.light .fid-prose pre    { background: #f8fafc; border-color: #e2e8f0; }
html.light .fid-prose pre code { color: #334155; }
html.light .fid-prose blockquote { color: #64748b; border-left-color: #0369a1; }
html.light .fid-prose td     { color: #334155; }
html.light .fid-prose th     { background: #f1f5f9; color: #0f172a; }
html.light .fid-prose a      { color: #0369a1; text-decoration-color: rgba(3,105,161,.5); }
html.light .fid-prose a:hover { text-decoration-color: #0369a1; }
html.light .fid-prose strong  { color: #0f172a; }

/* Light mode - surface-900 text (e.g. scan button label) */
html.light .text-surface-900 { color: var(--surface-900) !important; }

/* ── Light mode - WCAG 2.1 AA overrides ──────────────────── */

/* ink scale */
html.light .text-ink        { color: #0f172a !important; }  /* 18.10:1 on white ✓ */
html.light .text-ink-muted  { color: #475569 !important; }  /* 6.54:1 on white ✓ */
html.light .text-ink-subtle { color: #64748b !important; }  /* 4.54:1 on white ✓ */

/* Brand - darker blue for sufficient contrast on white backgrounds */
html.light .text-brand-400               { color: #0369a1 !important; }  /* 7.05:1 ✓ */
html.light .text-brand-300               { color: #0284c7 !important; }  /* 5.27:1 ✓ */
html.light .hover\:text-brand-400:hover  { color: #0369a1 !important; }
html.light .bg-brand-400                 { background-color: #0369a1 !important; }
html.light .hover\:bg-brand-300:hover    { background-color: #0284c7 !important; }
html.light .border-brand-400             { border-color: #0369a1 !important; }

/* Result badges - light mode */
html.light .fid-badge--ok {
  background: rgba(5,150,105,.12);
  color: #047857;       /* 5.92:1 on white ✓ */
  border-color: rgba(5,150,105,.35);
}
html.light .fid-badge--warn {
  background: rgba(180,83,9,.10);
  color: #b45309;       /* 4.66:1 on white ✓ */
  border-color: rgba(180,83,9,.35);
}
html.light .fid-badge--caution {
  background: rgba(109,40,217,.08);
  color: #7c3aed;       /* 5.12:1 on white ✓ */
  border-color: rgba(109,40,217,.30);
}

/* Error page decorative numbers - light mode */
html.light .fid-error-number { color: #cbd5e1; }  /* decorative, aria-hidden ✓ */

/* ELA overlay labels - always dark bg regardless of theme (overlaid on image) */
.fid-overlay-label { background: rgba(13,15,18,0.72); }

/* Breadcrumb separators */
html.light .text-surface-400 { color: #94a3b8 !important; }  /* decorative ✓ */

/* Placeholder text */
html.light ::placeholder { color: #94a3b8 !important; opacity: 1; }

/* Focus ring */
html.light :focus-visible { outline-color: #0369a1; }

/* Skip link */
html.light .skip-link { background: #0369a1; color: #ffffff; }

/* Card borders */
html.light .hover\:border-brand-400\/30:hover { border-color: rgba(3,105,161,.30) !important; }
html.light .border-brand-400\/50              { border-color: rgba(3,105,161,.50) !important; }

/* shadow-glow variants */
html.light .shadow-glow-sm  { box-shadow: 0 0 10px 0 rgba(3,105,161,0.15); }
html.light .hover\:shadow-glow-cyan:hover { box-shadow: 0 0 24px 0 rgba(3,105,161,0.20); }

/* ── Prose / blog content ─────────────────────────────────── */
.fid-prose {
  color: #c8d0dc;  /* 12.35:1 on surface-900 ✓ */
  line-height: 1.75;
  font-size: 0.9375rem;
}
.fid-prose h1,
.fid-prose h2,
.fid-prose h3,
.fid-prose h4 {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-weight: 500;
  color: #f0f2f5;  /* 17.11:1 ✓ */
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}
.fid-prose h1 { font-size: 1.75rem; }
.fid-prose h2 { font-size: 1.375rem; }
.fid-prose h3 { font-size: 1.125rem; }
.fid-prose h4 { font-size: 1rem; }

.fid-prose p  { margin-bottom: 1.25em; }

.fid-prose a {
  color: #00c2ff;  /* 9.29:1 on surface-900 ✓ */
  text-decoration-line: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0,194,255,.5);
  transition: text-decoration-color 0.15s;
}
.fid-prose a:hover { text-decoration-color: #00c2ff; }

.fid-prose ul,
.fid-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25em;
}
.fid-prose ul { list-style-type: disc; }
.fid-prose ol { list-style-type: decimal; }
.fid-prose li { margin-bottom: 0.4em; }

.fid-prose strong { color: #f0f2f5; font-weight: 600; }

.fid-prose blockquote {
  border-left: 3px solid #00c2ff;
  padding-left: 1rem;
  margin: 1.5em 0;
  color: #8a96a8;  /* 6.41:1 on surface-900 ✓ */
  font-style: italic;
}

.fid-prose code {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.85em;
  background: #1e242e;
  border: 1px solid #2e3847;
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: #00c2ff;  /* 9.29:1 ✓ */
}

.fid-prose pre {
  background: #12151a;
  border: 1px solid #252d3a;
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5em;
}
.fid-prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: #c8d0dc;  /* 12.35:1 ✓ */
}

.fid-prose img {
  border-radius: 12px;
  max-width: 100%;
  margin: 1.5em auto;
  display: block;
}

.fid-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.875rem;
}
.fid-prose th {
  background: #1e242e;
  color: #f0f2f5;  /* 13.90:1 on #1e242e ✓ */
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #252d3a;
}
.fid-prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #1e242e;
  color: #c8d0dc;  /* 12.35:1 ✓ */
}

/* ── Result badges ────────────────────────────────────────── */
.fid-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}
.fid-badge--ok {
  background: rgba(16,185,129,.15);
  color: #10b981;  /* 7.21:1 on surface-800 ✓ */
  border: 1px solid rgba(16,185,129,.35);
}
.fid-badge--warn {
  background: rgba(245,158,11,.15);
  color: #f59e0b;  /* 8.52:1 on surface-800 ✓ */
  border: 1px solid rgba(245,158,11,.35);
}
.fid-badge--caution {
  background: rgba(139,92,246,.12);
  color: #a78bfa;  /* 7.06:1 on surface-800 ✓ */
  border: 1px solid rgba(139,92,246,.30);
}

/* SynthID detail flags */
.fid-synthid-flags {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.fid-synthid-flags li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.fid-synthid-flags li::before {
  content: '›';
  position: absolute;
  left: 0.25rem;
  color: var(--brand-400);
  font-weight: 600;
}

.text-ink-subtle { color: #7a8694 !important; }

::placeholder { color: #7a8694 !important; opacity: 1; }
.placeholder-ink-subtle::placeholder { color: #7a8694 !important; opacity: 1; }

/* ── Stretched link (card covers) ────────────────────────── */
.stretched-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── Animation delay utilities ───────────────────────────── */
.delay-100 { animation-delay: 0.10s; }
.delay-200 { animation-delay: 0.20s; }
.delay-300 { animation-delay: 0.30s; }

/* ── AdSense CLS guard ───────────────────────────────────── */
.adsbygoogle { min-height: 90px; }

:focus-visible {
  outline: 2px solid #00c2ff;
  outline-offset: 3px;
}

/* Remove default focus for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Skip link - WCAG 2.4.1 bypass blocks ────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #00c2ff;
  color: #0d0f12;
  padding: 8px 16px;
  z-index: 10000;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 6px 0;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

/* Links must not rely on colour alone to be distinguished */
a:not([class]):hover {
  text-decoration: underline;
}

/* ── Error page decorative numbers ───────────────────────── */
.fid-error-number {
  color: #2e3847;  /* decorative only, not conveying info */
  user-select: none;
  aria-hidden: true;
}

/* ==========================================================================
 * BLOCK-BASED BLOG - public rendering
 * Blocks render inside .fid-prose (base typography). These classes theme the
 * special blocks with the app's surface/ink/brand tokens, so light + dark
 * both adapt automatically via the CSS variables above.
 * ======================================================================== */

/* Heading anchors clear the sticky header (h-16 = 64px) when jumped to */
.block-heading { scroll-margin-top: 84px; }

/* ── Table of contents ──
   Sits inside #post-body (.fid-prose); rules use element+class so they win
   over the generic .fid-prose a / ol / li styles on specificity ties. */
.post-toc {
  background: var(--surface-800);
  border: 1px solid var(--surface-500);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.post-toc__label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.68rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-subtle);
  margin: 0 0 0.9rem;
}
.post-toc ol {
  margin: 0; padding-left: 1.6rem; list-style: decimal;
}
/* Nested levels: H3 (a, b, c) under H2, H4 (i, ii) under H3 */
.post-toc ol ol {
  margin: 0.4rem 0 0.1rem; padding-left: 1.35rem; list-style: lower-alpha;
}
.post-toc ol ol ol { list-style: lower-roman; }
.post-toc li {
  margin: 0.5rem 0; line-height: 1.45; padding-left: 0.35rem;
}
.post-toc ol ol li { margin: 0.3rem 0; }
.post-toc li::marker { color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.post-toc a {
  font-size: 1rem; color: var(--ink-muted);
  text-decoration: none; transition: color 0.15s;
}
.post-toc a:hover { color: var(--brand-400); text-decoration: underline; text-underline-offset: 3px; }

/* Tighten the space between the Contents card and the first section heading */
.article-body .post-toc + .block-heading { margin-top: 0.75rem; }

/* ── tip_box ── */
.block-tip-box {
  background: color-mix(in srgb, var(--brand-400) 7%, var(--surface-800));
  border: 1px solid color-mix(in srgb, var(--brand-400) 22%, transparent);
  border-left: 3px solid var(--brand-400);
  border-radius: 8px;
  padding: 1.1rem 1.35rem;
  margin: 1.75rem 0;
}
.block-tip-box__label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.68rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--brand-400);
  margin-bottom: 0.5rem;
}
.block-tip-box__body { color: var(--ink-muted); font-size: 0.95rem; line-height: 1.7; }

/* ── pull_quote ── */
.block-pull-quote { margin: 1.9rem 0; padding: 0; border: none; }
.block-pull-quote--accent {
  background: var(--surface-800);
  border-left: 3px solid var(--brand-400);
  border-radius: 0 8px 8px 0;
  padding: 1.4rem 1.6rem;
}
.block-pull-quote--accent .block-pull-quote__text {
  font-size: 1.3rem; line-height: 1.5; color: var(--ink);
  font-style: italic; margin: 0 0 0.5rem;
}
.block-pull-quote--centered {
  border-top: 2px solid var(--brand-400);
  border-bottom: 2px solid var(--brand-400);
  padding: 1.5rem 1rem; margin: 2.25rem 0; text-align: center;
}
.block-pull-quote--centered .block-pull-quote__text {
  font-size: 1.4rem; line-height: 1.45; color: var(--ink); font-style: italic; margin: 0;
}
.block-pull-quote__attribution {
  display: block;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem; font-style: normal;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-subtle);
  margin-top: 0.75rem;
}

/* ── stat_callout ── */
.block-stat-callout {
  background: var(--surface-800);
  border-left: 3px solid var(--brand-400);
  border-radius: 0 8px 8px 0;
  padding: 1.1rem 1.35rem;
  margin: 1.75rem 0;
  display: flex; flex-direction: column;
}
.block-stat-callout__value {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 2rem; font-weight: 500; color: var(--brand-400);
  line-height: 1.1; margin-bottom: 0.35rem;
}
.block-stat-callout__label {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted);
}

/* ── image ── */
.block-image { margin: 1.75rem 0; text-align: center; }
/* Frame shrinks to the image so the credit overlay hugs the image edge */
.block-image__frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
/* margin:0 overrides .fid-prose img's vertical margin so the frame hugs the image */
.block-image img { border-radius: 12px; max-width: 100%; height: auto; display: block; margin: 0; }
.block-image__caption {
  font-size: 0.8rem; font-style: italic; text-align: center;
  color: var(--ink-subtle); margin-top: 0.6rem; line-height: 1.5;
}
/* Credit - overlaid on the bottom-right corner of the image.
   width:max-content sizes the badge to its text so left/right padding stay equal
   (abs shrink-to-fit / fit-content otherwise size to "available width"). */
.block-image__credit {
  position: absolute; right: 0.5rem; bottom: 0.5rem; margin: 0;
  display: inline-flex; align-items: center;
  width: max-content; max-width: calc(100% - 1rem);
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px);
  border-radius: 5px; padding: 0.4rem 0.5rem; line-height: 1;
}
.block-image__credit a, .block-image__credit span {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline dotted; text-underline-offset: 2px;
}
.block-image__credit a:hover { color: #fff; }

/* ── faq ── (accordion cards matching /faq/, typography matching the article) */
.block-faq { margin: 1.75rem 0; display: flex; flex-direction: column; gap: 1rem; }
.block-faq__item {
  border: 1px solid color-mix(in srgb, var(--surface-500) 40%, transparent);
  border-radius: 12px;
  background: var(--surface-800);
  overflow: hidden;
}
.block-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.9rem; font-weight: 500; color: var(--ink);
  cursor: pointer; list-style: none;
  transition: color 0.15s;
}
.block-faq__q::-webkit-details-marker { display: none; }
.block-faq__q:hover { color: var(--brand-400); }
.block-faq__icon {
  flex-shrink: 0; color: var(--ink-subtle);
  transition: transform 0.2s;
}
.block-faq__item[open] .block-faq__icon { transform: rotate(180deg); }
.block-faq__a {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem; line-height: 1.75; color: var(--ink-muted);
}

/* ── Blog listing card featured image (/blog/) ── */
.blog-card { overflow: hidden; }
.blog-card__media {
  aspect-ratio: 16 / 9;
  background: var(--surface-700);
  overflow: hidden;
}
.blog-card__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.blog-card:hover .blog-card__img { transform: scale(1.04); }

/* ── table ── (element+class selectors beat .fid-prose th/td) ── */
.block-table-wrap { overflow-x: auto; margin: 1.75rem 0; }
.block-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.block-table__caption {
  caption-side: bottom; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-subtle); text-align: center; margin-top: 0.6rem;
}
.block-table th {
  background: var(--surface-600); color: var(--ink);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.55rem 0.75rem; text-align: center;
  border-bottom: 1px solid var(--surface-500);
}
.block-table__th--left, .block-table__rowhead { text-align: left !important; }
.block-table td {
  padding: 0.5rem 0.75rem; text-align: center;
  color: var(--ink-muted); border-bottom: 1px solid var(--surface-600);
}
.block-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-800) 55%, transparent);
}
.block-table__rowhead { color: var(--ink); font-weight: 500; }

/* ── internal_link card ── */
.block-internal-link { margin: 2rem 0; }
.block-internal-link__label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.66rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-subtle); margin: 0 0 0.6rem;
}
.article-body .bil-card, .bil-card {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  padding: 1rem 1.2rem; border: 1px solid var(--surface-500);
  border-radius: 12px; background: var(--surface-800);
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.bil-card:hover {
  border-color: color-mix(in srgb, var(--brand-400) 40%, transparent);
  background: var(--surface-700);
}
.bil-body { display: flex; flex-direction: column; gap: 0.3rem; }
.bil-title {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1rem; color: var(--ink); line-height: 1.3; transition: color 0.15s;
}
.bil-card:hover .bil-title { color: var(--brand-400); }
.bil-excerpt { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.55; }
.bil-meta {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-subtle); display: flex; gap: 0.8rem; flex-wrap: wrap;
}
.bil-arrow { color: var(--brand-400); flex-shrink: 0; display: flex; }

/* ── adsense ── */
.block-adsense { text-align: center; margin: 1.75rem 0; overflow: hidden; }
.block-adsense-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  background: var(--surface-800); border: 1px dashed var(--surface-400);
  border-radius: 8px; color: var(--ink-subtle);
  padding: 1.25rem; margin: 1.75rem 0; min-height: 90px;
}
.block-adsense-placeholder__kicker {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.18em;
}
.block-adsense-placeholder__size { font-size: 0.78rem; }

/* ==========================================================================
 * BLOCK EDITOR - admin authoring UI (static/js/block-editor.js)
 * ======================================================================== */
.be-editor { display: flex; flex-direction: column; gap: 0.85rem; }
.be-empty {
  color: var(--ink-subtle); font-size: 0.85rem; text-align: center;
  padding: 1.5rem; border: 1px dashed var(--surface-500); border-radius: 10px;
}
.be-block { border: 1px solid var(--surface-500); border-radius: 10px; background: var(--surface-700); overflow: hidden; }
.be-block__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; background: var(--surface-600);
  border-bottom: 1px solid var(--surface-500);
}
.be-block__type {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-400);
}
.be-block__actions { display: flex; gap: 0.25rem; }
.be-icon {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--surface-500); background: var(--surface-700);
  color: var(--ink-muted); font-size: 0.8rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.be-icon:hover { color: var(--ink); border-color: var(--surface-400); }
.be-icon--danger:hover { color: #f87171; border-color: rgba(248,113,113,.5); }
.be-block__body { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.7rem; }
.be-field { display: flex; flex-direction: column; gap: 0.3rem; }
.be-field__label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-subtle);
}
.be-input {
  width: 100%; padding: 0.5rem 0.65rem; border-radius: 8px;
  border: 1px solid var(--surface-500); background: var(--surface-800);
  color: var(--ink); font-size: 0.85rem; font-family: 'Plus Jakarta Sans', sans-serif;
}
.be-input:focus { outline: none; border-color: color-mix(in srgb, var(--brand-400) 60%, transparent); }
.be-textarea { resize: vertical; font-family: 'DM Mono', ui-monospace, monospace; line-height: 1.5; }
.be-select { cursor: pointer; }
.be-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-muted); cursor: pointer; }
.be-checkbox { width: 15px; height: 15px; accent-color: var(--brand-400); }
.be-add-bar {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--surface-600);
}
.be-add {
  padding: 0.4rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--surface-500); background: var(--surface-700);
  color: var(--ink-muted); font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
}
.be-add:hover {
  color: var(--brand-400);
  border-color: color-mix(in srgb, var(--brand-400) 40%, transparent);
  background: var(--surface-600);
}
.be-table { display: flex; flex-direction: column; gap: 0.3rem; }
.be-table__row { display: flex; gap: 0.3rem; align-items: center; }
.be-table__cell { flex: 1; min-width: 60px; }
.be-table__cell--head { font-weight: 600; }
.be-table__controls { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.be-table__opts { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.be-mini {
  padding: 0.3rem 0.55rem; border-radius: 6px;
  border: 1px solid var(--surface-500); background: var(--surface-800);
  color: var(--ink-muted); font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.66rem; cursor: pointer;
}
.be-mini:hover { color: var(--ink); }
.be-mini--danger:hover { color: #f87171; border-color: rgba(248,113,113,.4); }
.be-faq { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.6rem; }
.be-faq__item {
  display: flex; flex-direction: column; gap: 0.45rem;
  border: 1px solid var(--surface-500); border-radius: 8px;
  background: var(--surface-800); padding: 0.65rem;
}
.be-faq__head { display: flex; align-items: center; justify-content: space-between; }

/* ── Admin shell: viewport-height layout ──
   Bounds the sidebar+main flex row to the viewport so only <main> scrolls;
   the sidebar (and its View site / Sign out links) stays fixed. */
.admin-shell { height: 100vh; }

/* ── Custom scrollbars (admin) ──
   Slim, theme-matched thumbs on every admin scroller (main area, sticky
   post-form panel, TipTap editors, tables). Standard properties cover modern
   Chrome/Edge/Firefox; the ::-webkit-* rules are the Safari/older-WebKit path. */
.admin-shell,
.admin-shell * {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-400) transparent;
}
.admin-shell ::-webkit-scrollbar,
.admin-shell::-webkit-scrollbar { width: 8px; height: 8px; }
.admin-shell ::-webkit-scrollbar-track,
.admin-shell::-webkit-scrollbar-track { background: transparent; }
.admin-shell ::-webkit-scrollbar-thumb,
.admin-shell::-webkit-scrollbar-thumb {
  background: var(--surface-400);
  border-radius: 8px;
}
.admin-shell ::-webkit-scrollbar-thumb:hover,
.admin-shell::-webkit-scrollbar-thumb:hover { background: var(--ink-subtle); }
.admin-shell ::-webkit-scrollbar-corner { background: transparent; }
/* Flex children default to min-height:auto (content height), which would let
   <main> outgrow the bounded shell instead of scrolling - min-height:0 makes
   flex-1 + overflow-auto actually bound and scroll it. */
.admin-shell main { min-height: 0; }

/* ── Post form: sticky right panel ──
   Sticks within the scrolling <main>. align-self:start is required - grid
   items stretch by default, which would leave sticky no room to travel. */
.pf-side {
  align-self: start;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 5.5rem);   /* viewport minus admin top bar + breathing room */
  overflow-y: auto;
  scrollbar-width: thin;
}
.be-file { padding: 0.4rem 0.5rem; font-size: 0.78rem; cursor: pointer; }
.be-img-preview { min-height: 0; }
.be-img-preview:not(:empty) { margin: 0.2rem 0 0.2rem; }
.be-img-thumb {
  max-width: 100%; max-height: 160px; border-radius: 8px;
  border: 1px solid var(--surface-500); display: block;
}

/* ── Paragraph rich-text editor (TipTap) ── */
.bb-tiptap-wrap {
  border: 1px solid var(--surface-500); border-radius: 8px;
  overflow: hidden; background: var(--surface-800);
}
.bb-tiptap-toolbar {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  padding: 0.35rem 0.4rem; background: var(--surface-700);
  border-bottom: 1px solid var(--surface-500);
}
.bb-toolbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 0.4rem;
  border: 1px solid var(--surface-500); border-radius: 6px;
  background: var(--surface-800); color: var(--ink-muted);
  font-size: 0.8rem; cursor: pointer; transition: all 0.12s;
}
.bb-toolbar-btn code { font-family: 'DM Mono', ui-monospace, monospace; font-size: 0.7rem; }
.bb-toolbar-btn:hover { color: var(--ink); border-color: var(--surface-400); }
.bb-toolbar-btn--active {
  background: color-mix(in srgb, var(--brand-400) 15%, transparent);
  border-color: var(--brand-400); color: var(--brand-400);
}
.bb-tiptap-editor {
  padding: 0.6rem 0.7rem; min-height: 90px; font-size: 0.9rem;
  line-height: 1.7; color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif;
}
.bb-tiptap-editor:focus, .bb-tiptap-editor .tiptap { outline: none; }
.bb-tiptap-editor .tiptap { min-height: 78px; }
.bb-tiptap-editor p { margin: 0 0 0.6em; }
.bb-tiptap-editor p:last-child { margin-bottom: 0; }
.bb-tiptap-editor code {
  background: var(--surface-600); padding: 0.1em 0.35em; border-radius: 3px;
  font-size: 0.85em; font-family: 'DM Mono', ui-monospace, monospace; color: var(--brand-400);
}
.bb-tiptap-editor a { color: var(--brand-400); text-decoration: underline; }
.bb-tiptap-editor ul { list-style: disc;    padding-left: 1.5rem; margin-bottom: 0.75rem; }
.bb-tiptap-editor ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.bb-tiptap-editor li { margin-bottom: 0.25rem; line-height: 1.7; }
.bb-tiptap-editor ul ul, .bb-tiptap-editor ol ol { margin-bottom: 0; margin-top: 0.25rem; }

/* ── Featured image hero (public post) ── */
.post-hero { margin: 0 0 2rem; }
.post-hero__frame { position: relative; display: block; line-height: 0; }
.post-hero img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px solid var(--surface-500);
}

/* ── Author bio (blog post footer) ── */
.author-bio {
  display: flex; gap: 1.1rem; align-items: flex-start;
  margin: 3rem 0 0;
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--surface-500) 40%, transparent);
  border-radius: 14px;
  background: var(--surface-800);
}
.author-bio__avatar {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--surface-500);
}
.author-bio__label {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-subtle); margin-bottom: 0.25rem;
}
.author-bio__name {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 1rem; font-weight: 500; color: var(--ink);
  margin-bottom: 0.5rem;
}
.author-bio__name a { color: var(--ink); text-decoration: none; transition: color 0.15s; }
.author-bio__name a:hover { color: var(--brand-400); }
.author-bio__name a.author-bio__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;           /* ≥24px target - WCAG 2.5.8 */
  vertical-align: middle;
  border-radius: 6px; color: var(--ink-subtle);
}
.author-bio__name a.author-bio__x:hover { color: var(--brand-400); }
.author-bio__name {
  display: flex;
  align-items: center;
  gap: 0.50rem;
}
.author-bio__text {
  font-size: 0.9rem; line-height: 1.7; color: var(--ink-muted);
  white-space: pre-line; margin: 0;
}

/* ── Featured image card preview (admin) ── */
.fi-preview:not(:empty) { margin-bottom: 0.6rem; }
.fi-thumb {
  width: 100%; height: auto; display: block;
  border-radius: 8px; border: 1px solid var(--surface-500);
}

/* ==========================================================================
 * MEDIA MANAGER (admin)
 * ======================================================================== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.media-card {
  border: 1px solid var(--surface-500);
  border-radius: 10px; background: var(--surface-800); overflow: hidden;
  display: flex; flex-direction: column;
}
.media-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10;
  background: var(--surface-700); cursor: pointer;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb__missing {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-subtle); font-size: 0.72rem; font-family: 'DM Mono', ui-monospace, monospace;
}
.media-check {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2;
  width: 18px; height: 18px; accent-color: var(--brand-400); cursor: pointer;
}
.media-thumb:has(.media-check:checked) { outline: 2px solid var(--brand-400); outline-offset: -2px; }
.media-meta { padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.35rem; }
.media-name {
  font-size: 0.78rem; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.media-dims {
  font-size: 0.66rem; font-family: 'DM Mono', ui-monospace, monospace; color: var(--ink-subtle);
}
.media-del { align-self: flex-start; margin-top: 0.15rem; }

/* ==========================================================================
 * HOMEPAGE & FOOTER REVAMP (v5)
 * ======================================================================== */

/* ── Warning colour utilities (file-size alert) ── */
.text-warning              { color: var(--warning) !important; }
.text-warning\/60          { color: color-mix(in srgb, var(--warning) 60%, transparent) !important; }
.hover\:text-warning:hover { color: var(--warning) !important; }
.border-warning\/40        { border-color: color-mix(in srgb, var(--warning) 40%, transparent) !important; }
.bg-warning\/8             { background-color: color-mix(in srgb, var(--warning) 8%, transparent) !important; }

/* ── Hero background grid (fades out toward the bottom) ── */
.bg-grid {
  background-image:
    linear-gradient(to right,  color-mix(in srgb, var(--surface-500) 45%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--surface-500) 45%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 50%, transparent 100%);
}

/* ── Upload preview bottom fade ── */
.fid-img-fade {
  background: linear-gradient(to top,
    color-mix(in srgb, var(--surface-950) 60%, transparent), transparent);
}

/* ── Gradient headline accent ── */
.text-gradient-brand {
  background: linear-gradient(100deg, var(--brand-400), var(--brand-300));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ── Missing brand colour utilities ── */
.hover\:text-brand-300:hover { color: var(--brand-300) !important; }
.border-surface-400\/60      { border-color: color-mix(in srgb, var(--surface-400) 60%, transparent) !important; }
html.light .hover\:text-brand-300:hover { color: #0284c7 !important; }

/* ── group-hover colour states (brand/surface colours are not in the
     Tailwind config, so these variants must be hand-written) ── */
.group:hover .group-hover\:text-brand-400      { color: var(--brand-400) !important; }
.group:hover .group-hover\:text-brand-400\/25  { color: color-mix(in srgb, var(--brand-400) 25%, transparent) !important; }
.group:hover .group-hover\:text-brand-400\/20  { color: color-mix(in srgb, var(--brand-400) 20%, transparent) !important; }
.group:hover .group-hover\:bg-brand-400\/8     { background-color: color-mix(in srgb, var(--brand-400)  8%, transparent) !important; }
.group:hover .group-hover\:bg-brand-400\/15    { background-color: color-mix(in srgb, var(--brand-400) 15%, transparent) !important; }
.group:hover .group-hover\:bg-brand-400\/20    { background-color: color-mix(in srgb, var(--brand-400) 20%, transparent) !important; }
.group:hover .group-hover\:border-brand-400\/60 { border-color: color-mix(in srgb, var(--brand-400) 60%, transparent) !important; }
html.light .group:hover .group-hover\:text-brand-400 { color: #0369a1 !important; }  /* 7.05:1 ✓ */

/* ── Homepage FAQ accordion - smooth expand/collapse ── */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.faq-panel__inner {
  overflow: hidden;
  min-height: 0;
  visibility: hidden;
  transition: visibility 0.3s;
}
.faq-panel.is-open { grid-template-rows: 1fr; }
.faq-panel.is-open .faq-panel__inner { visibility: visible; }
.faq-trigger[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }

/* ── Footer link hover - subtle slide ── */
.footer-link {
  display: inline-block;
  transition: color 0.2s, transform 0.2s;
}
.footer-link:hover { transform: translateX(3px); }

/* ── Reduced motion - disable decorative movement ── */
@media (prefers-reduced-motion: reduce) {
  .faq-panel,
  .faq-panel__inner,
  .faq-icon,
  .footer-link,
  .blog-card__img { transition: none !important; }
  .footer-link:hover { transform: none; }
  .blog-card:hover .blog-card__img { transform: none; }
  .animate-fade-up { animation: none !important; }
}