/* ==========================================================================
   NatusAI — research pages (/research/ + articles). Squad S1, generated pages: design/tools/gen_research.py
   Loaded after styles.css, only on the research pages. Uses the shared tokens (band-aware --fg/--text/--accent…).
   ========================================================================== */

/* ---------- index ---------- */
.research-hero .container > * + * { margin-top: var(--s-5); }
.research-hero .display { max-width: 14ch; }
.research-hero__kicker { font-size: var(--fs-h3); color: var(--fg); font-weight: 600; letter-spacing: -0.02em; }

.research-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-3) var(--s-6);
  padding-bottom: var(--s-4); margin-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
.research-label h2 { font-size: var(--fs-h3); }
.research-label span { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .12em; text-transform: uppercase; color: var(--meta); }

.research-feature { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; }
.research-feature__media { --ratio: 3 / 2; border-radius: 0; }
.research-feature__body { padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); display: flex; flex-direction: column; gap: var(--s-4); }
.research-feature__title { font-size: var(--fs-h3); line-height: 1.25; }
.research-feature__title a { color: var(--fg); text-decoration: none; }
.research-feature .card__foot { margin-top: auto; }
@media (min-width: 64em) {
  .research-feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: stretch; }
  .research-feature__media { height: 100%; }
  .research-feature__title { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); }
}

.research-about { display: grid; gap: var(--s-7); grid-template-columns: minmax(0, 1fr); }
.research-about h2 { margin-top: var(--s-4); }
.research-about__links { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-6) !important; }
@media (min-width: 64em) { .research-about { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--s-10); } }

/* ---------- article meta (both pages) ---------- */
.article-meta { display: flex; flex-wrap: wrap; gap: var(--s-2) 0; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--meta); }
.article-meta span + span::before { content: "·"; margin: 0 .7em; opacity: .7; }
.article-meta span:first-child { color: var(--accent); font-weight: 600; }
@media (max-width: 40em) { .article-meta { gap: .3em 1.1em; } .article-meta span + span::before { display: none; } }

/* ---------- article hero ---------- */
.article-hero { padding-bottom: 0; }
.article-hero__inner { max-width: min(860px, 100% - 2 * var(--gutter)); }
.article-hero__inner > * + * { margin-top: var(--s-5); }
.article-hero__title { font-size: var(--fs-display); line-height: 1.04; letter-spacing: -0.04em; font-weight: 600; }
.article-subtitle { font-size: var(--fs-h3); color: var(--fg); font-weight: 600; letter-spacing: -0.02em; background: var(--grad-hero-text); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.article-deck { font-size: var(--fs-lead); line-height: 1.6; color: var(--text); max-width: 40em; }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--line); color: var(--fg); font-weight: 600; font-size: var(--fs-meta); }
.article-byline .text-link { font-weight: 600; margin-left: auto; }
@media (max-width: 40em) { .article-byline .text-link { margin-left: 0; flex-basis: 100%; } }
.article-cover { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); max-width: 1080px; position: relative; z-index: 1; }
.article-cover img { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--border); border-bottom: 0; }

/* ---------- layout: sticky TOC + reading column ---------- */
.article-band { padding-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
.article-sidebar { display: grid; gap: var(--s-5); align-content: start; }
.article-toc, .article-status { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow); }
.article-toc__title { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .12em; text-transform: uppercase; color: var(--meta); font-weight: 600; margin-bottom: var(--s-2); }
.article-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.article-toc li { counter-increment: toc; border-top: 1px solid var(--line); }
.article-toc li:first-child { border-top: 0; }
.article-toc a { display: flex; gap: .75em; align-items: baseline; min-height: 44px; padding: .65em 0; color: var(--fg); text-decoration: none; font-weight: 550; font-size: .9375rem; line-height: 1.35; }
.article-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent); letter-spacing: .06em; flex: none; }
.article-toc a:hover { color: var(--accent); text-decoration: underline; }
.article-status { font-size: var(--fs-meta); line-height: 1.55; border-left: 3px solid var(--c-blue-700); }
.article-status > * + * { margin-top: var(--s-3); }
.article-status .text-link { font-size: var(--fs-meta); }
@media (min-width: 64em) {
  .article-layout { grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(3rem, 1rem + 4vw, 5.5rem); }
  .article-sidebar { position: sticky; top: calc(var(--header-h) + var(--s-6)); max-height: calc(100vh - var(--header-h) - var(--s-8)); overflow: auto; }
}
@media (max-width: 63.99em) { .article-sidebar { max-width: var(--measure); } }

/* ---------- reading column: editorial typography ---------- */
.article-body { max-width: 70ch; font-size: 1.0625rem; line-height: 1.75; color: var(--text); }
@media (min-width: 48em) { .article-body { font-size: 1.125rem; } }
.article-body > * + *, .article-body section > * + * { margin-top: 1.15em; }
.article-body section { scroll-margin-top: calc(var(--header-h) + var(--s-5)); margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); padding-top: clamp(2rem, 1.5rem + 1.5vw, 3rem); border-top: 1px solid var(--line); }
.article-body h2 { font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem); line-height: 1.18; margin-top: .35em !important; }
.article-body h3 { font-size: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem); margin-top: 2em !important; }
.article-body h3 + p { margin-top: .6em; }
.article-body strong { color: var(--fg); }
.article-body a:not(.text-link):not(.btn) { color: var(--link); }
.article-opening { font-size: 1.2em; line-height: 1.6; color: var(--fg); font-weight: 500; }
.article-kicker { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.article-pull { margin: 2em 0 !important; padding: .2em 0 .2em 1.1em; border-left: 3px solid; border-image: var(--grad-brand) 1; }
.article-pull p { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); line-height: 1.3; color: var(--fg); font-weight: 600; letter-spacing: -0.02em; }
.article-aside { background: var(--surface-2); border-radius: var(--r-sm); padding: 1em 1.2em; font-size: .95em; color: var(--fg); }

/* ---------- figures ---------- */
.article-figure { margin-block: 2.2em !important; font-size: 1rem; line-height: 1.55; }
.figure-title { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .1em; text-transform: uppercase; color: var(--meta); font-weight: 600; margin-bottom: var(--s-4); }
.diagram-kicker { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.diagram-note { font-size: .875rem; color: var(--meta); line-height: 1.5; }
@media (min-width: 80em) { .article-wide { margin-right: -6rem; } }

/* architecture comparison */
.arch-compare__cols { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .arch-compare__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.arch-col { display: flex; flex-direction: column; gap: var(--s-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow); }
.arch-col > p:last-child { font-size: .875rem; color: var(--text); margin-top: auto; }
.arch-col--cygnus { border-color: var(--c-violet-600); box-shadow: 0 0 0 3px rgba(123,104,238,.12), var(--shadow); }
.arch-box, .arch-data { border-radius: var(--r-sm); padding: .7em .8em; text-align: center; }
.arch-box { background: var(--surface-2); color: var(--fg); display: flex; flex-direction: column; gap: .15em; }
.arch-box span { font-size: .8125rem; color: var(--meta); }
.arch-data { border: 1.5px dashed var(--line-strong); color: var(--fg); font-weight: 600; font-size: .875rem; }
.arch-connector { text-align: center; color: var(--accent); font-weight: 700; line-height: 1; }
.arch-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.arch-services span { background: var(--surface-2); border-radius: var(--r-xs); padding: .55em .2em; font-size: .75rem; text-align: center; color: var(--fg); font-weight: 600; }
.arch-services--data span { background: transparent; border: 1.5px dashed var(--line-strong); }

/* topology (static replacement for the live <research-topology> explorer) */
.topology__grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); counter-reset: none; }
@media (min-width: 40em) { .topology__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.topology__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--s-3); font-size: .9375rem; }
.topology__card .diagram-note { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--line); }
.topology__title { font-size: 1.125rem; font-weight: 650; color: var(--fg); letter-spacing: -0.015em; line-height: 1.3; }
.topology__art { background: var(--c-navy-900); border-radius: var(--r-sm); padding: var(--s-3); }
.topology__svg { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.topology__svg .t-node { fill: #181B44; stroke: #4A4F92; stroke-width: 1.2; }
.topology__svg .t-group { fill: none; stroke: #C1A5FF; stroke-opacity: .55; stroke-dasharray: 4 4; stroke-width: 1.2; }
.topology__svg .t-code { fill: #2B2F66; }
.topology__svg .t-data { fill: #6495ED; fill-opacity: .85; }
.topology__svg .t-part { fill: #DF73FF; fill-opacity: .8; }
.topology__svg .t-link { fill: none; stroke: #C9B9FF; stroke-width: 1.6; stroke-dasharray: 3 3; }
.topology__svg .t-route { fill: none; stroke: #9EBAFF; stroke-width: 1.4; }
.topology__svg .t-txt { fill: #E4DFFF; font: 600 11px/1 var(--font-mono); text-anchor: middle; letter-spacing: .04em; }
.topology__svg .t-txt--data { fill: #0E1026; font-size: 11.5px; }
.topology__svg .t-txt--meta { fill: #9EBAFF; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.topology__legend { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: .4em .6em; }
.t-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; }
.t-key--data { background: #6495ED; }
.t-key--part { background: #DF73FF; margin-left: .6em; }

/* temporal model */
.temporal-model { background: var(--c-navy-900); color: var(--c-muted-dark); border-radius: var(--r-lg); padding: clamp(1.25rem, .8rem + 2vw, 2.25rem); }
.temporal-model .figure-title { color: var(--c-meta-dark); }
.temporal-model .diagram-note { color: var(--c-meta-dark); margin-top: var(--s-4); }
.temporal-model strong { color: var(--c-star); }
.temporal-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2em; padding: var(--s-4); border: 1px solid #353A78; border-radius: var(--r-md); background: radial-gradient(80% 120% at 50% 0%, rgba(123,104,238,.22), transparent 70%); }
.temporal-center > span:last-child { font-size: .875rem; }
.node-light { width: 12px; height: 12px; border-radius: 50%; background: var(--c-helio-300); box-shadow: 0 0 0 6px rgba(223,115,255,.16), 0 0 22px rgba(223,115,255,.6); margin-bottom: .4em; }
.temporal-facets { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s-4); list-style: none; padding: 0; }
@media (min-width: 48em) { .temporal-facets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.temporal-facets li { background: #181B44; border: 1px solid #353A78; border-radius: var(--r-sm); padding: var(--s-4); font-size: .875rem; display: flex; flex-direction: column; gap: .35em; }
.temporal-facets__icon { width: 22px; height: 22px; color: var(--c-violet-300); }
.temporal-access { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); border: 1.5px dashed #6A64A0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3em 1em; font-size: .875rem; }

.article-photo img { width: 100%; border-radius: var(--r-md); aspect-ratio: 3 / 2; object-fit: cover; }
.article-photo figcaption { margin-top: var(--s-3); font-size: .875rem; color: var(--meta); line-height: 1.5; padding-left: var(--s-3); border-left: 2px solid var(--line-strong); }

/* callout */
.article-callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c-blue-700); border-radius: var(--r-md); padding: var(--s-6); font-size: 1rem; line-height: 1.6; box-shadow: var(--shadow); }
.article-callout > * + * { margin-top: var(--s-3); }
.article-callout__title { display: flex; flex-wrap: wrap; align-items: center; gap: .6em; font-weight: 700; color: var(--fg); }
.article-callout__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }

/* further reading + back */
.article-sources ul { list-style: none; padding: 0; margin-top: var(--s-5) !important; }
.article-sources li { padding: 1em 0; border-top: 1px solid var(--line); font-size: 1rem; line-height: 1.6; }
.article-sources li:last-child { border-bottom: 1px solid var(--line); }
.article-sources a { font-weight: 650; }
.ext-link__icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.article-back { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3) var(--s-6); margin-top: var(--s-10) !important; padding-top: var(--s-6); border-top: 1px solid var(--line); font-size: 1rem; }
.text-link--back span { transition: transform var(--dur-2) var(--ease); }
.text-link--back:hover span { transform: translateX(-4px); }

@media print {
  .article-sidebar, .cta-band { display: none; }
  .article-layout { display: block; }
}
