/* Research article template v1 */
.crumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.crumb a:hover { color: var(--violet); }
.crumb b { font-weight: 600; color: var(--ink); }
.crumb--light { color: rgba(255,255,255,.62); }
.crumb--light a:hover { color: #fff; }
.crumb--light b { color: #fff; }

/* 1. header */
.ahero { margin: 0 16px; padding: 40px 0 64px; border-radius: 0 0 32px 32px; background: var(--ink); color: #fff; }
.ahero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.ahero__series { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-light); margin-bottom: 16px; }
.ahero__h { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.12; font-weight: 400; letter-spacing: -.01em; text-wrap: balance; }
.ahero__dek { margin-top: 20px; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.78); max-width: 56ch; }
.ahero__meta { list-style: none; margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; font-size: 14px; color: rgba(255,255,255,.72); }
.ahero__by { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 500; }
.ahero__by img { border-radius: 50%; background: #fff; padding: 3px; }
.tlp { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: #fff; }
.ahero__cover { margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.ahero__cover img { display: block; width: 100%; height: auto; }

/* 2. body grid */
.abody { display: grid; grid-template-columns: 220px minmax(0, 720px); justify-content: space-between; gap: 64px; padding-top: 72px; padding-bottom: 96px; }
.toc { position: sticky; top: 110px; align-self: start; display: grid; gap: 14px; }
.toc__h { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc__list a { display: grid; grid-template-columns: 24px 1fr; padding: 7px 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.toc__list li { counter-increment: toc; }
.toc__list a::before { content: counter(toc, decimal-leading-zero); font-size: 12px; font-weight: 700; color: var(--violet); line-height: 20px; }
.toc__list a:hover { color: var(--violet); }
.toc__track { height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; }
.toc__fill { display: block; height: 100%; background: var(--violet); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .toc__fill { animation: tocfill linear both; animation-timeline: scroll(root); }
  @keyframes tocfill { to { transform: scaleX(1); } }
}
.share--rail { margin-top: 18px; display: grid; gap: 10px; }
.share__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.share__list a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #D0D5DD; color: var(--ink); transition: border-color .2s, color .2s; }
.share__list a:hover { border-color: var(--violet); color: var(--violet); }
.share__list svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 3. prose */
.prose { font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.prose section { scroll-margin-top: 100px; }
.prose section + section { margin-top: 72px; }
.prose p + p { margin-top: 20px; }
.prose h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.2; color: var(--ink); margin-bottom: 24px; text-wrap: balance; }
.prose h3 { font-size: 22px; line-height: 1.35; font-weight: 500; color: var(--ink); margin: 44px 0 14px; text-wrap: balance; }
.prose .lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
.fnum { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 12px; border-radius: 50%; background: var(--violet-tint); color: var(--violet); font-size: 15px; font-weight: 700; vertical-align: 2px; }

/* data block */
.dstat { margin-top: 40px; padding: 28px 28px 8px; border-radius: 18px; background: var(--warm); }
.prose .dstat__h { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.dstat__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.dstat__grid > div { padding: 20px 0; border-top: 1px solid rgba(16,24,40,.1); }
.dstat__grid > div:nth-child(-n+2) { border-top: 0; }
.dstat dt { font-size: 40px; line-height: 1.1; font-weight: 400; color: var(--ink); letter-spacing: -.01em; }
.dstat dd { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.src { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* confidence labels */
.conf { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; }
.conf li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.conf b { padding: 2px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.conf span { font-size: 13px; font-weight: 600; color: var(--violet); text-transform: uppercase; letter-spacing: .06em; }

/* figure */
.fig, .tbl { margin: 36px 0 0; }
.fig__frame { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.fig__frame img { display: block; width: 100%; height: auto; }
figcaption { margin-top: 12px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
figcaption b { color: var(--ink); font-weight: 600; }
figcaption .src { display: inline; margin: 0 0 0 4px; }

/* table */
.tbl__scroll { overflow-x: auto; border: 1px solid #E4E7EC; border-radius: 16px; }
.tbl__scroll:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.tbl table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.tbl thead th { padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #F9FAFB; border-bottom: 1px solid #E4E7EC; }
.tbl td, .tbl tbody th { padding: 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #EEF1F6; color: var(--ink-2); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody th { width: 26%; font-weight: 600; color: var(--ink); }
.pnum { display: block; font-size: 12px; font-weight: 700; color: var(--violet); margin-bottom: 2px; }
.who { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1.4; }
.who--s { background: #F1EAFB; color: #4A1E8F; }
.who--b { background: #EEF1F6; color: var(--ink); }
.who--c { background: #E8F4EC; color: #1E6B3A; }
.who--n { background: #FDECEC; color: #9F1A23; }

/* case callout */
.case { margin-top: 40px; padding: 28px; border-radius: 18px; background: var(--ink); color: rgba(255,255,255,.8); font-size: 16.5px; line-height: 1.65; }
.case__k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red-light); }
.case h4 { margin: 8px 0 12px; font-size: 21px; line-height: 1.35; font-weight: 500; color: #fff; }
.case__lesson { margin-top: 18px !important; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); color: #fff; }
.case__lesson b { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #C9B3EE; }

.sample-note { margin-top: 56px !important; padding: 14px 18px; border-radius: 12px; border: 1px dashed #D0D5DD; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* tags + author */
.afoot { margin-top: 48px; padding-top: 32px; border-top: 1px solid #E4E7EC; display: grid; gap: 32px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: block; padding: 7px 14px; border-radius: 999px; background: #F2F4F7; font-size: 14px; line-height: 1.3; color: var(--ink-2); transition: background .2s, color .2s; }
.tags a:hover { background: var(--violet-tint); color: var(--violet); }
.author { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 24px; border-radius: 18px; background: var(--warm); }
.author__mark { border-radius: 50%; background: #fff; padding: 6px; }
.author__k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.author__n { margin-top: 2px !important; font-size: 19px; font-weight: 600; color: var(--ink); }
.author__d { margin-top: 6px !important; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* related */
.rel { padding: 0 0 96px; }
.rel__head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.rel__head h2 { font-size: clamp(26px, 2.4vw, 32px); }
.rel__all { font-size: 16px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.rel__all:hover { color: var(--violet); }
.rel__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rcard { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; height: 100%; padding: 24px; border-radius: 18px; border: 1px solid #E4E7EC; background: #fff; transition: border-color .2s, transform .2s; }
.rcard:hover { border-color: #C9B3EE; transform: translateY(-2px); }
.rcard__k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.rcard__t { font-size: 19px; line-height: 1.4; color: var(--ink); }
.rcard__go { font-size: 15px; font-weight: 500; color: var(--ink); }

@media (max-width: 1000px) {
  .ahero__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .ahero__cover { max-width: 560px; }
  .abody { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 48px; }
  .toc { position: static; margin-bottom: 40px; padding: 20px; border-radius: 16px; background: #F9FAFB; }
  .toc__track, .share--rail { display: none; }
  .rel__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ahero { margin: 0 8px; padding: 28px 0 40px; border-radius: 0 0 24px 24px; }
  .ahero__dek { font-size: 17px; }
  .prose { font-size: 17px; }
  .prose .lead { font-size: 19px; }
  .dstat { padding: 22px 20px 4px; }
  .dstat__grid { grid-template-columns: minmax(0, 1fr); }
  .dstat__grid > div:nth-child(2) { border-top: 1px solid rgba(16,24,40,.1); }
  .fig__frame { padding: 10px; }
  .case { padding: 22px 20px; }
  .author { grid-template-columns: 48px minmax(0, 1fr); padding: 20px; }
  .author .share__list { grid-column: 1 / -1; }
  .rel__head { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .toc__fill { animation: none; }
  .rcard { transition: none; }
}

/* Type system (2026-11): Poppins for headings and titles, Inter for content and numbers */
:root { --font: "Inter", "Helvetica Neue", Arial, sans-serif; --font-head: "Poppins", "Helvetica Neue", Arial, sans-serif; }
.gnav, .gnav * { font-family: var(--font); }
h1, h2, h3, h4, .ahero__h, .rcard__t, .author__n, .finalc h2 { font-family: var(--font-head); }
h1, .ahero__h { font-weight: 500; letter-spacing: -.015em; }
h2 { font-weight: 500; letter-spacing: -.01em; }
.prose h3, .case h4 { font-weight: 500; letter-spacing: -.005em; }
.ahero__h { font-size: clamp(30px, 3.3vw, 44px); line-height: 1.16; }
.prose h2 { font-size: clamp(26px, 2.4vw, 33px); }
.prose h3 { font-size: 21px; }
.rcard__t { font-size: 18px; font-weight: 500; }
.dstat dt { font-family: var(--font); font-weight: 500; letter-spacing: -.02em; }
.prose { font-size: 17px; line-height: 1.72; }
.prose .lead { font-size: 20px; }
/* r2 fixes */
.prose h3:has(.fnum) { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.prose h3 .fnum { margin: 0; vertical-align: 0; margin-top: 1px; }
.who { border-radius: 8px; }
.tbl thead th:nth-child(3), .tbl td:nth-child(3) { min-width: 150px; }

/* ===== v2: full-length components ===== */
/* findings list */
.kf { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: kf; }
.kf > li { padding: 28px 0; border-top: 1px solid #E4E7EC; }
.kf > li:last-child { border-bottom: 1px solid #E4E7EC; }
.prose .kf h3 { margin: 0 0 10px; }
.kf p { font-size: 16.5px; line-height: 1.68; }
.kf .conf { margin-top: 14px; }
.prose .fnote { margin-top: 20px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* prose lists */
.prose ul.ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.prose ul.ul li { position: relative; padding-left: 26px; }
.prose ul.ul li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; border-radius: 2px; background: var(--violet); }
.prose .ul + p { margin-top: 20px; }

/* assessment box */
.assess { margin-top: 44px; padding: 28px 28px 30px; border-radius: 18px; background: var(--warm); }
.prose .assess h3 { margin: 0 0 12px; font-size: 13px; font-family: var(--font); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.assess p:first-of-type { font-size: 19px; line-height: 1.6; color: var(--ink); }
.assess p + p { font-size: 16px; }

/* tables: generic text tables */
.tbl + p, .fig + p, .lessons + h3 { margin-top: 28px; }
.tbl--text tbody th { width: 22%; }
.tbl--text td:nth-child(3) { min-width: 0; }
.tbl tr.is-new > * { background: #FBF8FF; }
.newb { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.tbl--measures table { min-width: 760px; }
.tbl--measures td:nth-child(2) { color: var(--ink); font-weight: 500; }
.tbl--measures td:nth-child(3), .tbl--measures td:nth-child(4) { font-size: 14px; color: var(--muted); }

/* lessons grid */
.lessons { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lesson { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 22px 22px 20px; border-radius: 16px; border: 1px solid #E4E7EC; background: #fff; font-size: 15.5px; line-height: 1.6; }
.lesson__k { align-self: start; padding: 3px 10px; border-radius: 8px; background: var(--violet-tint); color: var(--violet); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.prose .lesson h4 { margin: 0; font-size: 17.5px; line-height: 1.35; font-weight: 500; color: var(--ink); }
.lesson p { margin: 0; }
.lesson .lesson__l { margin-top: auto; padding-top: 12px; border-top: 1px solid #EEF1F6; color: var(--ink); }
.lesson__l b { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.lesson--wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .lessons { grid-template-columns: minmax(0, 1fr); }
  .assess { padding: 22px 20px; }
}
/* v2 r1 */
@media (min-width: 1001px) { .abody { grid-template-columns: 220px minmax(0, 760px); } }
.tbl--measures table { min-width: 700px; }
.tbl--measures tbody th { width: 21%; }
.tbl--measures td:nth-child(4) { width: 17%; }

/* ===== Dark mode (html[data-theme="dark"]) ===== */
/* intentionally-dark panels: pin background so the global --ink text-color
   flip (shared/base.css) doesn't lighten them — they already carry literal
   white/rgba(255,255,255,…) text. */
html[data-theme="dark"] .ahero,
html[data-theme="dark"] .conf b,
html[data-theme="dark"] .case { background: #101828; }

/* light cards/surfaces (literal #fff as a surface, not a button/icon color):
   swap to the shared dark card surface and keep borders visible. */
html[data-theme="dark"] .fig__frame,
html[data-theme="dark"] .rcard,
html[data-theme="dark"] .lesson { background: #1D2939; border-color: rgba(255,255,255,.1); }

/* mobile sticky-TOC fallback box: only has a background below 1000px
   (desktop rail is transparent against the page), so scope the pin to match. */
@media (max-width: 1000px) {
  html[data-theme="dark"] .toc { background: #1D2939; }
}

/* tables: header row + row borders are light-grey literals by default */
html[data-theme="dark"] .tbl thead th { background: #161C2C; border-color: rgba(255,255,255,.12); color: #98A2B3; }
html[data-theme="dark"] .tbl td,
html[data-theme="dark"] .tbl tbody th { border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .tbl__scroll { border-color: rgba(255,255,255,.14); }
html[data-theme="dark"] .who--b { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .tbl tr.is-new > * { background: rgba(165,110,244,.1); }

/* crumb / tags / borders that are literal light-grey */
html[data-theme="dark"] .afoot,
html[data-theme="dark"] .kf > li,
html[data-theme="dark"] .kf > li:last-child { border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .tags a { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .share__list a { border-color: rgba(255,255,255,.2); }
html[data-theme="dark"] .author__mark,
html[data-theme="dark"] .ahero__by img { background: #1D2939; }
html[data-theme="dark"] .sample-note { border-color: rgba(255,255,255,.2); }
html[data-theme="dark"] .lesson .lesson__l,
html[data-theme="dark"] .lesson { border-color: rgba(255,255,255,.1); }
