/* Global Variables & Reset */
:root {
    --bg-color: #ffe6db;
    --footer-bg: #f4c4b5;
    --border-color: #000000;
    --element-bg: #ffffff;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-width: 3px;
    --border-rad: 16px;
    --shadow-offset: 4px;
}

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

body {
    background-color: transparent; 
    font-family: var(--font-main);
    color: #000;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* Reusable Neo-brutalism Classes */
.neo-box {
    background-color: var(--element-bg);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-rad);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-color);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.neo-box:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(var(--shadow-offset) + 4px) calc(var(--shadow-offset) + 4px) 0 var(--border-color);
}

.neo-box:active {
    transform: translate(var(--shadow-offset), var(--shadow-offset));
    box-shadow: 0 0 0 var(--border-color);
}

/* Typography */
h1 {
    font-size: 2.8rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
}

p {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* --- Header Layout Updates --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 60px;
    
    /* Weak visual separation */
    padding-bottom: 25px;
    margin-bottom: -10px; /* Offset the gap introduced by padding to keep layout tight */
    border-bottom: 2px dashed rgba(0, 0, 0, 0.25); 
}

.header-name {
    flex: 1;
    font-weight: 800;
    font-size: 1.5rem;
    text-transform: uppercase;
    display: flex;
    justify-content: flex-start;
}

nav {
    flex: 2;
    display: flex;
    justify-content: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #000;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1rem;
    position: relative;
    display: inline-block;
}

nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -5px;
    left: 0;
    background-color: var(--border-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.header-logo {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.header-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    animation: float 4s ease-in-out infinite;
}

/* --- Hero Section & Actions Updates --- */
.hero {
    display: flex;
    align-items: center;
    gap: 50px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
}

.hero-content {
    flex: 1;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    color: #000;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border-color);
}

.hero-socials {
    display: flex;
    gap: 15px;
}

.social-icon.hero-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-icon.hero-icon img {
    width: 25px;
    height: 25px;
}

/* --- Projects/Publications Section --- */
.projects {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    display: flex;
    align-items: center;
    padding: 25px 30px;
    gap: 25px;
}

/* Adjusted for paper teasers which are usually rectangular */
.card-icon {
    width: 200px; 
    background-color: #c0ebff; 
    border: var(--border-width) solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
}

.card-content p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* --- Education Section (Glassmorphism & Overlapping Logos) --- */
.about.glass-panel {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--border-width) solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 50px;
}

.about.glass-panel:hover {
    background: rgba(255, 255, 255, 0.6);
}

.about-content {
    flex: 1;
}

.about-image.overlapping-logos {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.stack-logo {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: var(--border-width) solid var(--border-color);
    background-color: var(--element-bg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-color);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s;
    object-fit: contain;
    padding: 10px;
}

.stack-logo:hover {
    transform: scale(1.1) translateY(-10px) !important;
    z-index: 10 !important;
}

.logo-1 {
    top: 10px;
    z-index: 3;
    transform: translateX(0);
}

.logo-2 {
    bottom: 20px;
    left: 10px;
    z-index: 2;
    transform: rotate(-10deg);
}

.logo-3 {
    bottom: 30px;
    right: 10px;
    z-index: 1;
    transform: rotate(15deg);
}

/* --- Connect / Footer Section --- */
.connect-section {
    background-color: var(--footer-bg);
    border-radius: 30px;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.social-area {
    flex: 1;
}

.social-area h2 {
    margin-bottom: 25px;
}

.social-icons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.social-icon {
    width: 70px;
    height: 70px;
    background-color: #ffffff; 
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

.social-icon img {
    width: 40px;
    height: 40px;
}

.form-area {
    flex: 1;
    max-width: 500px;
    background-color: var(--element-bg);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-rad);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.form-area h3 {
    text-transform: none;
    margin-bottom: 10px;
}

.form-area textarea {
    width: 100%;
    height: 120px;
    resize: none;
    border: var(--border-width) solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-family: var(--font-main);
    font-weight: 600;
}

.form-area textarea:focus {
    outline: none;
}

/* --- WebGL Background --- */
#webgl-water-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    pointer-events: none;
}

/* --- Keyframes --- */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Responsive Media Queries --- */
@media screen and (max-width: 900px) {
    .about.glass-panel {
        padding: 30px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 20px 15px;
        gap: 40px;
    }

    /* Header stacking */
    header {
        flex-direction: column;
        gap: 20px;
    }

    .header-name, nav, .header-logo {
        flex: auto;
        justify-content: center;
        text-align: center;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    /* Hero section */
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    /* Education Section */
    .about.glass-panel {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 30px 20px;
    }

    .overlapping-logos {
        display: none;
    }

    /* Publications Section */
    .card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
        gap: 15px;
    }

    .card-icon {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    /* Connect section */
    .connect-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 30px 20px;
        gap: 40px;
    }

    .social-icons {
        justify-content: center;
    }

    .form-area {
        width: 100%;
        max-width: 100%;
    }
}

/* --- Publication Card Enhancements --- */

/* 1. Base card positioning for absolute pseudo-elements */
.card {
    position: relative;
}

/* 2. Image and Container scale effect on hover */
.card-icon {
    /* Retain your existing card-icon styles, add transition here */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center center;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Removed the transition from img, as the parent container will scale */
}

/* Scale the entire box (including its border and background) */
.card:hover .card-icon {
    transform: scale(1.06);
    /* Optional: add a slight rotation for a more dynamic brutalist feel */
    /* transform: scale(1.06) rotate(-2deg); */
}

/* 3. Publication Link Buttons - Lighter Visual Weight */
.pub-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.pub-link {
    position: relative;
    z-index: 2; /* Ensures buttons stay clickable above the card overlay */
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    
    /* Lighter design: transparent background, black text, black border */
    color: var(--border-color);
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    
    /* Light static shadow to maintain the structural style */
    box-shadow: 2px 2px 0 var(--border-color);
    transition: all 0.2s ease;
}

.pub-link:hover {
    /* Add a subtle highlight color on hover (using your footer-bg color as an accent) */
    background-color: var(--footer-bg); 
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--border-color);
}

.pub-link:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--border-color);
}

/* 4. Make entire card clickable routing to HAL */
.primary-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Covers the card, but sits below the other .pub-link buttons */
    cursor: pointer;
}

/* --- Back To Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--element-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 var(--border-color);
}

/* Responsive adjustment for back to top */
@media screen and (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 10px;
    }
}