:root {
    --bg-dark: #0f172a; --bg-darker: #020617; --bg-card: #1e293b; --bg-card-hover: #334155;
    --text-main: #f8fafc; --text-muted: #94a3b8;
    --accent: #3b82f6; --accent-glow: rgba(59, 130, 246, 0.4);
    --border: #334155; --radius: 12px; --nav-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-dark); color: var(--text-main); font-family: 'Inter', sans-serif; line-height: 1.6; overflow-x: hidden; position: relative; min-height: 100vh; }

.bg-animation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
    background: linear-gradient(-45deg, #020617, #0f172a, #1e1b4b, #0f172a);
    background-size: 400% 400%; animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background-image: linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 40px 40px; pointer-events: none;
}

/* NAVBAR */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height); background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 1000; display: flex; justify-content: center; }
.nav-content { width: 100%; max-width: 1100px; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.4rem; color: #fff; text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; transition: 0.3s; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.btn-lang { background: rgba(59, 130, 246, 0.1); border: 1px solid var(--border); color: var(--accent); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.btn-lang:hover { background: var(--accent); color: #fff; }

/* MAIN */
.main-container { max-width: 1000px; margin: 0 auto; padding: 100px 20px 40px; }
.section { margin-bottom: 8rem; }
.section.last-section { margin-bottom: 0; }
.section-title { font-size: 1.8rem; margin-bottom: 2rem; color: #fff; border-left: 4px solid var(--accent); padding-left: 1rem; }

/* HERO */
.hero { text-align: center; padding: 4rem 0; }
.hero-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); padding: 4px; background: var(--bg-card); margin-bottom: 2rem; box-shadow: 0 0 30px var(--accent-glow); }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -1px; }
.hero h2 { font-size: 1.3rem; color: var(--accent); font-weight: 500; margin-bottom: 2rem; min-height: 1.6em; font-family: 'Fira Code', monospace; }
.hero-btns { display: flex; justify-content: center; gap: 1rem; }
.btn { padding: 12px 28px; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; transition: 0.3s; border: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-primary:hover { background: #2563eb; transform: translateY(-2px); }
.btn-secondary { background: rgba(30, 41, 59, 0.6); border: 1px solid var(--border); color: var(--text-muted); }
.btn-secondary:hover { border-color: #fff; color: #fff; background: var(--bg-card); }

.hero-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 3rem; text-align: left; }
.hero-card { background: rgba(30, 41, 59, 0.5); border: 1px solid var(--border); padding: 1.5rem; border-radius: var(--radius); transition: 0.3s; backdrop-filter: blur(5px); }
.hero-card:hover { background: var(--bg-card); border-color: var(--accent); }
.hero-card h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 10px; }
.hero-card h3 i { color: var(--accent); }
.hero-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin: 0; }

/* SKILLS & PROJETS & TIMELINE */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.skill-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: 0.3s; }
.skill-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.skill-card h4 { color: #fff; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; }
.skill-card h4 i { color: var(--accent); }
.skill-list li { list-style: none; margin-bottom: 8px; color: var(--text-muted); font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.skill-list li::before { content: "•"; color: var(--accent); }

.timeline { position: relative; border-left: 2px solid var(--border); margin-left: 10px; padding-left: 2rem; }
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-item::before { content: ''; position: absolute; left: calc(-2rem - 7px); top: 5px; width: 12px; height: 12px; background: var(--bg-dark); border: 2px solid var(--accent); border-radius: 50%; }
.time-date { color: var(--accent); font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; display: block; }
.timeline-item h4 { font-size: 1.2rem; color: #fff; margin-bottom: 5px; }
.timeline-item .company { color: var(--text-muted); font-size: 0.9rem; font-style: italic; margin-bottom: 10px; display: block; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: 0.3s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.card-body { padding: 1.5rem; }
.folder-icon { color: var(--accent); font-size: 1.5rem; margin-bottom: 1rem; }
.project-card h4 { font-size: 1.2rem; margin-bottom: 0.5rem; color: #fff; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.tech-stack span { font-size: 0.75rem; background: var(--bg-dark); color: var(--text-muted); padding: 4px 8px; border-radius: 4px; margin-right: 5px; border: 1px solid var(--border); }

/* CERTIFICATIONS (AVEC IMAGE) */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.cert-card { background: linear-gradient(145deg, var(--bg-card), #162032); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; transition: 0.3s; height: 100%; }
.cert-card:hover { border-color: var(--accent); transform: translateY(-5px); background: #1e293b; }
.cert-img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 1rem; filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); }
.cert-info strong { display: block; color: #fff; font-size: 1rem; margin-bottom: 0.2rem; }
.cert-info span { display: block; color: var(--text-muted); font-size: 0.85rem; }

/* SOFT SKILLS */
.soft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.soft-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; transition: 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.soft-card:hover { border-color: var(--accent); transform: translateY(-5px); background: #232d3f; }
.soft-icon { font-size: 2rem; color: var(--accent); margin-bottom: 1rem; opacity: 0.8; }
.soft-card h4 { color: #fff; font-size: 1.1rem; }

/* FOOTER */
.contact-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; border-bottom: none; padding: 4rem 2rem 2rem 2rem; text-align: center; width: 100%; margin: 0 auto; box-shadow: 0 -10px 30px rgba(0,0,0,0.1); }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 3rem; }
.contact-btn { display: flex; align-items: center; gap: 10px; background: var(--bg-dark); border: 1px solid var(--border); padding: 10px 24px; border-radius: 30px; cursor: pointer; color: var(--text-main); text-decoration: none; font-weight: 500; transition: 0.3s; }
.contact-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-3px); }
.contact-btn.secondary { border-color: var(--text-muted); }
.contact-btn.secondary:hover { background: #fff; color: #000; border-color: #fff; }
.copyright { color: var(--text-muted); font-size: 0.85rem; }

/* MODALES */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000; display: none; opacity: 0; transition: 0.3s; }
.modal-overlay.active { display: block; opacity: 1; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80vw; height: 85vh; max-width: 1200px; background: var(--bg-dark); border: 1px solid var(--border); z-index: 2001; display: none; box-shadow: 0 0 50px rgba(0,0,0,0.6); border-radius: 8px; overflow: hidden; }
.modal.active { display: flex; }

.modal-full-content { width: 100%; height: 100%; background: #000; display: flex; justify-content: center; align-items: center; }
.modal-full-content iframe { width: 100%; height: 100%; border: none; object-fit: contain; }
#modal-cv .close-modal { background: rgba(15, 23, 42, 0.8); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; top: 10px; right: 10px; z-index: 10; }
#modal-cv .close-modal:hover { background: var(--accent); }

.split-modal .modal-left { width: 50%; background: #000; border-right: 1px solid var(--border); height: 100%; padding: 1rem; display: flex; align-items: center; justify-content: center; }
.split-modal .modal-left iframe, .split-modal .modal-left img { width: 100%; height: 100%; object-fit: contain; border: none; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.split-modal .modal-right { width: 50%; padding: 3rem; overflow-y: auto; background: var(--bg-card); position: relative; }
.close-modal { position: absolute; top: 1.5rem; right: 1.5rem; background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: 0.2s; }
.close-modal:hover { color: #fff; transform: rotate(90deg); }
.modal-title { font-size: 1.8rem; color: #fff; margin-bottom: 1rem; }
.modal-desc { color: var(--text-muted); line-height: 1.7; white-space: pre-line; }

@media (max-width: 900px) {
    .modal { flex-direction: column; height: 100vh; width: 100vw; border: none; border-radius: 0; }
    .split-modal .modal-left { height: 40%; width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 0.5rem; }
    .split-modal .modal-right { height: 60%; width: 100%; padding: 1.5rem; }
    .hero-info-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}