/* ===== Variables & Base ===== */
:root {
    --bg: #141414;
    --bg-card: #1e1e1e;
    --accent: #c17f3a;
    --accent-secondary: #d4a574;
    --text: #e8e4df;
    --text-muted: #9a958e;
    --border: #3a3632;
    --grid-color: rgba(193, 127, 58, 0.06);
}

/* Mode clair */
body.theme-light {
    --bg: #f7f6f3;
    --bg-card: #ffffff;
    --accent: #2c5f4f;
    --accent-secondary: #3d7a6a;
    --text: #2a2825;
    --text-muted: #6b6560;
    --border: #d9d5cf;
    --grid-color: rgba(44, 95, 79, 0.04);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    transition: background-image 0.4s ease;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.4s ease, border-color 0.4s ease;
}

body.theme-light .navbar {
    background: rgba(247, 246, 243, 0.9);
    border-bottom-color: var(--border);
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.burger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
}

/* Theme toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-icon {
    position: absolute;
    font-size: 1.2rem;
    transition: opacity 0.3s, transform 0.3s;
}

.theme-icon.sun {
    opacity: 0;
}

.theme-icon.moon {
    opacity: 1;
}

body.theme-light .theme-icon.sun {
    opacity: 1;
}

body.theme-light .theme-icon.moon {
    opacity: 0;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 8rem 4rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero .highlight {
    color: var(--accent);
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-secondary);
    box-shadow: 0 8px 25px rgba(193, 127, 58, 0.35);
}

body.theme-light .btn-primary {
    color: #fff;
}

body.theme-light .btn-primary:hover {
    box-shadow: 0 8px 25px rgba(44, 95, 79, 0.3);
}

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

.btn-secondary:hover {
    background: rgba(193, 127, 58, 0.12);
}

body.theme-light .btn-secondary:hover {
    background: rgba(44, 95, 79, 0.1);
}

.hero-stats {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-stats span:nth-child(2) {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-photo-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-card);
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    line-height: 2;
}

.code-keyword {
    color: #ff7b72;
}

.code-string {
    color: var(--accent-secondary);
}

body.theme-light .code-string {
    color: var(--accent);
}

/* ===== Sections ===== */
.section {
    padding: 5rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.about-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.about-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.interest-tags span {
    background: rgba(193, 127, 58, 0.2);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

body.theme-light .interest-tags span {
    background: rgba(44, 95, 79, 0.12);
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.skill-category h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags span {
    background: rgba(193, 127, 58, 0.18);
    color: var(--accent-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

body.theme-light .skill-tags span {
    background: rgba(44, 95, 79, 0.12);
    color: var(--accent);
}

.languages {
    text-align: center;
}

.languages h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.lang-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.lang-tags span {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
}

/* ===== Formation Timeline ===== */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.timeline-year {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

.timeline-content h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.timeline-place {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.timeline-content p:last-child {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.timeline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.timeline-link:hover {
    text-decoration: underline;
}

/* ===== Contact ===== */
.contact-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    display: block;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.contact-card[href*="linkedin"] .contact-icon {
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0a66c2;
}

body.theme-light .contact-card[href*="linkedin"] .contact-icon {
    color: #0a66c2;
}

.contact-card[href*="github"] .contact-icon.github-icon {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e6edf3;
}

body.theme-light .contact-card[href*="github"] .contact-icon.github-icon {
    color: #24292f;
}

.contact-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-card-phone p a {
    color: var(--accent);
    text-decoration: none;
}

.contact-card-phone p a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 6rem 2rem 3rem;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-visual {
        order: -1;
    }

    .hero-photo-wrapper {
        width: 160px;
        height: 160px;
    }

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

    .nav-links {
        display: none;
    }

    .navbar .theme-toggle {
        margin-right: 0.5rem;
    }

    .burger {
        display: flex;
    }

    .navbar.active .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        padding: 2rem;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 600px) {
    .section {
        padding: 3rem 1.5rem;
    }

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

    .btn {
        width: 100%;
        text-align: center;
    }
}
