/* ============================================================
   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 interactive ("Human astrocytes in AD") ──
   Copy on top, the interactive panel full width below. The brain (left)
   and the magnified astrocyte (right) each crossfade three stage
   illustrations; a "+" beside the brain (early stage on) opens a card of
   brain changes. JS (modules/astro-interactive.js) writes --p, --c,
   --c-rgb, --o-early, --o-late and data-stage on .astro-lab. */
.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-lab {
    --c: #3B63C7; --c-rgb: 59,99,199;
    /* The art scales with the viewport height so the whole panel (chip,
       brain + lens, slider, caption) fits on a laptop screen at once:
       ~360px on a 768px-tall screen, capped at 420px. */
    --stage-h: clamp(250px, calc(100vh - 410px), 420px);
    position: relative; isolation: isolate; overflow: hidden;
    max-width: 1120px; margin-inline: auto;
    border-radius: 26px;
    padding: clamp(1.2rem, 2.4vw, 2rem) clamp(1.2rem, 3vw, 2.6rem) clamp(1.3rem, 2.4vw, 1.9rem);
    background: linear-gradient(150deg, var(--night) 0%, #13285A 60%, var(--blue-900) 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}
/* Ambient light that warms with the disease state */
.astro-lab::before {
    content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; left: -18%; top: -30%;
    background: radial-gradient(circle, rgba(var(--c-rgb), calc(.12 + var(--p) * .12)) 0%, transparent 62%);
}

/* Chip row shares the stage's columns so the chip sits above the lens */
.astro-lab__head { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(1rem, 4vw, 4rem); }
.astro-lab__head .astro-lab__state { grid-column: 2; justify-self: center; }
.astro-lab__state {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .45rem .9rem .45rem .75rem; border-radius: var(--radius-pill);
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
    font-size: .88rem; font-weight: 700; letter-spacing: .01em;
}
.astro-lab__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px rgba(var(--c-rgb), .22); }

.astro-lab__stage {
    position: relative;
    display: grid; grid-template-columns: 1.25fr 1fr; align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    margin-top: clamp(.5rem, 1.5vw, 1rem);
}

/* Shared three-layer crossfade (brain and lens) */
.astro-lab__layer {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    user-select: none; -webkit-user-drag: none;
}
.astro-lab__layer:first-child { position: relative; display: block; height: auto; }
.astro-lab__layer--early { opacity: var(--o-early, 0); }
.astro-lab__layer--late  { opacity: var(--o-late, 0); }

/* Brain */
.astro-lab__brain { position: relative; width: 100%; max-width: min(600px, calc(var(--stage-h) * 1.12)); justify-self: center; }
.astro-lab__brain-art { position: relative; }
/* Point on the cortex the lens "zooms" into */
.astro-lab__focus {
    position: absolute; left: 70%; top: 34%; width: 46px; aspect-ratio: 1;
    translate: -50% -50%; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.9);
    box-shadow: 0 0 0 4px rgba(var(--c-rgb), .18), inset 0 0 12px rgba(255,255,255,.25);
}

/* Zoom cone between the focus point and the lens (geometry set in JS) */
.astro-lab__cone { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.astro-lab__cone polygon { fill: rgba(255,255,255,.08); }

/* Lens */
.astro-lab__lens {
    position: relative; z-index: 1; margin: 0; justify-self: center;
    width: min(100%, calc(var(--stage-h) * .9)); aspect-ratio: 1;
}
.astro-lab__lens-view {
    position: relative; z-index: 1; width: 100%; height: 100%;
    border-radius: 50%; overflow: hidden; isolation: isolate;
    border: 6px solid #fff; background: #F4F6FD;
    box-shadow: 0 28px 56px -12px rgba(0,0,0,.45);
}
.astro-lab__lens-view .astro-lab__layer { object-fit: cover; height: 100%; }
.astro-lab__lens-glow {
    position: absolute; inset: -9%; border-radius: 50%; z-index: 0;
    background: radial-gradient(circle, rgba(var(--c-rgb), .4) 0%, transparent 68%);
}
.astro-lab__lens::after {
    content: ""; position: absolute; inset: -12px; border-radius: 50%; z-index: 0;
    border: 1px dashed rgba(255,255,255,.22);
}
.astro-lab__mag {
    position: absolute; z-index: 2; right: 14%; bottom: 3%;
    padding: .3rem .65rem; border-radius: var(--radius-pill);
    background: rgba(14,28,58,.78); color: #fff;
    font-size: .75rem; font-weight: 700; letter-spacing: .06em;
}

/* Slider */
.astro-lab__control {
    margin-top: clamp(1rem, 2.2vw, 1.5rem);
    display: flex; align-items: flex-start; gap: clamp(.9rem, 2vw, 1.4rem);
}
.astro-lab__track { flex: 1; min-width: 0; padding-top: 14px; }
/* Pause/play for the autoplay; centred on the slider line */
.astro-lab__play {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.28); color: #fff;
    transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.astro-lab__play:active { background: rgba(255,255,255,.3); }
.astro-lab__play:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
    .astro-lab__play:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
}
/* Pause (two bars) while playing; play (triangle) when aria-pressed="false".
   SVG, not CSS borders: stays crisp at fractional screen scaling. */
.astro-lab__play svg { width: 16px; height: 16px; fill: currentColor; }
.astro-lab__icon-play,
.astro-lab__play[aria-pressed="false"] .astro-lab__icon-pause { display: none; }
.astro-lab__play[aria-pressed="false"] .astro-lab__icon-play { display: block; }
.astro-lab__range {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; margin: 0;
    border-radius: var(--radius-pill); outline: none; cursor: pointer; background-color: transparent;
    background-image:
        linear-gradient(90deg, transparent calc(var(--p) * 100%), rgba(14,28,58,.62) calc(var(--p) * 100%)),
        linear-gradient(90deg, var(--blue-600) 0%, var(--state-early) 50%, var(--state-late) 100%);
}
.astro-lab__range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 4px solid var(--c);
    box-shadow: 0 0 0 6px rgba(var(--c-rgb), .22), 0 4px 12px rgba(0,0,0,.3);
    cursor: grab; transition: transform var(--dur-fast) var(--ease-out);
}
.astro-lab__range::-moz-range-track { background: transparent; height: 6px; border: 0; }
.astro-lab__range::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 4px solid var(--c);
    box-shadow: 0 0 0 6px rgba(var(--c-rgb), .22), 0 4px 12px rgba(0,0,0,.3);
    cursor: grab; transition: transform var(--dur-fast) var(--ease-out);
}
.astro-lab__range:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.12); }
.astro-lab__range:active::-moz-range-thumb { cursor: grabbing; transform: scale(1.12); }
.astro-lab__range:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 10px; }

/* Equal outer columns keep the middle label centred at exactly 50%, under
   the thumb's Early stop, whatever the length of the outer labels */
.astro-lab__scale { display: grid; grid-template-columns: 1fr auto 1fr; margin-top: .9rem; }
.astro-lab__stop:first-child { justify-self: start; }
.astro-lab__stop:last-child { justify-self: end; }
.astro-lab__stop {
    font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: rgba(255,255,255,.5); padding: .3rem 0;
    transition: color var(--dur-fast) var(--ease-out);
}
.astro-lab__stop.is-current { color: #fff; }
@media (hover: hover) and (pointer: fine) {
    .astro-lab__stop:hover { color: rgba(255,255,255,.85); }
}
.astro-lab__caption {
    margin-top: .8rem; max-width: 70ch; min-height: 3.1em;
    font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 1.55; color: rgba(255,255,255,.9);
    transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out);
}
.astro-lab__caption.is-transitioning { opacity: 0; translate: 0 4px; }

@media (max-width: 900px) {
    .astro-intro__cols { grid-template-columns: 1fr; gap: .9rem; }
    .astro-lab__stage { grid-template-columns: 1fr; gap: 0; }
    .astro-lab__head { grid-template-columns: 1fr; }
    .astro-lab__head .astro-lab__state { grid-column: 1; justify-self: start; }
    .astro-lab__brain { max-width: 560px; }
    .astro-lab { --stage-h: 420px; }
    /* Lens tucks over the brain's lower-right corner */
    .astro-lab__lens { width: 46%; max-width: 250px; justify-self: end; margin-top: -24%; margin-right: 2%; }
    .astro-lab__lens-view { border-width: 4px; }
    .astro-lab__cone { display: none; }
    .astro-lab__focus { display: none; }
    .astro-lab__mag { font-size: .68rem; right: 8%; }
}
@media (max-width: 560px) {
    .astro-lab { border-radius: 22px; }
    .astro-lab__stop { font-size: .7rem; }
}

/* 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; }
