/* Research Page Custom Styles - Glassy, Dynamic, and Colorful */

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

/* Canvas */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    background: linear-gradient(45deg, #2a3f98 0%, #3a2a6a 25%, #a15ac8 50%, #a12a4a 75%, #1a6ec8 100%);
    background-size: 400% 400%;
    animation: gradientShift 60s ease-in-out infinite;
    line-height: 1.6;
    text-align: center;
    margin: 0;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 25% 75%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 75% 25%; }
    100% { background-position: 0% 50%; }
}

/* Main Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem 1rem;
    padding-top: 8rem; /* Account for fixed navigation + extra space */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    perspective: 1000px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 0;
    text-align: center;
}

header h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    background-size: 300% 300%;
    animation: textGradient 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes textGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Buttons */
.button {
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
    margin: 0.5rem 0.25rem;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    filter: contrast(1.1) brightness(1.05);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: contrast(1.2) brightness(1.1);
}

.button.active {
    border: 2.5px solid rgba(69, 183, 209, 0.7);
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.13);
    color: #fff;
    box-shadow: 0 0 16px 4px rgba(69, 183, 209, 0.45), 0 2px 8px rgba(0,0,0,0.08);
    transition: border 0.3s, box-shadow 0.3s;
    overflow: visible;
}

.button.active::before {
    display: none;
}

.button.active::after {
    display: none;
}

/* Blockquote */
blockquote {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    color: #fff;
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    transition: box-shadow 0.3s, background 0.3s, transform 0.25s cubic-bezier(.4,1.4,.6,1);
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

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

.nav-logo-mobile {
    display: none;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo a,
.nav-logo-mobile a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.nav-logo a:hover,
.nav-logo a:focus,
.nav-logo-mobile a:hover,
.nav-logo-mobile a:focus {
    text-decoration: none;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    background-size: 300% 300%;
    animation: textGradient 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.nav-buttons .button {
    opacity: 0;
    transform: translateX(50px);
    animation: navButtonPopIn 0.6s ease forwards;
}



/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    position: relative;
    padding-right: 2rem;
}

.dropdown-toggle::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    /* Force hardware acceleration */
    will-change: backdrop-filter;
}

/* Right-aligned dropdown positioning */
.dropdown:last-child .dropdown-menu {
    left: auto;
    right: 0;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* Force backdrop-filter to render when visible */
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    will-change: backdrop-filter;
}

.dropdown-item {
    display: block;
    width: calc(100% - 1rem);
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: 12px;
    margin: 0.25rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    filter: contrast(1.1) brightness(1.05);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.dropdown-item:active {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-item.active {
    border: 2.5px solid rgba(69, 183, 209, 0.7);
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.13);
    color: #fff;
    box-shadow: 0 0 16px 4px rgba(69, 183, 209, 0.45), 0 2px 8px rgba(0,0,0,0.08);
    transition: border 0.3s, box-shadow 0.3s;
    overflow: visible;
}

@keyframes navButtonPopIn {
    0% {
        opacity: 0;
        transform: translateX(50px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateX(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* All buttons always visible */
.button {
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    position: static;
}



/* Sections */
section {
    /* No styling, plain container */
}

section > .bubble {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    /* Only .bubble class should control the glass effect */
}

section > .bubble:last-child {
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    section > .bubble {
        max-width: 98vw;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Page Titles */
.page-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.4),
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(255, 255, 255, 0.2),
        0 0 40px rgba(255, 255, 255, 0.1),
        0 0 50px rgba(255, 255, 255, 0.05),
        0 0 60px rgba(255, 255, 255, 0.03),
        0 0 70px rgba(255, 255, 255, 0.02),
        0 0 80px rgba(255, 255, 255, 0.01),
        0 0 90px rgba(255, 255, 255, 0.005),
        0 0 100px rgba(255, 255, 255, 0.003);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: left;
    color: #fff;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 1rem 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Lists */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid #4ecdc4;
    transition: all 0.3s ease;
}

ul li:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

ul li strong {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #4ecdc4;
    font-weight: 600;
}

/* Links */
a {
    color: #4ecdc4;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
}

/* Horizontal Line */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 2rem 0;
    border-radius: 1px;
}

/* ===== RESPONSIVE NAVIGATION ===== */

/* Desktop Navigation (1201px and above) */
@media screen and (min-width: 1201px) {
    /* Hide all mobile elements */
    .mobile-nav-buttons,
    .mobile-submenu,
    .submenu-item,
    .mobile-menu-toggle,
    .nav-logo-mobile {
        display: none !important;
    }
    
    /* Show desktop elements */
    .nav-brand,
    .nav-buttons,
    .dropdown {
        display: flex;
    }
}

/* Mobile/Tablet Navigation (1200px and below) */
@media screen and (max-width: 1200px) {
    /* Navigation layout */
    .top-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    
    /* Hide desktop elements */
    .nav-brand,
    .nav-buttons,
    .dropdown {
        display: none;
    }
    
    /* Show mobile logo */
    .nav-logo-mobile {
        display: flex;
        align-items: center;
    }
    
    .logo-image-mobile {
        height: 35px;
        width: auto;
        max-width: 100px;
        object-fit: contain;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        transition: transform 0.3s ease, filter 0.3s ease;
    }
    
    .logo-image-mobile:hover {
        transform: scale(1.05);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
    }
    
    .mobile-menu-toggle span {
        width: 100%;
        height: 3px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Mobile navigation menu */
    .mobile-nav-buttons {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        margin: 0.5rem;
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
        z-index: 1000;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }
    
    .mobile-nav-buttons.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Mobile submenus */
    .mobile-submenu {
        display: none;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 15px;
        margin: 0.5rem 0;
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
        box-shadow: 0 4px 16px rgba(31, 38, 135, 0.37);
        transform: translateY(-10px);
        opacity: 0;
        transition: all 0.3s ease;
        overflow: hidden;
        max-height: 0;
    }
    
    .mobile-submenu.active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        max-height: 300px;
    }
    
    .submenu-item {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s ease;
        width: 100%;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        margin: 0.1rem 0;
    }
    
    .submenu-item:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-1px);
    }

    @keyframes navButtonPopUp {
        0% {
            opacity: 0;
            transform: translateY(30px) scale(0.8);
        }
        60% {
            opacity: 1;
            transform: translateY(-3px) scale(1.05);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .button {
        padding: 8px 16px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    main {
        padding-top: 5rem; /* Space for mobile nav + dropdown */
        position: relative;
        z-index: 1;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .page-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        color: rgba(255, 255, 255, 0.6);
        text-shadow: 
            0 0 8px rgba(255, 255, 255, 0.4),
            0 0 16px rgba(255, 255, 255, 0.3),
            0 0 24px rgba(255, 255, 255, 0.2),
            0 0 32px rgba(255, 255, 255, 0.1),
            0 0 40px rgba(255, 255, 255, 0.05);
        filter: blur(0.3px);
        letter-spacing: 1px;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    section {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    main {
        padding: 1rem;
        padding-top: 5rem; /* Maintain space for mobile nav + dropdown */
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: rgba(255, 255, 255, 0.6);
        text-shadow: 
            0 0 6px rgba(255, 255, 255, 0.4),
            0 0 12px rgba(255, 255, 255, 0.3),
            0 0 18px rgba(255, 255, 255, 0.2),
            0 0 24px rgba(255, 255, 255, 0.1),
            0 0 30px rgba(255, 255, 255, 0.05);
        filter: blur(0.2px);
        letter-spacing: 0.5px;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

/* For Firefox */
html {
    scrollbar-width: none;
}

/* For IE/Edge */
body {
    -ms-overflow-style: none;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    margin: 0 0.5rem;
}

.footer-scroll-bubble {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(1.2) contrast(1.1);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 0.25rem 0.1rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    overflow: hidden;
    box-shadow: 
        0 4px 16px rgba(31, 38, 135, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    filter: contrast(1.1) brightness(1.05) saturate(1.1);
    position: relative;
    height: 100%;
}

.footer-datetime-bubble {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px) saturate(1.2) contrast(1.1);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    box-shadow: 
        0 4px 16px rgba(31, 38, 135, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    filter: contrast(1.1) brightness(1.05) saturate(1.1);
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}



.footer-scroll-text {
    white-space: nowrap;
    animation: scrollText 250s linear infinite;
    display: inline-block;
    padding: 0 20px;
    font-weight: bold;
    transform: translateX(100vw);
}

@keyframes scrollText {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Hide footer on mobile */
@media (max-width: 1200px) {
    .footer {
        display: none;
    }
}

.bubbles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: flex-start;
    align-items: stretch;
    margin-top: 1.5rem;
    perspective: 1000px;
}

.bubble {
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(6px) saturate(1.05) contrast(1.04);
    border-radius: 36px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 4px 32px 0 rgba(31, 38, 135, 0.10),
        0 1.5px 8px 0 rgba(31, 38, 135, 0.08),
        0 0 0 2px rgba(255,255,255,0.08),
        0 0 40px 0 rgba(255,255,255,0.10),
        /* Inner shadow for glass thickness */
        inset 0 2px 16px 0 rgba(255,255,255,0.18),
        inset 0 -8px 32px 0 rgba(31,38,135,0.10);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    filter: contrast(1.06) brightness(1.05) saturate(1.04);
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    padding: 2rem;
    text-align: left;
    outline: 1px solid #fff;
    outline-offset: -2px;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 36px;
    background:
        /* Bottom highlight */
        radial-gradient(ellipse 80% 40% at 50% 100%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.13) 60%, rgba(255,255,255,0.01) 100%),
        /* Subtle bottom shadow */
        radial-gradient(ellipse 90% 20% at 50% 100%, rgba(31,38,135,0.13) 0%, rgba(31,38,135,0.00) 80%);
    pointer-events: none;
    z-index: 2;
}

.bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 36px;
    background:
        /* Top highlight */
        linear-gradient(to bottom, rgba(255,255,255,0.33) 0%, rgba(255,255,255,0.10) 30%, rgba(255,255,255,0.00) 80%),
        /* Edge glow */
        radial-gradient(ellipse 100% 100% at 50% 0%, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.00) 80%);
    pointer-events: none;
    z-index: 2;
}

.bubble:hover {
    transform: scale(1.05) translateZ(20px);
    box-shadow:
        0 15px 40px rgba(31, 38, 135, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        inset 0 -1px 0 rgba(255, 255, 255, 0.01),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.05),
        /* Enhanced bubble curve shadows on hover */
        0 0 30px rgba(255, 255, 255, 0.15),
        0 0 60px rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.001);
    filter: contrast(1.3) brightness(1.2) saturate(1.2);
}

.bubble h3 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.bubble p {
    color: rgba(255,255,255,0.92);
    font-size: 1.05rem;
    margin-bottom: 0;
    text-align: justify;
}

/* Remove section:hover effect (if present) */
section:hover {
}

.project-bubble {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
}

/* Ensure project bubbles without images still look good */
.project-bubble:not(:has(.project-image-container)) .project-content {
    width: 100%;
}

.project-image-container {
    width: 280px;
    height: 280px;
    min-width: 280px;
    min-height: 280px;
    background: rgba(255,255,255,0.18);
    border-radius: 28px;
    border: 1.5px solid rgba(255,255,255,0.22);
    outline: 1px solid #fff;
    outline-offset: -2px;
    box-shadow: 0 2px 12px 0 rgba(31,38,135,0.10), 0 0 0 1.5px rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-left: 1.5rem;
    margin-right: 0;
    position: relative;
    align-self: center;
    z-index: 3;
}

.project-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.project-content {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    color: #fff;
    font-weight: 700;
    text-align: left;
}

.project-description {
    margin: 0;
    color: rgba(255,255,255,0.92);
    font-size: 1.08rem;
    text-align: left;
}

.view-images-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 1rem;
    background: rgba(20, 20, 30, 0.75);
    backdrop-filter: blur(6px) saturate(1.05) contrast(1.04);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.10);
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    z-index: 3;
    outline: 1px solid #fff;
    outline-offset: -2px;
    filter: contrast(1.06) brightness(1.05) saturate(1.04);
}

.view-images-btn:hover {
    background: rgba(255, 255, 255, 0.001);
    color: #000;
    box-shadow:
        0 4px 16px 0 rgba(31, 38, 135, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 20px rgba(255, 255, 255, 0.15);
    filter: contrast(1.3) brightness(1.2) saturate(1.2);
}

@media (max-width: 700px) {
    .project-bubble {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.7rem;
        padding: 1rem 0.3rem;
    }
    .project-image-container {
        width: 200px;
        height: 200px;
        min-width: 200px;
        min-height: 200px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0;
        margin-top: 0.7rem;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        position: relative;
    }
    .project-image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: inherit;
        display: block;
    }
    .bubble {
        border-radius: 18px;
    }
    .bubble::before,
    .bubble::after {
        border-radius: 18px;
    }
}

/* Gallery Modal Overlay */
.gallery-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 20, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s cubic-bezier(.4,1.4,.6,1), background 0.3s;
    opacity: 1;
}
.gallery-modal-overlay.gallery-modal-opening {
    animation: galleryFadeIn 0.35s cubic-bezier(.4,1.4,.6,1);
}
.gallery-modal-overlay.gallery-modal-closing {
    animation: galleryFadeOut 0.28s cubic-bezier(.4,1.4,.6,1) forwards;
}
@keyframes galleryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes galleryFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.gallery-modal {
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(6px) saturate(1.05) contrast(1.04);
    border-radius: 36px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    outline: 1px solid #fff;
    outline-offset: -2px;
    box-shadow:
        0 4px 32px 0 rgba(31, 38, 135, 0.10),
        0 1.5px 8px 0 rgba(31, 38, 135, 0.08),
        0 0 0 2px rgba(255,255,255,0.08),
        0 0 40px 0 rgba(255,255,255,0.10),
        /* Inner shadow for glass thickness */
        inset 0 2px 16px 0 rgba(255,255,255,0.18),
        inset 0 -8px 32px 0 rgba(31,38,135,0.10);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 98vw;
    max-height: 96vh;
    position: relative;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s cubic-bezier(.4,1.4,.6,1), transform 0.35s cubic-bezier(.4,1.4,.6,1);
    filter: contrast(1.06) brightness(1.05) saturate(1.04);
}
.gallery-modal-opening .gallery-modal {
    opacity: 0;
    transform: scale(0.92);
    animation: galleryModalIn 0.35s cubic-bezier(.4,1.4,.6,1) forwards;
}
.gallery-modal-closing .gallery-modal {
    opacity: 1;
    transform: scale(1);
    animation: galleryModalOut 0.28s cubic-bezier(.4,1.4,.6,1) forwards;
}
@keyframes galleryModalIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes galleryModalOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.92); }
}

.gallery-modal-image {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 24px;
    box-shadow: 0 4px 32px 0 rgba(31, 38, 135, 0.18);
    background: #222;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.gallery-modal-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.gallery-modal-btn {
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(6px) saturate(1.05) contrast(1.04);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 2px 8px 0 rgba(31, 38, 135, 0.10),
        0 0 0 1px rgba(255,255,255,0.08),
        inset 0 1px 4px 0 rgba(255,255,255,0.18);
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    outline: 1px solid #fff;
    outline-offset: -2px;
    line-height: 1;
    padding: 0;
    filter: contrast(1.06) brightness(1.05) saturate(1.04);
}
.gallery-modal-btn:hover {
    background: rgba(255, 255, 255, 0.001);
    box-shadow:
        0 4px 16px 0 rgba(31, 38, 135, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 20px rgba(255, 255, 255, 0.15);
    filter: contrast(1.3) brightness(1.2) saturate(1.2);
}

.gallery-modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(6px) saturate(1.05) contrast(1.04);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 2px 8px 0 rgba(31, 38, 135, 0.10),
        0 0 0 1px rgba(255,255,255,0.08),
        inset 0 1px 4px 0 rgba(255,255,255,0.18);
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    outline: 1px solid #fff;
    outline-offset: -2px;
    z-index: 10001;
    filter: contrast(1.06) brightness(1.05) saturate(1.04);
}
.gallery-modal-close:hover {
    background: rgba(255, 255, 255, 0.001);
    box-shadow:
        0 4px 16px 0 rgba(31, 38, 135, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 20px rgba(255, 255, 255, 0.15);
    filter: contrast(1.3) brightness(1.2) saturate(1.2);
}

@media (max-width: 700px) {
    .gallery-modal {
        padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
    .gallery-modal-image {
        max-width: 98vw;
        max-height: 50vh;
    }
}

.bubble.morphing-up {
    animation: genieMorphUp 0.6s cubic-bezier(.22,1.4,.36,1) forwards;
}

@keyframes genieMorphUp {
    0% {
        opacity: 0;
        transform: scaleY(0.2) scaleX(1.1);
        border-radius: 60px;
        filter: blur(6px) brightness(1.2);
    }
    60% {
        opacity: 1;
        transform: scaleY(1.08) scaleX(0.98);
        border-radius: 40px;
        filter: blur(0.5px) brightness(1.05);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1);
        border-radius: 36px;
        filter: none;
    }
}

@keyframes genieMorphUpMobile {
    0% {
        opacity: 0;
        transform: scaleY(0.2) scaleX(1.1);
        border-radius: 30px;
        filter: blur(6px) brightness(1.2);
    }
    60% {
        opacity: 1;
        transform: scaleY(1.08) scaleX(0.98);
        border-radius: 20px;
        filter: blur(0.5px) brightness(1.05);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1);
        border-radius: 18px;
        filter: none;
    }
}

@keyframes genieMorphUpSmallMobile {
    0% {
        opacity: 0;
        transform: scaleY(0.2) scaleX(1.1);
        border-radius: 20px;
        filter: blur(6px) brightness(1.2);
    }
    60% {
        opacity: 1;
        transform: scaleY(1.08) scaleX(0.98);
        border-radius: 15px;
        filter: blur(0.5px) brightness(1.05);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1);
        border-radius: 10px;
        filter: none;
    }
}

@media (max-width: 900px) {
  .bubble {
    max-width: 98vw;
    padding: 1.2rem 0.5rem;
  }
  .project-bubble {
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
    padding: 1.2rem 0.5rem;
  }
  .project-image-container {
    width: 280px;
    height: 280px;
    min-width: 280px;
    min-height: 280px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
  }
  .project-title {
    font-size: 1.15rem;
  }
  .project-description {
    font-size: 0.98rem;
  }
}

@media (max-width: 700px) {
  header {
    padding: 1.2rem 0.5rem;
  }
  .bubble {
    padding: 1rem 0.3rem;
    max-width: 99vw;
  }
  /* Disable bubble hover effects on mobile */
  .bubble:hover {
    transform: none;
    box-shadow: none;
    background: none;
    filter: none;
  }
  /* Mobile-specific animation for bubbles */
  .bubble.morphing-up {
    animation: genieMorphUpMobile 0.6s cubic-bezier(.22,1.4,.36,1) forwards;
  }
  /* Responsive text sizes for mobile */
  .bubble h3 {
    font-size: 1.4rem;
  }
  .bubble p {
    font-size: 0.95rem;
  }
  .project-bubble {
    gap: 0.7rem;
    padding: 1rem 0.3rem;
  }
  .project-image-container {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 18px;
    margin-bottom: 0.7rem;
  }
  .project-title {
    font-size: 0.9rem;
  }
  .project-description {
    font-size: 0.85rem;
  }
  .gallery-modal {
    padding: 0.7rem 0.1rem 0.5rem 0.1rem;
    border-radius: 18px;
    max-width: 100vw;
    max-height: 100vh;
  }
  .gallery-modal-image {
    max-width: 99vw;
    max-height: 40vh;
    border-radius: 12px;
  }
  .gallery-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .gallery-modal-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.1rem;
  }
  h2 {
    font-size: 0.95rem;
  }
  .button {
    padding: 8px 12px;
    font-size: 0.8rem;
    margin: 0.3rem 0.1rem;
  }
  blockquote {
    padding: 0.2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
  }
  .bubble {
    padding: 0.5rem 0.1rem;
    border-radius: 10px;
  }
  .bubble::before,
  .bubble::after {
    border-radius: 10px;
  }
  /* Disable bubble hover effects on mobile */
  .bubble:hover {
    transform: none;
    box-shadow: none;
    background: none;
    filter: none;
  }
  /* Small mobile-specific animation for bubbles */
  .bubble.morphing-up {
    animation: genieMorphUpSmallMobile 0.6s cubic-bezier(.22,1.4,.36,1) forwards;
  }
  /* Responsive text sizes for small mobile */
  .bubble h3 {
    font-size: 1.2rem;
  }
  .bubble p {
    font-size: 0.85rem;
  }
  .project-bubble {
    border-radius: 18px;
    gap: 0.4rem;
  }
  .project-image-container {
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .project-title {
    font-size: 0.8rem;
  }
  .project-description {
    font-size: 0.75rem;
  }
  .gallery-modal {
    border-radius: 10px;
    padding: 0.2rem 0.05rem 0.2rem 0.05rem;
  }
  .gallery-modal-image {
    border-radius: 6px;
  }
  .gallery-modal-close {
    font-size: 0.9rem;
  }
  .gallery-modal-btn {
    font-size: 0.8rem;
  }
}

/* Extra small screens - ensure image container never gets squeezed */
@media (max-width: 360px) {
  .project-image-container {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
  }
}

.magnetized {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 12px 36px 0 rgba(31,38,135,0.22), 0 8px 32px rgba(31, 38, 135, 0.37);
    transition: transform 0.25s cubic-bezier(.4,1.4,.6,1), box-shadow 0.25s;
} 