/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #39ffca;
    --primary-dark: #1dd7b0;
    --accent: #7dfff4;
    --dark-bg: #060b17;
    --light-bg: #0f172a;
    --surface: rgba(15, 22, 39, 0.92);
    --text-main: #e7f3ff;
    --text-muted: #94d2ff;
    --text-secondary: #a8caff;
    --font-titles: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at top right, rgba(57, 255, 202, 0.08), transparent 24%),
                linear-gradient(180deg, #080d1a 0%, #0d1627 100%);
    color: var(--text-main);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: #06131d;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 6px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 8%;
    background: rgba(8, 13, 23, 0.88);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(57, 255, 202, 0.12);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 28px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.25s ease;
}

nav a:hover,
nav a:focus {
    color: var(--primary);
}

.logo {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logo span {
    color: var(--primary);
}

.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px 4rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(57, 255, 202, 0.12), transparent 22%),
                radial-gradient(circle at 80% 30%, rgba(125, 255, 244, 0.08), transparent 18%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    margin-bottom: 16px;
    z-index: 1;
}

.hero h1 span {
    color: var(--primary);
}

.hero p,
.hero-tag {
    z-index: 1;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
}

.hero-tag {
    display: inline-block;
    margin-top: 18px;
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
}

.hero-btns {
    display: flex;
    gap: 14px;
    margin-top: 36px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
}

.hero-btns .btn {
    min-width: 180px;
}

.btn {
    padding: 13px 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #06131d;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(57, 255, 202, 0.65);
    color: var(--primary);
}

.btn:hover,
.btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(57, 255, 202, 0.15);
}

.btn-outline:hover,
.btn-outline:focus {
    background: rgba(57, 255, 202, 0.08);
    border-color: var(--primary);
}

.section {
    padding: 80px 10%;
    max-width: 1200px;
    margin: auto;
}

.section h2 {
    font-family: var(--font-titles);
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    letter-spacing: 0.05em;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin-top: 12px;
}

.dark {
    background: rgba(8, 13, 23, 0.95);
    border-radius: 24px;
    padding: 90px 10%;
    margin: 40px auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    text-align: center;
}

.metric-card {
    background: rgba(10, 17, 33, 0.95);
    padding: 30px;
    border-radius: 18px;
    border: 1px solid rgba(57, 255, 202, 0.12);
    transition: 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 40px rgba(57, 255, 202, 0.12);
}

.metric-card h3 {
    font-size: 2.7rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.metric-card p {
    color: var(--text-secondary);
}

.cv-container {
    background: rgba(8, 13, 23, 0.92);
    padding: 40px;
    border-radius: 22px;
    border: 1px solid rgba(57, 255, 202, 0.14);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.cv-summary h3,
.cv-section h4 {
    color: var(--primary);
}

.cv-section {
    margin: 28px 0;
}

.cv-section ul {
    list-style: none;
    padding: 0;
}

.cv-section li {
    margin-bottom: 12px;
    padding-left: 22px;
    position: relative;
    color: var(--text-secondary);
}

.cv-section li::before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
}

.skills-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: rgba(57, 255, 202, 0.16);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.cv-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

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

.project-card {
    background: rgba(10, 17, 33, 0.94);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(57, 255, 202, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-10px);
    box-shadow: 0 24px 38px rgba(57, 255, 202, 0.14);
}

.project-card h3 {
    margin-top: 18px;
    margin-bottom: 16px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    margin-top: 18px;
    font-weight: 700;
}

.project-link:hover,
.project-link:focus {
    text-decoration: underline;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.skill-category {
    background: rgba(10, 17, 33, 0.92);
    padding: 26px;
    border-radius: 18px;
    border: 1px solid rgba(57, 255, 202, 0.12);
}

.skill-category h3 {
    margin-bottom: 18px;
    color: var(--primary);
}

.skill-category ul li {
    opacity: 0;
    transform: translateX(-18px);
    animation: slideInLeft 0.5s ease forwards;
    color: var(--text-secondary);
}

.skill-category ul li:nth-child(1) { animation-delay: 0.1s; }
.skill-category ul li:nth-child(2) { animation-delay: 0.18s; }
.skill-category ul li:nth-child(3) { animation-delay: 0.26s; }
.skill-category ul li:nth-child(4) { animation-delay: 0.34s; }
.skill-category ul li:nth-child(5) { animation-delay: 0.42s; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-18px); }
    to { opacity: 1; transform: translateX(0); }
}

.contact-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-item {
    background: rgba(57, 255, 202, 0.16);
    color: var(--primary);
    padding: 16px 30px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(57, 255, 202, 0.18);
}

.fade-in {
    animation: fadeIn 0.9s ease forwards;
    opacity: 0;
}

.delay {
    animation-delay: 0.25s;
}

.delay2 {
    animation-delay: 0.55s;
}

.animate {
    animation: slideUp 0.85s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 5%;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: left;
        gap: 12px;
        margin-top: 12px;
    }

    nav ul.active {
        display: flex;
    }

    .hamburger {
        display: block;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.6rem;
        cursor: pointer;
        position: absolute;
        top: 1rem;
        right: 5%;
    }

    .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }
    .hero-btns { flex-direction: column; align-items: center; }
    .skills-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .cv-container { grid-template-columns: 1fr; padding: 24px; }
    .cv-actions { flex-direction: column; align-items: stretch; }
    .section { padding: 50px 5%; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-container { flex-direction: column; align-items: center; }
    .dark { padding: 60px 5%; margin: 30px auto; }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .section h2 { font-size: 1.6rem; }
    .project-card,
    .skill-category,
    .cv-container {
        border-radius: 16px;
    }
}

nav a:focus,
.btn:focus,
.contact-item:focus,
.project-card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: #06131d;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.back-to-top:focus {
    outline: 2px solid white;
    outline-offset: 3px;
}


/* SKILLS GRID (Remplaçant du tableau) */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.skill-category {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
}

.skill-category ul li {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease forwards;
}

.skill-category ul li:nth-child(1) { animation-delay: 0.1s; }
.skill-category ul li:nth-child(2) { animation-delay: 0.2s; }
.skill-category ul li:nth-child(3) { animation-delay: 0.3s; }
.skill-category ul li:nth-child(4) { animation-delay: 0.4s; }
.skill-category ul li:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* CONTACT */
.contact-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
}

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

.delay {
    animation-delay: 0.3s;
}

.delay2 {
    animation-delay: 0.6s;
}

.animate {
    animation: slideUp 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    nav { 
        flex-direction: column; 
        gap: 15px; 
        padding: 1rem 5%;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 15px;
        margin-top: 15px;
    }
    
    nav ul.active {
        display: flex;
    }
}