/* ==========================================================================
   ByteCI design system
   Tokens, base, layout, components, article prose, diagrams, print.
   ========================================================================== */

:root {
  color-scheme: light;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* brand palette */
  --navy-950: #050F1A;
  --navy-900: #0A1A2B;
  --navy-800: #102A43;
  --navy-700: #1A3D5C;
  --teal-700: #0A6466;
  --teal-600: #0D7F80;
  --teal-500: #12A09B;
  --teal-400: #2EC4B6;
  --teal-300: #7ADCD2;
  --amber-500: #F5A524;
  --amber-600: #DB8B0B;
  --amber-700: #9A5B00;

  /* semantic: light */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EFF3F7;
  --surface-3: #E4EBF1;
  --frame: #F2F5F8;
  --tint: #E6F5F3;
  --tint-strong: #C9ECE7;
  --amber-tint: #FEF4E1;
  --text: #0A1A2B;
  --text-2: #3A4C5D;
  --text-3: #5E7082;
  --line: #DCE4EB;
  --line-2: #C6D2DD;
  --brand: #0D7F80;
  --brand-strong: #0A6466;
  --brand-ink: #FFFFFF;
  --accent: #F5A524;
  --accent-text: #9A5B00;
  --link: #0A6E70;
  --solid: #0A1A2B;          /* dark blocks: roofs, side bars, contact band */
  --solid-ink: #FFFFFF;
  --logo-a: #0A6466;
  --logo-b: #2EC4B6;
  --dot: rgba(10, 26, 43, .09);
  --shadow-sm: 0 1px 2px rgba(10, 26, 43, .06);
  --shadow: 0 1px 2px rgba(10, 26, 43, .05), 0 10px 28px -14px rgba(10, 26, 43, .20);
  --shadow-lg: 0 2px 4px rgba(10, 26, 43, .05), 0 28px 56px -24px rgba(10, 26, 43, .30);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 68px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07131F;
    --surface: #0C1C2C;
    --surface-2: #112538;
    --surface-3: #183049;
    --frame: #0E2133;
    --tint: #0E2E33;
    --tint-strong: #14474B;
    --amber-tint: #2D2413;
    --text: #E6EDF3;
    --text-2: #B3C1CE;
    --text-3: #8698A9;
    --line: #1B3145;
    --line-2: #284560;
    --brand: #2EC4B6;
    --brand-strong: #63D8CD;
    --brand-ink: #04211F;
    --accent-text: #F6BC5A;
    --link: #5ED3C8;
    --solid: #123B4D;
    --solid-ink: #F2FBFA;
    --logo-a: #12A09B;
    --logo-b: #7ADCD2;
    --dot: rgba(230, 237, 243, .07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .35), 0 30px 60px -24px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07131F;
  --surface: #0C1C2C;
  --surface-2: #112538;
  --surface-3: #183049;
  --frame: #0E2133;
  --tint: #0E2E33;
  --tint-strong: #14474B;
  --amber-tint: #2D2413;
  --text: #E6EDF3;
  --text-2: #B3C1CE;
  --text-3: #8698A9;
  --line: #1B3145;
  --line-2: #284560;
  --brand: #2EC4B6;
  --brand-strong: #63D8CD;
  --brand-ink: #04211F;
  --accent-text: #F6BC5A;
  --link: #5ED3C8;
  --solid: #123B4D;
  --solid-ink: #F2FBFA;
  --logo-a: #12A09B;
  --logo-b: #7ADCD2;
  --dot: rgba(230, 237, 243, .07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .35), 0 30px 60px -24px rgba(0, 0, 0, .8);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--text); line-height: 1.15; letter-spacing: -.02em; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--tint-strong); color: var(--text); }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

svg.icon {
  display: inline-block; width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; }

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

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font: 500 12.5px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 2.5px; background: var(--accent); flex: none; }
.eyebrow.on-dark { color: var(--teal-300); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: 700 15px/1 var(--font-display); letter-spacing: -.005em;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn .icon { width: 18px; height: 18px; transition: transform .15s ease; }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-3); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: #E8F7F5; color: var(--navy-900); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn-sm { padding: 10px 16px; font-size: 14px; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.icon-btn .icon { width: 19px; height: 19px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; flex: none; border-radius: 8px; }
.brand svg { height: 30px; width: auto; }
.brand:hover { color: var(--text); }
.logo { display: block; height: 30px; width: auto; overflow: visible; }
.logo .logo-a { stop-color: var(--logo-a); }
.logo .logo-b { stop-color: var(--logo-b); }
.logo .logo-dot { fill: var(--accent); }
.logo .logo-byte { stroke: var(--text); }
.logo .logo-ci { stroke: var(--brand); }
.site-footer .logo { --logo-a: #12A09B; --logo-b: #7ADCD2; }
.site-footer .logo .logo-byte { stroke: #FFFFFF; }
.site-footer .logo .logo-ci { stroke: #2EC4B6; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font: 600 15px/1 var(--font-display);
  padding: 10px 14px; border-radius: 999px; transition: background-color .15s, color .15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

@media (max-width: 880px) {
  .menu-toggle { display: inline-grid; }
  .header-cta { display: none; }
  .header-actions { margin-left: auto; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 22px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: 14px 12px; font-size: 17px; border-radius: 12px; }
  .site-nav .nav-cta { margin-top: 10px; justify-content: center; color: var(--brand-ink); background: var(--brand); }
}
@media (min-width: 881px) { .site-nav .nav-cta { display: none; } }

.progress { position: fixed; top: var(--header-h); left: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), var(--accent)); z-index: 59; pointer-events: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-950); color: #A9B8C6; padding: 64px 0 28px; margin-top: 0; }
.site-footer a { color: #D5DEE7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer-brand svg { height: 30px; width: auto; color: #fff; }
.footer-brand p { margin: 16px 0 0; max-width: 34ch; font-size: 14.5px; line-height: 1.6; }
.footer-tagline { font: 500 12px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: lowercase; color: var(--teal-300); margin-top: 14px !important; }
.footer-col h2 { font: 600 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #7E92A5; margin: 6px 0 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: #7E92A5; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- shared sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding: clamp(48px, 6vw, 72px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -.035em; margin: 16px 0 16px; line-height: 1.08; }
.section-head p { color: var(--text-2); font-size: clamp(1.02rem, 1.4vw, 1.15rem); margin: 0; max-width: 62ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center p { margin-inline: auto; }
.split-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.split-head .section-head { margin-bottom: 0; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font: 700 15px/1 var(--font-display); color: var(--brand); text-decoration: none; }
.text-link .icon { width: 18px; height: 18px; transition: transform .15s; }
.text-link:hover { color: var(--brand-strong); }
.text-link:hover .icon { transform: translateX(3px); }

.icon-tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tint); color: var(--brand); flex: none; }
.icon-tile .icon { width: 25px; height: 25px; }
.icon-tile.sm { width: 38px; height: 38px; border-radius: 11px; }
.icon-tile.sm .icon { width: 20px; height: 20px; }

.dot-bg { position: relative; isolation: isolate; }
.dot-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}

/* ---------- home: hero ---------- */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 104px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; margin: 22px 0 24px; }
.grad-text { background: linear-gradient(100deg, var(--grad-a) 0%, var(--grad-b) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root { --grad-a: #0A6466; --grad-b: #13958F; }
:root[data-theme="dark"] { --grad-a: #2EC4B6; --grad-b: #8FE3DA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grad-a: #2EC4B6; --grad-b: #8FE3DA; } }
.hero-lede { font-size: clamp(1.06rem, 1.5vw, 1.24rem); line-height: 1.6; color: var(--text-2); max-width: 54ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-pillars { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 40px 0 0; padding: 0; list-style: none; color: var(--text-3); font: 600 14px/1.2 var(--font-display); }
.hero-pillars li { display: inline-flex; align-items: center; gap: 8px; }
.hero-pillars .icon { width: 18px; height: 18px; color: var(--brand); }
.hero-art { position: relative; aspect-ratio: 1; width: 100%; max-width: 480px; justify-self: end; }
.hero-art svg { width: 100%; height: 100%; overflow: visible; }
.bit { fill: var(--brand); }
.bit-dim { fill: var(--line-2); }
.bit-core { fill: var(--accent); }
.bit-anim { animation: bitPulse 6s ease-in-out infinite; }
@keyframes bitPulse { 0%, 100% { opacity: var(--o, .25); } 50% { opacity: calc(var(--o, .25) * .35); } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; justify-self: start; order: -1; margin-bottom: -8px; }
}
@media (max-width: 520px) { .hero-art { display: none; } }

/* ---------- home: services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.service-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 26px 26px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.service-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-3px); }
.service-card h3 { font-size: 1.22rem; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.service-card p { color: var(--text-2); margin: 0; font-size: 15.5px; line-height: 1.6; }
.service-card ul { list-style: none; margin: auto 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.service-card li { display: flex; gap: 8px; align-items: flex-start; }
.service-card li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); margin-top: .55em; flex: none; }
@media (max-width: 1080px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------- sectors ---------- */
.sector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sector-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 36px); display: grid; gap: 14px; align-content: start; }
.sector-card h3 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.025em; }
.sector-card p { color: var(--text-2); margin: 0; }
.sector-card .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; font: 500 13px/1 var(--font-sans); padding: 7px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
@media (max-width: 760px) { .sector-grid { grid-template-columns: 1fr; } }

/* ---------- principles / feature rows ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.feature h3 { font-size: 1.15rem; font-weight: 750; }
.feature p { margin: 0; color: var(--text-2); font-size: 15.5px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }

.quote-block { margin: 0; padding: clamp(28px, 4vw, 44px); border-radius: var(--radius-lg); background: var(--solid); color: var(--solid-ink); position: relative; overflow: hidden; }
.quote-block::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(122, 220, 210, .2) 1.2px, transparent 1.5px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(100deg, transparent 40%, #000 95%); mask-image: linear-gradient(100deg, transparent 40%, #000 95%); pointer-events: none; }
.quote-block p { font: 700 clamp(1.35rem, 2.6vw, 1.9rem)/1.3 var(--font-display); letter-spacing: -.025em; margin: 0; max-width: 32ch; position: relative; }
.quote-block footer { margin-top: 18px; font: 500 13px/1.4 var(--font-mono); letter-spacing: .04em; color: var(--teal-300); position: relative; }

/* ---------- contact band ---------- */
.contact-band { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--navy-900); color: #E6EDF3; padding: clamp(32px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center; isolation: isolate; }
.contact-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(122, 220, 210, .16) 1.2px, transparent 1.5px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(110deg, transparent 35%, #000 90%); mask-image: linear-gradient(110deg, transparent 35%, #000 90%); }
.contact-band::after { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 196, 182, .28), transparent 65%); z-index: -1; }
.contact-band h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.035em; margin: 14px 0 14px; }
.contact-band p { color: #B8C7D4; margin: 0; max-width: 56ch; font-size: 1.05rem; }
.contact-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.contact-actions .btn { justify-content: center; }
.contact-meta { font: 500 13px/1.5 var(--font-mono); color: #8FA3B6; text-align: center; margin-top: 4px; }
@media (max-width: 820px) { .contact-band { grid-template-columns: 1fr; } .contact-actions { align-items: flex-start; } .contact-meta { text-align: left; } }

/* ---------- page hero (library, about) ---------- */
.page-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(36px, 5vw, 56px); overflow: hidden; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.03; margin: 18px 0 18px; max-width: 18ch; }
.page-hero .lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--text-2); max-width: 60ch; margin: 0; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding: 0; list-style: none; }
.hero-stats li { display: grid; gap: 2px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 120px; }
.hero-stats b { font: 800 1.6rem/1.1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.hero-stats span { font-size: 13.5px; color: var(--text-3); }

/* ---------- library ---------- */
.library-bar { background: var(--surface); border-block: 1px solid var(--line); }
.library-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding-block: 16px; }
.library-bar .chip-row { order: 3; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.library-bar .result-note { margin-left: auto; }
.search-field { flex: 0 1 340px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px; height: 44px; transition: border-color .15s, box-shadow .15s; }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.search-field .icon { color: var(--text-3); width: 18px; height: 18px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 15px/1 var(--font-sans); height: 100%; }
.search-field input::placeholder { color: var(--text-3); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 600 14px/1 var(--font-display); cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s; }
.chip .icon { width: 16px; height: 16px; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .count { font: 500 12px/1 var(--font-mono); opacity: .7; }
.result-note { font: 500 13px/1 var(--font-mono); color: var(--text-3); white-space: nowrap; }
@media (max-width: 760px) { .library-bar .container { flex-wrap: wrap; } .search-field { flex: 1 1 100%; } .result-note { display: none; } }

.topic-section { padding: clamp(40px, 5vw, 64px) 0 8px; scroll-margin-top: calc(var(--header-h) + 80px); }
.topic-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.topic-head h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 800; letter-spacing: -.03em; }
.topic-head p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.paper-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.paper-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-3px); }
.paper-card:focus-within { border-color: var(--brand); }
.paper-topic { display: inline-flex; align-items: center; gap: 7px; font: 600 12.5px/1.2 var(--font-display); color: var(--brand); }
.topic-section .paper-topic { display: none; }
.paper-topic .icon { width: 16px; height: 16px; }
.paper-card h3 { font-size: 1.2rem; font-weight: 750; line-height: 1.25; letter-spacing: -.02em; }
.paper-card h3 a { color: var(--text); text-decoration: none; }
.paper-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.paper-card h3 a:focus-visible { outline: none; }
.paper-card .dek { color: var(--text-2); font-size: 15px; line-height: 1.5; margin: 0; }
.paper-card .summary { color: var(--text-3); font-size: 14.5px; line-height: 1.55; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.paper-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 500 12.5px/1 var(--font-mono); color: var(--text-3); }
.paper-meta span { display: inline-flex; align-items: center; gap: 6px; }
.paper-meta .icon { width: 15px; height: 15px; }
.paper-meta .go { color: var(--brand); }
.paper-meta .go .icon { transition: transform .15s; }
.paper-card:hover .paper-meta .go .icon { transform: translateX(3px); }
.empty-state { display: none; text-align: center; padding: 72px 0; color: var(--text-3); }
.no-results .empty-state { display: block; }
.is-hidden { display: none !important; }

/* ---------- article hero ---------- */
.article-hero { padding: clamp(28px, 4vw, 44px) 0 clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); overflow: hidden; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 28px; padding: 0; list-style: none; font: 500 13.5px/1.4 var(--font-sans); color: var(--text-3); }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--line-2); }
.topic-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 10px; border-radius: 999px; background: var(--tint); color: var(--brand); font: 600 13px/1 var(--font-display); text-decoration: none; }
.topic-chip .icon { width: 16px; height: 16px; }
.topic-chip:hover { color: var(--brand-strong); background: var(--tint-strong); }
.article-hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.6rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.04; margin: 20px 0 16px; max-width: 22ch; }
.article-dek { font: 500 clamp(1.1rem, 2vw, 1.4rem)/1.4 var(--font-display); letter-spacing: -.015em; color: var(--text-2); max-width: 46ch; margin: 0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 30px; font: 500 14px/1 var(--font-sans); color: var(--text-3); }
.article-meta .meta-item { display: inline-flex; align-items: center; gap: 7px; }
.article-meta .icon { width: 17px; height: 17px; }
.article-actions { margin-left: auto; display: flex; gap: 8px; }
@media (max-width: 640px) { .article-actions { margin-left: 0; } }

/* ---------- article layout ---------- */
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(48px, 6vw, 80px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; }
.toc summary { list-style: none; cursor: default; font: 600 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .icon { width: 16px; height: 16px; }
.toc summary .chev { display: none; margin-left: auto; transition: transform .2s; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none; font-size: 14px; line-height: 1.35; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
  .toc summary { cursor: pointer; margin: 0; }
  .toc summary .chev { display: inline-block; }
  .toc[open] summary { margin-bottom: 12px; }
  .toc[open] summary .chev { transform: rotate(180deg); }
}

/* ---------- article prose ---------- */
.prose { min-width: 0; max-width: 800px; font-size: 1.0625rem; line-height: 1.75; color: var(--text); }
.prose > * { max-width: 100%; }
.prose p, .prose > section > ul, .prose > section > ol, .prose li, .prose h2, .prose h3, .prose h4, .prose blockquote, .prose dl { overflow-wrap: break-word; }
.prose section > p, .prose section > ul, .prose section > ol, .prose section > h3, .prose section > h4, .prose .lede p { max-width: 70ch; }
.prose > section { margin-top: clamp(48px, 6vw, 72px); }
.prose > section:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.12; margin: 0 0 22px; }
.prose h3 { font-size: clamp(1.22rem, 1.9vw, 1.38rem); font-weight: 750; letter-spacing: -.02em; margin: 40px 0 12px; line-height: 1.25; }
.prose h4 { font-size: 1.07rem; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 8px; line-height: 1.3; }
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.35em; }
.prose li { margin: .45em 0; padding-left: .25em; }
.prose li > p { margin: 0; }
.prose ul > li::marker { color: var(--brand); }
.prose ol > li::marker { color: var(--brand); font-weight: 700; font-family: var(--font-display); font-size: .95em; }
.prose strong { font-weight: 650; color: var(--text); }
.prose a { color: var(--link); }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: .12em .38em; border-radius: 6px; overflow-wrap: anywhere; }
.prose pre { margin: 24px 0 28px; padding: 18px 20px; background: var(--navy-900); color: #DCE7F1; border-radius: var(--radius); overflow-x: auto; font: 400 13.5px/1.65 var(--font-mono); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose abbr[title] { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }

.lede { margin: 0 0 8px; font-size: clamp(1.12rem, 1.6vw, 1.28rem); line-height: 1.65; color: var(--text-2); }
.lede p { margin: 0 0 1em; }
.lede p:last-child { margin-bottom: 0; }
.audience { display: flex; gap: 12px; align-items: flex-start; margin: 28px 0 0; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-2); font-size: .95rem; line-height: 1.55; color: var(--text-2); max-width: none !important; }
.audience .icon { width: 20px; height: 20px; color: var(--brand); margin-top: 1px; }
.audience strong { color: var(--text); }

.takeaways { position: relative; margin: 28px 0 0; padding: clamp(22px, 3vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.takeaways::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--teal-400) 60%, var(--accent)); }
.takeaways h2 { font: 600 12.5px/1 var(--font-mono) !important; letter-spacing: .1em !important; text-transform: uppercase; color: var(--brand); margin: 0 0 18px !important; display: flex; align-items: center; gap: 8px; }
.takeaways h2 .icon { width: 17px; height: 17px; }
.takeaways ol, .takeaways ul { list-style: none; margin: 0; padding: 0; counter-reset: tk; display: grid; gap: 14px; }
.takeaways li { position: relative; margin: 0; padding-left: 42px; font-size: 1rem; line-height: 1.6; max-width: none; }
.takeaways li::before { counter-increment: tk; content: counter(tk); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; background: var(--tint); color: var(--brand); font: 700 13px/28px var(--font-display); text-align: center; }

.pullquote { margin: 40px 0; padding: 6px 0 6px 26px; border-left: 3px solid var(--accent); font: 700 clamp(1.3rem, 2.4vw, 1.62rem)/1.35 var(--font-display); letter-spacing: -.025em; color: var(--text); max-width: 34ch; }
.pullquote p { margin: 0; }
.pullquote cite { display: block; margin-top: 12px; font: 500 13px/1.4 var(--font-mono); font-style: normal; color: var(--text-3); letter-spacing: .02em; }

/* callouts */
.callout { --c: var(--brand); --cb: var(--tint); position: relative; margin: 32px 0; padding: 22px 24px 20px; border-radius: var(--radius); background: var(--cb); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.callout-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px !important; font: 600 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.callout-label .icon { width: 17px; height: 17px; }
.callout h4 { margin: 0 0 8px; font-size: 1.12rem; }
.callout p, .callout ul, .callout ol { font-size: 1rem; line-height: 1.65; max-width: none !important; }
.callout > :last-child { margin-bottom: 0; }
.callout ul, .callout ol { margin-bottom: .8em; }
.callout--practice { --c: var(--brand); --cb: var(--tint); }
.callout--caution { --c: var(--accent-text); --cb: var(--amber-tint); }
.callout--principle { --c: var(--text); --cb: var(--surface-2); }
.callout--note { --c: var(--text-3); --cb: var(--surface); }
.callout--note { border-color: var(--line); }
.callout--checklist { --c: var(--brand); --cb: var(--surface); border-color: var(--line); }

ul.checklist { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.checklist > li { position: relative; padding-left: 36px; margin: 0; }
ul.checklist > li::before { content: ""; position: absolute; left: 0; top: .18em; width: 24px; height: 24px; border-radius: 7px; background: var(--tint); }
ul.checklist > li::after { content: ""; position: absolute; left: 6px; top: calc(.18em + 6px); width: 12px; height: 12px; background: var(--brand); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat; }

ol.steps { list-style: none; padding: 0; margin: 24px 0 28px; counter-reset: step; }
ol.steps > li { position: relative; margin: 0; padding: 2px 0 22px 50px; max-width: 70ch; }
ol.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font: 700 14px/32px var(--font-display); text-align: center; }
ol.steps > li::after { content: ""; position: absolute; left: 15.5px; top: 40px; bottom: 6px; width: 1px; background: var(--line-2); }
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > strong:first-child { display: block; font-family: var(--font-display); font-weight: 700; margin-bottom: 2px; }

.cards { display: grid; gap: 14px; margin: 28px 0 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .cards--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); } }
@media (max-width: 560px) { .cards--2, .cards--3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; }
.card h4 { margin: 0 0 8px; font-size: 1.03rem; line-height: 1.3; }
.card p, .card ul { margin: 0; font-size: .95rem; line-height: 1.6; color: var(--text-2); }
.card ul { padding-left: 1.1em; }
.card li { margin: .3em 0; }
.card p + p, .card p + ul { margin-top: .6em; }
.cards--numbered { counter-reset: card; }
.cards--numbered .card h4::before { counter-increment: card; content: counter(card, decimal-leading-zero); display: block; margin-bottom: 10px; font: 600 12px/1 var(--font-mono); color: var(--brand); letter-spacing: .06em; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; margin: 28px 0 32px; }
.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--tint); }
.stat-value { display: block; font: 800 2rem/1 var(--font-display); letter-spacing: -.035em; color: var(--brand); }
.stat-label { display: block; margin-top: 8px; font-size: .92rem; line-height: 1.45; color: var(--text-2); }

/* tables */
.table-figure { margin: 32px 0 36px; }
.table-figure figcaption, .figure figcaption { display: flex; gap: 10px; align-items: baseline; font: 600 .95rem/1.4 var(--font-display); color: var(--text); letter-spacing: -.01em; }
.table-figure figcaption { margin: 0 0 12px; }
.cap-num { flex: none; font: 600 11.5px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.table-wrap table { min-width: 560px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { font: 650 12.5px/1.35 var(--font-display); color: var(--text-2); background: var(--surface-2); letter-spacing: 0; }
.prose tbody th { font-weight: 650; color: var(--text); font-family: var(--font-display); letter-spacing: -.005em; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose td ul { margin: 0; padding-left: 1.1em; }
.prose td li { margin: .15em 0; }

/* figures */
.figure { margin: 36px 0 40px; }
.figure figcaption { margin-top: 14px; font-weight: 500; font-size: .92rem; color: var(--text-2); }
.dg-frame { container-type: inline-size; background: var(--frame); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(14px, 3vw, 28px); overflow: hidden; }

/* glossary + references */
dl.glossary { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); margin: 8px 0 0; border-top: 1px solid var(--line); }
dl.glossary dt { padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); font: 700 .98rem/1.45 var(--font-display); letter-spacing: -.01em; }
dl.glossary dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: .98rem; line-height: 1.6; }
@media (max-width: 640px) { dl.glossary { grid-template-columns: 1fr; } dl.glossary dt { border-bottom: 0; padding: 14px 0 2px; } dl.glossary dd { padding-top: 0; } }
.references ol { font-size: .95rem; line-height: 1.6; color: var(--text-2); }
.references li { margin: .55em 0; }

.article-end { margin-top: clamp(48px, 6vw, 72px); padding-top: 24px; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.6; color: var(--text-3); }
.article-end p { max-width: 70ch; }

/* related + cta */
.related { padding: clamp(48px, 6vw, 80px) 0; background: var(--surface); border-top: 1px solid var(--line); }
.related h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -.03em; margin: 12px 0 26px; }
.cta-wrap { padding: clamp(48px, 6vw, 80px) 0; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-grid h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.035em; margin: 14px 0 18px; line-height: 1.1; }
.about-grid p { color: var(--text-2); font-size: 1.06rem; line-height: 1.7; }
.fact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.fact-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.fact-list b { font: 600 12px/1.6 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.fact-list span { color: var(--text); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .fact-list li { grid-template-columns: 1fr; gap: 2px; } }

.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.capability { display: grid; gap: 12px; align-content: start; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.capability h3 { font-size: 1.12rem; font-weight: 750; }
.capability p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }
@media (max-width: 960px) { .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .capability-grid { grid-template-columns: 1fr; } }

.engage-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; counter-reset: eng; }
.engage-list li { position: relative; padding: 22px 0 22px 56px; border-top: 1px solid var(--line); }
.engage-list li::before { counter-increment: eng; content: counter(eng, decimal-leading-zero); position: absolute; left: 0; top: 24px; font: 600 13px/1 var(--font-mono); color: var(--brand); letter-spacing: .06em; }
.engage-list h3 { font-size: 1.1rem; font-weight: 750; margin-bottom: 6px; }
.engage-list p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }
@media (max-width: 760px) { .engage-list { grid-template-columns: 1fr; } }

.case-study { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(24px, 4vw, 48px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.case-study h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.035em; margin: 14px 0 14px; }
.case-study p { color: var(--text-2); font-size: 1.02rem; line-height: 1.7; }
.case-study .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.case-points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.case-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.case-points .icon { width: 20px; height: 20px; color: var(--brand); margin-top: 2px; }
.case-points strong { color: var(--text); font-weight: 650; }
.case-visual { border-radius: var(--radius); background: var(--frame); border: 1px solid var(--line); padding: 18px; display: grid; gap: 12px; }
.mock-bar { display: flex; gap: 6px; align-items: center; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }
.mock-title { margin-left: 8px; font: 600 12px/1 var(--font-mono); color: var(--text-3); letter-spacing: .04em; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mock-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mock-kpi b { display: block; font: 800 1.05rem/1.2 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.mock-kpi span { font: 500 11px/1.3 var(--font-mono); color: var(--text-3); }
.mock-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 10px; }
.mock-chart svg { width: 100%; height: auto; }
.mock-legend { display: flex; gap: 14px; margin-top: 8px; font: 500 11px/1 var(--font-mono); color: var(--text-3); }
.mock-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mock-legend i { width: 10px; height: 3px; border-radius: 2px; display: block; }
.mock-legend .l-brand { background: var(--brand); }
.mock-legend .l-accent { background: var(--accent); }
.case-visual { margin: 0; }
.topic-links { margin-top: 28px; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.feature-grid + .quote-block { margin-top: 18px; }
.feature .text-link { margin-top: 4px; }
@media (max-width: 900px) { .case-study { grid-template-columns: 1fr; } }

/* ---------- back to top ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top .icon { width: 20px; height: 20px; }

/* ==========================================================================
   Diagrams (.dg). Each lives inside figure.figure.diagram > .dg-frame
   ========================================================================== */
.dg { font-family: var(--font-sans); font-size: .9rem; line-height: 1.45; color: var(--text); }
.dg h5 { font: 700 .97rem/1.25 var(--font-display); letter-spacing: -.01em; margin: 0 0 5px; color: var(--text); -webkit-hyphens: auto; hyphens: auto; overflow-wrap: normal; }
.dg p { margin: 0; color: var(--text-2); font-size: .86rem; line-height: 1.5; max-width: none !important; -webkit-hyphens: auto; hyphens: auto; }
.dg ul { margin: 6px 0 0; padding-left: 1.05em; font-size: .85rem; line-height: 1.5; color: var(--text-2); }
.dg li { margin: .15em 0; padding: 0; }
ol.dg, ul.dg, .dg ol, .dg ul.dg-chips, .dg ul.dg-spokes, .dg ul.dg-actors { margin: 0; padding: 0; list-style: none; max-width: none; }
.dg-box, .dg-col, .dg-q, .dg-flow > li, .dg-cycle > ol > li, .dg-layer, .dg-spokes > li, .dg-stairs > li, .dg-spectrum > ol > li, .dg-panel, .dg-decision > li, .dg-messages > li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px 14px;
}
.dg .is-key { background: var(--brand) !important; border-color: var(--brand) !important; }
.dg .is-key h5, .dg .is-key p, .dg .is-key li, .dg .is-key .dg-when { color: var(--brand-ink) !important; }
.dg .is-accent { background: var(--amber-tint) !important; border-color: var(--accent) !important; }
.dg-when { display: block; margin-bottom: 6px; font: 600 11px/1.3 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.dg-title { margin: 0 0 14px; text-align: center; font: 700 .98rem/1.3 var(--font-display); color: var(--text); }
.dg-note { margin-top: 12px !important; text-align: center; font-size: .82rem !important; color: var(--text-3) !important; }

/* 1. pillars */
.dg-pillars { display: grid; gap: 10px; }
.dg-roof, .dg-base { border-radius: 12px; padding: 13px 18px; text-align: center; font: 700 1rem/1.3 var(--font-display); letter-spacing: -.01em; }
.dg-roof { background: var(--solid); color: var(--solid-ink); }
.dg-base { background: var(--amber-tint); border: 1.5px solid var(--accent); color: var(--text); font-size: .93rem; font-weight: 650; }
.dg-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.dg-col { border-top: 3px solid var(--brand); }

/* 2. matrix */
.dg-matrix { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px 12px; }
.dg-axis-y { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 !important; font: 600 .78rem/1.25 var(--font-display) !important; color: var(--text-3) !important; letter-spacing: .01em; }
.dg-axis-x { grid-column: 2; grid-row: 2; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 !important; font: 600 .78rem/1.25 var(--font-display) !important; color: var(--text-3) !important; }
.dg-axis-x::after, .dg-axis-y::after { content: ""; width: 26px; height: 2px; flex: none; background: linear-gradient(90deg, var(--line-2), var(--text-3)); -webkit-mask: linear-gradient(#000, #000); border-radius: 2px; }
.dg-axis-y::after { width: 2px; height: 26px; background: linear-gradient(0deg, var(--text-3), var(--line-2)); }
.dg-quadrants { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dg-q { min-height: 116px; display: flex; flex-direction: column; justify-content: center; }
@container (max-width: 480px) { .dg-q { min-height: 0; padding: 11px 12px; } .dg-q p { font-size: .8rem; } }

/* 3. flow and 4. cycle */
.dg-flow, .dg-cycle > ol { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 26px; counter-reset: dgf; }
.dg-flow > li, .dg-cycle > ol > li { position: relative; }
.dg-flow > li::before, .dg-cycle > ol > li::before { counter-increment: dgf; content: counter(dgf); display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 9px; border-radius: 7px; background: var(--tint); color: var(--brand); font: 700 12px/1 var(--font-display); }
.dg-flow.no-num > li::before { display: none; }
.dg-flow > li:not(:last-child)::after, .dg-cycle > ol > li:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -21px; width: 16px; height: 16px; transform: translateY(-50%); background: var(--text-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dg-cycle { position: relative; padding-bottom: 46px; }
.dg-cycle::before { content: ""; position: absolute; left: calc(50% / var(--n, 4)); right: calc(50% / var(--n, 4)); bottom: 14px; height: 30px; border: 2px dashed var(--line-2); border-top: 0; border-radius: 0 0 16px 16px; }
.dg-cycle::after { content: ""; position: absolute; left: calc(50% / var(--n, 4) - 7px); bottom: 38px; width: 16px; height: 16px; background: var(--text-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.dg-loop { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); margin: 0 !important; padding: 0 10px; background: var(--frame); font: 600 .74rem/1.4 var(--font-mono) !important; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3) !important; white-space: nowrap; }
@container (max-width: 700px) {
  .dg-flow, .dg-cycle > ol { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dg-flow > li:not(:last-child)::after, .dg-cycle > ol > li:not(:last-child)::after { top: auto; right: auto; bottom: -21px; left: 50%; transform: translateX(-50%) rotate(90deg); }
  .dg-cycle { padding-bottom: 0; padding-right: 42px; }
  .dg-cycle::before { left: auto; right: 10px; top: 28px; bottom: 28px; width: 26px; height: auto; border: 2px dashed var(--line-2); border-left: 0; border-radius: 0 16px 16px 0; }
  .dg-cycle::after { left: auto; right: 30px; top: 21px; bottom: auto; transform: rotate(-90deg); }
  .dg-loop { position: static; transform: none; margin-top: 14px !important; display: block; text-align: center; background: none; white-space: normal; }
}

/* five steps in one row: tighter spacing so longer words fit */
@container (min-width: 701px) {
  .dg-flow[data-n="5"], .dg-cycle[data-n="5"] > ol { gap: 22px; }
  .dg-flow[data-n="5"] > li, .dg-cycle[data-n="5"] > ol > li { padding-inline: 11px; }
  .dg-flow[data-n="5"] h5, .dg-cycle[data-n="5"] h5 { font-size: .9rem; }
  .dg-flow[data-n="5"] > li:not(:last-child)::after, .dg-cycle[data-n="5"] > ol > li:not(:last-child)::after { right: -19px; }
}

/* very narrow frames (small phones): tighter boxes, smaller type, wrap as a last resort */
@container (max-width: 400px) {
  .dg h5 { font-size: .84rem; overflow-wrap: anywhere; }
  .dg p, .dg li { font-size: .78rem; }
  .dg-q, .dg-hub .dg-spokes > li { padding: 9px 9px 10px; }
  .dg-matrix { gap: 8px; }
  .dg-quadrants { gap: 8px; }
}

/* six or more steps: flows and cycles wrap into rows of three (numbers carry the order) */
@container (min-width: 701px) {
  .dg-flow[data-wrap], .dg-cycle[data-wrap] > ol { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
  .dg-flow[data-wrap] > li:nth-child(3n)::after, .dg-cycle[data-wrap] > ol > li:nth-child(3n)::after { display: none; }
  .dg-cycle[data-wrap] { padding-bottom: 0; }
  .dg-cycle[data-wrap]::before, .dg-cycle[data-wrap]::after { display: none; }
  .dg-cycle[data-wrap] .dg-loop { position: static; transform: none; display: block; margin-top: 16px !important; text-align: center; background: none; white-space: normal; }
  .dg-cycle[data-wrap] .dg-loop::before { content: "\21BB  "; font-size: 1.1em; }
}

/* 5. layers */
.dg-layers { display: flex; gap: 10px; align-items: stretch; }
.dg-stack { flex: 1; min-width: 0; display: grid; gap: 8px; }
.dg-layer { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr); gap: 14px; align-items: center; border-left: 4px solid var(--teal-400); }
.dg-layer:nth-child(2) { border-left-color: var(--teal-500); }
.dg-layer:nth-child(3) { border-left-color: var(--teal-600); }
.dg-layer:nth-child(4) { border-left-color: var(--teal-700); }
.dg-layer:nth-child(n+5) { border-left-color: var(--navy-700); }
.dg-layer h5 { margin: 0; }
.dg-layer > div > p + .dg-chips, .dg-layer > div > h5 + .dg-chips { margin-top: 8px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-chips > li { margin: 0; font-size: .78rem; line-height: 1.2; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.dg-side { flex: none; width: 44px; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--solid); color: var(--solid-ink); font: 650 .82rem/1.2 var(--font-display); letter-spacing: .01em; }
.dg-side + .dg-side { background: var(--brand); color: var(--brand-ink); }
@container (max-width: 560px) {
  .dg-layers { flex-direction: column; }
  .dg-layer { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .dg-side { width: auto; writing-mode: horizontal-tb; transform: none; padding: 10px 14px; }
}

/* 6. hub */
.dg-hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(84px, auto); gap: 10px; }
.dg-spokes { display: contents; }
.dg-center { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 16px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 16%, transparent); }
.dg-center h5 { color: var(--brand-ink); font-size: 1.05rem; }
.dg-center p { color: var(--brand-ink); opacity: .9; }
.dg-spokes > li { display: flex; flex-direction: column; justify-content: center; }
.dg-hub[data-n="3"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 2; } .dg-hub[data-n="3"] .dg-spokes > li:nth-child(2) { grid-area: 3 / 3; } .dg-hub[data-n="3"] .dg-spokes > li:nth-child(3) { grid-area: 3 / 1; }
.dg-hub[data-n="4"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 2; } .dg-hub[data-n="4"] .dg-spokes > li:nth-child(2) { grid-area: 2 / 3; } .dg-hub[data-n="4"] .dg-spokes > li:nth-child(3) { grid-area: 3 / 2; } .dg-hub[data-n="4"] .dg-spokes > li:nth-child(4) { grid-area: 2 / 1; }
.dg-hub[data-n="5"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 2; } .dg-hub[data-n="5"] .dg-spokes > li:nth-child(2) { grid-area: 2 / 3; } .dg-hub[data-n="5"] .dg-spokes > li:nth-child(3) { grid-area: 3 / 3; } .dg-hub[data-n="5"] .dg-spokes > li:nth-child(4) { grid-area: 3 / 1; } .dg-hub[data-n="5"] .dg-spokes > li:nth-child(5) { grid-area: 2 / 1; }
.dg-hub[data-n="6"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 1; } .dg-hub[data-n="6"] .dg-spokes > li:nth-child(2) { grid-area: 1 / 2; } .dg-hub[data-n="6"] .dg-spokes > li:nth-child(3) { grid-area: 1 / 3; } .dg-hub[data-n="6"] .dg-spokes > li:nth-child(4) { grid-area: 3 / 3; } .dg-hub[data-n="6"] .dg-spokes > li:nth-child(5) { grid-area: 3 / 2; } .dg-hub[data-n="6"] .dg-spokes > li:nth-child(6) { grid-area: 3 / 1; }
.dg-hub[data-n="7"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 1; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(2) { grid-area: 1 / 2; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(3) { grid-area: 1 / 3; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(4) { grid-area: 2 / 3; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(5) { grid-area: 3 / 3; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(6) { grid-area: 3 / 2; } .dg-hub[data-n="7"] .dg-spokes > li:nth-child(7) { grid-area: 3 / 1; }
.dg-hub[data-n="8"] .dg-spokes > li:nth-child(1) { grid-area: 1 / 1; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(2) { grid-area: 1 / 2; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(3) { grid-area: 1 / 3; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(4) { grid-area: 2 / 3; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(5) { grid-area: 3 / 3; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(6) { grid-area: 3 / 2; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(7) { grid-area: 3 / 1; } .dg-hub[data-n="8"] .dg-spokes > li:nth-child(8) { grid-area: 2 / 1; }
@container (max-width: 560px) {
  .dg-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .dg-hub .dg-center { grid-column: 1 / -1; grid-row: auto; }
  .dg-hub .dg-spokes > li { grid-area: auto !important; padding: 11px 11px 12px; }
  .dg-hub .dg-spokes h5 { font-size: .88rem; }
}

/* 7. pyramid */
.dg-pyramid { display: grid; gap: 6px; justify-items: center; }
.dg-pyramid > li { width: calc(42% + 58% * var(--i, 0) / max(1, var(--n, 3) - 1)); max-width: 100%; text-align: center; border-radius: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); }
.dg-pyramid > li:nth-child(1) { background: var(--brand); border-color: var(--brand); }
.dg-pyramid > li:nth-child(1) h5, .dg-pyramid > li:nth-child(1) p { color: var(--brand-ink); }
.dg-pyramid > li:nth-child(2) { background: var(--tint-strong); border-color: transparent; }
.dg-pyramid > li:nth-child(3) { background: var(--tint); border-color: transparent; }
@container (max-width: 480px) { .dg-pyramid > li { width: calc(70% + 30% * var(--i, 0) / max(1, var(--n, 3) - 1)); } }

/* 8. timeline */
.dg.dg-timeline { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 18px; padding-top: 30px; }
.dg-timeline::before { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--brand) 30%, var(--line-2)); border-radius: 2px; }
.dg-timeline > li { position: relative; }
.dg-timeline > li::before { content: ""; position: absolute; top: -30px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--frame); }
.dg-timeline > li:first-child::before { background: var(--accent); }
.dg-timeline h5 { margin-bottom: 4px; }
@container (max-width: 700px) {
  .dg.dg-timeline { grid-template-columns: minmax(0, 1fr); padding: 0 0 0 32px; gap: 20px; }
  .dg-timeline::before { left: 8px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; background: linear-gradient(180deg, var(--accent), var(--brand) 30%, var(--line-2)); }
  .dg-timeline > li::before { top: 2px; left: -32px; }
}

.dg.dg-timeline[data-wrap] { grid-template-columns: minmax(0, 1fr); padding: 0 0 0 32px; gap: 18px; }
.dg-timeline[data-wrap]::before { left: 8px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; background: linear-gradient(180deg, var(--accent), var(--brand) 30%, var(--line-2)); }
.dg-timeline[data-wrap] > li::before { top: 2px; left: -32px; }

/* 9. stairs (maturity path) */
.dg-stairs { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; align-items: end; }
.dg-stairs > li { min-height: calc(104px + var(--i, 0) * 30px); display: flex; flex-direction: column; border-radius: 12px 12px 6px 6px; border-top: 3px solid var(--brand); }
.dg-stairs > li:last-child { background: var(--brand); border-color: var(--brand); }
.dg-stairs > li:last-child h5, .dg-stairs > li:last-child p, .dg-stairs > li:last-child .dg-when { color: var(--brand-ink); }
@container (max-width: 760px) {
  .dg-stairs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dg-stairs > li { min-height: 0; margin-left: calc(var(--i, 0) * 10px); border-radius: 12px; }
}

/* 10. spectrum */
.dg-spectrum > ol { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; }
.dg-scale { position: relative; display: flex; justify-content: space-between; gap: 16px; margin: 16px 0 0 !important; padding-top: 16px; font: 600 .78rem/1.3 var(--font-display) !important; color: var(--text-3) !important; }
.dg-scale::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--tint-strong), var(--brand)); }
.dg-scale span:last-child { text-align: right; }
@container (max-width: 600px) { .dg-spectrum > ol { grid-template-columns: minmax(0, 1fr); } }

/* 11. sequence */
.dg-actors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px !important; }
.dg-actors > li { font: 650 .8rem/1 var(--font-display); padding: 8px 12px; border-radius: 999px; background: var(--solid); color: var(--solid-ink); }
.dg-messages { display: grid; gap: 8px; counter-reset: msg; }
.dg-messages > li { position: relative; padding-left: 52px !important; }
.dg-messages > li::before { counter-increment: msg; content: counter(msg); position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--tint); color: var(--brand); font: 700 12px/1 var(--font-display); }
.dg-route { display: block; margin-bottom: 4px; font: 600 .76rem/1.3 var(--font-mono); color: var(--brand); letter-spacing: .02em; }

/* 12. compare */
.dg-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.dg-panel { border-top: 3px solid var(--brand); }
.dg-panel:nth-child(2) { border-top-color: var(--accent); }
.dg-panel:nth-child(3) { border-top-color: var(--navy-700); }
.dg-panel:nth-child(4) { border-top-color: var(--teal-400); }

/* 13. decision */
.dg-decision { display: grid; gap: 10px; counter-reset: q; }
.dg-decision > li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px 18px; align-items: center; }
.dg-question { position: relative; padding-left: 34px; font: 650 .92rem/1.4 var(--font-display) !important; color: var(--text) !important; }
.dg-question::before { counter-increment: q; content: "Q" counter(q); position: absolute; left: 0; top: 0; font: 600 .72rem/1.9 var(--font-mono); color: var(--brand); }
.dg-answers { display: grid; gap: 6px; }
.dg-answer { display: flex; gap: 10px; align-items: baseline; font-size: .85rem !important; }
.dg-answer > b { flex: none; min-width: 34px; text-align: center; font: 700 .68rem/1.9 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; background: var(--tint); color: var(--brand); }
.dg-answer.no > b { background: var(--surface-2); color: var(--text-3); }
@container (max-width: 560px) { .dg-decision > li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- print ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  :root { --bg: #fff; --surface: #fff; --frame: #fff; --text: #000; --text-2: #222; --text-3: #444; --line: #ccc; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .toc, .progress, .to-top, .article-actions, .related, .cta-wrap, .breadcrumb, .skip-link { display: none !important; }
  .article-hero { background: none; border: 0; padding: 0 0 12pt; }
  .article-layout { display: block; padding: 0; }
  .container { max-width: none; padding: 0; }
  .prose { max-width: none; font-size: 11pt; }
  .prose a { color: #000; text-decoration: none; }
  .figure, .table-figure, .callout, .takeaways, .card, tr, .dg-frame { break-inside: avoid; }
  .prose h2, .prose h3 { break-after: avoid; }
  .takeaways, .callout, .dg-frame, .table-wrap { box-shadow: none; }
}
