/* IMPORT FONTS: Fira Code (Headers) & Merriweather (Body) */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Merriweather:wght@300;400;700&display=swap');

html {
    scroll-behavior: smooth !important; /* This forces ALL anchor links (like href='#') to scroll smoothly */
}

:root {
    /* Color Variables (Day Mode) */
    --bg-color: #fdfdfd;
    --text-color: #333;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --card-bg: #fff;
    --border-color: #eee;
    --primary-color: #0a192f; /* Deep Perovskite Blue */
    --accent-color: #d4af37;  /* Gold Catalyst Accent */
    --shadow: rgba(0,0,0,0.05);
}

/* DARK MODE OVERRIDES */
[data-theme="dark"] {
    --bg-color: #020c1b;      /* Deepest Navy */
    --text-color: #ccd6f6;    /* Soft Blue-White */
    --nav-bg: rgba(10, 25, 47, 0.95);
    --card-bg: #112240;       /* Lighter Navy for cards */
    --border-color: #233554;
    --primary-color: #64ffda; /* Teal/Cyan for headers in dark mode */
    --accent-color: #64ffda;
    --shadow: rgba(0,0,0,0.4);
}

body {
    font-family: 'Merriweather', serif; /* BODY: Academic & Readable */
    line-height: 1.8; /* Increased from 1.6 for better readability */
    color: #333;
    margin: 0;
    padding-top: 90px;
    background-color: #fdfdfd; /* Softer white */
    
    /* THE SCALE FIX */
    font-size: 18px; /* Was 16px. This mimics the "Wix" feel. */
}

/* HEADINGS: Modern & Strong */
h1, h2, h3, h4, h5, h6, nav a, .btn-download {
    font-family: 'Roboto', sans-serif;
    color: var(--primary-color);
    margin-top: 1.5em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-color); /* Gold underline */
    transition: all 0.3s ease;
}

a:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* LAYOUT CONTAINER */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* UPDATED HERO with Background Image */
.hero {
    /* Linear Gradient overlays the Navy color on top of the image so text stays readable */
    background: linear-gradient(rgba(10, 25, 47, 0.85), rgba(10, 25, 47, 0.85)), url('/images/hero-bg3.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 12px 20px; /* Taller padding for more impact */
    text-align: center;
    border-radius: 0 0 50% 50% / 40px; /* Elegant curve at the bottom */
    margin-bottom: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);

    /* ADDED: Text Shadow to ensure text is readable on top of the image */
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

/* Ensure the text pops against the background */
.hero h1 {
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    font-weight: 700;
    
}

.hero h1 {
    color: #fff; /* previous: var(--accent-color); */
    font-size: 3rem; /* previous: 2.5em; */
    margin-bottom: 15px;
}

.hero a {
    color: #fff;
    border-bottom: 1px dotted #fff;
}

/* IMAGES & FIGURES */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* PROJECT CARDS (For Lists) */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

article {
    background: var(--card-bg);
    padding: 25px;
    border-left: 5px solid var(--accent-color); /* Gold branding */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* NAVIGATION - Sleek Scientific Strip */
nav {
    background: rgba(255, 255, 255, 0.98);
    /* Reduced vertical padding (was 15px) */
    padding: 0 40px; 
    height: 70px; /* Fixed slim height */
    
    /* Flexbox Magic: Splits Logo and Menu */
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    /* Sticky Behavior */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't expand width */
    z-index: 9999;
    
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(5px);
}

/* BRAND LOCKUP (Logo + Name) */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between logo and name */
    text-decoration: none;
    border-bottom: none !important; /* No underline for the brand */
}

.nav-brand:hover {
    background-color: transparent !important;
    opacity: 0.8; /* Subtle fade on hover instead of gold background */
}

.brand-logo {
    height: 45px; /* Slightly smaller to fit text balance */
    width: auto;
    margin: 0;
}

.brand-text {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem; /* Large enough to be readable */
    font-weight: 700;  /* Bold */
    color: #0a192f;    /* Navy Blue */
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevents name from breaking to two lines */
}

/* Mobile Fix: Shrink text slightly on phones */
@media (max-width: 480px) {
    .brand-text {
        font-size: 1.1rem;
    }
    .brand-logo {
        height: 35px;
    }
}

/* The Menu List */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Horizontal list */
    align-items: center;
}

nav li {
    margin-left: 30px; /* Space between items */
    margin-right: 0;
}

/* Links - Keeping your Gold Style */
nav a {
    color: #0a192f;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem; /* Slightly smaller font for elegance */
    border-bottom: 2px solid transparent; /* Hidden until hover */
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

nav a:hover {
    color: #d4af37; /* Gold Text */
    border-bottom: 2px solid #d4af37; /* Gold Line */
    background-color: transparent; /* No background block, just clean text */
}

/* Mobile Responsiveness (Keeps it usable on phones) */
@media (max-width: 768px) {
    nav {
        padding: 0 20px;
        height: auto;
        flex-direction: column;
    }
    nav ul {
        margin-top: 10px;
        margin-bottom: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    nav li {
        margin: 5px 10px;
    }
}

/* RESEARCH PAGE GRID SYSTEM */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 5px solid var(--accent-color); /* Gold branding */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.project-card h2 a:hover {
    color: var(--accent-color) !important;
}

/* FIX: Override Global Link Styles for Project Cards */
.project-card a {
    border-bottom: none !important; /* Remove underline from images */
    display: block; /* Ensures links behave like blocks, not text */
}

/* Fix 1: Image Hover - Stop the Gold Background Strip */
.project-card a:hover {
    background-color: transparent !important; /* No Gold Background */
    color: inherit !important;
}

/* Fix 2: Title Hover - Text turns Gold, but Background stays clear */
.project-card h2 a:hover {
    color: #d4af37 !important; /* Gold Text */
    background-color: transparent !important; /* No Gold Background */
}

/* Fix 3: "Read Case Study" Button - Keep it clean */
.project-card p a {
    display: inline-block; /* Keep it text-like */
}
.project-card p a:hover {
    color: #0a192f !important; /* Navy on hover */
    background-color: transparent !important;
}

/* ZOOM EFFECT FOR CAPABILITY CARDS */
.project-card:hover img {
    transform: scale(1.1); /* Zooms in 10% on hover */
}

/* TIMELINE COMPONENT */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
}

/* The Vertical Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 20px; /* Position of the line */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0; /* Light grey line */
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 60px; /* Space for the line/marker */
}

/* The Gold Dots */
.timeline-marker {
    position: absolute;
    left: 11px; /* Center on the line (20px left - 9px half-width) */
    top: 5px;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 3px solid #d4af37; /* Gold border */
    border-radius: 50%;
    z-index: 1;
}

/* Hover Effect for Dots */
.timeline-item:hover .timeline-marker {
    background: #d4af37; /* Fills gold on hover */
    transition: background 0.3s ease;
}

/* The Content Box */
.timeline-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0a192f; /* Navy accent */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-content h3 {
    margin-top: 0;
    color: #0a192f;
    font-size: 1.2rem;
}

.timeline-content h4 {
    margin-top: 5px;
    font-family: 'Merriweather', serif; /* Serif for institution name */
    font-weight: normal;
    color: #555;
    font-size: 1rem;
}

.timeline-content .date {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #666;
    background: #f4f4f9;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.timeline-content ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.timeline-content li {
    margin-bottom: 5px;
    font-size: 0.95rem;
}

/* TIMELINE LOGOS & LINKS */
.institution-header {
    margin-top: 5px;
    margin-bottom: 15px;
}

/* The clickable container */
.institution-link {
    display: flex; /* Aligns logo and text horizontally */
    align-items: center; 
    text-decoration: none !important; /* Removes default underline */
    border-bottom: none !important; /* Removes gold border */
    color: inherit; /* Keeps text grey/black */
    transition: opacity 0.2s ease;
}

.institution-link:hover {
    opacity: 0.7; /* Slight fade when you hover to show it's clickable */
    background: transparent !important; /* Prevents gold background */
}

.timeline-logo {
    height: 40px; 
    width: auto;
    margin-right: 15px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.institution-link h4 {
    margin: 0;
    color: #555; /* Keeps the text professional grey */
    font-weight: normal;
    font-family: 'Merriweather', serif;
}

/* PROFESSIONAL PROFILE PICTURE */
.profile-circle {
    width: 200px;
    height: 200px;
    object-fit: cover; /* Ensures photo isn't squashed */
    border-radius: 50%; /* Perfect Circle */
    
    /* The Gold Halo */
    border: 4px solid #fff; /* White gap */
    outline: 3px solid #d4af37; /* Gold outer ring */
    
    /* Placement */
    float: left;
    margin-right: 35px;
    margin-bottom: 15px;
    margin-top: 5px;
    
    /* Visual Depth */
    box-shadow: 0 8px 20px rgba(10, 25, 47, 0.15); /* Soft Navy Shadow */
    transition: transform 0.3s ease;
}

.profile-circle:hover {
    transform: scale(1.05);
}

/* Mobile Fix */
@media (max-width: 768px) {
    .profile-circle {
        float: none;
        margin: 0 auto 25px auto;
        display: block;
    }
}

/* CONTACT PAGE - Split Layout */
.contact-split {
    display: flex;
    flex-wrap: wrap; /* Stacks on mobile */
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); /* Extremely subtle lift */
    margin-top: 20px;
}

.contact-text-area {
    flex: 1 1 60%; /* Takes up 60% of width */
    padding: 40px;
    color: #333; /* Standard dark text */
}

.contact-image-area {
    flex: 1 1 40%; /* Takes up 40% of width */
    background-image: url('/images/bg-pattern.jpg');
    background-size: cover;
    background-position: center;
    min-height: 300px; /* Ensures image shows even if empty */
}

/* Mobile: Stack them */
@media (max-width: 768px) {
    .contact-split {
        flex-direction: column-reverse; /* Image on top on mobile */
    }
    .contact-image-area {
        height: 200px;
        flex: none;
    }
}

/* COMPACT FOOTER STYLES */
footer {
    background: #f9f9f9;
    padding: 30px 0; /* Reduced padding */
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 50px;
}

.social-links {
    display: flex;           /* Forces horizontal alignment */
    justify-content: center; /* Centers them */
    gap: 25px;               /* Space between links */
    margin-bottom: 15px;
}

.social-links a {
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: none; /* Removes the gold underline for cleanliness */
}

.social-links a:hover {
    color: #0a192f; /* Navy on hover */
    background: transparent;
}

footer p {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* PUBLICATION LIST STYLES */
.pub-card {
    display: flex;
    flex-direction: row; /* Image Left, Content Right */
    gap: 25px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px var(--shadow);
    align-items: flex-start; /* Aligns content to top */
}

.pub-image {
    flex: 0 0 160px; /* Fixed Width for Image */
    width: 160px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #f9f9f9;
    padding: 5px;
}

/* THE FIX: Vertical Stacking for Text */
.pub-content {
    flex: 1; /* Take remaining width */
    display: flex;
    flex-direction: column; /* Forces Title -> Author -> Journal -> Links to stack */
    gap: 8px; /* Space between lines */
}

.pub-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    line-height: 1.4;
}

.pub-author {
    font-style: italic;
    color: #555;
    font-size: 1rem;
}

.pub-journal {
    color: var(--accent-color);
    font-weight: 500;
}

/* LINKS ROW */
.pub-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px; /* Space between buttons */
}

/* MOBILE: Stack everything vertically */
@media (max-width: 768px) {
    .pub-card {
        flex-direction: column;
        text-align: center;
    }
    .pub-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 15px auto;
    }
    .pub-actions {
        justify-content: center;
    }
}

/* SMART CAROUSEL CONTAINER */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* The Scrolling Track */
.carousel-track {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 5px; /* Space for shadow */
    scroll-behavior: smooth; /* Smooth gliding */
    
    /* Hide Scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}
.carousel-track::-webkit-scrollbar { 
    display: none; /* Chrome/Safari */
}

/* NAVIGATION BUTTONS */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #0a192f;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #0a192f;
    color: #d4af37; /* Gold Arrow */
    border-color: #0a192f;
}

.nav-btn.left { left: -20px; }
.nav-btn.right { right: -20px; }

/* CLICKABLE CARD DESIGN (Updated to be an <a> tag) */
a.scroll-card {
    display: block; /* Makes the link behave like a box */
    text-decoration: none; /* Kills default underline */
    color: inherit; /* Inherits text color */
    
    flex: 0 0 450px; /* Wider card = Bigger image */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

a.scroll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #d4af37; /* Gold border on hover */
}

/* Image Area */
.scroll-card-img-container {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.scroll-card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures full abstract is visible */
    padding: 10px; /* Breathing room */
}

.scroll-card-text {
    padding: 20px;
}

/* Mobile Fix: Hide buttons, allow swipe */
@media (max-width: 768px) {
    .nav-btn { display: none; }
    a.scroll-card { flex: 0 0 300px; } /* Smaller cards on phone */
}

/* BACK TO TOP BUTTON */
#myBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #d4af37; /* Gold */
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%; /* Circle */
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.3s;
}

#myBtn:hover {
    background-color: #0a192f; /* Navy on hover */
}

/* MOBILE TABLE PROTECTION */
table {
    display: block;
    width: 100%;
    overflow-x: auto; /* Allows table to scroll sideways on phone */
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

/* =========================================
   RESTORED 2-COLUMN FOOTER + BLENDED ROADMAP
   ========================================= */
footer {
    background: #f9f9f9;
    padding-top: 60px; /* Top padding only, bottom handled by roadmap row */
    padding-bottom: 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 80px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between; /* Pushes Bio Left, Social Right */
    align-items: flex-start;
    padding: 0 20px 40px 20px; /* Padding bottom for separation */
    gap: 40px;
}

/* LEFT COLUMN: BIO */
.footer-bio {
    flex: 1;
    max-width: 500px;
    text-align: left;
}

.footer-bio h4 {
    color: #0a192f;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-bio p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.copyright {
    font-size: 0.85rem;
    color: #999;
    margin-top: 20px;
}

/* RIGHT COLUMN: SOCIAL */
.footer-social {
    text-align: right;
    min-width: 200px;
}

.footer-social h4 {
    color: #0a192f;
    margin-top: 0;
    margin-bottom: 15px;
}

/* --- THE HOVER FIX --- */
/* This ensures footer links DO NOT get the solid gold background */
.footer-social a {
    display: block; /* Stack vertically */
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-decoration: none;
    border-bottom: none;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--accent-color) !important; /* Turn text Gold */
    background: transparent !important;   /* No Background Box */
    transform: translateX(-3px);          /* Subtle nudge left */
}

/* BOTTOM ROW: ROADMAP (The Blended Ticker) */
.footer-roadmap-row {
    background: #f0f0f0; /* Slightly darker than footer for separation */
    border-top: 1px solid #eee;
    padding: 15px 0;
    text-align: center;
}

.roadmap-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.roadmap-label {
    font-weight: 700;
    color: #0a192f;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.roadmap-inline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* MOBILE FIXES */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-bio, .footer-social {
        text-align: center;
        max-width: 100%;
    }
    .footer-social a {
        display: inline-block; /* Horizontal on mobile */
        margin: 0 10px;
    }
    .roadmap-content {
        flex-direction: column;
        gap: 10px;
    }
    .roadmap-inline-list li {
        margin: 5px 0 !important;
    }
}

/* --- LIGHTBOX (MODAL) STYLES --- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000; /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 25, 47, 0.95); /* Deep Navy backdrop, 95% opacity */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    cursor: default;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh; /* Leave room for text */
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    border: 2px solid #fff;
    object-fit: contain;
}

#lightbox-caption {
    margin-top: 15px;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    display: inline-block;
    border-radius: 4px;
    max-width: 800px;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10001;
}

.close-btn:hover {
    color: #d4af37; /* Gold on hover */
}

/* Animation */
@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}

/* --- NEW FEATURES (ADD TO BOTTOM) --- */

/* 1. Dark Mode Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}
.theme-switch input { display: none; }
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(24px); }

/* 3. Dark Mode Application (Critical Step) */
/* This forces your existing elements to use variables instead of hardcoded colors */
body { background-color: var(--bg-color); color: var(--text-color); transition: background 0.3s; }
nav { background: var(--nav-bg); border-bottom: 1px solid var(--border-color); }
.project-card, .pub-card, .timeline-content { background: var(--card-bg); border-color: var(--border-color); }
h1, h2, h3, h4 { color: var(--primary-color); }
a { color: var(--accent-color); }

/* HIDE SCROLL BUTTON ON MOBILE */
@media (max-width: 768px) {
    #myBtn {
        display: none !important;
    }
}

/* --- FIX: Remove Yellow Strip from Images --- */

/* 1. Kills the bottom border on the lightbox triggers (Story Images) */
a.lightbox-trigger {
    border-bottom: none !important;
    text-decoration: none !important;
    background: none !important;
}

/* 2. Kills the bottom border on the main Grid Cards */
.project-card a {
    border-bottom: none !important;
    text-decoration: none !important;
}

/* 3. Removes the "focus" outline (optional, for clicking) */
a.lightbox-trigger:focus, 
.project-card a:focus {
    outline: none !important;
}

/* Widget Container */
.roadmap-widget {
    background: rgba(255, 255, 255, 0.05); /* Subtle transparent background */
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    font-family: sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roadmap-widget h4 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

/* List Items */
#roadmap-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#roadmap-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Priority Badges */
.badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Badge Colors */
.badge.high {
    background-color: #ff4757; /* Red for High Priority */
    color: white;
}

.badge.medium {
    background-color: #ffa502; /* Orange for Medium Priority */
    color: black;
}

.badge.low {
    background-color: #2ed573; /* Green for Low Priority */
    color: black;
}

/* =========================================
   NEW ADDITIONS FOR HYBRID HOMEPAGE
   ========================================= */

/* 1. HERO TEXT & BUTTONS (Refining the existing .hero) */
.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: var(--accent-color); /* Gold */
    text-transform: uppercase;
    margin: 0;
}

.hero-tagline {
    font-size: 1.15rem;
    max-width: 750px;
    margin: 25px auto;
    line-height: 1.7;
    color: #e0e0e0;
    font-family: 'Merriweather', serif;
}

.hero-buttons {
    margin-top: 45px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Specific Button Styles (The old CSS only had generic links) */
.btn-gold {
    display: inline-block;
    background: var(--accent-color); 
    color: var(--primary-color) !important; /* Navy Text */
    padding: 14px 30px; 
    border-radius: 4px; 
    font-weight: bold; 
    text-decoration: none !important;
    border: none !important;
    
    /* 1. CRITICAL FIX: Removes the muddy black shadow inherited from Hero */
    text-shadow: none; 
    
    /* 2. OPTIONAL: Sharper Button Shadow (Less "Glow", More "Pop") */
    /* Changed from large spread (15px) to tight shadow (5px) for better definition */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); 
    
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Add a hover effect to lift it slightly */
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    opacity: 1; /* Ensure no transparency */
}

.btn-outline {
    display: inline-block;
    background: transparent; 
    color: #fff !important; 
    padding: 12px 28px; 
    border-radius: 4px; 
    font-weight: bold; 
    text-decoration: none !important;
    border: 2px solid #fff !important;
    transition: transform 0.2s;
}

.btn-gold:hover, .btn-outline:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* 2. VISION SECTION (The Authority Quote) */
.vision-container {
    max-width: 900px;
    margin: 0 auto 80px auto;
    text-align: center;
    padding: 0 20px;
}

.section-label {
    /* TYPOGRAPHY UPGRADE */
    font-size: 1.1rem;      /* Increased from 0.9rem (More readable) */
    font-weight: 600;       /* Slightly bolder to stand out */
    color: #555;            /* Darker grey (#555 instead of #888) for contrast */
    text-transform: uppercase;
    letter-spacing: 3px;    /* Increased spacing to keep it elegant */
    
    /* POSITIONING FOR THE ANIMATION */
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
    border-bottom: none;    /* Remove the old invisible border */
    cursor: default;        /* Shows it's a label, not a link */
}

/* THE GOLD UNDERLINE (Pseudo-element) */
.section-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%; /* Start from center */
    transform: translateX(-50%); /* Center perfectly */
    
    /* INITIAL STATE: Small & Gold */
    width: 40px;            /* Starts as a small, elegant dash */
    height: 3px;            /* Slightly thicker than 1px */
    background-color: var(--accent-color); /* Perovskite Gold */
    border-radius: 2px;     /* Soft edges */
    
    /* ANIMATION SETTINGS */
    transition: width 0.3s ease; 
}

/* HOVER EFFECT: Expands to full width */
.section-label:hover::after {
    width: 100%; /* Grows to cover the whole text */
}

.vision-quote {
    font-size: 1.3rem;
    color: var(--text-color);
    line-height: 1.8;
    font-family: 'Merriweather', serif;
    font-style: italic;
}

.vision-text {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.8;
    margin-top: 30px;
    max-width: 800px;
    margin: 30px auto 0 auto;
}

/* 3. CENTERED GRID ITEMS */
.project-grid-centered {
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 20px;
}

.text-center {
    text-align: center;
}
.text-center h3 {
    margin-top: 0;
}

/* 4. CAROUSEL & FEATURED SECTION UTILITIES */
.carousel-section {
    background: #f9f9f9; 
    padding: 60px 0; 
    margin-top: 80px;
}

.carousel-section h2, .carousel-section p {
    text-align: center;
}

.featured-section {
    max-width: 800px; 
    margin: 80px auto;
    padding: 0 20px;
}

/* 5. THE NEW "FEATURED LINK" CARD (This was missing) */
.featured-link {
    display: block;
    text-decoration: none !important;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    background: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border-left: 5px solid var(--accent-color); /* Gold Border */
    transition: transform 0.2s, background 0.2s;
}

.featured-link:hover {
    transform: translateX(5px);
    background: #fafafa;
}

.featured-link h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.featured-link p {
    color: #666; 
    margin: 0; 
    line-height: 1.6;
}

/* 6. CAROUSEL CARD TYPOGRAPHY (Small tweaks for the 'Read More') */
.scroll-card-text .meta {
    font-size: 0.85rem; 
    margin-bottom: 5px; 
    color: #666;
}
.scroll-card-text h4 {
    margin: 0; 
    color: var(--primary-color); 
    font-size: 1.1rem;
}
.read-more {
    margin-top: 10px; 
    color: var(--accent-color); 
    font-weight: bold; 
    font-size: 0.9rem;
    display: block;
}

/* =========================================
   GLOBAL UTILITY CLASSES (Clean Code System)
   ========================================= */

/* 1. CONTAINER UTILITIES */
.container-standard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
}

/* 2. TYPOGRAPHY UTILITIES */
.section-heading {
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-top: 50px;
    margin-bottom: 30px;
}

/* 3. FIGURE/IMAGE UTILITIES (Replaces <div style="text-align:center...">) */
.figure-container {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee; /* Subtle frame */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Soft lift */
}

.figure-img {
    max-height: 400px; /* Prevents giant images */
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.figure-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 15px;
    font-family: 'Merriweather', serif;
    font-style: italic;
}

.figure-caption strong {
    color: var(--primary-color);
    font-style: normal;
}

/* 4. PUBLICATION CARD REFINEMENTS */
.pub-card {
    /* Your existing class is good, but let's ensure the left border is standard */
    border-left: 5px solid var(--accent-color) !important; /* Force Gold Border */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pub-card:hover {
    transform: translateY(-3px); /* Micro-Interaction: Lift */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* =========================================
   GALLERY / LIFE IN SCIENCE STYLES
   ========================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.gallery-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden; /* Ensures image stays inside corners */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #eee; /* Subtle frame */
    position: relative;
}

/* MICRO-INTERACTION: The "Memory Lift" */
.gallery-card:hover {
    transform: translateY(-5px) scale(1.02); /* Slight lift and zoom */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 2; /* brings it to front */
}

/* The Image Area - Seamless (No Whitespace) */
.gallery-img-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f0f0f0;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures no distortion */
    object-position: center;
    transition: transform 0.5s ease;
}

/* Zoom image slightly more than the card for depth */
.gallery-card:hover .gallery-img {
    transform: scale(1.1); 
}

/* The Text Area */
.gallery-content {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #f9f9f9;
}

.gallery-role {
    display: block;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
    font-family: 'Roboto', sans-serif;
}

.gallery-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: 'Merriweather', serif;
}

/* =========================================
   PUBLICATION BUTTONS FIX (DOI vs Copy vs Altmetric)
   ========================================= */

/* 1. RESET ALTMETRIC (The "Golden Shadow" Fix) */
/* This tells the badge to ignore the global link styles */
.altmetric-embed a, 
.altmetric-embed a:hover {
    border-bottom: none !important;    /* Kills the wide gold underline */
    background-color: transparent !important; /* Kills the wide gold shadow */
    box-shadow: none !important;
    text-decoration: none !important;
}

/* 2. BASE BUTTON STYLE (Shared Logic) */
.btn-cite {
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth spring */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important; /* Kills underline on DOI */
}

/* 3. DOI BUTTON (Primary Action - The "Gold" One) */
/* Targeting the <a> tag specifically */
a.btn-cite {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color) !important;
    margin-right: 10px;
}

a.btn-cite:hover {
    background: var(--accent-color);
    color: var(--primary-color) !important; /* Navy Text for contrast */
    transform: translateY(-2px); /* The "Clickable" Lift */
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2); /* Soft Gold Glow */
}

/* 4. COPY CITATION BUTTON (Secondary Action - The "Subtle" One) */
/* Targeting the <button> tag specifically */
button.btn-cite {
    background: transparent;
    border: 1px solid #ccc; /* Neutral Grey Border */
    color: #777 !important; /* Neutral Grey Text */
}

button.btn-cite:hover {
    background: var(--primary-color); /* Navy Background */
    border-color: var(--primary-color);
    color: #fff !important; /* White Text */
    transform: translateY(-2px); /* The "Clickable" Lift */
    box-shadow: 0 4px 10px rgba(10, 25, 47, 0.2); /* Soft Navy Shadow */
}

/* Active State (When clicked) */
.btn-cite:active {
    transform: translateY(0); /* Pushes back down */
    box-shadow: none;
}

/* 2. CITATION BLOCKS (Replaces the grey boxes in Expertise pages) */
.citation-block {
    background-color: #f9f9f9;
    padding: 25px;
    border-left: 5px solid var(--accent-color); /* Gold Border */
    font-size: 0.95rem;
    margin-top: 40px;
    border-radius: 0 8px 8px 0;
}

.citation-text {
    font-family: 'Fira Code', monospace; /* Code font for the citation itself */
    background: #eee;
    padding: 10px;
    border-radius: 4px;
    color: #333;
    font-size: 0.85rem;
    margin: 10px 0;
    display: block;
    word-break: break-all; /* Prevents long DOIs from breaking layout */
}
/* ============ WOW LAYER (crystal viewer + motion) ============ */
.crystal-section {
    max-width: 1000px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}
.crystal-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 20px;
}
#crystal-wrap {
    width: 440px;
    max-width: 90vw;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.crystal-side {
    max-width: 340px;
    text-align: left;
    font-size: 0.98rem;
    line-height: 1.7;
}
#crystal-caption { transition: opacity 0.3s ease; }

/* Scroll reveal */
.js-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-reveal.in-view {
    opacity: 1;
    transform: none;
}

/* Card micro-physics */
.project-card, .pub-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.project-card:hover, .pub-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(10, 25, 47, 0.12);
}

/* Keyboard focus polish */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ============ MOBILE OVERHAUL (v2) ============ */

/* Hamburger button — hidden on desktop */
#nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}
#nav-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: #0a192f;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease;
}
#nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 900px) {
    nav {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        height: 64px !important;
        padding: 0 18px !important;
    }
    #nav-toggle { display: flex; }

    nav ul#nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.99);
        backdrop-filter: blur(8px);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0 !important;
        padding: 8px 0 18px 0 !important;
        box-shadow: 0 12px 24px rgba(10,25,47,0.10);
        border-top: 1px solid #eee;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.25s ease;
    }
    nav ul#nav-menu.open {
        max-height: 85vh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
    }
    nav ul#nav-menu li {
        margin: 0 !important;
        border-bottom: 1px solid #f2f2f2;
    }
    nav ul#nav-menu li:last-child { border-bottom: none; }
    nav ul#nav-menu li a {
        display: block;
        padding: 15px 24px;
        font-size: 1.02rem;
        border-bottom: none !important;
    }
    nav ul#nav-menu li a:active { background: #fdf8ec; }

    body { padding-top: 64px !important; }
}

/* Contact page: the right column now holds the FORM, not just an image */
@media (max-width: 900px) {
    .contact-split { flex-direction: column !important; }
    .contact-image-area {
        height: auto !important;
        min-height: 0 !important;
        background-image: none !important;
        flex: 1 1 auto !important;
        padding: 0 20px 30px 20px;
    }
    .contact-text-area { padding: 30px 20px !important; }
}
.contact-split { overflow: visible !important; }

/* Desktop: give the form column breathing room */
@media (min-width: 901px) {
    .contact-image-area {
        background-image: none;
        padding: 40px 40px 40px 0;
        min-height: 0;
    }
}

/* Crystal viewer on small screens */
@media (max-width: 900px) {
    .crystal-flex { gap: 24px; }
    .crystal-side { text-align: center; max-width: 100%; }
    #crystal-wrap { width: 340px; min-height: 260px; }
    .crystal-section { padding: 24px 14px; margin: 30px auto; }
}

/* Typography + tap-target comfort on phones */
@media (max-width: 600px) {
    body { font-size: 16.5px; }
    h1 { font-size: 1.85rem !important; line-height: 1.25; }
    h2 { font-size: 1.4rem !important; }
    .hero-buttons a {
        display: block;
        margin: 10px auto !important;
        text-align: center;
        max-width: 320px;
    }
    .quiz-opt { padding: 15px 16px !important; font-size: 0.97rem !important; }
    .quiz-cta { display: block !important; margin: 10px auto !important; max-width: 300px; text-align: center; }
    table { display: block; overflow-x: auto; }
    img { max-width: 100%; height: auto; }
}

/* Prevent any horizontal overflow site-wide */
html, body { overflow-x: hidden; max-width: 100%; }

/* iOS: stop auto-zoom when focusing form fields (needs >=16px) */
input, select, textarea { font-size: 16px !important; }
