/* ============================================================
   RESEARCH PAGE
   ============================================================ */
.research-line { padding: clamp(3rem, 6vw, 5rem) 0; }
.research-line--alt { background: var(--fog); }
.research-line__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.research-line__grid--reverse .research-line__figure,
.research-line__grid--reverse .model-selector { order: 2; }
.research-line__copy h2 { margin: .5rem 0 1rem; }
.research-line__copy p { margin-bottom: .9rem; max-width: 52ch; text-align: justify; hyphens: auto; }
.research-line__figure img { border-radius: var(--radius-lg); border: 1px solid var(--line); background: #fff; }
.research-line__see-models {
    font-size: .82rem; font-weight: 700; color: var(--blue-700);
    text-transform: uppercase; letter-spacing: .04em; margin-top: 1.2rem !important;
}

/* ── Astrocyte progression figure ("Human astrocytes in AD") ──
   Copy on top, a static three-stage figure below: healthy → early → late
   Alzheimer's disease, each a brain over a round "lens" showing the
   magnified astrocyte. Each stage sets its own --c (blue → violet → rose)
   for the lens ring and step label. The old interactive slider version is
   kept in _dev/astro-interactive/. */
.research-line--astro { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.astro-intro { max-width: 1080px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.astro-intro h2 { margin: .5rem 0 1.2rem; }
.astro-intro__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.astro-intro__cols p { max-width: 56ch; }
.astro-intro__cols .reveal:nth-child(2) { --reveal-i: 1; }

.astro-stages {
    max-width: 1120px; margin: 0 auto;
    padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.2rem, 3vw, 2.6rem) clamp(1.6rem, 3vw, 2.4rem);
    border: 1px solid var(--line); border-radius: 26px;
    background: linear-gradient(180deg, #fff 0%, var(--blue-50) 100%);
}
/* Progression bar along the top: healthy blue fading into disease rose */
.astro-stages__progress {
    position: relative; text-align: center; margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
    font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
}
.astro-stages__progress::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px;
    background: linear-gradient(90deg, #5A82DA 0%, #9467C9 50%, #D2507A 100%);
}
.astro-stages__progress span { position: relative; padding: .3rem 1rem; border-radius: var(--radius-pill); background: #fff; }

.astro-stages__list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem);
}
.astro-stage { --c: #3B63C7; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.astro-stage--2 { --c: #8A55C2; }
.astro-stage--3 { --c: #C93D6A; }
.astro-stage__step { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.astro-stage__brain { width: 56%; max-width: 165px; height: auto; margin-top: .6rem; }
/* Lens: the brain's dashed "zoom" line drops into it */
.astro-stage__lens {
    position: relative; width: 48%; max-width: 145px; aspect-ratio: 1; margin-top: 1.3rem;
    border-radius: 50%; padding: 4px; background: var(--c);
    box-shadow: 0 18px 40px -16px rgba(14,28,58,.45);
}
.astro-stage__lens::before {
    content: ""; position: absolute; left: 50%; bottom: 100%; height: 1.3rem; margin-left: -1px;
    border-left: 2px dashed var(--c); opacity: .5;
}
.astro-stage__lens img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid #fff; background: #fff; }
.astro-stage__title { margin-top: 1.2rem; font-size: 1.05rem; line-height: 1.3; }
.astro-stage__text { margin-top: .45rem; max-width: 30ch; font-size: .95rem; line-height: 1.55; color: var(--ink-soft); }
/* Arrow to the next stage, level with the brains */
.astro-stage__arrow {
    position: absolute; top: 19%; left: 100%; width: clamp(1.5rem, 4vw, 3.5rem);
    fill: none; stroke: var(--ink-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

@media (max-width: 900px) {
    .astro-intro__cols { grid-template-columns: 1fr; gap: .9rem; }
}
/* Stacked: one stage per row, brain and lens side by side, arrow pointing down */
@media (max-width: 760px) {
    .astro-stages { border-radius: 22px; }
    .astro-stages__progress { display: none; }
    .astro-stages__list { grid-template-columns: 1fr; gap: 3rem; }
    .astro-stage {
        display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 1rem;
    }
    .astro-stage__step, .astro-stage__title, .astro-stage__text { grid-column: 1 / -1; }
    .astro-stage__brain { width: 100%; max-width: 140px; margin: .6rem 0 0; justify-self: end; }
    .astro-stage__lens { width: 100%; max-width: 112px; margin: .6rem 0 0; justify-self: start; }
    .astro-stage__lens::before { display: none; }
    .astro-stage__text { justify-self: center; }
    .astro-stage__arrow { top: auto; bottom: -2.4rem; left: 50%; width: 1.8rem; margin-left: -.9rem; transform: rotate(90deg); }
}

/* Experimental-model selector ("Humanized models to study astrocyte
   function"): four clickable cards (2D / 3D / organoids / chimeric mice)
   occupy the figure slot; clicking one drives the .model-detail panel below
   via assets/js/modules/model-selector.js, which swaps title/text/image and
   toggles .is-transitioning for the fade+shift. */
.model-selector { max-width: 540px; width: 100%; }
/* Three models: one row when they fit, otherwise they wrap (centred) */
.model-selector__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem 1rem; }
/* The button IS the circle — no square card wrapping it. Only the picture
   (a true circle, border-radius:50%) carries background/border/shadow;
   .model-card itself is just an invisible flex wrapper stacking the circle
   and its caption. Active/hover states are expressed purely through
   border-color, box-shadow and background on that circle — never transform:
   scaling a parent that contains a raster <img> resamples the bitmap on every
   animation frame and reads as a blur flash during the transition, which is
   exactly what scaling the old square card produced. */
.model-card {
    display: flex; flex-direction: column; align-items: center; gap: .8rem; width: 156px;
    background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: center;
    transition: opacity var(--dur-base) var(--ease);
}
.model-card picture {
    display: flex; align-items: center; justify-content: center;
    width: 144px; height: 144px; border-radius: 50%;
    background: radial-gradient(circle, var(--blue-50) 0%, #fff 72%);
    border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur-base) var(--ease), background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.model-card img { width: 74%; height: 74%; object-fit: contain; }
.model-card span { font-size: .92rem; font-weight: 600; color: var(--ink-2); line-height: 1.25; transition: color var(--dur-base) var(--ease); }
@media (hover: hover) and (pointer: fine) {
    .model-card:hover picture { border-color: var(--blue-300); box-shadow: var(--shadow-md); }
}
.model-card:focus-visible picture { outline: 2px solid var(--blue-700); outline-offset: 3px; }
.model-card.is-active picture {
    background: radial-gradient(circle, var(--blue-100) 0%, #fff 70%);
    border-color: var(--blue-700);
    box-shadow: 0 0 0 4px var(--blue-50), var(--shadow-md);
}
.model-card.is-active span { color: var(--blue-700); }
.model-selector__grid.has-selection .model-card:not(.is-active) { opacity: .55; }
@media (hover: hover) and (pointer: fine) {
    .model-selector__grid.has-selection .model-card:not(.is-active):hover { opacity: .85; }
}

/* Dynamic detail panel: title/text/image swap in place, no navigation.
   JS toggles .is-transitioning on .model-detail__body for a brief fade-out +
   lateral shift before the content is replaced, then removes it to fade
   back in — see assets/js/modules/model-selector.js. */
.model-detail { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.model-detail__eyebrow {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-faint); margin: 0 0 .8rem;
}
.model-detail__body {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.6rem);
}
.model-detail__copy, .model-detail__figure {
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), filter var(--dur-base) var(--ease-out);
}
/* Short blurred crossfade: out ~150ms, swap, back in — reads as one change */
.model-detail__body.is-transitioning .model-detail__copy { opacity: 0; transform: translateY(4px); filter: blur(3px); }
.model-detail__body.is-transitioning .model-detail__figure { opacity: 0; transform: scale(.985); filter: blur(4px); }
.model-detail__copy h3 { margin: 0 0 .8rem; font-size: 1.3rem; }
.model-detail__copy p { color: var(--ink-2); max-width: 56ch; text-align: justify; hyphens: auto; }
.model-detail__figure { margin: 0; }
.model-detail__figure img {
    width: 100%; height: 260px; object-fit: cover; display: block;
    border-radius: var(--radius-md); background: var(--ink);
}
@media (max-width: 900px) {
    .model-detail__body { grid-template-columns: 1fr; }
    .model-detail__figure { order: -1; }
    .model-detail__figure img { height: 220px; }
}
@media (min-width: 901px) {
    /* Nudges the eyebrow to sit above the copy text inside the card below
       instead of flush with the card's outer edge. */
    .model-detail__eyebrow { margin-left: clamp(1.6rem, 4vw, 2.6rem); }
}
/* Mid widths: the model column narrows, keep the three circles on one row */
@media (min-width: 901px) and (max-width: 1180px) {
    .model-card { width: 128px; }
    .model-card picture { width: 118px; height: 118px; }
}
@media (max-width: 480px) {
    .model-card { width: 96px; }
    .model-card picture { width: 84px; height: 84px; }
    .model-card span { font-size: .78rem; }
}

/* "Integrative approaches": a light-blue band (same family as the sections
   around it) so it reads as part of the research story rather than a dark
   break; the dark navy is left to the footer. Intro line + four short cards. */
.research-line--feature { background: var(--blue-50); }
.research-line__feature-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.research-line__feature-copy h2 { margin: .5rem 0 1rem; }
.research-line__feature-copy p { color: var(--ink-soft); font-size: 1.05rem; margin: 0 auto; }
.research-line__feature-copy em { color: var(--blue-700); font-style: italic; }

.tech-grid {
    max-width: 1160px; margin: clamp(2rem, 5vw, 2.8rem) auto 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.25rem, 3.2vw, 2.4rem);
}
/* Flip cards. Front: illustration + title over a soft fade. Back: the
   description. Flips on hover (pointer devices), on keyboard focus, and on
   tap (modules/tech-cards.js toggles .is-flipped). */
.tech-item { transition: var(--reveal-transition); }
.tech-card {
    display: block; aspect-ratio: 4 / 5; perspective: 1100px;
    border-radius: var(--radius-lg); outline: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tech-card:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 4px; }
.tech-card__inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform 650ms var(--ease-in-out);
}
@media (hover: hover) and (pointer: fine) {
    .tech-card:hover .tech-card__inner { transform: rotateY(180deg); }
}
.tech-card:focus-visible .tech-card__inner,
.tech-card.is-flipped .tech-card__inner { transform: rotateY(180deg); }

.tech-card__face {
    position: absolute; inset: 0; overflow: hidden;
    border-radius: var(--radius-lg);
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.tech-card__front { background: #fff; display: flex; align-items: flex-end; }
.tech-card__front img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: scale 900ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .tech-card:hover .tech-card__front img { scale: 1.05; }
}
/* Soft fade so the title always reads, whatever the illustration */
.tech-card__front::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 38%, rgba(255,255,255,.72) 64%, rgba(255,255,255,.96) 86%);
}
.tech-card__title {
    position: relative; z-index: 1; margin: 0; padding: 1.1rem 1.2rem 1.25rem;
    font-size: 1.12rem; line-height: 1.2; color: var(--ink); text-align: left;
}
.tech-card__hint {
    position: absolute; z-index: 1; right: 1rem; bottom: 1.1rem;
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--blue-600); color: #fff; font-weight: 700; line-height: 1;
    box-shadow: var(--shadow-accent);
}
.tech-card__back {
    transform: rotateY(180deg);
    display: flex; flex-direction: column; justify-content: center; gap: .7rem;
    padding: 1.5rem 1.4rem;
    background: linear-gradient(155deg, #fff 0%, var(--blue-50) 100%);
    text-align: left;
}
.tech-card__back-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.tech-card__back-title::after { content: ""; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--blue-300); margin-top: .6rem; }
.tech-card__back p:not(.tech-card__back-title) { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--ink-soft); }

/* The goal of the whole story — highlighted so it isn't buried */
.tech-item--final .tech-card__face { border-color: var(--blue-600); }
.tech-item--final .tech-card__hint { background: var(--state-late); box-shadow: 0 10px 22px -10px rgba(226,64,98,.6); }
.tech-item--final .tech-card__back { background: linear-gradient(150deg, var(--night) 0%, var(--blue-900) 58%, var(--blue-600) 120%); border-color: var(--blue-900); }
.tech-item--final .tech-card__back-title { color: #fff; }
.tech-item--final .tech-card__back p:not(.tech-card__back-title) { color: rgba(255,255,255,.86); }

/* Reduced motion: no 3D turn — the back simply fades in over the front */
@media (prefers-reduced-motion: reduce) {
    .tech-card__inner { transform: none !important; transition: none; }
    .tech-card__back { transform: none; opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
    .tech-card:hover .tech-card__back, .tech-card:focus-visible .tech-card__back, .tech-card.is-flipped .tech-card__back { opacity: 1; }
}
@media (max-width: 1000px) {
    .tech-grid { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
}
@media (max-width: 560px) {
    .tech-grid { grid-template-columns: 1fr; max-width: 380px; }
    .tech-card { aspect-ratio: 5 / 4; }
}

.research-cta { padding: clamp(3rem, 6vw, 5rem) 0; text-align: center; }
.research-cta h2 { margin-bottom: 2.2rem; }
