/* Psychopathia Machinalis — shared design system (2026-09-19).
 *
 * Loaded LAST on every page. One palette, one type system, one card, one
 * button hierarchy, one section rhythm. Where an older layer
 * (main_free.css, clarity.css, psychopathia-styles.css, per-page <style>)
 * disagrees, this file wins by load order at equal specificity and by
 * matched specificity elsewhere. !important appears only where the legacy
 * rule it replaces already used it.
 *
 * Palette: ink navy for structure, slate for secondary ink, brass for rules
 * and icons (never as body text on white: it fails AA), paper surfaces on a
 * cool canvas. Type: Poppins for every interface surface; Charter only inside
 * long-form reading prose (framework body, pattern clinical entries).
 */

:root {
  --pm-ink: #0f1c2e;
  --pm-ink-2: #1b2d44;
  --pm-primary: #21354d;
  --pm-slate: #46617d;
  --pm-slate-2: #5b7085;
  --pm-brass: #b8862b;
  --pm-brass-text: #7d5a17;
  --pm-brass-soft: rgba(184, 134, 43, 0.14);
  --pm-brass-line: rgba(184, 134, 43, 0.45);
  --pm-brass-ink: #7d5a17;

  --pm-canvas: #f4f6f9;
  --pm-surface: #ffffff;
  --pm-surface-dim: #f8fafc;
  --pm-border: #e2e8ef;
  --pm-border-strong: #c9d3dd;

  --pm-text: #1c2a3a;
  --pm-text-2: #3f4f61;
  --pm-text-muted: #55657a;
  --pm-on-ink: #f3f6fa;
  --pm-on-ink-2: rgba(243, 246, 250, 0.76);

  --pm-shadow-1: 0 1px 2px rgba(15, 28, 46, 0.05), 0 8px 24px -16px rgba(15, 28, 46, 0.25);
  --pm-shadow-2: 0 2px 4px rgba(15, 28, 46, 0.06), 0 18px 40px -18px rgba(15, 28, 46, 0.32);
  --pm-shadow-3: 0 12px 40px -12px rgba(15, 28, 46, 0.45);

  --pm-radius: 16px;
  --pm-radius-sm: 10px;
  --pm-radius-pill: 999px;

  --pm-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pm-font-read: 'Charter', Georgia, 'Times New Roman', serif;
  --pm-font-mono: 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --pm-measure: 68rem;
  --pm-section: clamp(56px, 8vw, 96px);
  --pm-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --pm-nav-h: 64px;
  --pm-z-nav: 1100;

  /* Legacy token bridge: the older layers read these. */
  --color-primary: var(--pm-primary);
  --color-primary-light: var(--pm-slate);
  --color-primary-dark: var(--pm-ink);
  --color-accent: var(--pm-slate);
  --color-surface: var(--pm-surface);
  --color-surface-dim: var(--pm-surface-dim);
  --color-border: var(--pm-border);
  --color-text: var(--pm-text);
  --color-text-secondary: var(--pm-text-2);
  --color-text-muted: var(--pm-text-muted);
  --shadow-sm: var(--pm-shadow-1);
  --shadow-md: var(--pm-shadow-1);
  --shadow-lg: var(--pm-shadow-2);
  --shadow-xl: var(--pm-shadow-3);
  --shadow-glow: 0 0 0 3px rgba(33, 53, 77, 0.12);
  --radius-md: var(--pm-radius-sm);
  --radius-lg: var(--pm-radius);
  --nav-primary: var(--pm-ink);
  --nav-primary-2: var(--pm-ink-2);
  --nav-accent: var(--pm-brass);
  --nav-accent-hover: #d6a94a;
}

html.dark {
  --pm-ink: #070d16;
  --pm-ink-2: #0d1726;
  --pm-primary: #c9dcee;
  --pm-slate: #a9c4de;
  --pm-slate-2: #8ea9c3;
  --pm-brass: #d4a955;
  --pm-brass-text: #e2be6f;
  --pm-brass-soft: rgba(212, 169, 85, 0.16);
  --pm-brass-line: rgba(212, 169, 85, 0.5);
  --pm-brass-ink: #e2be6f;

  --pm-canvas: #0b1420;
  --pm-surface: #121f30;
  --pm-surface-dim: #0e1926;
  --pm-border: #26384c;
  --pm-border-strong: #3a4f66;

  --pm-text: #e6ecf2;
  --pm-text-2: #c3cfdb;
  --pm-text-muted: #9fb0c1;
  --pm-on-ink: #eef3f8;
  --pm-on-ink-2: rgba(238, 243, 248, 0.72);

  --pm-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --pm-shadow-2: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  --pm-shadow-3: 0 12px 40px -12px rgba(0, 0, 0, 0.8);

  --color-primary: var(--pm-primary);
  --color-primary-light: var(--pm-slate);
  --color-primary-dark: var(--pm-ink);
  --color-accent: var(--pm-slate);
  --color-surface: var(--pm-surface);
  --color-surface-dim: var(--pm-surface-dim);
  --color-border: var(--pm-border);
  --color-text: var(--pm-text);
  --color-text-secondary: var(--pm-text-2);
  --color-text-muted: var(--pm-text-muted);
  --dm-bg: var(--pm-canvas);
  --dm-surface: var(--pm-surface);
  --dm-surface-dim: var(--pm-surface-dim);
  --dm-text: var(--pm-text);
  --dm-text-secondary: var(--pm-text-2);
  --dm-text-muted: var(--pm-text-muted);
  --dm-border: var(--pm-border);
  --dm-accent: var(--pm-slate);
  --shadow-glow: 0 0 0 3px rgba(169, 196, 222, 0.22);
}

/* ------------------------------------------------------------------ */
/* 1. Base                                                            */
/* ------------------------------------------------------------------ */

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--pm-surface);
  color: var(--pm-text);
  font-family: var(--pm-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.dark,
html.dark body { background: var(--pm-canvas); color: var(--pm-text); }

::selection { background: rgba(184, 134, 43, 0.28); color: inherit; }
html.dark ::selection { background: rgba(212, 169, 85, 0.35); }

body h1, body h2, body h3, body h4, body h5, body h6 {
  font-family: var(--pm-font);
  color: var(--pm-text);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
html.dark body h1, html.dark body h2, html.dark body h3,
html.dark body h4, html.dark body h5, html.dark body h6 { color: var(--pm-text); }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--pm-slate);
  outline-offset: 2px;
}
html.dark a:focus-visible, html.dark button:focus-visible, html.dark [tabindex]:focus-visible { outline-color: var(--pm-brass); }

/* Shared type primitives */
.pm-eyebrow, body p.pm-eyebrow, body .container p.pm-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--pm-brass-text);
  font-family: var(--pm-font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pm-section-title {
  margin: 0 0 0.6rem;
  font-family: var(--pm-font);
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pm-lede {
  margin: 0 0 1.75rem;
  max-width: 44rem;
  color: var(--pm-text-2);
  font-family: var(--pm-font);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ */
/* 2. Buttons — one primary, one secondary, one text link with arrow  */
/* ------------------------------------------------------------------ */

.pm-btn,
a.pm-btn,
button.pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 46px;
  padding: 0.6rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--pm-radius-sm);
  background: var(--pm-primary);
  color: #fff !important;
  font-family: var(--pm-font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.2;
  text-decoration: none !important;
  text-transform: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.12), 0 6px 16px -10px rgba(15, 28, 46, 0.5);
  transition: background 0.18s var(--pm-ease), border-color 0.18s var(--pm-ease), transform 0.18s var(--pm-ease), box-shadow 0.18s var(--pm-ease), color 0.18s var(--pm-ease);
}
.pm-btn:hover, a.pm-btn:hover { background: var(--pm-ink); color: #fff !important; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 28, 46, 0.14), 0 12px 24px -12px rgba(15, 28, 46, 0.6); }
.pm-btn:active, a.pm-btn:active { transform: translateY(0); }
.pm-btn i, .pm-btn svg { font-size: 0.85em; }
.pm-btn .pm-btn__arrow { transition: transform 0.18s var(--pm-ease); }
.pm-btn:hover .pm-btn__arrow { transform: translateX(3px); }

.pm-btn.pm-btn--secondary, a.pm-btn.pm-btn--secondary, button.pm-btn.pm-btn--secondary {
  background: var(--pm-surface);
  border-color: var(--pm-border-strong);
  color: var(--pm-primary) !important;
  box-shadow: none;
}
.pm-btn.pm-btn--secondary:hover, a.pm-btn.pm-btn--secondary:hover, button.pm-btn.pm-btn--secondary:hover { background: var(--pm-surface-dim); border-color: var(--pm-slate); color: var(--pm-ink) !important; box-shadow: none; }

/* On ink backgrounds (hero, dark bands) */
.pm-btn.pm-btn--light, a.pm-btn.pm-btn--light, button.pm-btn.pm-btn--light { background: #fff; color: var(--pm-ink) !important; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6); }
.pm-btn.pm-btn--light:hover, a.pm-btn.pm-btn--light:hover, button.pm-btn.pm-btn--light:hover { background: #f1f4f8; color: var(--pm-ink) !important; }
.pm-btn.pm-btn--outline, a.pm-btn.pm-btn--outline, button.pm-btn.pm-btn--outline { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.28); color: #fff !important; box-shadow: none; backdrop-filter: blur(6px); }
.pm-btn.pm-btn--outline:hover, a.pm-btn.pm-btn--outline:hover, button.pm-btn.pm-btn--outline:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.5); color: #fff !important; box-shadow: none; }
.pm-btn.pm-btn--brass, a.pm-btn.pm-btn--brass, button.pm-btn.pm-btn--brass { background: var(--pm-brass); color: var(--pm-ink) !important; }
.pm-btn.pm-btn--brass:hover, a.pm-btn.pm-btn--brass:hover, button.pm-btn.pm-btn--brass:hover { background: #d6a94a; color: var(--pm-ink) !important; }

html.dark .pm-btn, html.dark a.pm-btn { background: var(--pm-slate); color: var(--pm-ink) !important; }
html.dark .pm-btn:hover, html.dark a.pm-btn:hover { background: #c9dcee; color: var(--pm-ink) !important; }
html.dark .pm-btn.pm-btn--secondary, html.dark a.pm-btn.pm-btn--secondary, html.dark button.pm-btn.pm-btn--secondary { background: var(--pm-surface); border-color: var(--pm-border-strong); color: var(--pm-primary) !important; }
html.dark .pm-btn.pm-btn--secondary:hover, html.dark a.pm-btn.pm-btn--secondary:hover, html.dark button.pm-btn.pm-btn--secondary:hover { background: #1a2a3e; border-color: var(--pm-slate); color: var(--pm-primary) !important; }
html.dark .pm-btn.pm-btn--light, html.dark a.pm-btn.pm-btn--light, html.dark button.pm-btn.pm-btn--light { background: #eef3f8; color: var(--pm-ink) !important; }
html.dark .pm-btn.pm-btn--outline, html.dark a.pm-btn.pm-btn--outline, html.dark button.pm-btn.pm-btn--outline { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.28); color: #fff !important; }
html.dark .pm-btn.pm-btn--outline:hover, html.dark a.pm-btn.pm-btn--outline:hover, html.dark button.pm-btn.pm-btn--outline:hover { background: rgba(255, 255, 255, 0.14); color: #fff !important; }
html.dark .pm-btn.pm-btn--brass, html.dark a.pm-btn.pm-btn--brass, html.dark button.pm-btn.pm-btn--brass { background: var(--pm-brass); color: #0b1420 !important; }

.pm-link {
  color: var(--pm-primary);
  font-family: var(--pm-font);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--pm-brass-line);
  transition: border-color 0.15s var(--pm-ease), color 0.15s var(--pm-ease);
}
.pm-link:hover { color: var(--pm-ink); border-bottom-color: var(--pm-brass); }
html.dark .pm-link { color: var(--pm-primary); }
html.dark .pm-link:hover { color: #fff; }

/* The legacy `.button` class, wherever it still appears, takes the secondary look. */
body a.button, body .button {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 46px;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--pm-border-strong);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface);
  color: var(--pm-primary);
  font-family: var(--pm-font);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.18s var(--pm-ease), border-color 0.18s var(--pm-ease), color 0.18s var(--pm-ease);
}
body a.button:hover, body .button:hover { background: var(--pm-surface-dim); border-color: var(--pm-slate); color: var(--pm-ink); transform: none; box-shadow: none; }
body a.button i, body .button i { color: var(--pm-brass-text); font-size: 0.85em; }
html.dark body a.button, html.dark body .button { background: var(--pm-surface); border-color: var(--pm-border-strong); color: var(--pm-primary); }
html.dark body a.button:hover, html.dark body .button:hover { background: #1a2a3e; color: #fff; }

/* Chips */
.pm-chip,
.section-links a,
.related-list a,
.mcp-toc a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-pill);
  background: var(--pm-surface);
  color: var(--pm-text-2);
  font-family: var(--pm-font);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s var(--pm-ease), background 0.15s var(--pm-ease), color 0.15s var(--pm-ease);
}
.pm-chip:hover, .section-links a:hover, .related-list a:hover, .mcp-toc a:hover { border-color: var(--pm-slate); background: var(--pm-surface-dim); color: var(--pm-ink); text-decoration: none; }
html.dark .pm-chip, html.dark .section-links a, html.dark .related-list a, html.dark .mcp-toc a { background: var(--pm-surface); border-color: var(--pm-border); color: var(--pm-text-2); }
html.dark .pm-chip:hover, html.dark .section-links a:hover, html.dark .related-list a:hover, html.dark .mcp-toc a:hover { background: #1a2a3e; border-color: var(--pm-slate); color: #fff; }

/* ------------------------------------------------------------------ */
/* 3. Site navigation                                                 */
/* ------------------------------------------------------------------ */

.site-nav {
  box-sizing: border-box;
  height: var(--pm-nav-h);
  z-index: var(--pm-z-nav);
  padding: 0 clamp(18px, 3vw, 40px);
  background: rgba(15, 28, 46, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -20px rgba(0, 0, 0, 0.6);
  font-family: var(--pm-font);
}
html.dark .site-nav { background: rgba(7, 13, 22, 0.9); }
.site-nav .nav-brand { font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.site-nav .nav-brand .nav-icon { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.site-nav .nav-links { gap: 2px; }
.site-nav .nav-link {
  padding: 8px 13px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.site-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); transform: none; }
.site-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.1); }
.site-nav .nav-link.active::after { left: 13px; right: 13px; bottom: 5px; height: 2px; background: var(--pm-brass); }
.site-nav .nav-toggle { font-size: 24px; border-radius: 8px; }
html { scroll-padding-top: calc(var(--pm-nav-h) + 12px); }
.has-site-nav { padding-top: var(--pm-nav-h); }
@media (max-width: 769px) {
  .site-nav .nav-links { top: var(--pm-nav-h); padding: 12px 16px 16px; background: rgba(15, 28, 46, 0.97); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .site-nav .nav-link { padding: 12px; font-size: 16px; }
}

.reading-progress { height: 3px; background: var(--pm-brass); z-index: 1200; }

/* ------------------------------------------------------------------ */
/* 4. Floating controls                                               */
/* ------------------------------------------------------------------ */

.dark-mode-toggle, .back-to-top {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  right: 22px;
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
  color: var(--pm-primary);
  box-shadow: var(--pm-shadow-2);
}
.dark-mode-toggle { bottom: 22px; font-size: 16px; border-radius: 50%; cursor: pointer; z-index: 9999; }
/* Pages without Font Awesome use text glyphs for the toggle. */
.dark-mode-toggle .icon-moon, .dark-mode-toggle .icon-sun { font-size: 20px; line-height: 1; }
.dark-mode-toggle .icon-sun { display: none; }
html.dark .dark-mode-toggle .icon-moon { display: none; }
html.dark .dark-mode-toggle .icon-sun { display: block; }
.back-to-top { bottom: 76px; border-radius: 50%; cursor: pointer; z-index: 9998; overflow: hidden; }
.dark-mode-toggle:hover { transform: translateY(-1px) !important; box-shadow: var(--pm-shadow-2); }
.back-to-top svg circle { stroke: var(--pm-brass); }
html.dark .dark-mode-toggle, html.dark .back-to-top { background: var(--pm-surface); border-color: var(--pm-border-strong); color: var(--pm-brass); }
html.dark .back-to-top .arrow-icon { color: var(--pm-brass); }

/* ------------------------------------------------------------------ */
/* 5. Site footer                                                     */
/* ------------------------------------------------------------------ */

.site-footer {
  margin-top: 0;
  padding: clamp(40px, 5vw, 60px) 0 clamp(32px, 4vw, 44px);
  background: var(--pm-ink);
  color: var(--pm-on-ink-2);
  font-family: var(--pm-font);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
body .site-footer, body footer.site-footer { background: var(--pm-ink) !important; }
html.dark body .site-footer, html.dark body footer.site-footer { background: #05090f !important; }
.site-footer__inner { max-width: var(--pm-measure); margin: 0 auto; padding: 0 24px; text-align: center; }
.site-footer p, .site-footer__text, .site-footer__subtitle { color: var(--pm-on-ink-2); font-family: var(--pm-font); font-style: normal; line-height: 1.6; }
.site-footer__text { margin: 0 0 0.4rem; color: var(--pm-on-ink); font-size: 0.95rem; font-weight: 500; }
.site-footer__subtitle { margin: 0; font-size: 0.85rem; }
.site-footer__link { color: var(--pm-on-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--pm-brass-line); transition: color 0.15s var(--pm-ease), text-decoration-color 0.15s var(--pm-ease); }
.site-footer__link:hover { color: #fff; text-decoration-color: var(--pm-brass); }
.site-footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.25rem; margin: 1.4rem auto 0; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); max-width: 40rem; font-size: 0.86rem; }
.site-footer__nav .site-footer__link { padding: 0.25rem 0.55rem; border-radius: 6px; color: var(--pm-on-ink-2); text-decoration: none; }
.site-footer__nav .site-footer__link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.site-footer__dot { color: rgba(255, 255, 255, 0.25); }

/* ------------------------------------------------------------------ */
/* 6. Reading column and section rhythm (Clarity pages)               */
/* ------------------------------------------------------------------ */

.section-divider { display: none; }

body.landing div.container.blog.main,
body.pattern-page-body div.container.blog.main { padding-top: var(--pm-section); padding-bottom: var(--pm-section); }
body.landing div.container.blog.main.gray,
body.pattern-page-body div.container.blog.main.gray,
body.has-side-rails div.container.blog.main.gray,
div.container.blog.gray {
  background: var(--pm-canvas);
  border-top: 1px solid var(--pm-border);
  border-bottom: 1px solid var(--pm-border);
}
div.container.blog.gray + div.container.blog.gray { border-top: 0; }
html.dark div.container.blog.gray, html.dark .container.blog.main.gray { background: var(--pm-surface-dim); border-color: var(--pm-border); }

body.landing .container.blog h2,
body.pattern-page-body .container.blog h2 {
  margin: 0 0 0.6rem;
  padding: 0;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
body.landing .container.blog p.text {
  padding: 0;
  margin: 0 0 1.1rem;
  max-width: 46rem;
  hyphens: manual;
  font-family: var(--pm-font);
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--pm-text-2);
}
body.landing .container.blog p.text:last-child { margin-bottom: 0; }
body.landing #understanding-ai-behavioral-anomalies p.text:first-of-type::first-letter { float: none; font-size: inherit; padding: 0; font-weight: inherit; color: inherit; }
html.dark body.landing .container.blog p.text { color: var(--pm-text-2); }
body.landing .container.blog h2 + p.text { margin-bottom: 1.6rem; }

/* ------------------------------------------------------------------ */
/* 7. Landing hero                                                    */
/* ------------------------------------------------------------------ */

body.landing div.container.blog#first-content.hero-container {
  position: relative;
  padding-top: clamp(56px, 8vw, 96px) !important;
  padding-bottom: clamp(48px, 7vw, 88px);
  background:
    radial-gradient(60% 70% at 88% 8%, rgba(184, 134, 43, 0.18), transparent 60%),
    radial-gradient(50% 60% at 10% 100%, rgba(70, 97, 125, 0.35), transparent 60%),
    linear-gradient(165deg, #0f1c2e 0%, #17293f 55%, #1d3350 100%);
  overflow: hidden;
  isolation: isolate;
}
body.landing div.container.blog#first-content.hero-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(75% 80% at 50% 40%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 80% at 50% 40%, #000 20%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
body.landing div.container.blog#first-content div.blog-title { position: relative; z-index: 1; padding-top: 0 !important; column-gap: clamp(32px, 5vw, 72px); align-items: center; }
@media screen and (min-width: 770px) {
  body.landing div.container.blog#first-content div.blog-title { grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr); }
}
body.landing div.container.blog#first-content div.blog-title .blog-intro { padding: 0 !important; justify-content: center; }

body.landing div.container.blog#first-content div.blog-title .blog-intro p.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
  padding: 0.35rem 0.85rem 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--pm-radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86) !important;
  font-family: var(--pm-font);
  font-size: 0.78rem;
  line-height: 1.3;
  hyphens: manual;
  width: auto;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.landing div.container.blog#first-content .hero-kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pm-brass); box-shadow: 0 0 0 4px rgba(184, 134, 43, 0.22); }

body.landing .hero-container h1.title,
body.landing .hero-container .title-first-line {
  margin: 0;
  padding: 0;
  font-family: var(--pm-font);
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: #fff !important;
}
body.landing div.container.blog#first-content div.blog-title .blog-intro p.hero-subtitle {
  margin: 1.1rem 0 0;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.82) !important;
  font-family: var(--pm-font);
  font-size: clamp(1.1rem, 1.7vw, 1.32rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
}
body.landing div.container.blog#first-content div.blog-title .blog-intro p.author {
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  color: rgba(255, 255, 255, 0.72) !important;
  font-family: var(--pm-font);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 500;
}
body.landing .hero-container .reading-time { margin: 0; padding: 0.2rem 0.6rem; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.8) !important; font-size: 0.82rem; font-weight: 500; }
body.landing .hero-container .reading-time i { margin-right: 0.35rem; color: var(--pm-brass) !important; }
body.landing div.container.blog#first-content div.blog-title .blog-intro p.abstract {
  margin: 1.4rem 0 0;
  padding: 0;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.78) !important;
  font-family: var(--pm-font);
  font-size: 1.02rem;
  line-height: 1.7;
  hyphens: manual;
}
body.landing .hero-container .hero-announcement { display: none; }

body.landing .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.9rem 0 0;
}
body.landing .hero-container .hero-actions .pm-btn { flex: 0 1 auto; min-height: 50px; padding: 0.7rem 1.4rem; font-size: 0.98rem; white-space: nowrap; }

body.landing .hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.25rem;
  margin: 1.6rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
  font-family: var(--pm-font);
}
body.landing .hero-links li { margin: 0; padding: 0; font-size: 0.88rem; }
body.landing .hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s var(--pm-ease), color 0.15s var(--pm-ease);
}
body.landing .hero-links a:hover { background: rgba(255, 255, 255, 0.1); color: #fff !important; }
body.landing .hero-links a i { color: var(--pm-brass) !important; font-size: 0.85em; }
body.landing .hero-links__label { padding-right: 0.5rem; color: rgba(255, 255, 255, 0.5) !important; font-size: 0.76rem !important; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

body.landing div.container.blog#first-content div.blog-title .blog-cover { padding: 0; justify-content: center; }
body.landing .hero-container .corona-effect {
  filter: none;
  border-radius: 14px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
  max-width: min(100%, 520px);
  height: auto;
}
body.landing div.container.blog#first-content div.blog-title .blog-cover img.background { opacity: 0.55; filter: blur(40px); }

@media (max-width: 769px) {
  body.landing .hero-container .hero-actions .pm-btn { flex: 1 1 100%; }
  body.landing .hero-container .corona-effect { max-width: 100%; }
}

/* ------------------------------------------------------------------ */
/* 8. Landing: explainer video                                        */
/* ------------------------------------------------------------------ */

.video-section {
  padding: var(--pm-section) 0 !important;
  background: var(--pm-canvas) !important;
  border-bottom: 1px solid var(--pm-border);
}
html.dark .video-section { background: var(--pm-surface-dim) !important; }
.video-container { max-width: 960px; }
.video-wrapper { border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-3) !important; border: 1px solid rgba(255, 255, 255, 0.08); }
.video-wrapper:hover { box-shadow: var(--pm-shadow-3) !important; }
.video-section p.caption { margin-top: 1rem; font-family: var(--pm-font); font-size: 0.88rem; color: var(--pm-text-muted); }
.video-section p.caption a, body.landing .video-section p.caption a { font-size: 0.9rem; }
.video-section p.caption a { color: var(--pm-text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--pm-brass-line); }
.video-section p.caption a:hover { color: var(--pm-ink); text-decoration-color: var(--pm-brass); }

/* ------------------------------------------------------------------ */
/* 9. Landing: intent router cards                                    */
/* ------------------------------------------------------------------ */

body.landing .intent-router { margin-top: 0; }
.intent-router__grid { gap: 1.25rem; margin-top: 1.9rem; }
.intent-card {
  padding: clamp(1.4rem, 2.2vw, 1.9rem);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-1);
}
.intent-card:hover { transform: translateY(-2px); border-color: var(--pm-border-strong); box-shadow: var(--pm-shadow-2); }
.intent-card .intent-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  background: var(--pm-brass-soft);
  box-shadow: inset 0 0 0 1px rgba(184, 134, 43, 0.2);
  color: var(--pm-brass-text);
  font-size: 1.15rem;
}
.intent-card:hover .intent-card__icon { background: rgba(184, 134, 43, 0.2); box-shadow: inset 0 0 0 1px rgba(184, 134, 43, 0.3); }
.intent-card h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.015em; }
.intent-card__lede { font-size: 0.98rem; color: var(--pm-text-2); }
.container.blog.main .intent-card a:not(.button):not(.series-button):not(.research-cta-btn):not(.download-link) { color: var(--pm-primary); }
.intent-card__go a { font-size: 1rem; }
.intent-card__more, .intent-card__note { color: var(--pm-text-muted); }
.intent-card__more a { font-weight: 500; }
.intent-router__note {
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--pm-brass);
  border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0;
  background: var(--pm-brass-soft);
  color: var(--pm-text-2);
  font-family: var(--pm-font);
  font-size: 0.92rem;
}
html.dark .intent-card { background: var(--pm-surface); border-color: var(--pm-border); box-shadow: var(--pm-shadow-1); }
html.dark .intent-card:hover { border-color: var(--pm-border-strong); box-shadow: var(--pm-shadow-2); }
html.dark .intent-card .intent-card__icon { background: var(--pm-brass-soft); box-shadow: inset 0 0 0 1px rgba(212, 169, 85, 0.3); color: var(--pm-brass-text); }
html.dark .intent-router__note { background: var(--pm-brass-soft); color: var(--pm-text-2); }
html.dark .intent-card__more, html.dark .intent-card__note { color: var(--pm-text-muted); }

/* ------------------------------------------------------------------ */
/* 10. Landing: framework pointer, atlas mosaic, wheel                */
/* ------------------------------------------------------------------ */

.framework-link { margin-top: 0.4rem; }
body.landing .container.blog.main p.framework-link a:not(.button) {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 50px;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--pm-radius-sm);
  background: var(--pm-primary);
  color: #fff;
  font-family: var(--pm-font);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.12), 0 6px 16px -10px rgba(15, 28, 46, 0.5);
  transition: background 0.18s var(--pm-ease), transform 0.18s var(--pm-ease);
}
body.landing .container.blog.main p.framework-link a:not(.button):hover { background: var(--pm-ink); color: #fff; transform: translateY(-1px); text-decoration: none; }
body.landing .container.blog.main p.framework-link a:not(.button) i { color: var(--pm-brass); }
html.dark body.landing .container.blog.main p.framework-link a:not(.button) { background: var(--pm-slate); color: var(--pm-ink); }
html.dark body.landing .container.blog.main p.framework-link a:not(.button):hover { background: #c9dcee; color: var(--pm-ink); }
html.dark body.landing .container.blog.main p.framework-link a:not(.button) i { color: var(--pm-ink); }
.framework-link__meta { margin-top: 0.75rem; color: var(--pm-text-muted); font-size: 0.9rem; }

.atlas-axes { gap: 20px; margin: 26px 0 30px; }
.atlas-axis { border: 1px solid var(--pm-border); border-radius: var(--pm-radius); background: var(--pm-surface); box-shadow: var(--pm-shadow-1); }
.atlas-axis:hover { transform: translateY(-2px); border-color: var(--pm-border-strong); box-shadow: var(--pm-shadow-2); }
.atlas-axis__mosaic { gap: 2px; background: var(--pm-border); }
.atlas-axis__title { margin: 14px 16px 3px; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.atlas-axis__meta { margin: 0 16px 16px; color: var(--pm-text-muted); font-size: 0.86rem; }
body.landing .container.blog.main p.atlas-axis__meta a:not(.button) { color: var(--pm-primary); font-size: 0.86rem; font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--pm-brass-line); }
body.landing .container.blog.main p.atlas-axis__meta a:not(.button):hover { color: var(--pm-ink); border-bottom-color: var(--pm-brass); text-decoration: none; }
html.dark body.landing .container.blog.main p.atlas-axis__meta a:not(.button) { color: var(--pm-primary); }
html.dark body.landing .container.blog.main p.atlas-axis__meta a:not(.button):hover { color: #fff; }
html.dark .atlas-axis { background: var(--pm-surface); border-color: var(--pm-border); box-shadow: var(--pm-shadow-1); }
html.dark .atlas-axis__mosaic { background: var(--pm-border); }
html.dark .atlas-axis__meta { color: var(--pm-text-muted); }
.atlas-teaser__all { margin-top: 0.4rem; }
body .atlas-teaser__all a.button { min-height: 50px; padding: 0.7rem 1.4rem; border-color: transparent; background: var(--pm-primary); color: #fff; font-size: 0.98rem; box-shadow: 0 1px 2px rgba(15, 28, 46, 0.12), 0 6px 16px -10px rgba(15, 28, 46, 0.5); }
body .atlas-teaser__all a.button:hover { background: var(--pm-ink); color: #fff; }
body .atlas-teaser__all a.button i { color: var(--pm-brass); }
html.dark body .atlas-teaser__all a.button { background: var(--pm-slate); color: var(--pm-ink); }
html.dark body .atlas-teaser__all a.button i { color: var(--pm-ink); }

#wheel-of-dysfunctions .wheel-iframe,
.wheel-iframe { border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-1); border: 1px solid var(--pm-border); }
#wheel-of-dysfunctions p.caption { font-family: var(--pm-font); color: var(--pm-text-muted); font-size: 0.9rem; }

/* ------------------------------------------------------------------ */
/* 11. Landing: MCP callout and book CTA band                         */
/* ------------------------------------------------------------------ */

.mcp-teaser {
  max-width: none;
  margin: 0;
  padding: clamp(1.4rem, 2.6vw, 2.1rem) clamp(1.4rem, 2.8vw, 2.4rem);
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-brass);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-1);
  font-family: var(--pm-font);
}
.mcp-teaser__header { gap: 0.6rem; margin-bottom: 0.7rem; }
.mcp-teaser__icon { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--pm-brass-soft); color: var(--pm-brass-text); font-size: 0.8rem; }
.mcp-teaser__label { color: var(--pm-brass-text); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.mcp-teaser__badge { margin-left: auto; padding: 0.2rem 0.65rem; border: 1px solid var(--pm-brass-line); border-radius: var(--pm-radius-pill); background: transparent; color: var(--pm-brass-text); font-size: 0.72rem; font-weight: 600; }
.mcp-teaser__body { margin: 0 0 1.2rem; max-width: 44rem; color: var(--pm-text-2); font-size: 1.02rem; line-height: 1.65; hyphens: none; }
.mcp-teaser__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; }
.mcp-teaser__btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px; padding: 0.6rem 1.35rem; border: 1px solid transparent; border-radius: var(--pm-radius-sm); background: var(--pm-primary); color: #fff !important; font-size: 0.95rem; font-weight: 600; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 28, 46, 0.12), 0 6px 16px -10px rgba(15, 28, 46, 0.5); }
.mcp-teaser__btn-primary:hover { background: var(--pm-ink); color: #fff !important; }
.mcp-teaser__btn-secondary { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px; padding: 0.6rem 1.35rem; border: 1px solid var(--pm-border-strong); border-radius: var(--pm-radius-sm); background: var(--pm-surface); color: var(--pm-primary) !important; font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.mcp-teaser__btn-secondary:hover { background: var(--pm-surface-dim); border-color: var(--pm-slate); color: var(--pm-ink) !important; }
.mcp-teaser__meta { flex-basis: 100%; margin: 0.3rem 0 0; color: var(--pm-text-muted); font-size: 0.86rem; }
html.dark .mcp-teaser { background: var(--pm-surface); border-color: var(--pm-border); border-left-color: var(--pm-brass); }
html.dark .mcp-teaser__icon { background: var(--pm-brass-soft); color: var(--pm-brass-text); }
html.dark .mcp-teaser__label, html.dark .mcp-teaser__badge { color: var(--pm-brass-text); border-color: var(--pm-brass-line); background: transparent; }
html.dark .mcp-teaser__body { color: var(--pm-text-2); }
html.dark .mcp-teaser__btn-primary { background: var(--pm-slate); color: var(--pm-ink) !important; }
html.dark .mcp-teaser__btn-primary:hover { background: #c9dcee; color: var(--pm-ink) !important; }
html.dark .mcp-teaser__btn-secondary { background: var(--pm-surface); border-color: var(--pm-border-strong); color: var(--pm-primary) !important; }
html.dark .mcp-teaser__btn-secondary:hover { background: #1a2a3e; color: #fff !important; }
html.dark .mcp-teaser__meta { color: var(--pm-text-muted); }

.book-cta {
  position: relative;
  max-width: min(62rem, calc(100vw - 2 * clamp(28px, (100vw - 980px) / 2, 300px)));
  margin: 2rem auto var(--pm-section);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pm-radius);
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(184, 134, 43, 0.22), transparent 60%),
    linear-gradient(160deg, #0f1c2e 0%, #1b2d44 100%);
  box-shadow: var(--pm-shadow-3);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 2.5rem;
  align-items: center;
  overflow: hidden;
}
.book-cta__eyebrow { margin: 0 0 0.5rem; color: var(--pm-brass); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.book-cta__title { margin: 0 0 0.5rem; color: #fff; font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 600; letter-spacing: -0.02em; }
.book-cta__desc { margin: 0; max-width: 38rem; color: rgba(255, 255, 255, 0.76); font-size: 1rem; line-height: 1.65; }
.book-cta__actions { display: flex; flex-direction: column; gap: 0.6rem; min-width: 14rem; }
.book-cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 50px; padding: 0.7rem 1.5rem; border-radius: var(--pm-radius-sm); background: #fff; color: var(--pm-ink) !important; font-size: 1rem; font-weight: 600; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6); transition: background 0.18s var(--pm-ease), transform 0.18s var(--pm-ease); }
.book-cta-btn:hover { background: #f1f4f8; color: var(--pm-ink) !important; transform: translateY(-1px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6); }
html.dark .book-cta { background: radial-gradient(60% 80% at 100% 0%, rgba(212, 169, 85, 0.18), transparent 60%), linear-gradient(160deg, #0d1726 0%, #152438 100%); border-color: var(--pm-border); }
html.dark .book-cta-btn { background: #eef3f8; color: var(--pm-ink) !important; }
html.dark .book-cta-btn:hover { background: #fff; color: var(--pm-ink) !important; }
@media (max-width: 800px) { .book-cta { grid-template-columns: 1fr; } .book-cta__actions { flex-direction: row; flex-wrap: wrap; } }

/* Legacy mid-page MCP band on the framework page */
.mcp-integration { padding: 0; margin: var(--pm-section) 0 0; background: transparent; border: 0; }
.mcp-integration__inner { max-width: none; margin: 0; padding: clamp(1.4rem, 2.6vw, 2.1rem) clamp(1.4rem, 2.8vw, 2.4rem); border: 1px solid var(--pm-border); border-left: 4px solid var(--pm-brass); border-radius: var(--pm-radius); background: var(--pm-surface); box-shadow: var(--pm-shadow-1); text-align: left; font-family: var(--pm-font); }
.mcp-integration__eyebrow { color: var(--pm-brass-text); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; margin-bottom: 0.5rem; }
.mcp-integration__title { font-size: 1.3rem; font-weight: 600; margin: 0 0 0.5rem; }
.mcp-integration__title i { color: var(--pm-brass-text); }
.mcp-integration__body { margin: 0 0 1.2rem; max-width: 44rem; color: var(--pm-text-2); }
.mcp-integration__btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px; padding: 0.6rem 1.35rem; border-radius: var(--pm-radius-sm); background: var(--pm-primary); color: #fff !important; font-weight: 600; }
.mcp-integration__btn:hover { background: var(--pm-ink); }
.mcp-integration__link { color: var(--pm-primary); border-bottom-color: var(--pm-brass-line); }
.mcp-integration__link:hover { border-bottom-color: var(--pm-brass); }
html.dark .mcp-integration__inner { background: var(--pm-surface); border-color: var(--pm-border); border-left-color: var(--pm-brass); }
html.dark .mcp-integration__title, html.dark .mcp-integration__body, html.dark .mcp-integration__cta { color: var(--pm-text); }
html.dark .mcp-integration__btn { background: var(--pm-slate); color: var(--pm-ink) !important; }
html.dark .mcp-integration__link { color: var(--pm-primary); }

/* ------------------------------------------------------------------ */
/* 12. Framework page                                                 */
/* ------------------------------------------------------------------ */

body.has-side-rails { background: var(--pm-surface); }
.framework-header { padding-top: clamp(40px, 6vw, 72px) !important; padding-bottom: 1.5rem; }
.framework-header__eyebrow { margin: 0 0 0.6rem; color: var(--pm-brass-text); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; }
.framework-header__title { margin: 0 0 0.6rem; font-size: clamp(2.1rem, 4.4vw, 3.3rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; }
.framework-header p.author { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: 0 0 1.2rem; padding: 0; color: var(--pm-text-muted); font-family: var(--pm-font); font-size: 0.98rem; font-style: normal; font-weight: 500; }
.framework-header .reading-time { margin: 0; padding: 0.2rem 0.6rem; border-radius: 6px; background: var(--pm-brass-soft); color: var(--pm-brass-text); font-size: 0.82rem; }
html.dark .framework-header .reading-time { color: var(--pm-brass-text); }
.framework-header p.text { font-size: 1.12rem; line-height: 1.7; color: var(--pm-text-2); }

/* Long-form reading prose keeps Charter, at a measured size. */
body.has-side-rails div.container.blog p.text,
body.pattern-page-body .pattern-reference p.text,
body.pattern-page-body .pattern-reference p,
body.pattern-page-body .pattern-reference li {
  font-family: var(--pm-font-read);
  font-size: 1.1rem;
  line-height: 1.72;
  color: var(--pm-text-2);
}
html.dark body.has-side-rails div.container.blog p.text,
html.dark body.pattern-page-body .pattern-reference p.text,
html.dark body.pattern-page-body .pattern-reference p,
html.dark body.pattern-page-body .pattern-reference li { color: var(--pm-text-2); }

body.has-side-rails div.container.blog h2 {
  margin: 0 0 0.9rem;
  padding: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
body.has-side-rails div.container.blog h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em; }
body.has-side-rails div.container.blog.main { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); }
body.has-side-rails div.container.blog.main.first { padding-bottom: 0; }

/* Series cards */
.content-grid { gap: 18px; margin: 22px 0; }
.content-card,
.content-card--primary,
.content-card--secondary,
.content-card--tertiary,
.content-card--highlight,
.content-card--tight {
  padding: 1.4rem 1.6rem !important;
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-brass);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-1);
}
.content-card--highlight { background: var(--pm-brass-soft); }
.content-card h3 { margin-bottom: 0.5rem; font-size: 1.12rem; }
.heading--accent { color: var(--pm-primary); }
html.dark .content-card, html.dark .content-card--highlight { background: var(--pm-surface); border-color: var(--pm-border); border-left-color: var(--pm-brass); }
html.dark .content-card--highlight { background: var(--pm-brass-soft); }
.series-button { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0.45rem 1.05rem; border: 1px solid var(--pm-border-strong); border-radius: var(--pm-radius-sm); background: var(--pm-surface); color: var(--pm-primary); font-family: var(--pm-font); font-size: 0.88rem; font-weight: 600; box-shadow: none; }
.series-button:hover { background: var(--pm-surface-dim); border-color: var(--pm-slate); color: var(--pm-ink); box-shadow: none; }
.series-button i { color: var(--pm-brass-text); margin-right: 0; }
html.dark .series-button { background: var(--pm-surface); color: var(--pm-primary) !important; border-color: var(--pm-border-strong); }
html.dark .series-button:hover { background: #1a2a3e; color: #fff !important; }

/* Axis introductions */
.dysfunction-intro {
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pm-radius);
  background: radial-gradient(60% 80% at 100% 0%, rgba(184, 134, 43, 0.2), transparent 60%), linear-gradient(160deg, #0f1c2e 0%, #1b2d44 100%);
  box-shadow: var(--pm-shadow-2);
  color: var(--pm-on-ink);
}
.dysfunction-intro::before { display: none; }
.dysfunction-intro h1, .dysfunction-intro h2 { color: #fff; border-bottom: 0 !important; padding-bottom: 0; }
.dysfunction-intro h2 > .section-subtitle { color: rgba(255, 255, 255, 0.7); }
.dysfunction-intro p, body.has-side-rails .dysfunction-intro p.text { color: rgba(255, 255, 255, 0.82); }
.dysfunction-intro p:first-of-type::first-letter { color: var(--pm-brass); }
html.dark .dysfunction-intro { background: radial-gradient(60% 80% at 100% 0%, rgba(212, 169, 85, 0.16), transparent 60%), linear-gradient(160deg, #0d1726 0%, #152438 100%); border-color: var(--pm-border); }

.container.blog.main .axis-pattern-index li a:not(.button):not(.series-button):not(.research-cta-btn):not(.download-link) { border-color: var(--pm-border); border-radius: var(--pm-radius-sm); background: var(--pm-surface); box-shadow: var(--pm-shadow-1); transition: border-color 0.15s var(--pm-ease), transform 0.15s var(--pm-ease); }
.container.blog.main .axis-pattern-index li a:not(.button):not(.series-button):not(.research-cta-btn):not(.download-link):hover { border-color: var(--pm-border-strong); transform: translateY(-1px); }
.axis-pattern-index__id { color: var(--pm-brass-text); }
html.dark .axis-pattern-index__id { color: var(--pm-brass-text); }
.axis-pattern-index small { color: var(--pm-text-muted); }

/* Callouts */
body .callout-box, body .callout-box.warning, body .callout-box.info, body .key-insight-box, body .confounders-callout {
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-brass);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-brass-soft);
  box-shadow: none;
  color: var(--pm-text);
}
body .callout-box h3, body .callout-box h4, body .callout-box strong { color: var(--pm-text); }
body .callout-box i.fa-triangle-exclamation, body .callout-box .fa-solid { color: var(--pm-brass-text); }
html.dark body .callout-box, html.dark body .callout-box.warning { background: var(--pm-brass-soft); border-color: var(--pm-border); border-left-color: var(--pm-brass); color: var(--pm-text); }

body .attribution-quote, body .attribution-quote.warning {
  margin: 1.5rem 0;
  padding: 1.1rem 1.4rem !important;
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-brass);
  border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0;
  background: var(--pm-surface-dim);
}
body .attribution-quote p:first-child { font-family: var(--pm-font-read); font-size: 1.12rem; line-height: 1.65; color: var(--pm-text); }
body .attribution-quote p:last-child, body .attribution-quote cite { display: block; margin-top: 0.5rem; color: var(--pm-text-2); font-family: var(--pm-font); font-size: 0.9rem; font-style: normal; }
html.dark body .attribution-quote, html.dark body .attribution-quote.warning { background: var(--pm-surface-dim); border-color: var(--pm-border); border-left-color: var(--pm-brass); }
html.dark body .attribution-quote p:last-child, html.dark body .attribution-quote cite { color: var(--pm-text-2); }

/* Contents rail (navbar.js) */
.nav-container { background: var(--pm-canvas); border-right: 1px solid var(--pm-border); font-family: var(--pm-font); }
html.dark .nav-container { background: var(--pm-surface-dim); border-right-color: var(--pm-border); }

/* ------------------------------------------------------------------ */
/* 13. Pattern pages                                                  */
/* ------------------------------------------------------------------ */

body.pattern-page-body main { padding-top: clamp(28px, 4vw, 48px); }
body.pattern-page-body div.container.blog.main.first.pattern-page__head { padding-top: 0; padding-bottom: 2.5rem; }
body.pattern-page-body .breadcrumbs { margin-bottom: 1.6rem; color: var(--pm-text-muted); font-size: 0.86rem; }
body.pattern-page-body .breadcrumbs a { color: var(--pm-text-2); }
body.pattern-page-body .breadcrumbs [aria-current] { color: var(--pm-text); }
.pattern-hero .eyebrow { margin-bottom: 0.7rem; color: var(--pm-brass-text); font-size: 0.76rem; letter-spacing: 0.14em; }
.pattern-hero .eyebrow a { border-bottom-color: var(--pm-brass-line); }
.pattern-hero .eyebrow a:hover { border-bottom-color: var(--pm-brass); }
html.dark .pattern-hero .eyebrow, html.dark .pattern-hero .eyebrow a { color: var(--pm-brass-text); }
.pattern-hero h1 { margin: 0 0 0.25em; font-size: clamp(2.2rem, 4.8vw, 3.5rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.03em; }
.pattern-hero .subtitle { margin: 0 0 1.2rem; color: var(--pm-slate); font-family: var(--pm-font-read); font-size: 1.4rem; font-style: italic; letter-spacing: 0; }
html.dark .pattern-hero .subtitle { color: var(--pm-slate); }
body.pattern-page-body .pattern-hero p.lede { font-family: var(--pm-font); font-size: 1.12rem; line-height: 1.7; color: var(--pm-text-2); max-width: 46rem; hyphens: manual; }
.pattern-hero .pattern-illustration { max-width: 56rem; margin: 2rem 0 0; }
.pattern-hero .pattern-illustration img { border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-2); border: 1px solid var(--pm-border); }
.pattern-hero figcaption, .condition-illustration figcaption { margin-top: 0.7rem; color: var(--pm-text-muted); font-family: var(--pm-font); font-size: 0.86rem; font-style: normal; text-align: center; }
.section-links { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--pm-border); gap: 0.45rem; }

body.pattern-page-body div.container.blog.main.gray.pattern-page__reference h2,
body.pattern-page-body .pattern-page__corpus > section > h2 { font-size: 1.35rem; }
body.pattern-page-body .pattern-page__reference > section > h2 { margin-bottom: 1.1rem; }

/* The clinical reference card: one flat card, one hairline, no nested chrome. */
.pattern-reference.disorder-white,
.disorder-white, .disorder-grey {
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-1);
  transition: none;
}
.disorder-white:hover, .disorder-grey:hover { transform: none; box-shadow: var(--pm-shadow-1); border-color: var(--pm-border); }
.disorder-white::before, .disorder-grey::before { display: none; }
html.dark .disorder-white, html.dark .disorder-grey { background: var(--pm-surface); border-color: var(--pm-border); }

.disorder-white h3, .disorder-grey h3 {
  margin: calc(-1 * clamp(1.4rem, 3vw, 2.4rem)) calc(-1 * clamp(1.4rem, 3vw, 2.4rem)) 1.5rem;
  padding: 1.2rem clamp(1.4rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--pm-border);
  border-radius: var(--pm-radius) var(--pm-radius) 0 0;
  background: var(--pm-surface-dim);
  color: var(--pm-text);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
html.dark .disorder-white h3, html.dark .disorder-grey h3 { background: var(--pm-surface-dim); border-color: var(--pm-border); color: var(--pm-text); }
.disorder-subtitle { color: var(--pm-slate); font-family: var(--pm-font-read); font-size: 0.8em; font-style: italic; font-weight: 400; }
html.dark .disorder-subtitle { color: var(--pm-slate); }

.disorder-white h4, .disorder-grey h4 {
  margin: 2rem 0 0.9rem;
  padding-left: 2.35rem;
  color: var(--pm-text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
body .disorder-white h4:before, body .disorder-grey h4:before {
  top: -3px;
  width: 26px !important;
  height: 26px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--pm-brass-soft) !important;
  color: var(--pm-brass-text) !important;
  box-shadow: inset 0 0 0 1px rgba(184, 134, 43, 0.22) !important;
  font-size: 12px !important;
}

/* Flatten the nested chrome: paragraphs and lists sit directly on the card. */
html body .disorder-white p:not(.human-analogue):not(.checklist-note),
html body .disorder-grey p:not(.human-analogue):not(.checklist-note),
html body .disorder-white h4+p, html body .disorder-grey h4+p {
  margin: 0 0 1rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
html body .disorder-white ol, html body .disorder-grey ol,
html body .disorder-white h4+ol, html body .disorder-grey h4+ol {
  padding: 0 0 0 2.35rem !important;
  margin: 0.6rem 0 1.2rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
html body .disorder-white ol ol, html body .disorder-grey ol ol { margin: 0.5rem 0 0.25rem !important; }
html body .disorder-white ol li, html body .disorder-grey ol li { padding: 0 0 0 0.1rem !important; margin: 0 0 0.7rem !important; }

body .disorder-white p:not(.human-analogue), body .disorder-grey p:not(.human-analogue),
body .disorder-white h4+p, body .disorder-grey h4+p,
body .disorder-white h4.description+p:not(.human-analogue), body .disorder-grey h4.description+p:not(.human-analogue) {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
body .disorder-white h4.diagnostic+ol, body .disorder-grey h4.diagnostic+ol,
body .disorder-white h4.etiology+ol, body .disorder-grey h4.etiology+ol,
body .disorder-white h4.symptoms+ol, body .disorder-grey h4.symptoms+ol,
body .disorder-white h4.mitigation+ol, body .disorder-grey h4.mitigation+ol {
  padding: 0 0 0 2.35rem;
  border: 0;
  border-radius: 0;
  background: none;
}
body .example-box p.text, body .key-insight p.text, body .pattern-reference blockquote p, body .key-insight p { margin: 0 0 0.8rem; padding: 0; background: none; border: 0; }
body .example-box p.text:last-child, body .key-insight p.text:last-child, body .pattern-reference blockquote p:last-child { margin-bottom: 0; }
html.dark .disorder-white h4, html.dark .disorder-grey h4 { color: var(--pm-text); }
html.dark body .disorder-white h4:before, html.dark body .disorder-grey h4:before { background: var(--pm-brass-soft) !important; color: var(--pm-brass-text) !important; box-shadow: inset 0 0 0 1px rgba(212, 169, 85, 0.3) !important; }

.disorder-white ol, .disorder-grey ol { margin: 0.6rem 0 1.2rem; padding-left: 2.35rem; }
.disorder-white ol li, .disorder-grey ol li { margin-bottom: 0.7rem; padding-left: 0.1rem; }
.disorder-white ol li::before, .disorder-grey ol li::before,
.disorder-white h4.mitigation+ol li::before, .disorder-grey h4.mitigation+ol li::before,
.disorder-white h4.diagnostic+ol li:before, .disorder-grey h4.diagnostic+ol li:before,
.disorder-white h4.etiology+ol li:before, .disorder-grey h4.etiology+ol li:before,
.disorder-white h4.symptoms+ol li:before, .disorder-grey h4.symptoms+ol li:before {
  left: -2.35rem !important;
  top: 0.2rem !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 7px !important;
  background: var(--pm-surface-dim) !important;
  color: var(--pm-text-2) !important;
  border: 1px solid var(--pm-border) !important;
  box-shadow: none !important;
  font-family: var(--pm-font);
  font-size: 12px;
  font-weight: 600;
}
html.dark .disorder-white ol li::before, html.dark .disorder-grey ol li::before,
html.dark .disorder-white h4.mitigation+ol li::before, html.dark .disorder-grey h4.mitigation+ol li::before { background: var(--pm-surface-dim) !important; color: var(--pm-text-2) !important; border-color: var(--pm-border) !important; }

.disorder-white p.human-analogue, .disorder-grey p.human-analogue {
  margin: 1.4rem 0 0.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--pm-border);
  border-left: 3px solid var(--pm-brass);
  border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0;
  background: var(--pm-surface-dim);
}
.disorder-white em, .disorder-grey em { color: inherit; font-weight: inherit; }
.disorder-white p strong, .disorder-grey p strong { color: var(--pm-text); font-weight: 600; }

.example-box, .key-insight, .pattern-reference blockquote, .disorder-white blockquote, .disorder-grey blockquote, .pattern-reference .callout, .info-box, .info-panel {
  margin: 1.2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--pm-border) !important;
  border-radius: var(--pm-radius-sm) !important;
  background: var(--pm-surface-dim) !important;
  box-shadow: none !important;
}
.example-box h5, .key-insight h5, .pattern-reference h5 { margin: 0 0 0.6rem; color: var(--pm-text); font-family: var(--pm-font); font-size: 0.95rem; font-weight: 600; }
.example-box h5 i, .key-insight h5 i, .pattern-reference h5 i { color: var(--pm-brass-text); }
html.dark .example-box, html.dark .key-insight, html.dark .pattern-reference blockquote, html.dark .info-box, html.dark .info-panel { background: var(--pm-surface-dim) !important; border-color: var(--pm-border) !important; }

.specifier-badges { gap: 8px; margin: 0 0 1.4rem; }
.specifier-badge { min-height: 30px; padding: 4px 12px; border-radius: var(--pm-radius-pill); background: var(--pm-surface-dim); border: 1px solid var(--pm-border); color: var(--pm-text-2); font-size: 0.78rem; font-weight: 500; }
.specifier-badge.training-induced { background: var(--pm-primary); border-color: var(--pm-primary); color: #fff; }
html.dark .specifier-badge { background: var(--pm-surface-dim); border-color: var(--pm-border); color: var(--pm-text-2); }
html.dark .specifier-badge.training-induced { background: var(--pm-slate); border-color: var(--pm-slate); color: var(--pm-ink); }

/* Corpus sections */
.pattern-page__corpus section { padding: clamp(1.3rem, 2.4vw, 1.9rem) clamp(1.3rem, 2.6vw, 2.1rem) clamp(1.1rem, 2vw, 1.6rem); border-color: var(--pm-border); border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-1); }
.container.blog.pattern-page__corpus section h2 { border-bottom-color: var(--pm-border); font-size: 1.3rem; font-weight: 600; }
.pattern-page__corpus section h2::before { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--pm-brass-soft); color: var(--pm-brass-text); font-size: 0.8rem; }
html.dark .pattern-page__corpus section h2::before { background: var(--pm-brass-soft); color: var(--pm-brass-text); }
.pattern-page__corpus li::marker { color: var(--pm-brass); }
.evidence-list article, .compact-dl > div { border-color: var(--pm-border); border-radius: var(--pm-radius-sm); background: var(--pm-surface-dim); }
.evidence-list details summary { color: var(--pm-primary); }
.pattern-pagination { border-top-color: var(--pm-border); }
.pattern-pagination a { border-color: var(--pm-border); border-radius: var(--pm-radius-sm); box-shadow: var(--pm-shadow-1); }
.pattern-pagination a:hover { border-color: var(--pm-border-strong); }
.pattern-pagination a .metadata { color: var(--pm-text-muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
html.dark .pattern-page__corpus section, html.dark .pattern-pagination a { background: var(--pm-surface); border-color: var(--pm-border); box-shadow: var(--pm-shadow-1); }
html.dark .evidence-list article, html.dark .compact-dl > div { background: var(--pm-surface-dim); border-color: var(--pm-border); }
html.dark .pattern-page__corpus section h2 { border-color: var(--pm-border); }

/* Atlas index */
.pattern-atlas .pattern-hero { margin-bottom: 2rem; }
.pattern-atlas .pattern-hero .lede { font-family: var(--pm-font); font-size: 1.12rem; color: var(--pm-text-2); }
.atlas-toolbar, .compare-panel { border-color: var(--pm-border); border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-1); }
.pattern-card { border-color: var(--pm-border); border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-1); }
.pattern-card:hover { border-color: var(--pm-border-strong); box-shadow: var(--pm-shadow-2); }
.atlas-toolbar input[type="search"], .atlas-toolbar select { border-color: var(--pm-border-strong); border-radius: var(--pm-radius-sm); }
.atlas-toolbar input[type="search"]:focus, .atlas-toolbar select:focus { border-color: var(--pm-slate); box-shadow: 0 0 0 3px rgba(70, 97, 125, 0.18); }
.atlas-reset { border-color: var(--pm-border-strong); border-radius: var(--pm-radius-sm); background: var(--pm-surface); }
.pattern-specifier { border-color: var(--pm-border); background: var(--pm-surface); }
.pattern-specifier:has(input:checked) { background: var(--pm-primary); border-color: var(--pm-primary); color: #fff; }
.pattern-specifier:has(input:checked) input { border-color: #fff; background: var(--pm-primary); }
.pattern-specifier:has(input:checked) input::before { background: #fff; }
.pattern-card__axis, .pattern-id { color: var(--pm-brass-text); }
html.dark .atlas-toolbar, html.dark .compare-panel, html.dark .pattern-card { background: var(--pm-surface); border-color: var(--pm-border); box-shadow: var(--pm-shadow-1); }
html.dark .pattern-card:hover { border-color: var(--pm-border-strong); }
html.dark .pattern-card__axis, html.dark .pattern-id { color: var(--pm-brass-text); }

/* ------------------------------------------------------------------ */
/* 14. Tables and code, site-wide                                     */
/* ------------------------------------------------------------------ */

.container.blog table, table.tools-table, .table-wrap table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--pm-border); border-radius: var(--pm-radius-sm); overflow: hidden; font-family: var(--pm-font); font-size: 0.94rem; }
.container.blog table th, table.tools-table th { background: var(--pm-surface-dim); color: var(--pm-text); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--pm-border); }
.container.blog table td, table.tools-table td { border-bottom: 1px solid var(--pm-border); }
.container.blog table tr:last-child td { border-bottom: 0; }
html.dark .container.blog table, html.dark table.tools-table { border-color: var(--pm-border); }
html.dark .container.blog table th, html.dark table.tools-table th { background: var(--pm-surface-dim); color: var(--pm-text); border-color: var(--pm-border); }
html.dark .container.blog table td, html.dark table.tools-table td { border-color: var(--pm-border); }

code, kbd, samp { font-family: var(--pm-font-mono); }

/* ------------------------------------------------------------------ */
/* 15. Motion                                                         */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .pm-btn, .pm-btn .pm-btn__arrow, .intent-card, .atlas-axis, .pattern-card, .site-nav .nav-link { transition: none !important; }
  .pm-btn:hover, .intent-card:hover, .atlas-axis:hover { transform: none !important; }
}

@media print {
  .site-nav, .dark-mode-toggle, .back-to-top, .reading-progress, .hero-actions, .hero-links, .book-cta, .mcp-callout { display: none !important; }
  body.landing div.container.blog#first-content.hero-container { background: #fff; }
  body.landing div.container.blog#first-content.hero-container * { color: #000 !important; }
}
