/* =====================================================================
   grantautomation.org — main stylesheet
   Light, elegant, professional palette inspired by grant / compliance work.
   ===================================================================== */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --primary: #0f766e;
  --primary-soft: #ccfbf1;
  --primary-deep: #115e59;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --secondary: #4338ca;
  --secondary-soft: #e0e7ff;

  --code-bg: #f6f8fa;
  --code-ink: #1f2937;
  --inline-code-bg: #eef4f3;
  --inline-code-ink: #115e59;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.10);

  --header-h: 68px;
  --content-text-max: 78ch;
  --container-max: min(1400px, 92vw);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(15px, 0.5vw + 14px, 17px);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--primary-deep);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
a:hover, a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  z-index: 100;
}

.container { width: var(--container-max); margin-inline: auto; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-bottom: none;
  color: var(--ink);
  font-weight: 600;
}
.site-header__brand:hover { color: var(--primary); }

.site-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.site-header__brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.site-header__brand-tag { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

.site-header__toggle {
  margin-left: auto;
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
}
.site-header__toggle:hover { border-color: var(--primary); color: var(--primary); }
.site-header__toggle svg { width: 22px; height: 22px; }

.site-header__nav { margin-left: auto; }
.site-header__nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-header__nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-bottom: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-header__nav a svg { width: 18px; height: 18px; }
.site-header__nav a:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.site-header__nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-deep);
}
.site-header__nav a[aria-current="page"] svg { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 80px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--primary) 8%, transparent));
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-footer__name { font-weight: 700; margin: 0; }
.site-footer__desc { color: var(--muted); margin: 4px 0 0; font-size: 0.9rem; }

.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.site-footer__col h2 {
  font-size: 0.95rem;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.site-footer__col h2 a {
  border-bottom: none;
  color: var(--accent, var(--primary-deep));
}
.site-footer__col h2 a:hover { color: var(--accent); }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__col a {
  font-size: 0.93rem;
  color: var(--ink-soft);
  border-bottom: none;
}
.site-footer__col a:hover { color: var(--accent); }

.site-footer__legal { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- Main ---------- */

.site-main { min-height: 60vh; padding: 24px 0 48px; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs ol {
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs a { color: var(--muted); border-bottom: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: var(--border-strong); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Hero (home) ---------- */

.hero {
  padding: 56px 0 32px;
  background:
    radial-gradient(ellipse at 10% -20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%),
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero__inner { text-align: center; }
.hero__logo-row { display: flex; justify-content: center; margin-bottom: 24px; }
.hero__logo-row svg { width: clamp(120px, 18vw, 200px); height: auto; filter: drop-shadow(0 8px 24px rgba(15,23,42,.10)); }
.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw + .6rem, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 18px;
  max-width: 22ch;
  color: var(--ink);
}
.hero__title span {
  background: linear-gradient(120deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: clamp(1rem, 0.4vw + .95rem, 1.18rem);
  color: var(--ink-soft);
  max-width: 72ch;
  margin: 12px auto;
}

.cta-grid {
  margin-top: 36px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  text-align: left;
}
.cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 60%, var(--border));
  color: var(--ink);
}
.cta__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cta__icon svg { width: 24px; height: 24px; }
.cta__body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cta__label { font-weight: 700; }
.cta__desc { color: var(--muted); font-size: 0.9rem; }
.cta__arrow svg { width: 22px; height: 22px; color: var(--accent, var(--primary)); }

/* ---------- Section cards (home) ---------- */

.sections { padding: 56px 0 24px; }
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.section-lede {
  color: var(--ink-soft);
  max-width: 76ch;
  margin: 0 0 32px;
}

.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  opacity: .85;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.card__icon {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: var(--radius-sm);
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font-size: 1.2rem; }
.card h3 a { border-bottom: none; color: var(--ink); }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--ink-soft); margin: 0 0 16px; }
.card__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.card__list a {
  display: inline-flex;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--primary-deep);
  border-bottom: none;
}
.card__list a::before { content: "›"; color: var(--accent); }
.card__list a:hover { color: var(--accent); }

/* ---------- FAQ (accordions) ---------- */

.faq { padding: 24px 0 8px; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.faq__item:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.faq__item summary {
  list-style: none;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform .2s ease;
  line-height: 1;
}
.faq__item[open] summary::after { content: "−"; }
.faq__item > *:not(summary) { padding: 0 22px 18px; color: var(--ink-soft); }

/* ---------- Article (content pages) ---------- */

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding: 16px 0 40px;
  width: min(1600px, 94vw);
  margin-inline: auto;
}
.content-layout > .breadcrumbs { grid-column: 1 / -1; }

@media (min-width: 1100px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 48px);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.article__header { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 2vw + 1.3rem, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  background: linear-gradient(120deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.article__lede { color: var(--ink-soft); font-size: 1.06rem; margin: 0; max-width: var(--content-text-max); }

.article__body { max-width: 100%; }
.article__body > * { max-width: 100%; }

.article__body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1vw + 1.1rem, 1.75rem);
  margin: 40px 0 12px;
  scroll-margin-top: calc(var(--header-h) + 16px);
  color: var(--ink);
  border-bottom: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  padding-bottom: 6px;
}
.article__body h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1vw + 0.9rem, 1.35rem);
  margin: 28px 0 8px;
  scroll-margin-top: calc(var(--header-h) + 16px);
  color: var(--primary-deep);
}
.article__body h4 { margin: 22px 0 8px; color: var(--ink); }

.article__body p { margin: 0 0 14px; }

/* Lists */
.article__body ul,
.article__body ol {
  margin: 12px 0 18px;
  padding-left: 1.6em;
}
.article__body li { margin: 6px 0; line-height: 1.6; }
.article__body li::marker { color: var(--accent); font-weight: 700; }
.article__body ol > li::marker { color: var(--primary); font-weight: 700; }

/* Unordered list bullets — custom marker for better visual rhythm */
.article__body ul:not(.contains-task-list) {
  list-style: none;
  padding-left: 0;
}
.article__body ul:not(.contains-task-list) > li {
  position: relative;
  padding-left: 1.6em;
}
.article__body ul:not(.contains-task-list) > li::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: rotate(45deg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}

/* Nested unordered lists: lighter marker, slight indent */
.article__body ul:not(.contains-task-list) ul:not(.contains-task-list) {
  margin: 6px 0 6px;
}
.article__body ul:not(.contains-task-list) ul:not(.contains-task-list) > li::before {
  background: var(--secondary);
  width: 6px;
  height: 6px;
  top: 0.78em;
}

/* Ordered lists: styled numeric markers in a soft chip */
.article__body ol {
  list-style: none;
  counter-reset: ga-ol;
  padding-left: 0;
}
.article__body ol > li {
  counter-increment: ga-ol;
  position: relative;
  padding-left: 2.4em;
  min-height: 1.8em;
}
.article__body ol > li::before {
  content: counter(ga-ol);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.6em;
  height: 1.6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: 999px;
  line-height: 1;
}
.article__body ol ol > li::before {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Description lists */
.article__body dl { margin: 12px 0 18px; }
.article__body dt { font-weight: 700; color: var(--ink); margin-top: 10px; }
.article__body dd { margin: 2px 0 8px 1.2em; color: var(--ink-soft); }

.header-anchor {
  margin-left: 8px;
  opacity: 0;
  color: var(--accent);
  border-bottom: none;
  font-weight: 400;
  transition: opacity .15s ease;
}
.article__body h2:hover .header-anchor,
.article__body h3:hover .header-anchor,
.article__body h4:hover .header-anchor { opacity: 1; }

/* Inline code */
.article__body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--inline-code-bg);
  color: var(--inline-code-ink);
  padding: 0.06em 0.4em;
  border-radius: 5px;
  border: none;
}

/* Strong / em */
.article__body strong { color: var(--ink); }
.article__body em { color: var(--ink-soft); }

/* Blockquotes */
.article__body blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}

/* Tables */
.table-scroll {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table-scroll th, .table-scroll td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-scroll thead th {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-deep);
  font-weight: 700;
  position: sticky; top: 0;
}
.table-scroll tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-scroll tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }

/* Task list rendering */
.article__body ul.contains-task-list {
  list-style: none;
  padding-left: 0;
}
.article__body ul.contains-task-list ul.contains-task-list { padding-left: 1.2em; }
.article__body li.task-list-item {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
}
.article__body li.task-list-item::marker,
.article__body li.task-list-item::before { content: ""; }
.article__body li.task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin-top: 4px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  flex: 0 0 18px;
  transition: background .15s ease, border-color .15s ease;
}
.article__body li.task-list-item input[type="checkbox"]:hover { border-color: var(--primary); }
.article__body li.task-list-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: linear-gradient(45deg, transparent 45%, #fff 46%, #fff 52%, transparent 53%),
                    linear-gradient(-45deg, transparent 60%, #fff 61%, #fff 67%, transparent 68%);
  background-size: 100% 100%;
  background-position: center;
}
.article__body li.task-list-item.is-done > * { text-decoration: line-through; color: var(--muted); }
.article__body li.task-list-item.is-done input[type="checkbox"] { /* checked styling already applies */ }

/* Code blocks */
.code-block {
  margin: 20px 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-bottom: 1px solid var(--border);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-deep);
}
.code-block__copy {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.code-block__copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.code-block__copy.is-copied { background: var(--accent); color: #fff; border-color: var(--accent); }

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.code-block code { background: transparent; padding: 0; border-radius: 0; color: inherit; }

/* Prism token colors tuned to palette (light) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b7280; font-style: italic; }
.token.punctuation { color: #374151; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #b45309; }
.token.boolean, .token.number { color: #4338ca; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #0f766e; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.variable { color: #115e59; }
.token.atrule, .token.attr-value, .token.function, .token.class-name { color: #b45309; }
.token.keyword { color: #4338ca; font-weight: 600; }
.token.regex, .token.important { color: #b45309; }
.token.decorator, .token.annotation { color: #b45309; }

/* Mermaid containers */
.mermaid {
  margin: 24px 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow-x: auto;
}

/* Article body links */
.article__body a {
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
}
.article__body a:hover { border-bottom-color: var(--accent); }

/* Related sidebar */
.related {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow: auto;
}
.related h2 {
  font-size: 1rem;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { color: var(--ink-soft); border-bottom: none; font-size: 0.93rem; }
.related a:hover { color: var(--accent); }
.related__parent a { color: var(--primary-deep); font-weight: 600; }

@media (max-width: 1099px) {
  .related { position: static; max-height: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .site-header__toggle { display: inline-flex; }
  .site-header__nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    display: none;
  }
  .site-header__nav.is-open { display: block; }
  .site-header__nav ul { flex-direction: column; gap: 4px; }
  .site-header__nav a { width: 100%; }
  .site-header__brand-tag { display: none; }
}

@media print {
  .site-header, .site-footer, .breadcrumbs, .related, .code-block__copy { display: none; }
  .article { box-shadow: none; border: none; padding: 0; }
}

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