/* ── Base ── */
body {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    background-color: #07090f;
    color: #e8e8e8;
    overflow-x: hidden;
}

/* ── Scroll animations ── */
[data-scroll="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s);
}

[data-scroll="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Container ── */
.competences-container {
    padding: 80px 8vw 140px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* ── SVG fil en arrière-plan ── */
.background-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.line-path {
    fill: none;
    stroke: url(#lineGrad);
    stroke-width: 2px;
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    animation: draw-line 3.5s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0.18;
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

/* ── Intro / hero ── */
.intro {
    position: relative;
    z-index: 1;
    margin-bottom: 80px;
}

.page-hero-bar {
    margin-bottom: 16px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 1.2rem;
}

h1.typewriter {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.2rem, 6vw, 5rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #5599ff;
    width: 0;
    animation: typing 3.5s steps(35, end) 0.3s forwards, blink 0.9s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.desc {
    font-size: clamp(0.85rem, 1.6vw, 1rem);
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    letter-spacing: 0.05em;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* ── Skills section ── */
.skills-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 80px;
    position: relative;
    z-index: 1;
}

.skill-card {
    background: #0d0f18;
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 36px 32px 40px;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.6s ease, box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.6s ease;
    will-change: transform;
}

[data-scroll].visible.skill-card {
    opacity: 1;
    transform: translateY(0);
}

.card-num {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(85, 153, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 18px;
}

.skill-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.skill-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-card ul li {
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    padding-left: 16px;
    position: relative;
}

.skill-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5599ff;
    opacity: 0.5;
}

/* ── MMI Resume ── */
.mmi-resume {
    position: relative;
    z-index: 1;
    padding: 48px;
    background: #0d0f18;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid #5599ff;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    margin-bottom: 60px;
}

.mmi-resume[data-scroll].visible {
    opacity: 1;
    transform: translateY(0);
}

.mmi-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 28px;
}

.mmi-num {
    font-size: 0.9rem;
    color: rgba(85, 153, 255, 0.5);
    font-weight: 300;
}

.mmi-resume h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0;
}

.mmi-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.mmi-body p {
    font-size: 0.97rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-weight: 300;
}

/* ── Scroll fix global ── */
[data-scroll].visible {
    opacity: 1 !important;
    transform: translateY(0);
}

/* ── Theme light ── */
body.light {
    background-color: #f4f4f8;
    color: #111;
}

body.light .page-hero-bar { border-bottom-color: rgba(0,0,0,0.07); }
body.light .eyebrow-label { color: #2266dd; }
body.light h1.typewriter { color: #0a0a0f; border-right-color: #2266dd; }
body.light .desc { color: rgba(0,0,0,0.4); }

body.light .line-path { stroke: url(#lineGrad); opacity: 0.25; }

body.light .skill-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
body.light .skill-card h2 { color: #0a0a0f; border-bottom-color: rgba(0,0,0,0.07); }
body.light .skill-card ul li { color: rgba(0,0,0,0.55); }
body.light .card-num { color: rgba(34,102,221,0.5); }
body.light .skill-card ul li::before { background: #2266dd; }

body.light .mmi-resume {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
    border-left-color: #2266dd;
}
body.light .mmi-resume h2 { color: #0a0a0f; }
body.light .mmi-body p { color: rgba(0,0,0,0.55); }
body.light .mmi-num { color: rgba(34,102,221,0.5); }

/* ── Responsive ── */
@media screen and (max-width: 900px) {
    .skills-section {
        grid-template-columns: 1fr 1fr;
    }
    .skill-card:last-child {
        grid-column: span 2;
    }
}

@media screen and (max-width: 600px) {
    .competences-container {
        padding: 60px 6vw 100px;
    }
    h1.typewriter {
        font-size: 1.8rem;
        white-space: normal;
        overflow: visible;
        width: auto !important;
        border-right: none;
        animation: none;
        opacity: 1;
    }
    .background-line {
        display: none;
    }
    .skills-section {
        grid-template-columns: 1fr;
    }
    .skill-card:last-child {
        grid-column: span 1;
    }
    .mmi-resume {
        padding: 28px 24px;
    }
}
