/* ==============================================
   AEROFIELD — HUMAN ANATOMY PAGE
   Full-viewport golden energy channels & nerve map
   Theme: Kaya-Vidya (Body & Vitality) — gold/amber
   ============================================== */

/* ── Reset & Viewport Lock ──────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
}

:root {
    --anat-primary:     #d4a04a;
    --anat-primary-dim: #a07830;
    --anat-glow:        rgba(212, 160, 74, 0.25);
    --anat-bg-tint:     rgba(212, 160, 74, 0.04);
    --anat-border:      rgba(212, 160, 74, 0.15);
    --anat-wire:        rgba(212, 160, 74, 0.06);
    --anat-wire-bright: rgba(212, 160, 74, 0.18);
    --anat-node:        rgba(212, 160, 74, 0.35);
}


/* ── Backgrounds ────────────────────────────────────── */
.anat-bg-void {
    position: fixed; inset: 0; z-index: 0;
    background: #070502;
}

.anat-grid-canvas {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
    filter: contrast(110%) sepia(20%);
}

.anat-bg-glow {
    position: fixed; inset: 0; z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle, transparent 30%, rgba(0,0,0,0.85) 100%);
}


/* ── Navbar ──────────────────────────────────────────── */
.anat-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--navbar-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(16px, 3vw, 48px);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    background: rgba(10, 10, 15, 0.75);
    border-bottom: 1px solid var(--anat-border);
}

.anat-nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}

.anat-logo-icon {
    width: 32px; height: 32px; border-radius: 7px;
    background: linear-gradient(135deg, var(--anat-primary) 0%, var(--anat-primary-dim) 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 12px var(--anat-glow);
    padding: 6px;
}
.anat-logo-icon svg { width: 20px; height: 20px; }

.anat-logo-text {
    font-family: var(--font-display);
    font-weight: 700; font-size: 15px; letter-spacing: 2px;
    background: linear-gradient(135deg, var(--anat-primary) 0%, var(--anat-primary-dim) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.anat-nav-center {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
}

.anat-nav-title {
    font-family: var(--font-display);
    font-size: 13px; font-weight: 600; letter-spacing: 3px;
    color: var(--anat-primary);
}

.anat-nav-status { display: flex; align-items: center; gap: 6px; }

.anat-status-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--anat-primary);
    box-shadow: 0 0 6px var(--anat-primary);
    animation: anatDotPulse 2s ease-in-out infinite;
}

@keyframes anatDotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--anat-primary); }
    50%      { opacity: 0.4; box-shadow: 0 0 3px var(--anat-primary); }
}

.anat-nav-sub {
    font-family: var(--font-ui);
    font-size: 9px; font-weight: 400;
    letter-spacing: 2px; color: var(--text-muted);
}

.anat-nav-controls { display: flex; align-items: center; gap: 8px; }

.anat-btn {
    font-family: var(--font-ui); font-size: 10px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    text-decoration: none;
    padding: 5px 12px; border-radius: 6px;
    border: 1px solid var(--anat-border);
    background: transparent;
    color: var(--anat-primary-dim);
    cursor: pointer; transition: all 0.25s ease;
    display: flex; align-items: center; gap: 5px;
}

.anat-btn:hover {
    color: var(--anat-primary);
    border-color: var(--anat-primary);
    background: var(--anat-bg-tint);
}


/* ── Main Canvas Container ──────────────────────────── */
.anat-main {
    position: relative; z-index: 1;
    width: 100vw; height: 100vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.anat-body-canvas {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
}


/* ── System Labels ──────────────────────────────────── */
.anat-labels {
    position: absolute;
    inset: 0; z-index: 10;
    pointer-events: none;
}

.anat-label {
    position: absolute;
    display: flex; align-items: center; gap: 0;
    opacity: 0;
    animation: anatLabelFade 0.5s ease-out forwards;
}

.anat-label-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--anat-primary);
    box-shadow: 0 0 8px var(--anat-glow);
    flex-shrink: 0;
    animation: anatDotPulse 2.5s ease-in-out infinite;
}

.anat-label-line {
    width: 40px; height: 1px;
    background: linear-gradient(90deg, var(--anat-primary) 0%, rgba(212,160,74,0.1) 100%);
    flex-shrink: 0;
}

.anat-label-tag {
    font-family: var(--font-ui);
    font-size: 9px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--anat-primary);
    padding: 3px 10px;
    border: 1px solid var(--anat-border);
    border-radius: 4px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.25s ease;
}

.anat-label-tag:hover {
    background: var(--anat-bg-tint);
    border-color: var(--anat-primary);
    box-shadow: 0 0 12px var(--anat-glow);
}

/* Label positions — adjusted by JS for responsiveness */
.anat-label--brain    { top: 15%; left: 55%; animation-delay: 0.3s; }
.anat-label--heart    { top: 35%; left: 55%; animation-delay: 0.5s; }
.anat-label--lungs    { top: 32%; right: 5%; left: auto; flex-direction: row-reverse; animation-delay: 0.7s; }
.anat-label--lungs .anat-label-line { background: linear-gradient(270deg, var(--anat-primary) 0%, rgba(212,160,74,0.1) 100%); }
.anat-label--stomach  { top: 48%; left: 55%; animation-delay: 0.9s; }
.anat-label--skeleton { top: 65%; right: 5%; left: auto; flex-direction: row-reverse; animation-delay: 1.1s; }
.anat-label--skeleton .anat-label-line { background: linear-gradient(270deg, var(--anat-primary) 0%, rgba(212,160,74,0.1) 100%); }
.anat-label--muscle   { top: 55%; left: 55%; animation-delay: 1.3s; }

@keyframes anatLabelFade {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ── Composition Data Section ─────────────────────── */
.anat-composition {
    position: absolute;
    bottom: 48px; left: 50%; transform: translateX(-50%);
    z-index: 20;
    display: flex; flex-direction: column; align-items: center; gap: 0;
    animation: anatInfoSlide 0.8s ease-out 1.5s both;
}

.anat-comp-tabs {
    display: flex; gap: 2px;
    margin-bottom: 0;
}

.anat-comp-tab {
    font-family: var(--font-ui);
    font-size: 8px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(10, 10, 15, 0.45);
    border: 1px solid rgba(212, 160, 74, 0.06);
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 4px 14px 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    outline: none;
}

.anat-comp-tab:hover {
    color: var(--anat-primary-dim);
    background: rgba(10, 10, 15, 0.6);
    border-color: var(--anat-border);
}

.anat-comp-tab--active {
    color: var(--anat-primary);
    background: rgba(10, 10, 15, 0.75);
    border-color: var(--anat-border);
    text-shadow: 0 0 8px var(--anat-glow);
}

.anat-comp-panels {
    position: relative;
}

.anat-comp-panel {
    display: none;
    align-items: center; gap: 20px;
    padding: 10px 28px;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--anat-border);
    border-radius: 10px;
}

.anat-comp-panel--active {
    display: flex;
}

@keyframes anatInfoSlide {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.anat-info-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}

.anat-info-value {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 700; letter-spacing: 1px;
    color: var(--anat-primary);
    text-shadow: 0 0 10px var(--anat-glow);
}

.anat-info-label {
    font-family: var(--font-ui);
    font-size: 8px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted);
}

.anat-info-sep {
    width: 1px; height: 28px;
    background: linear-gradient(180deg, transparent, var(--anat-border), transparent);
}


/* ── Sanskrit Quote ─────────────────────────────────── */
.anat-quote {
    position: absolute;
    bottom: 10px; left: 50%; transform: translateX(-50%);
    z-index: 20;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    animation: anatInfoSlide 0.6s ease-out 2s both;
}

.anat-quote-sanskrit {
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 12px; font-weight: 500;
    color: rgba(212, 160, 74, 0.4);
    letter-spacing: 2px;
}

.anat-quote-english {
    font-family: var(--font-ui);
    font-size: 8px; font-weight: 500;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--text-muted);
}


/* ── Active Label States ────────────────────────────── */
.anat-labels--has-active .anat-label {
    transition: opacity 0.4s ease;
}

.anat-labels--has-active .anat-label:not(.anat-label--active) {
    opacity: 0.2 !important;
}

.anat-labels--has-active .anat-label--active {
    opacity: 1 !important;
}

.anat-label--active .anat-label-tag {
    background: rgba(212, 160, 74, 0.12);
    border-color: var(--anat-primary);
    box-shadow: 0 0 16px var(--anat-glow), inset 0 0 6px rgba(212, 160, 74, 0.08);
    color: #fff;
}

.anat-label--active .anat-label-dot {
    width: 8px; height: 8px;
    box-shadow: 0 0 14px var(--anat-glow);
}

.anat-label--active .anat-label-line {
    height: 2px;
}


/* ── System Detail Panel ────────────────────────────── */
.anat-detail-panel {
    position: absolute;
    bottom: 120px; right: clamp(20px, 3vw, 50px);
    z-index: 30;
    width: clamp(220px, 20vw, 280px);
    background: rgba(10, 10, 15, 0.88);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--anat-border);
    border-radius: 10px;
    padding: 16px 18px;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.25,.46,.45,.94),
                transform 0.35s cubic-bezier(.25,.46,.45,.94);
}

.anat-detail-panel--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.anat-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.anat-detail-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--anat-primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.anat-detail-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--anat-primary);
    flex: 1;
    transition: color 0.3s ease;
}

.anat-detail-close {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.anat-detail-close:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
}

.anat-detail-desc {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.anat-detail-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(212, 160, 74, 0.1);
    padding-top: 10px;
}

.anat-detail-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.anat-detail-stat + .anat-detail-stat {
    border-left: 1px solid rgba(212, 160, 74, 0.08);
}

.anat-detail-stat-val {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--anat-primary);
    transition: color 0.3s ease;
}

.anat-detail-stat-lbl {
    font-family: var(--font-ui);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}


/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .anat-labels { display: none; }

    .anat-comp-tabs { gap: 1px; }
    .anat-comp-tab { font-size: 7px; padding: 3px 9px 2px; letter-spacing: 1px; }
    .anat-comp-panel {
        gap: 12px; padding: 8px 16px;
    }
    .anat-info-value { font-size: 13px; }
    .anat-info-label { font-size: 7px; }
    .anat-info-sep   { height: 20px; }

    .anat-nav-center { display: none; }
    .anat-detail-panel { bottom: 90px; right: 12px; width: 200px; }
    .anat-detail-stat-val { font-size: 12px; }
}

@media (max-width: 480px) {
    .anat-comp-tab { font-size: 6px; padding: 3px 6px 2px; letter-spacing: 0.8px; }
    .anat-comp-panel { gap: 8px; padding: 6px 12px; }
    .anat-info-value { font-size: 11px; }
    .anat-detail-panel { width: 180px; padding: 12px; }
}
