/* ============================================================
   Legal Document Redaction & Compliance Automation
   Theme: Watermelon Sorbet — light, elegant, professional
   ============================================================ */

/* ---- 1. Design tokens ------------------------------------- */
:root {
  /* Watermelon Sorbet palette */
  --melon-50: #fff7f4;
  --melon-100: #ffeef1;
  --melon-200: #ffdce4;
  --melon-300: #ffc1d1;
  --melon-400: #ff95b1;
  --pink: #f2547d;
  --pink-deep: #e0365f;
  --pink-ink: #b32453;
  --rind: #3da67e;
  --rind-light: #6fcf97;
  --rind-deep: #2f8765;
  --seed: #2d2a32;

  /* Surfaces & text */
  --bg: #fff9f7;
  --bg-tint: #fff1f3;
  --surface: #ffffff;
  --surface-2: #fff5f7;
  --ink: #2b2630;
  --muted: #6c6675;
  --border: #f6dde2;
  --border-strong: #f0c6d0;

  /* Accent set for colorful icons / CTAs */
  --c-pii: #f2547d;
  --c-arch: #6a5acd;
  --c-parse: #3da67e;

  /* Effects */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(176, 36, 83, 0.08);
  --shadow: 0 6px 22px rgba(176, 36, 83, 0.10);
  --shadow-lg: 0 18px 48px rgba(176, 36, 83, 0.16);
  --ring: 0 0 0 3px rgba(242, 84, 125, 0.30);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --maxw-site: 1700px;
  --maxw-content: var(--maxw-site); /* content page aligns with the app-bar/header width */
  --maxw-prose: 1280px;
  --header-h: 68px;
  --gutter: clamp(1rem, 4vw, 3rem);

  /* Type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Consolas,
    "Liberation Mono", Menlo, monospace;
}

/* ---- 2. Reset & base -------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, #fff 40%, var(--bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--pink-ink);
  text-decoration-color: var(--melon-300);
  text-underline-offset: 0.18em;
  transition: color var(--transition), text-decoration-color var(--transition);
}
a:hover {
  color: var(--pink-deep);
  text-decoration-color: var(--pink);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* ---- 3. Layout helpers ------------------------------------ */
.container {
  width: 100%;
  max-width: var(--maxw-site);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 200;
  background: var(--pink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}
.skip-link:focus {
  top: 0.5rem;
  color: #fff;
}
main {
  flex: 1 0 auto;
  width: 100%;
}

/* ---- 4. Header -------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 247, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover {
  color: var(--pink-deep);
}
.brand__logo {
  width: 38px;
  height: 38px;
  flex: none;
  transition: transform var(--transition);
}
.brand:hover .brand__logo {
  transform: rotate(-6deg) scale(1.06);
}
.brand__text strong {
  display: block;
  line-height: 1.05;
}
.brand__text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav__list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
    transform var(--transition);
}
.nav__link svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent, var(--pink));
}
.nav__link:hover {
  background: var(--melon-100);
  color: var(--pink-deep);
  transform: translateY(-1px);
}
.nav__link[aria-current="page"] {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.nav__link[aria-current="page"] svg {
  color: #fff;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--pink-deep);
  cursor: pointer;
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    position: absolute;
    inset: var(--header-h) 0 auto 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem var(--gutter) 1rem;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }
  .nav__link {
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
  }
}

/* ---- 5. Footer -------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  margin-top: 4rem;
  background: linear-gradient(180deg, var(--bg-tint), var(--melon-100));
  border-top: 1px solid var(--border);
}
.site-footer__inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.4fr 1fr;
  padding-block: 2.75rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 42ch;
}
.footer-brand__head {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
}
.footer-brand img {
  width: 34px;
  height: 34px;
}
.footer-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-nav {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}
.footer-nav h2 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink-ink);
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.footer-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.footer-nav a:hover {
  color: var(--pink-deep);
  padding-left: 4px;
}
.site-footer__base {
  border-top: 1px solid var(--border);
  padding-block: 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  justify-content: space-between;
}
@media (max-width: 680px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* ---- 6. Buttons & pills ----------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn--primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn--ghost {
  background: var(--surface);
  color: var(--pink-ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover {
  color: var(--pink-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn--section {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn--section .btn__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent, var(--pink)) 16%, #fff);
  color: var(--accent, var(--pink));
}
.btn--section .btn__chip svg {
  width: 18px;
  height: 18px;
}
.btn--section:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent, var(--pink));
}

/* ---- 7. Home / hero --------------------------------------- */
.hero {
  text-align: center;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem);
}
.hero__logo {
  width: clamp(120px, 18vw, 188px);
  height: auto;
  display: block;
  margin: 0 auto 1.75rem;
  filter: drop-shadow(0 14px 30px rgba(176, 36, 83, 0.22));
  transition: transform var(--transition);
}
.hero__logo:hover {
  transform: translateY(-4px) rotate(-3deg);
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem);
  line-height: 1.08;
  margin: 0 auto 1rem;
  max-width: 18ch;
  background: linear-gradient(120deg, var(--pink-deep), var(--pink) 55%, var(--rind));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 auto 2rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

.home-section {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}
.home-section__head {
  max-width: 70ch;
  margin-bottom: 1.75rem;
}
.home-section__head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem);
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.home-section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.prose-block {
  max-width: var(--maxw-prose);
  display: grid;
  gap: 1.1rem;
  font-size: 1.07rem;
}

/* Pillar cards */
.card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent, var(--pink)), var(--rind-light));
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  color: var(--ink);
}
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent, var(--pink)) 16%, #fff);
  color: var(--accent, var(--pink));
}
.card__icon svg {
  width: 28px;
  height: 28px;
}
.card h3 {
  font-family: var(--font-head);
  font-size: 1.28rem;
  margin: 0;
  color: var(--ink);
}
.card__title-link {
  color: var(--ink);
  text-decoration: none;
}
/* Stretched link makes the whole card clickable to the pillar,
   while sub-links sit above it (z-index) and stay independently clickable. */
.card__title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card:hover .card__title-link {
  color: var(--accent, var(--pink-deep));
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}
.card__more {
  margin-top: auto;
  font-weight: 700;
  color: var(--accent, var(--pink-deep));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.card__more svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.card:hover .card__more {
  gap: 0.6rem;
}
/* Keep sub-links and the explicit CTA above the stretched overlay. */
.subpage-links,
.card__more {
  position: relative;
  z-index: 2;
}
.subpage-links {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.subpage-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- 8. Content layout ------------------------------------ */
.content-wrap {
  max-width: var(--maxw-content);
  margin-inline: auto;
  padding-block: 1.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 1080px) {
  .content-wrap {
    grid-template-columns: 1fr;
  }
}
.article {
  min-width: 0;
}
.article > * {
  max-width: var(--maxw-prose);
}
.article > .table-scroll,
.article > pre,
.article > .full-bleed {
  max-width: 100%;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
/* Breadcrumb is a direct grid child of .content-wrap — span the full
   content width so it aligns with the app-bar/header, not just the
   narrower article column. */
.content-wrap > .breadcrumbs {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  color: var(--border-strong);
}
.breadcrumbs a {
  text-decoration: none;
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--pink-deep);
}
.breadcrumbs [aria-current="page"] {
  color: var(--pink-ink);
  font-weight: 600;
}

/* Article typography */
.article h1.page-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.12;
  margin: 0.2rem 0 1.4rem;
  background: linear-gradient(120deg, var(--pink-deep), var(--pink) 60%, var(--rind-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article h2,
.article h3,
.article h4 {
  font-family: var(--font-head);
  line-height: 1.22;
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
  color: var(--ink);
}
.article h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.85rem);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.article h2::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--pink), var(--rind));
  vertical-align: middle;
}
.article h3 {
  font-size: clamp(1.18rem, 1.05rem + 0.6vw, 1.4rem);
  margin: 1.8rem 0 0.7rem;
  color: var(--pink-ink);
}
.article h4 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.6rem;
}
.article p {
  margin: 0 0 1.15rem;
}
.article ul,
.article ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
}
.article li {
  margin-bottom: 0.45rem;
}
.article li::marker {
  color: var(--pink);
}
.article strong {
  color: var(--ink);
  font-weight: 700;
}

/* Header anchor */
.header-anchor {
  margin-left: 0.4rem;
  font-weight: 400;
  color: var(--border-strong);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor {
  opacity: 1;
}
.header-anchor:hover {
  color: var(--pink);
}

/* In-content links */
.article a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

/* ---- 9. Inline code & code blocks ------------------------- */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  color: var(--pink-ink);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: none;
  white-space: nowrap;
}
.code-block {
  position: relative;
  margin: 0 0 1.4rem;
}
.code-block pre[class*="language-"],
.article > pre[class*="language-"] {
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: #fff8f5;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  tab-size: 4;
}
.code-block pre code,
pre[class*="language-"] code {
  font-family: inherit;
  background: none;
  color: inherit;
  white-space: pre;
  border: none;
  padding: 0;
}
.code-copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--pink-ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition),
    color var(--transition), transform var(--transition);
}
.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}
.code-copy svg {
  width: 14px;
  height: 14px;
}
.code-copy:hover {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}
.code-copy[data-copied="true"] {
  background: var(--rind);
  color: #fff;
  border-color: var(--rind);
  opacity: 1;
}

/* Prism token theme — light, watermelon-tuned */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #9a93a6;
  font-style: italic;
}
.token.punctuation {
  color: #8a8494;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--pink-deep);
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--rind-deep);
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #b3623a;
}
.token.atrule,
.token.attr-value,
.token.keyword {
  color: #7a4dd1;
}
.token.function,
.token.class-name {
  color: #c2356b;
}
.token.regex,
.token.important,
.token.variable {
  color: #b3623a;
}

/* ---- 10. Tables ------------------------------------------- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
  font-size: 0.94rem;
}
.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(135deg, var(--melon-100), var(--melon-200));
  color: var(--pink-ink);
  font-weight: 700;
  white-space: nowrap;
}
.table-scroll tbody tr:nth-child(even) {
  background: var(--surface-2);
}
.table-scroll tbody tr:hover {
  background: var(--melon-100);
}
.table-scroll td code {
  white-space: normal;
}

/* ---- 11. Task-list checkboxes ----------------------------- */
.contains-task-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.55rem;
}
.task-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition);
}
.task-list-item::marker {
  content: "";
}
.task-list-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.task-list-item input[type="checkbox"]::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  transform: scale(0);
  transform-origin: center;
  transition: transform var(--transition);
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 84% 0, 39% 70%);
  background: #fff;
}
.task-list-item input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--rind-light), var(--rind));
  border-color: var(--rind-deep);
}
.task-list-item input[type="checkbox"]:checked::before {
  transform: scale(1);
}
.task-list-item input[type="checkbox"]:hover {
  border-color: var(--pink);
}
.task-list-item label,
.task-list-item > input + * {
  cursor: pointer;
  transition: color var(--transition);
}
.task-list-item.is-checked label,
.task-list-item.is-checked {
  text-decoration: line-through;
  text-decoration-color: var(--rind);
  color: var(--muted);
}

/* ---- 12. FAQ accordions ----------------------------------- */
.faq {
  margin: 0 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--pink-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq > summary::-webkit-details-marker {
  display: none;
}
.faq > summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--pink);
  transition: transform var(--transition);
}
.faq[open] > summary::after {
  transform: rotate(45deg);
}
.faq__body {
  padding: 0 1.2rem 1.1rem;
  color: var(--ink);
}

/* ---- 13. Aside / on-page TOC ------------------------------ */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow: auto;
}
.toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink-ink);
  margin: 0 0 0.7rem;
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.toc a {
  text-decoration: none;
  color: var(--muted);
  display: block;
  padding: 0.15rem 0.55rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
}
.toc a:hover,
.toc a.is-active {
  color: var(--pink-deep);
  border-left-color: var(--pink);
  background: var(--surface-2);
}
.toc li.lvl-3 a {
  padding-left: 1.3rem;
  font-size: 0.85rem;
}
@media (max-width: 1080px) {
  .toc {
    display: none;
  }
}

/* ---- 14. Related links / page nav ------------------------- */
.related {
  margin-top: 2.5rem;
  padding-top: 1.6rem;
  border-top: 2px solid var(--border);
}
.related h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.related__grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.related__card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.related__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  color: var(--ink);
}
.related__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
  font-weight: 700;
}
.related__card strong {
  font-size: 1.02rem;
}
.related__card span.desc {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---- 15. Mermaid + KaTeX theming -------------------------- */
pre.mermaid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.4rem;
}

/* ---- 16. Section landing intro ---------------------------- */
.section-intro {
  margin-bottom: 1.5rem;
}
.section-lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 70ch;
}

/* ---- 16b. Diagrams / visualizations ----------------------- */
:root {
  --d-go: #2f8765;     /* approve / proceed (rind) */
  --d-review: #c8821f; /* human review (amber) */
  --d-hold: #d8456f;   /* hold / quarantine (pink) */
  --d-drop: #8a8494;   /* drop / noise (muted) */
  --d-ml: #6a5acd;     /* secondary ML (indigo) */
  --d-cross: #2e9a9a;  /* cross-border (teal) */
}
.diagram {
  margin: 1.9rem 0;
  padding: 1.5rem 1.5rem 1.1rem;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}
.diagram > figcaption {
  margin-top: 1.1rem;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}
.diagram > figcaption strong {
  color: var(--pink-ink);
}

/* Linear process flow */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
}
.flow-step {
  flex: 1 1 150px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--c, var(--pink));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.flow-step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.flow-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--c, var(--pink));
}
.flow-step__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.2;
}
.flow-step__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
/* connector chevron (desktop: pointing right between steps) */
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.52rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid var(--pink);
  border-right: 2px solid var(--pink);
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}
@media (max-width: 760px) {
  .flow {
    flex-direction: column;
  }
  .flow-step:not(:last-child)::after {
    right: 50%;
    top: auto;
    bottom: -0.5rem;
    transform: translateX(50%) rotate(135deg);
  }
}

/* Branch / decision diagram */
.decision {
  display: grid;
  gap: 1.4rem;
  justify-items: center;
}
.decision__node {
  position: relative;
  text-align: center;
  padding: 0.85rem 1.4rem;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  border-radius: var(--radius);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.decision__node span {
  display: block;
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.92;
}
.decision__node::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1.05rem;
  width: 2px;
  height: 1.05rem;
  background: var(--border-strong);
  transform: translateX(-50%);
}
.decision__branches {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.branch {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--pink));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.branch:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.branch .cond {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c, var(--pink-ink));
}
.branch strong {
  font-size: 0.98rem;
  color: var(--ink);
}
.branch .note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Feedback-loop banner (e.g. human-in-the-loop) */
.flow-loop {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  font-size: 0.86rem;
  color: var(--rind-deep);
  background: color-mix(in srgb, var(--rind) 10%, #fff);
  border: 1px dashed var(--rind);
  border-radius: var(--radius);
}
.flow-loop::before {
  content: "\21BA"; /* ↺ */
  font-size: 1.2rem;
  line-height: 1;
  color: var(--rind-deep);
}

/* ---- 17. Misc --------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
