/*
 * LACA Human Immune Aging Atlas
 * Scoped product layer aligned with aging-atlas-refresh / laca-section-refresh.
 */
.hia-page {
    --hia-cyan: #00f0ff;
    --hia-pink: #ff2e97;
    --hia-gold: #ffd700;
    --hia-green: #00ff88;
    --hia-surface: rgba(10, 1, 24, 0.74);
    --hia-surface-strong: rgba(5, 0, 15, 0.9);
    --hia-border: rgba(255, 255, 255, 0.11);
    --hia-muted: rgba(255, 255, 255, 0.68);
    --hia-soft: rgba(255, 255, 255, 0.5);
    --hia-copy: rgba(255, 255, 255, 0.76);
    --hia-width: 1380px;
    --hia-radius: 18px;
    cursor: default;
    isolation: isolate;
}

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

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

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

.hia-hero {
    position: relative;
    min-height: clamp(420px, 56vh, 580px);
    padding: clamp(4rem, 8vw, 7rem) 0 clamp(2.4rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

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

.hia-eyebrow,
.hia-section-kicker,
.hia-metrics-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--hia-cyan);
    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;
}

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

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

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

.hia-lede {
    max-width: 680px;
    margin: 0;
    color: var(--hia-copy);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: clamp(1.15rem, 2vw, 1.48rem);
    font-weight: 300;
    line-height: 1.62;
}

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

.hia-pill {
    min-height: 48px;
    padding: 0.82rem 1.2rem;
    border: 1px solid rgba(0, 240, 255, 0.46);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(107, 70, 193, 0.2));
    box-shadow: 0 10px 34px rgba(0, 240, 255, 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, color 220ms ease;
}

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

.hia-pill:hover,
.hia-pill:focus-visible {
    color: #fff;
    border-color: var(--hia-cyan);
    box-shadow: 0 14px 38px rgba(0, 240, 255, 0.18);
    transform: translateY(-3px);
    outline: none;
}

.hia-metrics {
    position: relative;
    min-height: 360px;
    padding: 1.25rem 1.25rem 1.15rem;
    border: 1px solid var(--hia-border);
    border-radius: 30px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 38%),
        radial-gradient(circle at 50% 18%, rgba(0, 240, 255, 0.14), transparent 58%),
        var(--hia-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);
}

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

.hia-metrics-head {
    position: relative;
    z-index: 1;
    margin: 0.35rem 0.35rem 1rem;
}

.hia-metrics-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.hia-metric {
    min-height: 118px;
    padding: 1rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: rgba(5, 0, 15, 0.58);
}

.hia-metric strong,
.hia-metric span {
    display: block;
}

.hia-metric strong {
    color: var(--hia-cyan);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.25rem, 2.6vw, 1.85rem);
    line-height: 1.12;
}

.hia-metric:nth-child(2) strong { color: var(--hia-green); }
.hia-metric:nth-child(3) strong { color: var(--hia-gold); }
.hia-metric:nth-child(4) strong { color: var(--hia-pink); }

.hia-metric span {
    margin-top: 0.45rem;
    color: var(--hia-soft);
    font-size: 0.72rem;
    line-height: 1.45;
}

.hia-nav {
    position: sticky;
    top: calc(var(--laca-nav-height, 76px) + 18px);
    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;
    flex-wrap: wrap;
    gap: 0.55rem;
    background: rgba(10, 1, 24, 0.88);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px) saturate(130%);
}

.hia-nav a {
    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.78);
    background: rgba(0, 240, 255, 0.045);
    font-family: "Azeret Mono", monospace;
    font-size: 0.67rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hia-nav a:hover,
.hia-nav a:focus-visible {
    color: #fff;
    border-color: rgba(0, 240, 255, 0.58);
    background: rgba(0, 240, 255, 0.11);
    outline: none;
}

.hia-nav a.is-accent {
    color: var(--hia-green);
    border-color: rgba(0, 255, 136, 0.28);
}

.hia-nav a.is-gold {
    color: var(--hia-gold);
    border-color: rgba(255, 215, 0, 0.28);
}

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

.hia-section-head {
    max-width: 860px;
    margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

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

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

.hia-note {
    margin: 0 0 1.15rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid rgba(0, 255, 136, 0.18);
    border-left: 3px solid var(--hia-green);
    border-radius: 14px;
    background: rgba(0, 255, 136, 0.05);
    color: var(--hia-copy);
    font-size: 0.86rem;
    line-height: 1.65;
}

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

.hia-card {
    position: relative;
    min-height: 230px;
    padding: 1.25rem;
    border: 1px solid var(--hia-border);
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 45%),
        var(--hia-surface);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(16px);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

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

.hia-card:hover {
    border-color: rgba(0, 240, 255, 0.38);
    box-shadow: 0 18px 44px rgba(0, 240, 255, 0.08);
    transform: translateY(-4px);
}

.hia-card-kicker {
    color: var(--hia-cyan);
    font-family: "Azeret Mono", monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hia-card h3 {
    margin: 0;
    font-family: "Orbitron", sans-serif;
    font-size: 0.92rem;
    line-height: 1.35;
}

.hia-card h3 a {
    color: #fff;
    text-decoration: none;
}

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

.hia-card p {
    margin: 0;
    color: var(--hia-muted);
    font-size: 0.78rem;
    line-height: 1.65;
}

.hia-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.7rem;
}

.hia-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--hia-border);
    border-radius: 16px;
    background: var(--hia-surface);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hia-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}

.hia-table th,
.hia-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
    vertical-align: top;
    text-align: left;
}

.hia-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--hia-cyan);
    font-family: "Azeret Mono", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--hia-surface-strong);
    white-space: nowrap;
}

.hia-table td {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    line-height: 1.58;
}

.hia-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.026);
}

.hia-table tbody tr:hover td {
    background: rgba(0, 240, 255, 0.055);
}

.hia-table tr:last-child td {
    border-bottom: 0;
}

.hia-sortable-heading {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-height: 24px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
}

.hia-sortable-heading::after {
    content: "";
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.42);
    opacity: 0.75;
    transform: translateY(1px);
}

.hia-sortable-heading:hover,
.hia-sortable-heading:focus-visible {
    color: #fff;
    outline: none;
}

.hia-sortable-heading:focus-visible {
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.18);
}

.hia-table th[aria-sort="ascending"],
.hia-table th[aria-sort="descending"] {
    color: var(--hia-green);
}

.hia-table th[aria-sort="ascending"] .hia-sortable-heading::after {
    border-top: 0;
    border-bottom: 5px solid var(--hia-green);
    opacity: 1;
}

.hia-table th[aria-sort="descending"] .hia-sortable-heading::after {
    border-top: 5px solid var(--hia-green);
    opacity: 1;
}

.hia-link {
    color: var(--hia-cyan);
    text-decoration: none;
    text-underline-offset: 3px;
}

.hia-link:hover,
.hia-link:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--hia-cyan);
}

.hia-tag,
.hia-tag-success,
.hia-tag-accent,
.hia-tag-warning {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    font-family: "Azeret Mono", monospace;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.28;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}

.hia-tag-success {
    border-color: rgba(0, 255, 136, 0.34);
    color: var(--hia-green);
    background: rgba(0, 255, 136, 0.075);
}

.hia-tag-accent {
    border-color: rgba(0, 240, 255, 0.34);
    color: var(--hia-cyan);
    background: rgba(0, 240, 255, 0.075);
}

.hia-tag-warning {
    border-color: rgba(255, 215, 0, 0.34);
    color: var(--hia-gold);
    background: rgba(255, 215, 0, 0.075);
}

.hia-row-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
    font-size: 0.78rem;
}

.hia-dataset-link {
    color: #fff;
    font-weight: 800;
}

.hia-muted {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.78rem;
    line-height: 1.55;
}

@media (max-width: 980px) {
    .hia-hero {
        grid-template-columns: 1fr;
    }

    .hia-hero {
        min-height: 0;
        padding-top: clamp(6.5rem, 16vw, 8.5rem);
    }

    .hia-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 240, 255, 0.45) transparent;
    }
}

@media (max-width: 620px) {
    .hia-shell {
        width: min(var(--hia-width), calc(100% - 1.4rem));
    }

    .hia-metrics-grid {
        grid-template-columns: 1fr;
    }

    .hia-table {
        min-width: 720px;
    }

    .hia-table th,
    .hia-table td {
        padding: 0.72rem 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hia-pill,
    .hia-card,
    .hia-nav a {
        transition: none;
    }

    .hia-pill:hover,
    .hia-card:hover {
        transform: none;
    }
}
