/* Core Layout Styles */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Hero Animation Elements */

/* Dots: Small, vibrant circles with a subtle blur */
.dot {
    position: absolute;
    border-radius: 9999px;
    pointer-events: none;
    opacity: 0.8;
    filter: blur(2px);
    z-index: -1;
}

/* Blobs: Large, soft organic shapes that drift centrally */
.blob {
    position: absolute;
    border-radius: 9999px;
    pointer-events: none;
    opacity: 0.6;
    filter: blur(40px);
    z-index: -1;
}

/* Constellation: Full-screen canvas for the particle network */
#constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Container for all hero background effects */
#animation-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Smooth Transitions for Theme Switching */
.dark-mode-transition {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ── Navbar on dark-hero pages (light mode, not yet scrolled) ──────────────
   Dark mode handles itself via Tailwind's dark: prefix.
   In light mode, the transparent navbar sits over a dark gradient, force
   the theme toggle icon and lab button to white so they're legible.
*/
body[data-dark-hero="true"] #navbar:not(.scrolled) #theme-toggle {
    color: white;
}
body[data-dark-hero="true"] #navbar:not(.scrolled) #theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.12);
}
body[data-dark-hero="true"] #navbar:not(.scrolled) a[href="lab.html"] {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
/* Also ensure nav links are white over the dark hero in light mode */
body[data-dark-hero="true"] #navbar:not(.scrolled) nav a {
    color: rgba(255, 255, 255, 0.85);
}
body[data-dark-hero="true"] #navbar:not(.scrolled) nav a:hover {
    color: white;
}
/* Back arrow / "All Projects" link on project pages */
body[data-dark-hero="true"] #navbar:not(.scrolled) header > div > a:first-child,
body[data-dark-hero="true"] #navbar:not(.scrolled) .container > div > a:first-child {
    color: rgba(255, 255, 255, 0.85);
}
/* Separator between nav and theme toggle */
body[data-dark-hero="true"] #navbar:not(.scrolled) .bg-gray-200 {
    background-color: rgba(255, 255, 255, 0.25) !important;
}

/* Anchor offset for fixed nav */
[id] { scroll-margin-top: 80px; }

/* Publication list items */
.pub-item {
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease;
}
.pub-item:hover { border-left-color: #004a99; }

/* Member photo placeholders */
.member-photo {
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    object-fit: cover;
    background-color: #c7d2e7;
}

/* Lab hero gradient */
.lab-hero-bg {
    background: linear-gradient(135deg, #003d80 0%, #004a99 50%, #0060c0 100%);
}

/* Scroll indicator fade */
#scroll-indicator { transition: opacity 0.4s ease; }

/* Navbar text on dark-hero pages: white until frosted glass kicks in */
[data-dark-hero="true"] #navbar:not(.scrolled) a,
[data-dark-hero="true"] #navbar:not(.scrolled) button:not(#theme-toggle) {
    color: white !important;
}