/* =====================================================================
   Media Pipeline Automation Hub — site stylesheet
   Light, professional palette inspired by audio waveforms and circuit traces.
   ===================================================================== */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f5f3ee;
  --surface-tinted: #eef4fb;
  --ink: #1f2230;
  --ink-soft: #4b5160;
  --ink-mute: #6c7280;
  --brand: #2b6cb0;
  --brand-strong: #1f4d80;
  --brand-soft: #d4e4f4;
  --accent: #d97706;
  --accent-soft: #fde9c8;
  --success: #16a34a;
  --success-soft: #d8f3df;
  --warn: #c05621;
  --danger: #b91c1c;
  --border: #e3dfd5;
  --border-strong: #c9c2b1;
  --code-bg: #f3efe6;
  --code-ink: #2a2535;
  --shadow-sm: 0 1px 2px rgba(31, 34, 48, 0.05), 0 2px 6px rgba(31, 34, 48, 0.04);
  --shadow-md: 0 4px 10px rgba(31, 34, 48, 0.06), 0 14px 32px rgba(31, 34, 48, 0.06);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --header-h: 68px;
  --container: clamp(60ch, 92vw, 1440px);
  --measure: clamp(60ch, 80vw, 90ch);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg)
    radial-gradient(1200px 600px at 80% -10%, rgba(43, 108, 176, 0.06), transparent 60%)
    radial-gradient(900px 500px at 0% 110%, rgba(217, 119, 6, 0.05), transparent 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.main {
  flex: 1 0 auto;
  width: 100%;
  margin: 0 auto;
  max-width: var(--container);
  padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 3vw, 2.5rem) 4rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ====================================================================
   Site header
   ==================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__logo {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.brand:hover .brand__logo { transform: rotate(-3deg) scale(1.04); }
.brand__logo svg { width: 38px; height: 38px; }
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--brand) 30%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand__subtitle {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.primary-nav { margin-left: auto; }
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.nav-link:hover { color: var(--brand-strong); background: var(--brand-soft); }
.nav-link.is-active {
  color: var(--brand-strong);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(43, 108, 176, 0.2);
}
.nav-link .nav-icon { width: 18px; height: 18px; flex: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  gap: 4px;
  flex-direction: column;
}
.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  display: block;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
  }
  .primary-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .primary-nav ul { flex-direction: column; gap: 0.2rem; }
  .nav-link { width: 100%; }
}

/* ====================================================================
   Footer
   ==================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 1.5rem;
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
}
.site-footer__brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.site-footer__brand .brand__logo {
  width: 56px;
  height: 56px;
}
.site-footer__brand .brand__logo svg { width: 50px; height: 50px; }
.site-footer__brand p { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer__nav h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  color: var(--ink-mute);
}
.site-footer__nav ul { list-style: none; padding: 0; margin: 0; }
.site-footer__nav li {
  position: relative;
  padding-left: 0.95rem;
  margin: 0.35rem 0;
  font-size: 0.95rem;
}
.site-footer__nav li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  transform: rotate(45deg);
}
.site-footer__nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-footer__nav a:hover { color: var(--brand-strong); border-bottom-color: var(--brand); }
.site-footer__base {
  border-top: 1px solid var(--border);
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  text-align: center;
  color: var(--ink-mute);
}

/* ====================================================================
   Hero
   ==================================================================== */
.hero {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 3.5rem) 0 1.5rem;
}
.hero__logo {
  display: block;
  width: clamp(140px, 22vw, 220px);
  height: clamp(140px, 22vw, 220px);
  margin: 0 auto 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.hero__logo:hover { transform: translateY(-3px) scale(1.02); }
.hero__logo svg { width: 78%; height: 78%; }
.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero__title-line { display: block; }
.hero__title-accent {
  background: linear-gradient(95deg, var(--brand) 20%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tagline {
  max-width: 56ch;
  margin: 0 auto 2rem;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--ink-soft);
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
  min-width: 230px;
  text-align: left;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
  background: var(--surface-tinted);
}
.cta__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cta__icon svg { width: 26px; height: 26px; }
.cta--ingest .cta__icon { background: linear-gradient(135deg, #d9eaff, #d8f3df); }
.cta--transcribe .cta__icon { background: linear-gradient(135deg, #fde9c8, #d9eaff); }
.cta--pipeline .cta__icon { background: linear-gradient(135deg, #d8f3df, #fde9c8); }
.cta__text { display: flex; flex-direction: column; line-height: 1.15; }
.cta__title { font-weight: 700; color: var(--ink); }
.cta__sub { font-size: 0.85rem; color: var(--ink-mute); }

/* ====================================================================
   Intro and sections grid
   ==================================================================== */
.intro {
  margin: 2.5rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 2.25rem) clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
}
.intro h2 {
  margin-top: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  color: var(--brand-strong);
}
.intro__col p {
  max-width: 80ch;
}
.intro--secondary { background: transparent; border: none; box-shadow: none; padding: 0; }
.intro--secondary h2 { text-align: center; }

.topic-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.topic-list__group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
}
.topic-list__group h3 { margin: 0 0 0.6rem; }
.topic-list__group h3 a {
  color: var(--brand-strong);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.topic-list__group h3 a:hover { border-bottom-color: var(--accent); }
.topic-list__group ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.topic-list__group li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.35rem;
  margin: 0;
  border-top: 1px dashed var(--border);
}
.topic-list__group li:first-child { border-top: none; }
.topic-list__group li::before {
  content: "›";
  position: absolute;
  left: 0.15rem;
  top: 0.35rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.15s, color 0.15s;
}
.topic-list__group li:hover::before { transform: translateX(3px); color: var(--brand); }
.topic-list__group a {
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-block;
  font-size: 0.95rem;
}
.topic-list__group a:hover { color: var(--brand-strong); }

.sections__heading { text-align: center; font-size: clamp(1.4rem, 2.2vw, 1.85rem); margin: 2.5rem 0 1rem; }
.sections__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
}
.card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.card__icon svg { width: 36px; height: 36px; }
.card--ingest .card__icon { background: linear-gradient(135deg, #d9eaff, #d8f3df); }
.card--transcribe .card__icon { background: linear-gradient(135deg, #fde9c8, #d9eaff); }
.card--pipeline .card__icon { background: linear-gradient(135deg, #d8f3df, #fde9c8); }
.card__title { font-size: 1.2rem; margin: 0 0 0.5rem; color: var(--ink); }
.card__blurb { color: var(--ink-soft); margin: 0 0 1rem; }
.card__cta { color: var(--brand-strong); font-weight: 600; margin-top: auto; }

/* ====================================================================
   Content article
   ==================================================================== */
.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1180px) {
  .content {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
      "crumbs crumbs"
      "body related";
    column-gap: 2.5rem;
  }
  .breadcrumbs { grid-area: crumbs; }
  .content__body { grid-area: body; }
  .related { grid-area: related; position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; }
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-size: 0.92rem;
  color: var(--ink-mute);
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.6rem;
  color: var(--ink-mute);
}
.breadcrumbs a {
  color: var(--brand-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.breadcrumbs a:hover { border-bottom-color: var(--brand); }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); }

.content__body {
  max-width: 100%;
}
.content__body :is(p, ul, ol, table, blockquote, pre, .codeblock, .table-scroll, details, .mermaid) {
  max-width: var(--measure);
}
.content__body h1 {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(95deg, var(--brand) 25%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.content__body h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--brand-strong);
  position: relative;
  padding-bottom: 0.35rem;
}
.content__body h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.content__body h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.content__body h4 { font-size: 1.1rem; color: var(--ink); }
.content__body :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.content__body p { margin: 0.85rem 0; }
.content__body a {
  color: var(--brand-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--brand-soft);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.content__body a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.content__body ul, .content__body ol {
  padding-left: 0;
  margin: 1rem 0;
  list-style: none;
}
.content__body ul > li,
.content__body ol > li {
  position: relative;
  padding-left: 1.7rem;
  margin: 0.45rem 0;
  line-height: 1.6;
}
.content__body ul > li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.7em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--bg);
}
.content__body ol {
  counter-reset: ordered;
}
.content__body ol > li {
  counter-increment: ordered;
}
.content__body ol > li::before {
  content: counter(ordered);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 0.72rem var(--font-sans);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  letter-spacing: 0;
}
/* Nested lists keep a tighter, more subdued bullet */
.content__body li ul,
.content__body li ol { margin: 0.35rem 0 0.35rem; }
.content__body li ul > li::before {
  background: var(--ink-mute);
  width: 0.4rem;
  height: 0.4rem;
  top: 0.78em;
  border-radius: 999px;
  transform: none;
  box-shadow: none;
}
.content__body li ol > li::before {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
/* Task list items use native checkbox styling; bullet hidden */
.content__body li.task-list-item { padding-left: 0; }
.content__body li.task-list-item::before { content: none; }
/* Strong term inside list item — treat as a definition */
.content__body li > strong:first-child {
  color: var(--brand-strong);
}
.content__body blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-tinted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}

/* Header anchors */
.header-anchor {
  text-decoration: none;
  color: inherit;
  border-bottom: none;
}
.header-anchor:hover { color: var(--accent); }

/* Inline code */
.content__body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.08em 0.38em;
  border-radius: 4px;
  border: 0;
}

/* Code blocks */
.codeblock {
  position: relative;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.codeblock::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.55rem;
  left: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  opacity: 0.8;
}
.codeblock pre {
  margin: 0;
  padding: 2.1rem 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.55;
  background: var(--code-bg);
  color: var(--code-ink);
}
.codeblock pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  color: inherit;
}
.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  font: 600 0.76rem var(--font-sans);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--brand-strong); border-color: var(--brand); background: #fff; }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

/* PrismJS palette tuned to site colors */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7b7560; font-style: italic; }
.token.punctuation { color: #6b6b6b; }
.token.namespace { opacity: 0.7; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #b91c1c; }
.token.boolean, .token.number { color: #b45309; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #166534; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #1f4d80; background: transparent; }
.token.atrule, .token.attr-value, .token.keyword { color: #1d4ed8; }
.token.function, .token.class-name { color: #6b21a8; }
.token.regex, .token.important, .token.variable { color: #d97706; }

/* Tables */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 560px;
}
.table-scroll th, .table-scroll td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-scroll thead th {
  background: linear-gradient(90deg, var(--brand-soft), var(--surface-tinted));
  color: var(--brand-strong);
  font-weight: 700;
  border-bottom-color: var(--brand);
}
.table-scroll tbody tr:nth-child(2n) { background: var(--surface-soft); }
.table-scroll tbody tr:hover { background: var(--surface-tinted); }

/* Task list checkboxes */
.task-list-item {
  list-style: none;
  margin-left: -1.2rem;
  padding-left: 0;
}
.task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid var(--brand);
  border-radius: 4px;
  margin-right: 0.55em;
  vertical-align: -0.16em;
  cursor: pointer;
  background: #fff;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.task-list-item input[type="checkbox"]:hover { transform: scale(1.05); }
.task-list-item input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.task-list-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-list-item.is-checked {
  color: var(--ink-mute);
  text-decoration: line-through;
}

/* FAQ accordion */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0.6rem 0;
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.faq-item[open] { box-shadow: var(--shadow-sm); border-color: var(--brand-soft); }
.faq-item summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  list-style: none;
  position: relative;
  color: var(--brand-strong);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.18s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item > *:not(summary) { padding: 0 1.1rem; }
.faq-item > *:last-child { padding-bottom: 1rem; }

/* Mermaid */
.mermaid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  font-family: var(--font-sans);
  text-align: center;
}

/* Related sidebar */
.related {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}
.related h2 { font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--brand-strong); }
.related h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin: 1rem 0 0.4rem; }
.related__list { list-style: none; padding: 0; margin: 0; }
.related__list li {
  margin: 0;
  border-top: 1px solid var(--border);
}
.related__list li:first-child { border-top: none; }
.related__list a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.93rem;
  border-bottom: none;
  transition: color 0.15s, padding 0.15s;
}
.related__list a::before {
  content: "→";
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.15s;
}
.related__list a:hover {
  color: var(--brand-strong);
  padding-left: 0.25rem;
}
.related__list a:hover::before { transform: translateX(2px); }

/* KaTeX adjustments */
.katex { font-size: 1.05em; }
.katex-display {
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

/* Focus states */
:focus-visible {
  outline: 3px solid rgba(43, 108, 176, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Print */
@media print {
  .site-header, .site-footer, .related, .copy-btn { display: none; }
  .main { max-width: 100%; }
  a { color: #000; border-bottom: none; }
}
