/* ==========================================================================
   CSS Reset & Base variables
   ========================================================================== */
:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-primary: #090e1a;
    --bg-secondary: #0f172a;
    --bg-navbar: rgba(9, 14, 26, 0.75);
    
    --card-bg: rgba(20, 30, 54, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-shadow: rgba(0, 0, 0, 0.25);
    --card-hover-bg: rgba(28, 42, 73, 0.6);
    --card-hover-border: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-linear: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-color: #818cf8;
    --accent-color-rgb: 129, 140, 248;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s ease;
    
    --glass-blur: 16px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

/* Light Mode overrides */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-navbar: rgba(248, 250, 252, 0.8);
    
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.06);
    --card-shadow: rgba(15, 23, 42, 0.05);
    --card-hover-bg: rgba(255, 255, 255, 0.9);
    --card-hover-border: rgba(99, 102, 241, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-linear: linear-gradient(135deg, #4f46e5 0%, #0d9488 100%);
    --accent-glow: rgba(79, 70, 229, 0.15);
    --accent-color: #4f46e5;
    --accent-color-rgb: 79, 70, 229;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Background Neural Canvas Container */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.85;
}

/* Typography & General Utilities */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

p {
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 9999px;
    background: var(--accent-linear);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.badge-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   Header Navigation Bar
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--bg-navbar);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--card-border);
    transition: var(--transition-smooth);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.05em;
}

.logo-bracket {
    color: var(--accent-color);
    font-weight: 800;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-linear);
    transition: var(--transition-fast);
}

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

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background-color: var(--card-bg);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Mobile Hamburger Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 110;
}

.hamburger-bar {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 10rem 2rem 5rem;
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 4rem;
    align-items: center;
}

/* Avatar Image & Glow */
.hero-avatar-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.hero-avatar-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 35% 65% 60% 40% / 45% 45% 55% 55%;
    background: var(--accent-linear);
    filter: blur(24px);
    opacity: 0.65;
    animation: waveGlow 8s infinite ease-in-out;
}

.hero-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 35% 65% 60% 40% / 45% 45% 55% 55%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    background-color: var(--bg-secondary);
    animation: waveGlow 8s infinite ease-in-out;
}

.hero-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    margin-top: -0.5rem;
    background: var(--accent-linear);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 650px;
    line-height: 1.7;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
}

/* Button & Action items */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--accent-linear);
    color: #ffffff;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-primary svg {
    transition: transform 0.25s ease;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.social-btn:hover {
    color: var(--text-primary);
    border-color: var(--card-hover-border);
    background-color: var(--card-hover-bg);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-linear);
    border-radius: 99px;
}

/* ==========================================================================
   Glassmorphism Cards
   ========================================================================== */
.glass-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 15px 35px var(--card-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: var(--transition-smooth);
}

.clickable-card:hover {
    transform: translateY(-6px);
    background-color: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 25px rgba(99, 102, 241, 0.15);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
}

.about-main p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-main p:last-child {
    margin-bottom: 0;
}

.text-link {
    color: var(--accent-color);
    font-weight: 600;
    border-bottom: 1px dashed var(--accent-color);
}

.text-link:hover {
    color: var(--text-primary);
    border-bottom-style: solid;
}

.about-roots {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-roots .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.about-roots .card-icon {
    font-size: 1.75rem;
}

.about-roots p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ==========================================================================
   Research / Experience Section
   ========================================================================== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.card-icon-large {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.research-grid h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.research-grid p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.academic-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.academic-list li {
    position: relative;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.academic-list li::before {
    content: "•";
    position: absolute;
    left: 5px;
    color: var(--accent-color);
    font-weight: bold;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.card-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--card-border);
    padding: 4px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   Bioengineering Club Section
   ========================================================================== */
.club-card {
    padding: 3.5rem;
}

.club-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3.5rem;
    align-items: center;
}

.club-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.club-info h2 {
    font-size: 2rem;
}

.club-info p {
    font-size: 1.05rem;
    line-height: 1.7;
}

.club-stats {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* DNA Graphic Animation */
.club-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 250px;
}

.dna-animation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: rotate(-15deg);
}

.dna-dot {
    width: 140px;
    height: 8px;
    position: relative;
    display: flex;
    justify-content: space-between;
}

.dna-dot::before, .dna-dot::after {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    top: -3px;
    animation: rotateDna 3s infinite ease-in-out;
}

.dna-dot::before {
    background: #6366f1;
    left: 0;
    animation-delay: calc(var(--i) * 0.15s);
}

.dna-dot::after {
    background: #06b6d4;
    right: 0;
    animation-delay: calc(var(--i) * 0.15s + 1.5s);
}

.dna-dot::translate-line {
    /* Connection line in double helix */
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    top: 3px;
    z-index: -1;
}

/* Custom separator line across DNA pairs */
.dna-dot::after {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}
.dna-dot::before {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Connect DNA dots with horizontal bar */
.dna-dot {
    background-image: linear-gradient(to right, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
    background-size: 80% 2px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px solid var(--card-border);
    background-color: var(--bg-secondary);
    padding: 3.5rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Entrance & Scroll Animations
   ========================================================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hero-avatar-wrapper.fade-in-up {
    animation-delay: 0.1s;
}

.hero-info.fade-in-up {
    animation-delay: 0.25s;
}

/* Scroll reveal class triggered by JS */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes waveGlow {
    0%, 100% {
        border-radius: 35% 65% 60% 40% / 45% 45% 55% 55%;
    }
    50% {
        border-radius: 50% 50% 45% 55% / 55% 40% 60% 45%;
    }
}

@keyframes rotateDna {
    0%, 100% {
        transform: scale(0.8) translateY(0);
        z-index: 1;
    }
    50% {
        transform: scale(1.1) translateY(-2px);
        z-index: 2;
    }
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-info {
        align-items: center;
    }
    
    .hero-cta-group {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .club-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .club-graphic {
        order: -1;
        height: 150px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .nav-menu {
        display: none; /* Hidden on mobile, activated via JS class */
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--card-border);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        text-align: center;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    }
    
    .nav-menu.mobile-active {
        display: flex;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .mobile-toggle.active .hamburger-bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active .hamburger-bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .section-container {
        padding: 4rem 1.5rem;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}
