/* ============================================================
   Geospatial Orchestration Hub — Moonlit Ocean theme
   Shadowy black, twilight blue, dawn pastels.
   ============================================================ */

:root {
  /* Core palette */
  --c-bg:           #f5f7fb;        /* dawn sky */
  --c-bg-soft:      #eef1f8;
  --c-surface:      #ffffff;
  --c-surface-2:    #f0f3fa;
  --c-ink:          #0b1426;        /* shadowy black */
  --c-ink-soft:     #1f2a44;
  --c-muted:        #4f5a76;
  --c-muted-2:      #768297;
  --c-line:         #d8def0;
  --c-line-soft:    #e7ecf7;

  /* Twilight blues */
  --c-twilight:     #1f3a82;
  --c-twilight-2:   #2a4ea8;
  --c-twilight-3:   #3a6ed1;
  --c-twilight-mist:#9ab8ff;

  /* Dawn pastels */
  --c-dawn-peach:   #f6c89a;
  --c-dawn-rose:    #e9a0b8;
  --c-dawn-mint:    #a9d7c5;
  --c-dawn-sand:    #f1d9b8;
  --c-dawn-lilac:   #c9b8f0;

  /* Accents */
  --c-link:         #2a4ea8;
  --c-link-hover:   #1f3a82;
  --c-focus:        #3a6ed1;

  /* Code */
  --c-code-bg:      #eef2fb;
  --c-code-inline:  #eef2fb;
  --c-code-border:  #dbe2f3;

  /* Layout */
  --header-h:       64px;
  --content-max:    1240px;
  --prose-max:      900px;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(11,20,38,0.06), 0 1px 1px rgba(11,20,38,0.04);
  --shadow:    0 6px 18px rgba(11,20,38,0.08), 0 2px 6px rgba(11,20,38,0.05);
  --shadow-lg: 0 22px 48px rgba(11,20,38,0.16), 0 8px 18px rgba(11,20,38,0.08);

  --ease: cubic-bezier(.2,.7,.2,1);

  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (min-width: 1024px) {
  :root { --header-h: 72px; }
}

/* ---------------- base ---------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

html, body { margin: 0; padding: 0; }

body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Subtle dawn-pastel gradient over the page */
  background-image:
    radial-gradient(1100px 600px at 90% -10%, rgba(154,184,255,0.20), transparent 60%),
    radial-gradient(900px 500px at -10% 5%, rgba(246,200,154,0.15), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(201,184,240,0.18), transparent 60%);
}

.site-main { flex: 1 0 auto; }

img, svg { max-width: 100%; }

a { color: var(--c-link); text-decoration: none; transition: color .15s var(--ease), background-color .15s var(--ease); }
a:hover { color: var(--c-link-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100px; left: 8px;
  background: var(--c-ink);
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { top: 8px; }

/* Headings inside long-form content controlled inside .prose */
h1, h2, h3, h4, h5, h6 { color: var(--c-ink); }

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--c-line-soft);
}

.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--c-ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--c-twilight); text-decoration: none; }
.brand__logo { width: 36px; height: 36px; display: inline-block; }
.brand__logo--small { width: 28px; height: 28px; }
.brand__name { display: inline-grid; line-height: 1.05; font-size: 14px; }
.brand__name-line1 { color: var(--c-muted); font-weight: 500; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.brand__name-line2 { font-size: 16px; font-weight: 700; color: var(--c-ink); }

.primary-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--c-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all .15s var(--ease);
}
.primary-nav__link:hover {
  color: var(--c-twilight);
  background: var(--c-surface-2);
  text-decoration: none;
}
.primary-nav__link.is-active {
  color: var(--c-twilight);
  background: linear-gradient(135deg, rgba(58,110,209,0.10), rgba(233,160,184,0.10));
  box-shadow: inset 0 0 0 1px rgba(58,110,209,0.18);
}
.primary-nav__icon { width: 18px; height: 18px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle__bar { width: 18px; height: 2px; background: var(--c-ink); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px clamp(16px, 3vw, 32px);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line-soft);
    box-shadow: var(--shadow-sm);
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav__link { width: 100%; justify-content: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); }
}

/* ---------------- footer ---------------- */

.site-footer {
  flex-shrink: 0;
  margin-top: 80px;
  background: linear-gradient(180deg, transparent, rgba(31,58,130,0.04) 30%, rgba(31,58,130,0.07));
  border-top: 1px solid var(--c-line-soft);
}
.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px clamp(16px, 3vw, 32px) 24px;
  display: grid;
  gap: 32px;
  grid-template-columns: 2fr 1fr 1fr;
}
@media (max-width: 720px) { .site-footer__inner { grid-template-columns: 1fr; } }
.site-footer__brand { display: flex; align-items: flex-start; gap: 12px; }
.site-footer__tagline { color: var(--c-muted); margin: 0; max-width: 36ch; }
.site-footer__heading { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 10px; font-weight: 600; }
.site-footer__nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer__nav a { color: var(--c-ink-soft); }
.site-footer__nav a:hover { color: var(--c-twilight); }
.site-footer__base { max-width: var(--content-max); margin: 0 auto; padding: 16px clamp(16px, 3vw, 32px) 32px; color: var(--c-muted-2); border-top: 1px solid var(--c-line-soft); }

/* ---------------- hero ---------------- */

.hero {
  padding: clamp(40px, 7vw, 88px) clamp(16px, 3vw, 32px) clamp(32px, 5vw, 64px);
}
.hero__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
@media (max-width: 960px) { .hero__inner { grid-template-columns: 1fr; } }

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  color: var(--c-twilight);
  font-weight: 700;
  margin: 0 0 16px;
}
.hero__title {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--c-ink);
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--c-twilight) 0%, var(--c-twilight-3) 45%, var(--c-dawn-rose) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--c-ink-soft);
  margin: 0 0 16px;
  max-width: 64ch;
}
.hero__sub {
  color: var(--c-muted);
  margin: 0 0 14px;
  max-width: 64ch;
}

.hero__cta {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.cta:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.cta__icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}
.cta__icon svg { width: 22px; height: 22px; }
.cta__title { display: block; font-weight: 700; color: var(--c-ink); }
.cta__desc { display: block; font-size: 13px; color: var(--c-muted); margin-top: 2px; }

.cta--architecture .cta__icon { background: linear-gradient(135deg, var(--c-twilight) 0%, var(--c-twilight-3) 100%); }
.cta--tasks .cta__icon        { background: linear-gradient(135deg, var(--c-dawn-mint) 0%, var(--c-twilight-mist) 100%); color: var(--c-ink); }
.cta--resilience .cta__icon   { background: linear-gradient(135deg, var(--c-dawn-rose) 0%, var(--c-dawn-peach) 100%); color: var(--c-ink); }

.hero__visual {
  display: flex;
  justify-content: center;
}
.hero__visual-card {
  width: min(360px, 80%);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(58,110,209,0.10), rgba(233,160,184,0.10));
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.hero__visual-card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.6);
  pointer-events: none;
}
.hero__visual-card svg { width: 75%; height: auto; filter: drop-shadow(0 14px 28px rgba(31,58,130,.20)); }

/* ---------------- pillars (homepage) ---------------- */

.pillars {
  padding: clamp(32px, 5vw, 56px) clamp(16px, 3vw, 32px) 24px;
}
.pillars__inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.pillars__title {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.pillars__intro {
  color: var(--c-muted);
  margin: 0 0 28px;
  max-width: 70ch;
}
.pillars__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.pillar {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pillar__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pillar__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: white; }
.pillar__icon svg { width: 20px; height: 20px; }
.pillar--architecture .pillar__icon { background: linear-gradient(135deg, var(--c-twilight), var(--c-twilight-3)); }
.pillar--tasks .pillar__icon        { background: linear-gradient(135deg, var(--c-dawn-mint), var(--c-twilight-mist)); color: var(--c-ink); }
.pillar--resilience .pillar__icon   { background: linear-gradient(135deg, var(--c-dawn-rose), var(--c-dawn-peach)); color: var(--c-ink); }
.pillar__title { margin: 0; font-size: 18px; line-height: 1.25; }
.pillar__title a { color: var(--c-ink); }
.pillar__title a:hover { color: var(--c-twilight); }
.pillar p { color: var(--c-muted); margin: 8px 0 14px; }
.pillar__links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.pillar__links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
  color: var(--c-twilight);
}
.pillar__links a::before {
  content: "→";
  color: var(--c-dawn-rose);
  transition: transform .15s var(--ease);
}
.pillar__links a:hover::before { transform: translateX(3px); }

/* ---------------- article layout ---------------- */

.article { padding: 16px clamp(16px, 3vw, 32px) 48px; }
.article__container {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.article__header { margin-top: 8px; margin-bottom: 12px; }
.article__title {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(120deg, var(--c-twilight) 0%, var(--c-twilight-3) 55%, var(--c-dawn-rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* breadcrumbs */
.breadcrumbs ol {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--c-muted);
  font-size: 14px;
}
.breadcrumbs li + li::before {
  content: "/";
  color: var(--c-muted-2);
  margin-right: 8px;
}
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-twilight); }
.breadcrumbs [aria-current="page"] { color: var(--c-ink); font-weight: 600; }

/* ---------------- prose ---------------- */

.prose {
  /* fills the full article container — no narrow-column constraint */
  font-size: 17px;
  color: var(--c-ink-soft);
}
.prose > * { max-width: 100%; }

.prose p { margin: 0 0 1.05em; }
.prose strong { color: var(--c-ink); }

.prose h2, .prose h3, .prose h4 {
  color: var(--c-ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.prose h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  margin: 2em 0 .6em;
  padding-bottom: .25em;
  border-bottom: 1px solid var(--c-line-soft);
  position: relative;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: -14px;
  top: .35em;
  bottom: .55em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--c-twilight-3), var(--c-dawn-rose));
}
.prose h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  margin: 1.6em 0 .4em;
  color: var(--c-twilight);
}
.prose h4 {
  font-size: 18px;
  margin: 1.4em 0 .3em;
  color: var(--c-ink-soft);
}

.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.25em 0; }
.prose li::marker { color: var(--c-twilight-mist); }

/* anchor link beside heading (markdown-it-anchor ariaHidden permalink) */
.heading-anchor {
  display: inline-block;
  color: var(--c-twilight-mist);
  margin-left: 8px;
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
  font-size: 0.8em;
  vertical-align: middle;
}
.prose h1:hover .heading-anchor,
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { color: var(--c-twilight); text-decoration: none; }
/* the anchor must not pick up the in-prose link underline-on-hover */
.prose .heading-anchor { background-image: none; padding-bottom: 0; }

/* blockquote */
.prose blockquote {
  margin: 1.2em 0;
  padding: .8em 1.2em;
  border-left: 4px solid var(--c-twilight-3);
  background: var(--c-surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-ink-soft);
}

/* links inside prose */
.prose a.in-link,
.prose a.ext-link {
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(180deg, transparent 92%, rgba(58,110,209,0.35) 92%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding-bottom: 1px;
  transition: background-size .2s var(--ease), color .15s var(--ease);
}
.prose a.in-link:hover,
.prose a.ext-link:hover {
  text-decoration: none;
  background-image: linear-gradient(180deg, transparent 50%, rgba(58,110,209,0.18) 50%);
  color: var(--c-twilight);
}
.prose a.ext-link::after {
  content: " ↗";
  color: var(--c-muted-2);
  font-size: .85em;
}

/* ---------------- inline code ---------------- */

.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--c-code-inline);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: var(--c-ink);
  border: none;
}

/* ---------------- code blocks ---------------- */

.codeblock {
  position: relative;
  margin: 1.4em 0;
  max-width: 100%;
  background: var(--c-code-bg);
  border: 1px solid var(--c-code-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.codeblock[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-muted-2);
  pointer-events: none;
}
.codeblock pre {
  margin: 0;
  padding: 36px 16px 14px;
  overflow-x: auto;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-ink);
}
.codeblock code { font-family: inherit; background: transparent; padding: 0; }
.codeblock__copy {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--c-line);
  color: var(--c-muted);
  padding: 4px 10px;
  font: 500 12px var(--font-sans);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.codeblock__copy:hover { color: var(--c-twilight); border-color: var(--c-twilight-mist); background: white; }
.codeblock__copy.is-copied { color: #1f7a4f; border-color: #b4dcc6; background: #ecf8f1; }
.codeblock__copy svg { display: block; }

/* highlight.js — light Moonlit-Ocean tinted */
.hljs                              { color: var(--c-ink); background: transparent; }
.hljs-comment, .hljs-quote         { color: #6c7a99; font-style: italic; }
.hljs-keyword, .hljs-selector-tag,
.hljs-built_in                     { color: #2a4ea8; font-weight: 600; }
.hljs-string, .hljs-doctag         { color: #7a3b1a; }
.hljs-attr, .hljs-name, .hljs-tag  { color: #1f3a82; }
.hljs-number, .hljs-literal,
.hljs-symbol                       { color: #b25430; }
.hljs-title, .hljs-section,
.hljs-class .hljs-title            { color: #2a4ea8; font-weight: 600; }
.hljs-meta                         { color: #5f6b8a; }
.hljs-type, .hljs-params           { color: #2d5d4d; }
.hljs-variable, .hljs-template-variable { color: #7a2d49; }
.hljs-emphasis                     { font-style: italic; }
.hljs-strong                       { font-weight: 700; }

/* ---------------- tables ---------------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.2em 0;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 520px;
}
.table-wrap thead {
  background: linear-gradient(180deg, rgba(58,110,209,0.10), rgba(58,110,209,0.04));
}
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-line-soft);
  vertical-align: top;
}
.table-wrap th { color: var(--c-twilight); font-weight: 600; }
.table-wrap tbody tr:hover { background: rgba(58,110,209,0.04); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

/* ---------------- task list (checkboxes) ---------------- */

.task-list { list-style: none; padding-left: 0; }
.task-list .task-item { padding-left: 0; }
.task-list .task-item::marker { content: ""; }
.task-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s var(--ease);
}
.task-label:hover { background: var(--c-surface-2); }
.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 1.5px solid var(--c-line);
  border-radius: 4px;
  background: var(--c-surface);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.task-checkbox:hover { border-color: var(--c-twilight-3); }
.task-checkbox:checked {
  background: linear-gradient(135deg, var(--c-twilight), var(--c-twilight-3));
  border-color: var(--c-twilight);
}
.task-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M13.5 4.2 6.4 11.3 2.5 7.4l1.1-1.1 2.8 2.8 6-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.task-checkbox:checked + .task-text { text-decoration: line-through; color: var(--c-muted-2); }
.task-text { line-height: 1.5; }

/* ---------------- FAQ accordions ---------------- */

.faq { display: grid; gap: 10px; margin: 1.2em 0; }
.faq__item {
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.faq__item[open] { border-color: var(--c-twilight-mist); box-shadow: var(--shadow); }
.faq__question {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--c-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::after {
  content: "+";
  font-size: 22px;
  line-height: 1;
  color: var(--c-twilight);
  transition: transform .2s var(--ease);
}
.faq__item[open] .faq__question::after { content: "−"; }
.faq__answer { padding: 0 18px 16px; color: var(--c-ink-soft); }
.faq__answer > *:first-child { margin-top: 0; }

/* ---------------- mermaid ---------------- */

pre.mermaid {
  display: block;
  margin: 1.4em 0;
  padding: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  text-align: center;
  overflow-x: auto;
}

/* ---------------- related sections ---------------- */

.related { margin-top: 56px; }
.related__heading {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--c-muted);
  margin: 0 0 12px;
}
.related__list {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.related__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-ink);
  font-weight: 500;
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.related__list a:hover {
  text-decoration: none;
  border-color: var(--c-twilight-mist);
  background: linear-gradient(135deg, rgba(58,110,209,0.06), rgba(233,160,184,0.06));
  transform: translateX(2px);
}
.related__arrow { color: var(--c-dawn-rose); transition: transform .15s var(--ease); }
.related__list a:hover .related__arrow { transform: translateX(4px); }

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------------- selection ---------------- */

::selection { background: rgba(58,110,209,0.25); color: var(--c-ink); }

/* ---------------- print ---------------- */

@media print {
  .site-header, .site-footer, .nav-toggle, .codeblock__copy { display: none !important; }
  .prose a { color: inherit; }
  body { background: white; }
}
