:root {
  --bg: #ffffff;
  --surface: #f3f7ff;
  --card: #ffffff;
  --ink: #0b1b3f;
  --muted: #4a5a7d;
  --border: #e1e9f7;
  --accent: #1d5bff;
  --accent-fill: #1d5bff;
  --accent-soft: #e8efff;
  --navy: #0a1c4a;
  --ink-rgb: 11, 27, 63;
  --accent-rgb: 29, 91, 255;
}

html[data-theme="dark"] {
  --bg: #071022;
  --surface: #0a1530;
  --card: #0e1c3f;
  --ink: #f1f5ff;
  --muted: #aab8d8;
  --border: #1f2f5a;
  --accent: #4a86ff;
  --accent-fill: #2d62e8;
  --accent-soft: #14275a;
  --navy: #0a1c4a;
  --ink-rgb: 255, 255, 255;
  --accent-rgb: 74, 134, 255;
}

.pg-insights-connected {
  --cd-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cd-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --cd-gutter: clamp(20px, 6vw, 56px);
  --cd-colw: 62ch;
  --cd-bleedw: 1200px;
  --cd-amber: #b26b00;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--cd-font);
  font-size: clamp(15px, 0.5vw + 13.8px, 17px);
  line-height: 1.65;
  padding-top: 100px;
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.pg-insights-connected) *,
:where(.pg-insights-connected) *::before,
:where(.pg-insights-connected) *::after { box-sizing: border-box; }

:where(.pg-insights-connected) p { margin: 0; }
:where(.pg-insights-connected) h1,
:where(.pg-insights-connected) h2,
:where(.pg-insights-connected) h3 { margin: 0; font-weight: 600; }
:where(.pg-insights-connected) ul,
:where(.pg-insights-connected) ol { margin: 0; padding: 0; list-style: none; }

:where(.pg-insights-connected) a:focus-visible,
:where(.pg-insights-connected) button:focus-visible,
.pg-insights-connected [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* top bar */
.cd-top { border-bottom: 1px solid var(--border); }
.cd-top__wrap {
  max-width: var(--cd-bleedw);
  margin-inline: auto;
  padding: 12px var(--cd-gutter) 0;
}
.cd-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--cd-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cd-crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cd-crumb a:hover,
.cd-crumb a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }
.cd-crumb [aria-current="page"] { color: var(--ink); }
.cd-crumb__sep { color: rgba(var(--ink-rgb), 0.35); }
.cd-top__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 16px;
}
.cd-top__kick {
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.cd-top__mid {
  font-family: var(--cd-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.cd-top__mark {
  margin-left: auto;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* reading column */
.cd-article { display: block; }
.cd-col {
  max-width: var(--cd-colw);
  margin-inline: auto;
  padding-inline: var(--cd-gutter);
}
.cd-bleed {
  max-width: var(--cd-bleedw);
  margin-inline: auto;
  padding-inline: var(--cd-gutter);
}

/* article head */
.cd-head {
  text-align: center;
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: clamp(26px, 4vw, 48px);
}
.cd-kicker {
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.cd-h1 {
  font-size: clamp(36px, 6.4vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}
.cd-lede {
  margin-top: clamp(18px, 2.4vw, 26px);
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  max-width: 54ch;
  margin-inline: auto;
}

/* sections */
.cd-section { padding-block: clamp(30px, 4.4vw, 56px); }
.cd-h2 {
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: clamp(18px, 2.4vw, 26px);
}
.cd-body p + p { margin-top: 1.1em; }
.cd-body p { color: var(--ink); }

/* problem list */
.cd-list {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}
.cd-list li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
}
.cd-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.55);
}

/* diagram stage */
.cd-stage {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  padding: clamp(16px, 2.4vw, 28px);
}
.cd-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(14px, 2vw, 22px);
}
.cd-stage__label {
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cd-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}
.cd-js .cd-toggle { display: inline-flex; }
.cd-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.cd-toggle__btn:hover { color: var(--ink); }
.cd-toggle__btn[aria-pressed="true"] {
  background: var(--accent-fill);
  color: #fff;
}
.cd-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
}
.cd-panel { margin: 0; }
.cd-panel svg { display: block; width: 100%; height: auto; }
.cd-panel__cap {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.cd-panel__cap span {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}
.cd-panel--after .cd-panel__cap { color: var(--accent); }
.cd-panel--after .cd-panel__cap span { color: var(--muted); }

/* svg parts */
.cd-node__box {
  fill: var(--card);
  stroke: var(--border);
  stroke-width: 1.6;
}
.cd-node__label {
  fill: var(--ink);
  font-family: var(--cd-font);
  font-size: 12px;
  font-weight: 600;
}
.cd-wire {
  fill: none;
  stroke: rgba(var(--ink-rgb), 0.3);
  stroke-width: 1.5;
}
.cd-wire--warn { stroke: rgba(178, 107, 0, 0.85); }
.cd-spine {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}
.cd-stem {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.55;
}
.cd-dot { fill: var(--accent); }

/* js overlay morph */
.cd-js .cd-panels { grid-template-columns: 1fr; }
.cd-js .cd-panel {
  grid-area: 1 / 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.cd-js .cd-panel--after {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.cd-js.is-after .cd-panel--before { opacity: 0; }
.cd-js.is-after .cd-panel--after {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.cd-js.is-after .cd-spine {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: cd-draw 0.9s ease 0.15s forwards;
}
@keyframes cd-draw { to { stroke-dashoffset: 0; } }

/* pull quote */
.cd-pull {
  margin: clamp(26px, 4.4vw, 48px) 0;
  padding-left: clamp(18px, 3vw, 30px);
  border-left: 3px solid var(--accent);
}
.cd-pull p {
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: balance;
}

/* checklist */
.cd-check { display: grid; gap: 12px; margin-top: 4px; }
.cd-check__item { list-style: none; }
.cd-check__btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cd-check__btn:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.cd-check__box {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cd-check__box svg { width: 15px; height: 15px; opacity: 0; transition: opacity 0.18s ease; }
.cd-check__n {
  font-family: var(--cd-mono);
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 22px;
}
.cd-check__text { transition: color 0.18s ease; }
.cd-check__item.is-done .cd-check__box {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}
.cd-check__item.is-done .cd-check__box svg { opacity: 1; }
.cd-check__item.is-done .cd-check__text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.cd-check__item.is-done .cd-check__n { color: var(--muted); }

/* drop cap */
.cd-drop .cd-drop__lead { margin-top: 0; }
.cd-drop .cd-drop__lead::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.8;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 12px 0 0;
}

/* closing */
.cd-end { padding-top: clamp(30px, 4vw, 52px); }
.cd-keep {
  border-top: 1px solid var(--border);
  padding-top: clamp(20px, 3vw, 30px);
}
.cd-keep__label {
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.cd-keep ul { display: grid; gap: 4px; }
.cd-keep a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cd-keep a:hover,
.cd-keep a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }
.cd-keep a svg { flex: none; width: 16px; height: 16px; }
.cd-cta {
  margin-top: clamp(26px, 3.6vw, 40px);
  font-size: clamp(19px, 1.6vw, 23px);
  color: var(--muted);
}
.cd-cta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.4);
  padding-bottom: 2px;
  min-height: 44px;
  display: inline;
}
.cd-cta a:hover,
.cd-cta a:focus-visible { border-bottom-color: currentColor; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  :where(.pg-insights-connected) * { transition: none !important; }
  .cd-js.is-after .cd-spine {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none !important;
  }
}

/* tablet */
@media (max-width: 860px) {
  .cd-panels { grid-template-columns: 1fr; }
  .cd-js .cd-panels { grid-template-columns: 1fr; }
}

/* phone */
@media (max-width: 560px) {
  .pg-insights-connected { padding-top: 84px; }
  .cd-top__mid { display: none; }
  .cd-stage { border-radius: 18px; }
  .cd-stage__bar { justify-content: flex-start; }
  .cd-toggle { width: 100%; }
  .cd-toggle__btn { flex: 1; }
  .cd-h1 { font-size: clamp(32px, 9vw, 42px); }
  .cd-lede { max-width: none; }
  .cd-list li { padding-left: 26px; }
  .cd-pull { border-left-width: 3px; }
}
