:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #2d2d2d;
    --text-secondary: #555;
    --text-muted: #888;
    --text-light: #666;
    --border-light: #e8e8e8;
    --border-lighter: #f0f0f0;
    --shadow: rgba(0, 0, 0, 0.02);
    --shadow-hover: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --text-light: #999;
    --border-light: #3a3a3a;
    --border-lighter: #333;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === LAYOUT === */
.container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-secondary);
    padding: 1rem 2.5rem 3rem 2.5rem;
    width: 320px;
    min-width: 320px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
    z-index: 1000;
    box-shadow: 0 0 20px var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.content {
    margin-left: 400px;
    padding: 3rem 2rem;
    width: calc(100% - 320px);
    max-width: 800px;
    margin-right: auto;
}

/* === THEME TOGGLES === */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    position: absolute;
    top: 1rem;
    right: 2rem;
    z-index: 10;
}

.theme-toggle:hover {
    border-color: var(--text-muted);
    background: var(--bg-primary);
}

.mobile-theme-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px var(--shadow-hover);
    transition: all 0.3s ease;
}

.mobile-theme-toggle:hover {
    transform: scale(1.1);
}

/* Theme icons */
.theme-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

[data-theme="light"] .sun-icon {
    display: inline;
}

[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: inline;
}

/* === HEADER SECTION === */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 3rem;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-light);
    margin: 1rem auto 2rem auto;
    display: block;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
    border-color: var(--text-muted);
}

.intro h1 {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.intro h1 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.intro h1 a:hover {
    color: var(--text-light);
}

.intro h2 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
    margin: 0 0 2rem 0;
    font-family: 'JetBrains Mono', monospace;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.navigation ul {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0 0;
}

.navigation li {
    margin-bottom: 0.8rem;
}

.navigation a {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    border-radius: 4px;
}

.navigation a::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

.navigation a:hover,
.navigation a.active {
    color: var(--text-primary);
    transform: translateX(0.5rem);
}

.navigation a:hover::before,
.navigation a.active::before {
    width: 0.75rem;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* === SECTIONS === */
section {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.15s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.25s; }

section h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    position: relative;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 0;
    width: 2rem;
    height: 1px;
    background: var(--border-light);
    transition: background 0.3s ease;
}

section p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.experience-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-lighter);
    border-radius: 4px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.experience-item:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.experience-item h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.experience-item p:first-of-type {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

#projects ul {
    list-style: none;
    padding: 0;
}

.project-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-lighter);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 300;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-item:hover {
    border-color: var(--border-light);
    transform: translateX(0.5rem);
    box-shadow: 0 4px 15px var(--shadow-hover);
}

.project-item h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.project-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-item::before {
    content: '↗';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.project-item:hover::before {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Styles généraux pour tous les liens et boutons d'action dans #contact */
#contact a,
.submit-btn {
    display: inline-block;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    margin: 0.5rem 1rem 0.5rem 0;
    cursor: pointer;
    font-weight: 500;
    text-transform: lowercase;
}

#contact a:hover,
.submit-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

#contact a:active,
.submit-btn:active {
    transform: translateY(0);
}

/* Formulaire */
.contact-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-lighter);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

.contact-form:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 15px var(--shadow-hover);
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group:last-of-type {
    margin-bottom: 2.5rem;
}

.contact-form label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text-muted);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(136, 136, 136, 0.1);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.contact-form textarea {
    min-height: 120px;
}

/* Liens contact (LinkedIn / CV) */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.contact-links p {
    margin: 0;
}


/* responsive */

/* Large screens */
@media (min-width: 1920px) {
    .content {
        max-width: 1000px;
        padding: 4rem 5rem;
    }
}

@media (max-width: 1920px) and (min-width: 1400px) {
    .content {
        max-width: 750px;
        padding: 3rem 4rem;
    }
}

@media (max-width: 1399px) and (min-width: 1200px) {
    .content {
        max-width: 750px;
        padding: 3rem 2rem;
    }
}

/* Medium screens */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
        padding: 2.5rem 2rem;
    }
    
    .content {
        margin-left: 280px;
        width: calc(100% - 280px);
        padding: 2.5rem 3rem;
        max-width: 750px;
    }
}

/* Mobile screens */
@media (max-width: 768px) {
    body {
        overflow-x: auto;
    }
    
    .container {
        flex-direction: column;
        min-height: auto;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        min-width: auto;
        height: auto;
        padding: 2rem;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .theme-toggle {
        display: none;
    }

    .mobile-theme-toggle {
        display: flex;
    }

    .header-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .intro h1 {
        font-size: 2.2rem;
    }

    .profile-photo {
        margin: 1.5rem auto;
        display: block;
    }
    
    .navigation a::before {
        display: none;
    }
    
    .content {
        margin-left: 0;
        width: 100%;
        padding: 2rem;
    }
    
    section {
        margin-bottom: 3.5rem;
    }

    /* Contact section updates */
    .contact-form {
        padding: 2rem;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .contact-form input,
    .contact-form textarea {
        padding: 0.8rem;
    }
    
    .submit-btn {
        width: 100%;
        padding: 1rem;
        font-size: 0.9rem;
    }

    .contact-links {
        flex-direction: column;
        gap: 0.8rem;
        justify-content: center;
        margin-top: 1.5rem;
    }

    #contact a {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .intro h1 {
        font-size: 2rem;
    }
    
    .sidebar {
        padding: 1.5rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .experience-item,
    .project-item {
        padding: 1.5rem;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .contact-links {
        gap: 0.5rem;
    }

    #contact a {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
}
