/*
 * LACA Aging Atlas
 * A scoped literature-product layer aligned with the LACA landing pages.
 */
.aa-page {
    --aa-pink: #ff2e97;
    --aa-cyan: #00f0ff;
    --aa-gold: #ffd700;
    --aa-green: #00ff88;
    --aa-surface: rgba(10, 1, 24, 0.74);
    --aa-surface-strong: rgba(5, 0, 15, 0.9);
    --aa-border: rgba(255, 255, 255, 0.11);
    --aa-muted: rgba(255, 255, 255, 0.68);
    --aa-soft: rgba(255, 255, 255, 0.5);
    --aa-width: 1380px;
    cursor: default;
    isolation: isolate;
}

.aa-page,
.aa-page * {
    box-sizing: border-box;
}

.aa-page a,
.aa-page button,
.aa-page select {
    cursor: pointer;
}

.aa-shell {
    width: min(var(--aa-width), 92%);
    margin: 0 auto;
    padding: 0 0 clamp(4rem, 7vw, 7rem);
}

.aa-hero {
    position: relative;
    min-height: clamp(440px, 60vh, 620px);
    padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.aa-hero::before {
    content: "";
    position: absolute;
    width: min(44vw, 620px);
    aspect-ratio: 1;
    right: -10%;
    top: 6%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 46, 151, 0.16), transparent 68%);
    filter: blur(14px);
    pointer-events: none;
}

.aa-eyebrow,
.aa-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--aa-pink);
    font-family: "Azeret Mono", "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    line-height: 1.4;
    text-transform: uppercase;
}

.aa-eyebrow::before,
.aa-section-kicker::before {
    content: "";
    width: 32px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 0 14px currentColor;
}

.aa-hero h1 {
    max-width: 12ch;
    margin: 1.1rem 0 1.2rem;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(2.7rem, 5.5vw, 5.25rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1.03;
}

.aa-hero h1 span {
    background: linear-gradient(118deg, #fff 0%, var(--aa-pink) 48%, var(--aa-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aa-hero-lede {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.65;
}

.aa-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.8rem;
}

.aa-button {
    min-height: 48px;
    padding: 0.82rem 1.2rem;
    border: 1px solid rgba(255, 46, 151, 0.46);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 46, 151, 0.18), rgba(107, 70, 193, 0.2));
    box-shadow: 0 10px 34px rgba(255, 46, 151, 0.1);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.aa-button.secondary {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--aa-cyan);
    background: rgba(5, 0, 15, 0.48);
    box-shadow: none;
}

.aa-button:hover,
.aa-button:focus-visible {
    color: #fff;
    border-color: var(--aa-pink);
    box-shadow: 0 14px 38px rgba(255, 46, 151, 0.18);
    transform: translateY(-3px);
}

.aa-hero-visual {
    position: relative;
    min-height: 390px;
    border: 1px solid var(--aa-border);
    border-radius: 30px;
    display: grid;
    padding-bottom: 5.7rem;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 38%),
        radial-gradient(circle at 50% 42%, rgba(255, 46, 151, 0.14), transparent 58%),
        var(--aa-surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.27), inset 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.aa-hero-visual::after {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 22px;
    pointer-events: none;
}

.aa-atlas-map {
    position: relative;
    z-index: 1;
    width: min(94%, 550px);
    height: auto;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.34));
}

.aa-map-ring {
    fill: none;
    stroke: rgba(255, 255, 255, 0.11);
    stroke-width: 1;
    stroke-dasharray: 4 9;
}

.aa-map-track {
    fill: none;
    stroke: url("#aa-map-gradient");
    stroke-width: 2;
    stroke-linecap: round;
}

.aa-map-node {
    fill: #080115;
    stroke: var(--node-color, #ff2e97);
    stroke-width: 2;
}

.aa-map-core {
    fill: var(--node-color, #ff2e97);
}

.aa-map-label {
    fill: rgba(255, 255, 255, 0.72);
    font-family: "Azeret Mono", monospace;
    font-size: 9px;
    text-anchor: middle;
}

.aa-map-title {
    fill: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-anchor: middle;
}

.aa-hero-stats {
    position: absolute;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.aa-hero-stat {
    min-width: 0;
    padding: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(5, 0, 15, 0.76);
    backdrop-filter: blur(12px);
}

.aa-hero-stat strong,
.aa-hero-stat span {
    display: block;
}

.aa-hero-stat strong {
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    line-height: 1.35;
}

.aa-hero-stat span {
    margin-top: 0.28rem;
    color: var(--aa-soft);
    font-size: 0.58rem;
    line-height: 1.4;
}

.aa-species-nav {
    position: sticky;
    top: calc(var(--laca-nav-height, 76px) + 38px);
    z-index: 50;
    margin: 0 0 clamp(2.4rem, 5vw, 4rem);
    padding: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    background: rgba(10, 1, 24, 0.88);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px) saturate(130%);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 46, 151, 0.45) transparent;
}

.aa-species-pill {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0.58rem 0.85rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(0, 240, 255, 0.045);
    font-family: "Azeret Mono", monospace;
    font-size: 0.67rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.aa-species-pill:hover,
.aa-species-pill:focus-visible {
    color: #fff;
    border-color: rgba(255, 46, 151, 0.58);
    background: rgba(255, 46, 151, 0.11);
}

.aa-species-pill .cnt {
    min-width: 22px;
    min-height: 22px;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--aa-cyan);
    background: rgba(0, 240, 255, 0.1);
    font-size: 0.62rem;
}

.aa-section {
    margin: 0 0 clamp(4rem, 7vw, 7rem);
    scroll-margin-top: calc(var(--laca-nav-height, 76px) + 112px);
}

.aa-section-head {
    max-width: 780px;
    margin-bottom: clamp(1.6rem, 4vw, 2.6rem);
}

.aa-section-head h2 {
    margin: 0.72rem 0 0.75rem;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.7rem, 3.5vw, 2.8rem);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.aa-section-head p {
    margin: 0;
    color: var(--aa-muted);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: clamp(1.05rem, 1.5vw, 1.24rem);
    line-height: 1.72;
}

.aa-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.aa-overview-card,
.aa-search,
.aa-paper,
.aa-stat,
.aa-empty {
    border: 1px solid var(--aa-border);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 45%),
        var(--aa-surface);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(16px);
}

.aa-overview-card {
    min-height: 190px;
    padding: clamp(1.35rem, 2.5vw, 2rem);
    border-radius: 18px;
}

.aa-overview-card strong {
    display: block;
    margin-bottom: 0.65rem;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: 0.9rem;
}

.aa-overview-card p {
    margin: 0;
    color: var(--aa-muted);
    font-size: 0.8rem;
    line-height: 1.75;
}

.aa-overview-card .aa-card-label {
    margin-bottom: 0.8rem;
    color: var(--aa-pink);
    font-family: "Azeret Mono", monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.aa-search {
    position: relative;
    padding: clamp(1.35rem, 3vw, 2.2rem);
    border-radius: 22px;
    overflow: hidden;
}

.aa-search::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--aa-pink), var(--aa-cyan), transparent);
}

.aa-search-header {
    margin-bottom: 1.2rem;
}

.aa-search-header h2 {
    margin: 0;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.aa-search-header p {
    max-width: 780px;
    margin: 0.55rem 0 0;
    color: var(--aa-muted);
    font-size: 0.78rem;
    line-height: 1.65;
}

.aa-search form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.28fr) auto;
    gap: 0.7rem;
    align-items: end;
}

.aa-field {
    min-width: 0;
}

.aa-field label {
    display: block;
    margin-bottom: 0.42rem;
    color: rgba(255, 255, 255, 0.62);
    font-family: "Azeret Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aa-search input[type="text"],
.aa-select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.76rem 0.88rem;
    border: 1px solid rgba(0, 240, 255, 0.26);
    border-radius: 10px;
    color: #eefbff;
    background: rgba(0, 240, 255, 0.055);
    font-family: "Azeret Mono", "JetBrains Mono", monospace;
    font-size: 0.78rem;
}

.aa-select option {
    color: #fff;
    background: #0a0118;
}

.aa-search input[type="text"]:focus,
.aa-select:focus {
    outline: none;
    border-color: var(--aa-cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.aa-btn {
    min-height: 48px;
    padding: 0.76rem 1.2rem;
    border: 1px solid var(--aa-pink);
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 46, 151, 0.22), rgba(107, 70, 193, 0.25));
    font-family: "Orbitron", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.aa-btn:hover,
.aa-btn:focus-visible {
    background: rgba(255, 46, 151, 0.28);
    box-shadow: 0 10px 28px rgba(255, 46, 151, 0.16);
    transform: translateY(-2px);
}

.aa-search-note {
    margin: 0.8rem 0 0;
    color: var(--aa-soft);
    font-size: 0.68rem;
    line-height: 1.55;
}

.aa-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 1.4rem;
}

.aa-stat {
    min-width: 0;
    padding: 1rem;
    border-radius: 14px;
}

.aa-stat strong,
.aa-stat span {
    display: block;
}

.aa-stat strong {
    overflow-wrap: anywhere;
    color: var(--aa-cyan);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.35;
}

.aa-stat span {
    margin-top: 0.35rem;
    color: var(--aa-soft);
    font-size: 0.65rem;
}

.aa-results-block {
    margin-top: 1.3rem;
}

.aa-results-heading {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
}

.aa-results-heading h3 {
    margin: 0;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: 1rem;
}

.aa-results-heading span {
    color: var(--aa-soft);
    font-size: 0.68rem;
}

.aa-grid,
.aa-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 1rem;
}

.aa-species {
    margin-bottom: clamp(4rem, 7vw, 6.5rem);
    scroll-margin-top: calc(var(--laca-nav-height, 76px) + 112px);
}

.aa-species-head {
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 46, 151, 0.18);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.aa-species-head img {
    width: 116px;
    height: 82px;
    border: 1px solid rgba(255, 46, 151, 0.28);
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.aa-species-copy {
    min-width: 0;
}

.aa-species-copy h2 {
    margin: 0;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.15rem, 2.4vw, 1.65rem);
    line-height: 1.3;
}

.aa-lat {
    display: block;
    margin-top: 0.35rem;
    color: var(--aa-soft);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: 1rem;
    font-style: italic;
}

.aa-paper-count {
    padding: 0.5rem 0.7rem;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 999px;
    color: var(--aa-cyan);
    background: rgba(0, 240, 255, 0.06);
    font-family: "Azeret Mono", monospace;
    font-size: 0.62rem;
    white-space: nowrap;
}

.aa-paper {
    position: relative;
    min-height: 285px;
    padding: 1.25rem;
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow: hidden;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.aa-paper::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--aa-pink), var(--aa-cyan), transparent);
    opacity: 0.82;
}

.aa-paper:hover {
    border-color: rgba(255, 46, 151, 0.4);
    box-shadow: 0 18px 44px rgba(255, 46, 151, 0.08);
    transform: translateY(-4px);
}

.aa-paper .aa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.aa-pmid,
.aa-tissue,
.aa-status {
    min-height: 25px;
    padding: 0.28rem 0.46rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-family: "Azeret Mono", monospace;
    font-size: 0.59rem;
    line-height: 1.2;
}

.aa-pmid {
    color: var(--aa-green);
    background: rgba(0, 255, 136, 0.07);
}

a.aa-pmid {
    text-decoration: none;
}

a.aa-pmid:hover,
a.aa-pmid:focus-visible {
    color: #fff;
    background: rgba(0, 255, 136, 0.14);
}

.aa-tissue {
    border: 1px solid rgba(0, 240, 255, 0.18);
    color: var(--aa-cyan);
    background: rgba(0, 240, 255, 0.055);
}

.aa-status {
    color: var(--aa-gold);
    background: rgba(255, 215, 0, 0.07);
}

.aa-paper h3 {
    margin: 0.25rem 0 0;
    color: #eef8ff;
    font-family: "Crimson Pro", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.45;
}

.aa-paper h3 a {
    color: inherit;
    text-decoration: none;
}

.aa-paper h3 a:hover,
.aa-paper h3 a:focus-visible {
    color: var(--aa-cyan);
}

.aa-journal,
.aa-cells {
    color: var(--aa-soft);
    font-size: 0.68rem;
    line-height: 1.5;
}

.aa-cells {
    font-family: "Azeret Mono", monospace;
}

.aa-finding {
    margin-top: 0.15rem;
    color: var(--aa-muted);
    font-size: 0.75rem;
    line-height: 1.65;
}

.aa-ext {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem 0.9rem;
}

.aa-ext a {
    color: var(--aa-cyan);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-decoration: none;
}

.aa-ext a:hover,
.aa-ext a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.aa-discovery-card {
    min-height: 225px;
}

.aa-empty {
    padding: 1.6rem;
    border-style: dashed;
    border-radius: 16px;
    color: var(--aa-muted);
    text-align: center;
}

.aa-empty strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    font-size: 0.82rem;
}

.aa-empty p {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.6;
}

.aa-empty a {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--aa-cyan);
    font-size: 0.7rem;
}

.aa-error {
    border-color: rgba(255, 90, 118, 0.45);
}

.aa-error strong {
    color: #ff7f91;
}

.aa-provenance {
    margin: -2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--aa-soft);
    font-size: 0.68rem;
    line-height: 1.65;
}

.aa-provenance code {
    color: rgba(255, 255, 255, 0.72);
}

.aa-page :focus-visible {
    outline: 3px solid var(--aa-pink);
    outline-offset: 3px;
}

.aa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1050px) {
    .aa-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .aa-hero-copy {
        max-width: 790px;
    }

    .aa-hero h1 {
        max-width: 14ch;
    }

    .aa-search form {
        grid-template-columns: minmax(0, 1fr) minmax(190px, 0.35fr);
    }

    .aa-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .aa-shell {
        width: min(94%, 680px);
    }

    .aa-hero {
        padding-top: 3.2rem;
    }

    .aa-hero h1 {
        font-size: clamp(2.35rem, 10vw, 3.55rem);
    }

    .aa-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .aa-button {
        width: 100%;
    }

    .aa-overview-grid,
    .aa-search form,
    .aa-stats {
        grid-template-columns: 1fr;
    }

    .aa-btn {
        grid-column: auto;
        width: 100%;
    }

    .aa-species-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .aa-paper-count {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 520px) {
    .aa-hero-visual {
        min-height: 340px;
        border-radius: 22px;
    }

    .aa-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aa-hero-stat:nth-child(3) {
        display: none;
    }

    .aa-species-nav {
        margin-left: -3%;
        margin-right: -3%;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .aa-species-head img {
        width: 78px;
        height: 58px;
        border-radius: 10px;
    }

    .aa-paper {
        min-height: 0;
    }

    .aa-results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .aa-search input[type="text"],
    .aa-select,
    .aa-btn {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aa-page *,
    .aa-page *::before,
    .aa-page *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .aa-paper:hover,
    .aa-button:hover,
    .aa-button:focus-visible,
    .aa-btn:hover,
    .aa-btn:focus-visible {
        transform: none;
    }
}
