/* ===========================================
   1. CSS VARIABLES & THEME CONFIGURATION
   =========================================== */
:root {
    --bg-primary: #030712;
    --bg-secondary: #0b1120;
    --bg-glass: rgba(15, 23, 42, 0.55);
    --accent-cyan: #00f0ff;
    --accent-blue: #0ea5e9;
    --accent-dark-blue: #1e40af;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.35);
    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 20px;
}

/* ===========================================
   2. BASE RESET & TYPOGRAPHY
   =========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ===========================================
   3. LAYOUT & UTILITIES
   =========================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
    position: relative;
}

/* ===========================================
   4. HEADER & NAVIGATION
   =========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1.1;
}

.logo-accent {
    color: var(--accent-cyan);
}

.logo-sub {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 2px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    position: relative;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ===========================================
   5. HERO SECTION
   =========================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, var(--bg-secondary) 0%, var(--bg-primary) 70%);
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-primary) 90%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.btn {
    display: inline-block;
    padding: 16px 36px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-dark-blue) 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4), var(--shadow-glow);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 13px;
    display: block;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-wheel 2s infinite;
}

/* ===========================================
   6. ABOUT SECTION
   =========================================== */
.section-header {
    margin-bottom: 64px;
}

.section-header.center {
    text-align: center;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-cyan);
    margin-bottom: 16px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 6px 14px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 20px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border-glass);
    padding-top: 32px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.about-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hologram-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hologram-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 24px;
    animation: hologram-spin 12s linear infinite;
}

.ring-second {
    inset: 20px;
    border-style: dashed;
    animation-direction: reverse;
    animation-duration: 18s;
    opacity: 0.6;
}

.hologram-core {
    position: absolute;
    inset: 60px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
    animation: float 6s ease-in-out infinite;
}

.hologram-core svg {
    width: 64px;
    height: 64px;
    stroke: var(--accent-cyan);
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
}

.hologram-scanlines {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 24px;
    pointer-events: none;
}

.hologram-scanlines span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.6), transparent);
    animation: scan-move 4s linear infinite;
    opacity: 0.6;
}

.hologram-scanlines span:nth-child(1) { top: 10%; animation-delay: 0s; }
.hologram-scanlines span:nth-child(2) { top: 40%; animation-delay: 1.3s; }
.hologram-scanlines span:nth-child(3) { top: 75%; animation-delay: 2.6s; }

/* ===========================================
   7. PROGRAMS SECTION
   =========================================== */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.program-card {
    padding: 40px 28px;
    transition: var(--transition);
}

.program-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 240, 255, 0.1);
}

.program-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 24px;
    color: var(--accent-cyan);
}

.program-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.program-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.program-link {
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.program-card:hover .program-link {
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* ===========================================
   8. LABORATORY SECTION
   =========================================== */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.lab-card {
    padding: 36px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.lab-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.4;
    transition: opacity 0.3s;
}

.lab-card:hover::before {
    opacity: 1;
}

.lab-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.lab-number {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2.2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
    pointer-events: none;
}

.lab-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.lab-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulse-light 2s infinite;
}

.lab-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
    padding-right: 40px;
}

.lab-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===========================================
   9. CONTACTS SECTION
   =========================================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.contact-card {
    padding: 40px 24px;
    text-align: center;
    transition: var(--transition);
}

.contact-card.wide {
    grid-column: 1 / -1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contact-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    color: var(--accent-cyan);
}

.contact-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.contact-info,
.contact-info a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.3s;
    line-height: 1.7;
}

.contact-info a:hover {
    color: var(--accent-cyan);
}

.map-graphic {
    position: relative;
    height: 220px;
    width: 100%;
    background:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-dot {
    width: 14px;
    height: 14px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 24px var(--accent-cyan);
    animation: pulse-light 2.5s infinite;
    position: relative;
    z-index: 2;
}

.map-dot::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    animation: sonar 3s infinite;
}

.map-label {
    position: absolute;
    bottom: 16px;
    left: 20px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 3;
}

.map-coords {
    position: absolute;
    bottom: 16px;
    right: 20px;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    z-index: 3;
}

/* ===========================================
   10. FOOTER
   =========================================== */
.footer {
    padding: 40px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-glass);
}

/* ===========================================
   11. GLASSMORPHISM COMPONENTS
   =========================================== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
}

/* ===========================================
   12. ANIMATIONS & KEYFRAMES
   =========================================== */
@keyframes scroll-wheel {
    0% { top: 8px; opacity: 1; }
    100% { top: 22px; opacity: 0; }
}

@keyframes hologram-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scan-move {
    0% { top: 0%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes pulse-light {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-cyan); }
    50% { opacity: 0.5; box-shadow: 0 0 2px var(--accent-cyan); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes sonar {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ===========================================
   13. SCROLL REVEAL UTILITIES
   =========================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ===========================================
   14. RESPONSIVE MEDIA QUERIES
   =========================================== */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .lab-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        max-width: 320px;
        height: calc(100vh - 70px);
        background: rgba(3, 7, 18, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid var(--border-glass);
        padding: 40px 32px;
        transition: right 0.35s ease-in-out;
        z-index: 999;
    }

    .nav.nav-open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 28px;
    }

    .nav-link {
        font-size: 1.1rem;
    }

    .menu-toggle {
        display: block;
    }

    .programs-grid,
    .lab-grid,
    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 80px 0;
    }

    .about-stats {
        flex-direction: column;
        gap: 24px;
    }

    .contact-card.wide {
        grid-column: auto;
    }

    .hero-title {
        font-size: 2rem;
    }
}