/* Ai Spark Blog
   Layout concept: a workflow canvas. Dot-grid ground, content set like nodes on it,
   category colour encodes topic (amber = automation, cobalt = AI tools, teal = CRM). */
:root {
  --paper: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #131922;
  --ink-2: #4A5563;
  --ink-3: #6B7684;
  --line: #DAE0E6;
  --dot: #C6CED8;
  --cobalt: #2346D6;
  --cobalt-soft: #E6EBFC;
  --amber: #F0A20C;
  --amber-ink: #855700;
  --amber-soft: #FDF1D9;
  --teal: #0C8C7C;
  --teal-ink: #0A6E62;
  --teal-soft: #DDF3EF;
  --plum: #7A3FD1;
  --plum-ink: #5F2AB0;
  --plum-soft: #EFE6FB;
  --code-bg: #EEF1F5;
  --shadow: 0 1px 2px rgba(19, 25, 34, .06), 0 8px 24px rgba(19, 25, 34, .06);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 72rem;
  --read: 42rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1217;
    --surface: #151B22;
    --ink: #E8EDF3;
    --ink-2: #A9B3C0;
    --ink-3: #8691A0;
    --line: #29313B;
    --dot: #27303A;
    --cobalt: #8EA6FF;
    --cobalt-soft: #1B2547;
    --amber: #FFBE3D;
    --amber-ink: #FFCF70;
    --amber-soft: #33270F;
    --teal: #3ED3BF;
    --teal-ink: #5FE0CE;
    --teal-soft: #0F2E2A;
    --plum: #B792FF;
    --plum-ink: #CDB2FF;
    --plum-soft: #2A1C47;
    --code-bg: #1B222B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1217;
  --surface: #151B22;
  --ink: #E8EDF3;
  --ink-2: #A9B3C0;
  --ink-3: #8691A0;
  --line: #29313B;
  --dot: #27303A;
  --cobalt: #8EA6FF;
  --cobalt-soft: #1B2547;
  --amber: #FFBE3D;
  --amber-ink: #FFCF70;
  --amber-soft: #33270F;
  --teal: #3ED3BF;
  --teal-ink: #5FE0CE;
  --teal-soft: #0F2E2A;
  --plum: #B792FF;
  --plum-ink: #CDB2FF;
  --plum-soft: #2A1C47;
  --code-bg: #1B222B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* Category colour tokens */
[data-cat="automation"] { --cat: var(--amber); --cat-ink: var(--amber-ink); --cat-soft: var(--amber-soft); }
[data-cat="ai-tools"]   { --cat: var(--cobalt); --cat-ink: var(--cobalt); --cat-soft: var(--cobalt-soft); }
[data-cat="crm"]        { --cat: var(--teal); --cat-ink: var(--teal-ink); --cat-soft: var(--teal-soft); }
[data-cat="blogging"]   { --cat: var(--plum); --cat-ink: var(--plum-ink); --cat-soft: var(--plum-soft); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

.mono { font-family: var(--f-mono); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.brand-tag {
  font-family: var(--f-mono); font-weight: 500; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; margin-left: .15rem;
}
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: .45rem .7rem; border-radius: 8px;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav .nav-cta { color: var(--surface); background: var(--ink); margin-left: .35rem; }
.nav .nav-cta:hover { color: var(--surface); background: var(--ink); opacity: .9; }
.menu-btn {
  display: none; align-items: center; gap: .4rem;
  font: 600 .9rem var(--f-display); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; cursor: pointer;
}
.menu-btn svg { width: 1.1rem; height: 1.1rem; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: .75rem var(--gutter) 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .75rem; font-size: 1rem; }
  .nav .nav-cta { margin: .35rem 0 0; text-align: center; }
}

/* ---------- Canvas ground (dot grid) ---------- */
.canvas {
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: -11px -11px;
}

/* ---------- Home hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.35rem, 6vw, 4.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; margin-top: .9rem; }
.hero h1 em { font-style: normal; color: var(--cobalt); }
.hero-dek { font-family: var(--f-body); font-size: clamp(1.05rem, 2.2vw, 1.2rem); line-height: 1.6; color: var(--ink-2); max-width: 34rem; margin-top: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .98rem var(--f-display); text-decoration: none;
  padding: .75rem 1.15rem; border-radius: 10px; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }

/* The hero workflow: trigger -> AI -> action, as nodes */
.flow-demo { position: relative; display: grid; gap: 0; max-width: 24rem; justify-self: end; width: 100%; }
.node {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.node-icon { width: 2.25rem; height: 2.25rem; border-radius: 9px; display: grid; place-items: center; background: var(--cat-soft); color: var(--cat-ink); }
.node-icon svg { width: 1.15rem; height: 1.15rem; }
.node-kind { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.node-title { font-weight: 600; font-size: .98rem; line-height: 1.3; }
.wire { height: 1.6rem; margin-left: 2.1rem; border-left: 2px dashed var(--line); position: relative; }
.wire::after { content: ""; position: absolute; left: -5px; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); }
.flow-result {
  margin-top: 1rem; display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .75rem; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: 10px; padding: .6rem .8rem; background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.flow-result strong { color: var(--teal-ink); font-weight: 600; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .flow-demo { justify-self: start; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.section-head p { color: var(--ink-2); font-size: .98rem; }

/* Category cards */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1000px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat-card {
  display: grid; gap: .6rem; align-content: start;
  text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.35rem; border-top: 4px solid var(--cat);
}
.cat-card:hover { border-color: var(--cat); border-top-color: var(--cat); }
.cat-card h3 { font-size: 1.25rem; font-weight: 700; }
.cat-card p { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.cat-count { font-family: var(--f-mono); font-size: .75rem; color: var(--cat-ink); letter-spacing: .04em; }
@media (max-width: 760px) { .cat-grid { grid-template-columns: minmax(0, 1fr); } }

/* Post cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.post-card {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--cat) 50%, var(--line)); }
.post-card .cover { border-bottom: 1px solid var(--line); }
.post-card-body { display: grid; gap: .6rem; align-content: start; padding: 1.1rem 1.15rem 1.25rem; }
.post-card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.post-card p { font-family: var(--f-body); color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.post-card .meta { margin-top: .2rem; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem; width: fit-content;
  font-family: var(--f-mono); font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cat-ink); background: var(--cat-soft); border-radius: 6px; padding: .22rem .5rem;
  text-decoration: none;
}
.chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--cat); }
.meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }

/* Featured post */
.featured {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.featured .cover { height: 100%; border-right: 1px solid var(--line); }
.featured-body { display: grid; gap: .85rem; align-content: center; padding: clamp(1.25rem, 4vw, 2.5rem); }
.featured h3 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.025em; }
.featured p { font-family: var(--f-body); color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }
.featured:hover h3 { color: var(--cobalt); }
@media (max-width: 760px) {
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured .cover { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Cover art (inline SVG workflow motifs) */
.cover { display: block; background: var(--cat-soft); aspect-ratio: 16 / 9; width: 100%; max-width: 100%; }
.cover svg { display: block; width: 100%; height: 100%; }

/* Author strip on home */
.author-strip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
}
.author-strip h2 { font-size: 1.25rem; }
.author-strip p { color: var(--ink-2); font-family: var(--f-body); margin-top: .35rem; }
@media (max-width: 760px) { .author-strip { grid-template-columns: minmax(0, 1fr); } }

.author-avatar {
  width: 3.5rem; height: 3.5rem; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font: 700 1.05rem var(--f-display); letter-spacing: .02em;
  color: var(--surface); background: var(--ink);
}

/* ---------- Listing header (category / page) ---------- */
.page-head { padding-block: clamp(2.25rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; margin-top: .7rem; }
.page-head .dek { font-family: var(--f-body); color: var(--ink-2); font-size: clamp(1.02rem, 2vw, 1.15rem); line-height: 1.6; max-width: 40rem; margin-top: .9rem; }
.page-head[data-cat] { border-bottom: 4px solid var(--cat); }

.post-list { display: grid; gap: 1rem; }
.post-row {
  display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.25rem; align-items: stretch; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.post-row .cover { height: 100%; aspect-ratio: auto; min-height: 8rem; border-right: 1px solid var(--line); }
.post-row-body { display: grid; gap: .55rem; align-content: center; padding: 1.1rem 1.25rem 1.1rem 0; }
.post-row h2 { font-size: 1.3rem; font-weight: 700; }
.post-row p { font-family: var(--f-body); color: var(--ink-2); font-size: .98rem; }
.post-row:hover h2 { color: var(--cobalt); }
@media (max-width: 640px) {
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-row .cover { aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-row-body { padding: 1rem 1.1rem 1.15rem; }
}
.empty-note { color: var(--ink-2); font-family: var(--f-body); }

/* ---------- Article ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--cobalt); text-decoration: underline; }
.article-head { padding-block: clamp(2rem, 5vw, 3.25rem) 1.5rem; }
.article-head .inner { max-width: 50rem; display: grid; gap: 1rem; }
.article-head h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); font-weight: 800; letter-spacing: -0.032em; line-height: 1.06; }
.article-head .dek { font-family: var(--f-body); font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.55; color: var(--ink-2); }
.byline { display: flex; align-items: center; gap: .75rem; }
.byline .author-avatar { width: 2.5rem; height: 2.5rem; font-size: .8rem; }
.byline-name { font-weight: 600; font-size: .95rem; }
.article-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-cover .cover { aspect-ratio: 3 / 1; }
@media (max-width: 620px) { .article-cover .cover { aspect-ratio: 16 / 9; } }

.article-layout { display: grid; grid-template-columns: 15rem minmax(0, var(--read)); gap: clamp(2rem, 5vw, 4rem); padding-block: 2.5rem 3rem; justify-content: center; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5.5rem); align-self: start; }
.toc-title { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-left: 1px solid var(--line); }
.toc a { display: block; color: var(--ink-2); text-decoration: none; font-size: .88rem; line-height: 1.35; padding: .35rem 0 .35rem .85rem; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--cat); }
.toc-mobile { display: none; }
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); max-width: var(--read); margin-inline: auto; }
  .toc { display: none; }
  .toc-mobile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 2rem; }
  .toc-mobile summary { cursor: pointer; padding: .85rem 1rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
  .toc-mobile ol { margin: 0; padding: 0 1rem 1rem 2.2rem; display: grid; gap: .45rem; }
  .toc-mobile a { color: var(--ink); font-size: .95rem; text-decoration: none; }
}

/* Prose */
.prose { font-family: var(--f-body); font-size: 1.1rem; line-height: 1.75; color: var(--ink); min-width: 0; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-family: var(--f-display); font-size: clamp(1.45rem, 3vw, 1.8rem); font-weight: 700; margin-top: 2.75rem; scroll-margin-top: 6rem; }
.prose h3 { font-family: var(--f-display); font-size: 1.22rem; font-weight: 700; margin-top: 2rem; }
.prose h2 + *, .prose h3 + * { margin-top: .75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .45rem; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 650; }
.prose code { font-family: var(--f-mono); font-size: .84em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; overflow-wrap: anywhere; }
.prose pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; font-size: .82rem; overflow-wrap: normal; white-space: pre; }
.prose .lead { font-size: 1.22rem; line-height: 1.6; color: var(--ink-2); }
.prose .meta-line { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); }
.prose .small-print { font-size: .95rem; color: var(--ink-2); }

.takeaways { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.takeaways h3 { margin: 0 0 .6rem; font-size: .78rem; font-family: var(--f-mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--cat-ink, var(--ink-2)); }
.takeaways ul { margin: 0; font-size: 1.02rem; }
.callout { border-left: 3px solid var(--cat, var(--cobalt)); background: var(--cat-soft, var(--cobalt-soft)); border-radius: 0 12px 12px 0; padding: 1rem 1.2rem; font-size: 1.02rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--f-display); font-size: .92rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--f-mono); font-weight: 500; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--paper); }
.prose tr:last-child td { border-bottom: 0; }

/* Flow strip inside articles */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-family: var(--f-display); }
.flow-step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; font-size: .92rem; font-weight: 600; }
.flow-arrow { color: var(--ink-3); font-family: var(--f-mono); }

/* Pipeline strip inside articles */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; font-family: var(--f-display); }
.pipeline-stage {
  display: grid; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .75rem; font-size: .88rem; font-weight: 600; line-height: 1.25;
}
.pipeline-stage span { font-family: var(--f-mono); font-size: .68rem; font-weight: 500; color: var(--ink-3); }
.pipeline-stage.won { border-color: var(--cat); background: var(--cat-soft); }
@media (max-width: 620px) { .pipeline { grid-template-columns: minmax(0, 1fr); } .pipeline-stage { grid-template-columns: 1.5rem minmax(0, 1fr); align-items: center; } }

/* FAQ */
.faq { display: grid; gap: .6rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 1.1rem; }
.faq summary { cursor: pointer; font-family: var(--f-display); font-weight: 600; font-size: 1.02rem; padding: .95rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 1rem; font-size: 1.02rem; }

/* Author card (article end + about) */
.author-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.author-card .author-name { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; }
.author-card .author-role { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); margin-top: .15rem; }
.author-card p + p { margin-top: .6rem; }
.prose .author-card p { font-size: 1rem; line-height: 1.6; }
@media (max-width: 520px) { .author-card { grid-template-columns: minmax(0, 1fr); } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 620px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-card { display: grid; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem; color: var(--ink); text-decoration: none; }
.contact-card:hover { border-color: var(--cobalt); }
.contact-label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.contact-value { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; user-select: all; }
.contact-note { font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.social-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0 !important; }
.social-list li + li { margin-top: 0; }
.social-list a { display: inline-block; font-family: var(--f-display); font-weight: 600; font-size: .92rem; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; }
.social-list a:hover { border-color: var(--cobalt); color: var(--cobalt); }

/* Related */
.related { border-top: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 2.75rem 2rem; margin-top: 1rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer-grid p { color: var(--ink-2); font-size: .92rem; margin-top: .75rem; max-width: 22rem; font-family: var(--f-body); line-height: 1.6; }
.footer-col h2 { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .75rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.footer-col a:hover { color: var(--cobalt); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Contact form ---------- */
.form { display: grid; gap: 1.1rem; margin-block: 1.25rem 2rem; padding: clamp(1.1rem, 3vw, 1.6rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.field { display: grid; gap: .35rem; }
.field label { font: 600 .95rem var(--f-display); color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; font: 400 1rem var(--f-body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt); }
.field .hint { font-size: .88rem; color: var(--ink-3); }
.consent { display: flex; gap: .65rem; align-items: flex-start; font-size: .95rem; color: var(--ink-2); line-height: 1.45; }
.consent input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--cobalt); }
.form .btn { cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Ai Spark helper (chat) ---------- */
.chat-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font: 600 .92rem var(--f-display); padding: .7rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.chat-fab:hover { opacity: .92; }
.chat-panel {
  position: fixed; right: 1rem; bottom: 4.6rem; z-index: 60;
  width: min(23rem, calc(100vw - 2rem)); max-height: min(34rem, calc(100vh - 7rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat-title { font: 700 1rem var(--f-display); margin: 0; }
.chat-sub { margin: .1rem 0 0; font-size: .82rem; color: var(--ink-3); }
.chat-close { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chat-log { flex: 1 1 auto; min-height: 9rem; overflow-y: auto; padding: .85rem 1rem; display: grid; gap: .6rem; align-content: start; }
.chat-msg { max-width: 92%; padding: .55rem .75rem; border-radius: 12px; font: 400 .93rem/1.45 var(--f-display); }
.chat-msg p { margin: 0; }
.chat-msg p + p { margin-top: .4rem; }
.chat-user { justify-self: end; background: var(--cobalt); color: #fff; }
:root[data-theme="dark"] .chat-user { color: #0E1217; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-user { color: #0E1217; } }
.chat-bot { justify-self: start; background: var(--paper); border: 1px solid var(--line); }
.chat-link { color: var(--cobalt); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .7rem; }
.chat-chip { font: 600 .82rem var(--f-display); padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chat-chip:hover { border-color: var(--cobalt); }
.chat-form { display: flex; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.chat-input { flex: 1 1 auto; min-width: 0; font: 400 .95rem var(--f-display); padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.chat-send { flex: none; font: 600 .92rem var(--f-display); padding: .6rem .9rem; border-radius: 10px; border: 0; background: var(--ink); color: var(--surface); cursor: pointer; }
.chat-note { margin: 0; padding: 0 1rem .8rem; font-size: .76rem; line-height: 1.4; color: var(--ink-3); }
.chat-fab:focus-visible, .chat-close:focus-visible, .chat-chip:focus-visible, .chat-send:focus-visible, .chat-input:focus-visible, .chat-log:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
@media (max-width: 480px) {
  .chat-fab-label { display: none; }
  .chat-fab { padding: .8rem; }
  .chat-panel { right: .75rem; bottom: 4.4rem; width: calc(100vw - 1.5rem); }
}
@media print { .chat-fab, .chat-panel { display: none !important; } }
