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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #050505;
    color: #ffffff;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ============================================================
   Video Background Container (home page only)
   ============================================================ */
.video-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.8s ease-out;
}

.video-wrapper video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Overlay to ensure text readability */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

/* Caption for the background video (bottom-right, fades with the video) */
.video-caption {
    position: absolute;
    bottom: 1.25rem;
    right: 1.5rem;
    z-index: 2;
    font-size: 0.72rem;
    letter-spacing: 0.03rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
    max-width: 70vw;
}

.video-caption a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.video-caption a:hover {
    color: #fff;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 3rem;
    z-index: 100;
}

/* Brand / name, top-left of the navigation bar */
.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.7;
}

/* Active page indicator */
.nav-links a.active {
    color: #00aaff;
}

/* Dropdown / submenu */
.has-submenu {
    position: relative;
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    flex-direction: column;
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    min-width: 230px;
    padding: 0.5rem 0;
    margin-top: 1.2rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.has-submenu:hover .nav-submenu {
    display: flex;
}

.nav-submenu a {
    display: block;
    padding: 0.65rem 1.4rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Invisible hover bridge spanning the gap between the nav item and the
   dropdown, so the menu stays open while the pointer moves down to click an item */
.has-submenu::before {
    content: "";
    position: absolute;
    top: calc(100% - 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 2rem;
}

/* The Hamburger Icon (Hidden on Desktop) */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
}

/* Mobile Styles */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 105;
        gap: 2rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        font-size: 1.4rem;
    }

    /* Submenu becomes a simple indented list on mobile */
    .nav-submenu {
        display: flex;
        position: static;
        transform: none;
        background: none;
        border: none;
        box-shadow: none;
        min-width: 0;
        padding: 0;
        margin-top: 0.4rem;
        gap: 0.6rem;
    }

    .has-submenu::before {
        display: none;
    }

    .nav-submenu a {
        font-size: 1rem;
        font-weight: 300;
        padding: 0.2rem 0;
    }
}

/* ============================================================
   Hero Content (home page)
   ============================================================ */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    position: relative;
    z-index: 2;
    padding: 0 10%;
    background: transparent;
}

.tagline {
    font-size: 0.8rem;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
    color: #00aaff;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(1.9rem, 4.2vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
    max-width: 900px;
}

.hero .hero-name {
    font-size: 1rem;
    font-weight: 400;
    color: #9a9a9a;
}

/* ============================================================
   Section Styling (shared)
   ============================================================ */
section {
    position: relative;
    z-index: 3;
    padding: 120px 10%;
    background: #050505;
    border-bottom: 1px solid #1a1a1a;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #fff;
}

h3 {
    font-size: 1.2rem;
    margin: 2rem 0 1rem 0;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-weight: 600;
}

/* ============================================================
   Research Grid (home page)
   ============================================================ */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    display: block;
    padding: 2.5rem;
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #00aaff;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #00aaff;
}

.card p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.card-link {
    color: inherit;
    text-decoration: none;
}

.card-link:hover {
    color: inherit;
}

.card-link .card-cta {
    color: #00aaff;
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* ============================================================
   Gallery (home page) section
   ============================================================ */
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-thumb {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-thumb:hover {
    transform: translateY(-5px);
    border-color: #00aaff;
}

.gallery-thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-cta {
    display: inline-block;
    color: #00aaff;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 1rem;
}

#gallery > p {
    color: #ccc;
    max-width: 700px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ============================================================
   Publication list
   ============================================================ */
.pub-list {
    margin-bottom: 3rem;
}

.pub-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #222;
    line-height: 1.6;
}

.pub-year {
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: #666;
}

.pub-body {
    flex: 1;
}

.pub-title {
    display: block;
    color: #ffffff;
    font-weight: 500;
}

.pub-meta {
    display: block;
    margin-top: 0.25rem;
    color: #888;
}

.journal-name {
    font-style: italic;
}

.pub-link {
    color: #00aaff;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 4px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.pub-link:hover {
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
}

/* ============================================================
   Scroll indicator
   ============================================================ */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    font-size: 0.7rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    opacity: 0.5;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, -20% { transform: translateY(0); }
    60%, 100% { transform: translateY(-10px); }
}

/* ============================================================
   About Me Section
   ============================================================ */
#about {
    padding: 100px 10%;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.profile-image-wrapper {
    flex: 0 0 300px;
}

.profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #00aaff;
    padding: 10px;
    background: #111;
}

.bio-content {
    flex: 1;
    min-width: 300px;
}

.bio-content h2 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.bio-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.sub-link {
    color: #00aaff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.sub-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .profile-image-wrapper {
        flex: 0 0 auto;
    }
    .bio-content p {
        text-align: left;
    }
}

/* ============================================================
   Contact
   ============================================================ */
#contact {
    text-align: center;
    background: #000;
}

#contact .contact-line {
    margin-top: 2rem;
}

#contact .contact-email {
    color: #00aaff;
    text-decoration: none;
    font-weight: bold;
}

#contact .contact-social {
    margin-top: 3rem;
}

#contact .contact-social a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

#contact .contact-social a:hover {
    color: #00aaff;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 50px;
    position: relative;
    z-index: 3;
}

.copyright-text {
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================================
   Internal pages (research detail)
   ============================================================ */
.page {
    position: relative;
    z-index: 3;
    padding-top: 140px;
    background: #050505;
    min-height: 100vh;
}

.page-header {
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    padding: 0 3rem 3rem 3rem;
    border-bottom: 1px solid #1a1a1a;
}

.back-link {
    display: inline-block;
    color: #00aaff;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 0.7;
}

.page-header h1 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.page-intro {
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.7;
    color: #ccc;
}

.page-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 3rem;
}

.page-body h2 {
    margin-top: 3rem;
}

.page-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.2rem;
}

/* Key-topics list on internal pages */
.page-body ul {
    margin: 0.5rem 0 1.5rem 0;
    padding-left: 1.1rem;
}

.page-body li {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 0.9rem;
    padding-left: 0.4rem;
}

.page-body li::marker {
    color: #00aaff;
}

.page-body li strong {
    color: #fff;
}

/* Placeholder marker so the spots to fill in are obvious */
.placeholder {
    color: #666;
    font-style: italic;
    border-left: 2px solid #00aaff;
    padding-left: 1rem;
}

/* Mobile: internal (research) pages */
@media (max-width: 768px) {
    .page {
        padding-top: 100px;
    }
    .page-header {
        padding: 0 1.25rem 2rem 1.25rem;
    }
    .page-body {
        padding: 0 1.25rem;
    }
}

/* ============================================================
   Gallery page + carousel
   ============================================================ */
.gallery {
    position: relative;
    z-index: 3;
    background: #050505;
    min-height: 100vh;
    padding-top: 4.5rem; /* keep the view clear of the fixed navigation bar */
}

.carousel {
    position: relative;
    width: 100%;
    height: calc(100vh - 4.5rem);
    overflow: hidden;
    background: #050505;
}

.carousel-track {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    padding-bottom: 9rem; /* keep the media clear of the caption band below */
}

.carousel-slide.is-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050505;
}

/* Description bar at the bottom of each slide: a fixed, wide, low band so the
   media above never overlaps it */
.carousel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    height: 9rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 3rem 2.4rem;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    pointer-events: none;
}

.carousel-title {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.carousel-text {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.6;
    color: #ccc;
    max-width: 900px;
    margin: 0 auto;
}

/* Prev / next arrows */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.carousel-prev { left: 1.5rem; }
.carousel-next { right: 1.5rem; }

.carousel-prev:hover,
.carousel-next:hover {
    border-color: #00aaff;
    color: #00aaff;
    background: rgba(0, 0, 0, 0.65);
}

/* Counter (bottom-left) */
.carousel-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 1.8rem;
    z-index: 6;
    font-size: 0.8rem;
    letter-spacing: 0.15rem;
    color: #888;
}

/* Dots */
.carousel-dots {
    position: absolute;
    bottom: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover { background: rgba(255, 255, 255, 0.6); }
.carousel-dot.is-active { background: #00aaff; transform: scale(1.25); }

/* Mobile: gallery */
@media (max-width: 768px) {
    .carousel-prev,
    .carousel-next {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    .carousel-prev { left: 0.8rem; }
    .carousel-next { right: 0.8rem; }
    .carousel-caption { height: 8.5rem; padding: 0 1.25rem 2.2rem; }
    .carousel-text { font-size: 0.72rem; }
    .carousel-counter { bottom: 1.2rem; left: 1.2rem; }
    .gallery-thumbs { grid-template-columns: repeat(2, 1fr); }
}
