:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #ffffff0d;
    --bg-header: #000000ac;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-third: #d1d5db;
    --text-color: #7c8ee7;
    --text-other: #ffffff;
    --text-gradient: linear-gradient(50deg, #7c8ee7, #ffffff);
    --border-color: #7c8ee7;
    --btn1: linear-gradient(135deg, #7c8ee7, #959ecb);
    --btn2: #ffffff;
    --color-btn1: #ffffff;
    --color-btn2: #7c8ee7;
    --dark: #28292c;
    --light: #f5f5f5;
}

[data-theme="light"] {
    --bg-primary: #ffffffbd;
    --bg-secondary: #f7f7f7;
    --bg-header: #ffffffeb;
    --text-primary: #333333;
    --text-secondary: #777f8b;
    --text-third: #555a62;
    --text-color: #7c8ee7;
    --text-other : #333333;
    --text-gradient: linear-gradient(50deg, #555a62, #7c8ee7);
    --border-color: #7c8ee7;
    --btn1: linear-gradient(135deg, #7c8ee7, #959ecb);
    --btn2: #ffffff;
    --color-btn1: #ffffff;
    --color-btn2: #7c8ee7;    
    --dark: #28292c;
    --light: #f5f5f5;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    transition: all 0.3s ease;
}

/* Header Section */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--bg-header);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(30px);
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    background: var(--text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    z-index: 1003;
    color: transparent;
    cursor: wait;
}

/* Toggle Switch Theme*/
.toggle-switch {
    position: relative;
    z-index: 1002;
    margin-inline-start: auto;
    margin-inline-end: 5rem;
    width: 3.2rem;
    height: 1.8rem;
}

.theme-switch {
    position: absolute;
    width: 100%;
    height: 1.8rem;
    background-color: var(--dark);
    border-radius: 15px;
    cursor: pointer;
    border: 2px solid var(--dark);
}

.theme-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox {
    position: absolute;
    display: none;
}

.slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    top: 0.14rem;
    left: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    -webkit-box-shadow: inset 9px -4px 0px 0px var(--light);
    box-shadow: inset 9px -4px 0px 0px var(--light);
    background-color: var(--dark);
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

input:checked+.slider {
    background-color: var(--light);
}

input:checked+.slider:before {
    -webkit-transform: translateX(1.2rem);
    -ms-transform: translateX(1.2rem);
    transform: translateX(1.2rem);
    background-color: var(--dark);
    -webkit-box-shadow: none;
    box-shadow: none;
}

/* Onglets Nav */
.nav {
    display: flex;
    gap: 2rem;
    justify-content: right;
}

.nav a {
    color: var(--text-other);
    text-decoration: none;
}

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

/* Burger Button */
.hamburger-btn {
    display: none;
    margin: -1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.hamburger-btn:hover {
    box-shadow: 0px 4px 14px var(--border-color);
}

.hamburger-line {
    width: 1.2rem;
    height: 2px;
    background: var(--text-other);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu Burger */
.menu-overlay {
    position: fixed;
    top: -1000%;
    right: 0;
    width: 100%;
    height: auto;
    background: var(--bg-header);
    backdrop-filter: blur(30px);
    transition: all 0.4s ease;
    z-index: 999;
    padding: 3.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-other);
}

.menu-overlay.active {
    top: 0;
}

.menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: -2rem;
    justify-items: center;
}

.menu-item {
    padding: 1.2rem;
}

.menu-link {
    color: var(--text-other);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
}

.menu-link:hover {
    color: var(--border-color);
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.502);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* First Section */
.first {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.first-image {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2rem;
}

img {
    width: 17rem;
    height: 17rem;
    border-radius: 50%;
    border: 3px solid var(--border-color);
}

.first-content {
    flex: 1;
    max-width: 599px;
}

.first h1 {
    font-size: 2.5rem;
}

.first .name {
    color: var(--text-color);
}

.first .role {
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.first .description {
    color: var(--text-third);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.first-buttons {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    background: var(--btn1);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    color: var(--color-btn1);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.05);
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: 1.5px solid var(--border-color);
    border-radius: 5px;
    color: var(--color-btn2);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--color-btn1);
}

/* About Section */
.about {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.about p {
    color: var(--text-third);
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.skill-card {
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 3rem;
    text-align: left;
    transition: all 0.3s ease;
}

.skill-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.skill-item {
    margin-bottom: 1rem;
}

.skill-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.skill-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    transition: all 0.3s ease;
}

.skill-list {
    color: var(--text-third);
    margin: 0.5rem 0;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* Portfolio Section */
.portfolio {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.portfolio h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.portfolio-card {
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 3rem;
    margin-bottom: 3rem;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.portfolio-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.portfolio p {
    color: var(--text-third);
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.portfolio-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Contact Section */
.contact {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-third);
    transition: all 0.3s ease;
}

.contact-item::before {
    content: '●';
    color: var(--border-color);
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.social-links {
    margin-top: 2rem;
}

.social-links h3 {
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.5rem;
    background: var(--btn1);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)
}

.social-icon:hover {
    background: var(--border-color);
    color: white;
    transform: translateY(-3px) scale(1.1) rotate(3deg);
}

/* Formulaire */
.contact-form {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-third);
    transition: all 0.3s ease;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-other);
    transition: all 0.3s ease;
}

/* Footer Section */
.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-third);
    transition: all 0.3s ease;
}

.footer-links {
    position: absolute;
    right: 2rem;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .toggle-switch {
        left: 1rem;
    }

    .nav {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .first {
        flex-direction: column;
        text-align: center;
    }

    .first h1 {
        font-size: 2rem;
    }

    .first-image {
        position: relative;
        margin: -2.5rem 0 1rem;
    }

    img {
        width: 60%;
        height: 60%;
    }
    
    .first-buttons {
        flex-direction: row;
        display: inline-flex;
        justify-content: center;
        width: auto;
        height: auto;
    }

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

    .portfolio-buttons {
        display: grid;
        justify-content: center;
        gap: 1rem;
    }

    .footer {
        flex-direction: column;
        text-align: center;
        font-size: 0.9rem;
    }

    .footer-links {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 400px) {
    .toggle-switch {
        left: 1.7rem;
    }

    .logo {
        font-size: 0.95rem;
        margin-left: -1rem;
    }
}

@media (min-width: 769px) {
        .menu-overlay {
        display: none;
    }

    .backdrop {
        display: none;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 1s ease-in;
}

.fade-out {
    animation: fadeOut 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

        to {
        opacity: 0;
        transform: translateY(30px);
    }
}