/* =============================================
   Philip Abbet - Professional Webpage
   Inspired by Idiap Research Institute Theme
   ============================================= */

/* Root Variables - Idiap Color Palette */
:root {
    --primary-color: #1a5a7a;      /* Idiap Blue */
    --secondary-color: #2d7fa3;    /* Lighter Blue */
    --accent-color: #f39c12;       /* Idiap Orange/Gold */
    --text-dark: #2c3e50;
    --text-light: #555555;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --font-size-3xl: 48px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
    font-size: var(--font-size-base);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   HEADER & NAVIGATION
   ============================================= */

.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

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

.nav-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-list a:hover {
    color: var(--primary-color);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-list a:hover::after {
    width: 100%;
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    padding: 100px 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: var(--font-size-xl);
    margin-bottom: 10px;
    font-weight: 500;
    opacity: 0.95;
}

.subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: #e08a0a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* =============================================
   SECTIONS - GENERAL
   ============================================= */

section {
    padding: 80px 20px;
}

section h2 {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

/* =============================================
   ABOUT SECTION
   ============================================= */

.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    margin-bottom: 15px;
    color: var(--text-light);
    line-height: 1.8;
}

.interests-list {
    list-style: none;
    margin-top: 20px;
}

.interests-list li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: var(--text-light);
}

.interests-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.info-card {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: var(--font-size-lg);
}

.info-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
}

.social-links {
    list-style: none;
}

.social-links li {
    margin-bottom: 10px;
}

.social-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* =============================================
   EDUCATION SECTION
   ============================================= */

.education {
    background-color: var(--bg-light);
}

.education-timeline {
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
}

.education-timeline::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.education-item {
    display: flex;
    gap: 40px;
    position: relative;
}

.education-item::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 25px;
    width: 34px;
    height: 34px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 4px solid var(--bg-light);
    box-shadow: 0 0 0 4px var(--primary-color);
}

.education-year {
    flex-shrink: 0;
    width: 120px;
    padding-top: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

.education-content {
    flex-grow: 1;
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.education-content:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.education-content h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: var(--font-size-lg);
}

.education-institution {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
}

.education-details {
    color: var(--text-light);
    margin-bottom: 10px;
    font-size: 14px;
}

.education-description {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 15px;
}

/* =============================================
   INTERESTS SECTION
   ============================================= */

.interests {
    background-color: var(--bg-white);
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.interest-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    padding: 30px;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.interest-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
    border-left-color: var(--accent-color);
}

.interest-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: var(--font-size-lg);
}

.interest-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 20px;
}

.tech-list {
    list-style: none;
}

.tech-list li {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.tech-list li:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* =============================================
   PUBLICATIONS SECTION
   ============================================= */

.publications {
    background-color: var(--bg-white);
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.publication-item {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.publication-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(5px);
}

.publication-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: var(--font-size-lg);
}

.authors {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
    font-style: italic;
}

.publication-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.publication-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.publication-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

/* =============================================
   PROJECTS SECTION
   ============================================= */

.projects {
    background-color: var(--bg-light);
}

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

.project-card {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--primary-color);
}

.project-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: var(--font-size-lg);
}

.project-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
    flex-grow: 1;
}

.project-tech {
    color: var(--secondary-color);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.project-links {
    display: flex;
    gap: 10px;
}

.project-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-btn:hover {
    background-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

/* Project Publications Subsection */
.project-publications {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.project-publications h4 {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-publications-list {
    list-style: none;
}

.project-publications-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
}

.project-publications-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.pub-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.pub-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* =============================================
   CONTACT SECTION
   ============================================= */

.contact {
    background-color: var(--bg-white);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: var(--font-size-lg);
    line-height: 1.8;
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-item {
    text-align: left;
}

.contact-item h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: var(--font-size-lg);
}

.contact-item p {
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.8;
}

.contact-phone {
    font-weight: 600;
    color: var(--primary-color);
}

.contact-links {
    list-style: none;
}

.contact-links li {
    margin-bottom: 10px;
}

.contact-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: var(--accent-color);
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-align: center;
    padding: 40px 20px;
    border-top: 3px solid var(--accent-color);
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--bg-white);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 768px) {
    /* Keep logo and hamburger on same row */
    .header-content {
        flex-direction: row;
        gap: 12px;
        align-items: center;
    }

    /* Hidden nav-list until menu is opened; overlays content */
    .navigation .nav-list {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        position: fixed;
        top: var(--header-height, 64px);
        left: 0;
        right: 0;
        background: var(--bg-white);
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
        transition: max-height 0.28s ease, opacity 0.18s ease;
        padding: 10px 20px 20px;
        z-index: 200;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    /* Make nav links touch-friendly */
    .navigation .nav-list a {
        display: block;
        padding: 10px 0;
        font-size: 16px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        margin-left: auto;
        color: var(--primary-color);
    }

    .menu-toggle .hamburger {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--primary-color);
        position: relative;
    }
    .menu-toggle .hamburger::before,
    .menu-toggle .hamburger::after {
        content: '';
        position: absolute;
        left: 0;
        width: 22px;
        height: 2px;
        background: var(--primary-color);
        transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
    }
    .menu-toggle .hamburger::before { top: -7px; }
    .menu-toggle .hamburger::after { top: 7px; }

    /* When menu is open, reveal nav and animate hamburger into X */
    .header.menu-open .navigation .nav-list {
        max-height: calc(100vh - var(--header-height, 64px));
        opacity: 1;
        pointer-events: auto;
    }
    .header.menu-open .menu-toggle .hamburger {
        background: transparent;
    }
    .header.menu-open .menu-toggle .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .header.menu-open .menu-toggle .hamburger::after {
        transform: rotate(-45deg);
        top: 0;
    }
    .header.menu-open .menu-toggle .hamburger {
        background: transparent;
    }
    .header.menu-open .menu-toggle .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .header.menu-open .menu-toggle .hamburger::after {
        transform: rotate(-45deg);
        top: 0;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .tagline {
        font-size: 18px;
    }

    .subtitle {
        font-size: 16px;
    }

    .hero-links {
        flex-direction: column;
    }

    .education-timeline::before {
        left: 20px;
    }

    .education-item::before {
        left: 3px;
    }

    .education-item {
        gap: 20px;
        margin-left: 0;
    }

    .education-year {
        width: 80px;
        font-size: 14px;
        text-align: right;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    section {
        padding: 60px 20px;
    }

    section h2 {
        font-size: 28px;
    }

    .publication-item {
        padding: 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-details {
        grid-template-columns: 1fr;
    }

    .education-content {
        padding: 15px;
    }

    .education-year {
        width: 70px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }

    .tagline {
        font-size: 16px;
    }

    section {
        padding: 40px 15px;
    }

    section h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .interests-list li,
    .social-links li {
        font-size: 14px;
    }

    .publication-item,
    .info-card {
        padding: 15px;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .header,
    .hero-links,
    .footer {
        display: none;
    }

    body {
        font-size: 12px;
        line-height: 1.5;
    }

    section {
        page-break-inside: avoid;
        padding: 20px 0;
    }
}
