:root {
    --bg-dark: #050505;
    --bg-card: rgba(22, 22, 22, 0.85);
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #00ff9d;
    --accent-dim: rgba(0, 255, 157, 0.1);
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

#matrix-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.12;
}

h1, h2, h3, .mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px; }
.highlight { color: var(--accent); font-weight: bold; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 4rem 0; position: relative; z-index: 1; }

.section-title {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--accent-dim);
    padding-bottom: 0.8rem;
}

/* --- NAV --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--accent-dim);
}
.nav-logo { font-family: var(--font-mono); font-weight: 700; font-size: 1.2rem; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: 0.3s;
}
.nav-links a:hover { color: var(--accent); text-shadow: 0 0 10px var(--accent); }

/* --- HERO --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}
.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.15);
}
.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-family: var(--font-mono);
}
.hero-alternance {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: rgba(0, 255, 157, 0.08);
    border: 1px solid rgba(0, 255, 157, 0.35);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.12), inset 0 0 20px rgba(0, 255, 157, 0.04);
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.3);
    letter-spacing: 0.3px;
}
.cursor-blink {
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 2rem;
    background: var(--accent);
    color: var(--bg-dark);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid var(--accent);
    border-radius: 8px;
}
.btn:hover {
    box-shadow: 0 0 25px var(--accent);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* --- TERMINAL --- */
.terminal-window {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    margin-top: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    font-family: var(--font-mono);
    overflow: hidden;
}
.terminal-header {
    background: #1a1a1a;
    padding: 0.6rem 1rem;
    display: flex;
    gap: 8px;
    align-items: center;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }
.terminal-body {
    padding: 1rem;
    height: 180px;
    overflow-y: auto;
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.7;
}
.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
}
.about-text p {
    font-size: 1rem;
    color: #bbb;
    line-height: 1.9;
    margin-bottom: 1.2rem;
}
.about-text strong { color: #fff; }
.about-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-dim);
}
.about-terminal {
    max-width: 380px;
    background: #0a0a0a;
    border-radius: 15px;
    border: 1px solid #333;
    overflow: hidden;
}
.about-terminal .terminal-body {
    height: auto;
    background: #0a0a0a;
    min-height: 160px;
    font-size: 0.8rem;
    line-height: 2;
}

/* --- TIMELINE --- */
.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid rgba(0, 255, 157, 0.3);
}
.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}
.timeline-marker {
    position: absolute;
    left: -36px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}
.timeline-content {
    background: #161616;
    border: 1px solid rgba(0, 255, 157, 0.15);
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
}
.timeline-content:hover {
    transform: translateX(8px);
    border-color: var(--accent);
}
.timeline-content::after {
    content: 'DÉTAILS +';
    position: absolute;
    right: 1.2rem;
    top: 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 1px;
    transition: 0.3s;
    pointer-events: none;
    border: 1px solid #444;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
}
.timeline-content:hover::after {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0,255,157,0.08);
}
.job-header { margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.job-title { color: #fff; font-size: 1.05rem; text-transform: none; letter-spacing: 0; }
.job-company { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; display: block; margin-top: 4px; }
.job-date { font-size: 0.8rem; color: #777; }
.job-body p { color: #bbb; margin-bottom: 0.8rem; font-size: 0.95rem; }
.job-missions { list-style: none; padding: 0; }
.job-missions li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.4rem;
    color: #aaa;
    font-size: 0.9rem;
}
.job-missions li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}
.job-skills { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tag {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.06);
    padding: 3px 10px;
    border-radius: 6px;
    color: #aaa;
    font-family: var(--font-mono);
    border: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- PROJECTS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: #161616;
    border: 1px solid #222;
    border-radius: 15px;
    padding: 1.8rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px -12px var(--accent-dim);
}
.project-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}
.project-card-header i {
    font-size: 1.8rem;
    color: var(--accent);
}
.project-card-header h3 {
    font-size: 1rem;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
}
.project-card-body p {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
}
.project-card-footer {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    align-items: center;
}
.project-card-footer .mini-tag {
    margin-right: auto;
}
.btn-card {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.btn-card:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-overlay.hidden {
    display: none;
}
.modal-window {
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    background: #0a0a0a;
    border: 1px solid var(--accent);
    box-shadow: 0 0 50px rgba(0, 255, 157, 0.12);
    border-radius: 15px;
    overflow: hidden;
    transform: scale(0.93) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-window {
    transform: scale(1) translateY(0);
}
.modal-header {
    background: #111;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-dots {
    display: flex;
    gap: 6px;
}
.modal-dots .dot { cursor: pointer; }
.modal-dots .dot.red:hover { transform: scale(1.2); }
.modal-title-text {
    font-family: var(--font-mono);
    color: #888;
    font-size: 0.8rem;
    flex: 1;
}
.modal-close-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    padding: 4px;
}
.modal-close-btn:hover { color: #ff5f56; }
.modal-content {
    padding: 2rem;
    color: #ccc;
    max-height: calc(90vh - 52px);
    overflow-y: auto;
    line-height: 1.8;
}
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
.modal-content h3 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: 0;
}
.modal-content .modal-desc {
    color: #bbb;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #222;
}
.modal-content h4 {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin: 1.5rem 0 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-content ul {
    list-style: none;
    padding: 0;
}
.modal-content ul li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.7rem;
    color: #aaa;
    font-size: 0.9rem;
}
.modal-content ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: bold;
}
.modal-content ul li strong {
    color: #fff;
}
.modal-pill {
    display: inline-block;
    padding: 3px 12px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    margin: 0.4rem 0.3rem 0 0;
}
.btn-program {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}
.btn-program:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--accent-dim);
    transform: translateY(-2px);
}

/* --- SKILL DETAIL MODAL --- */
.skill-detail-section {
    margin-bottom: 1.5rem;
}
.skill-detail-section h4 {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
}
.skill-detail-section h4 i {
    color: var(--accent);
}
.skill-detail-section h4 .badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 400;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
}
.skill-detail-section ul {
    list-style: none;
    padding: 0;
}
.skill-detail-section ul li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.6rem;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.7;
}
.skill-detail-section ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: bold;
}
.skill-detail-section ul li strong {
    color: #fff;
}
.skill-detail-pct {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* --- SKILLS COMPACT --- */
.skills-compact {
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.skill-row {
    background: #161616;
    border: 1px solid #222;
    border-radius: 15px;
    padding: 1.2rem 1.5rem;
    transition: border-color 0.3s;
    cursor: pointer;
    position: relative;
}
.skill-row:hover { border-color: var(--accent); }
.skill-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #ccc;
}
.skill-row-header i {
    color: var(--accent);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.skill-row-header span:first-of-type {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.skill-pct {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
}
.skill-pct::before {
    content: 'DÉTAILS +';
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 1px;
    margin-right: 12px;
    transition: 0.3s;
    display: inline;
    border: 1px solid #444;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
}
.skill-row:hover .skill-pct::before {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0,255,157,0.08);
}
.skill-row .bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}
.skill-row .bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 5px;
    transition: width 1s ease;
    box-shadow: 0 0 10px var(--accent-dim);
}
.bar { display: block; }
.bar-fill { display: block; }

/* --- FOOTER --- */
footer {
    background: #080808;
    border-top: 1px solid #1a1a1a;
    padding-top: 2.5rem;
    padding-bottom: 1rem;
    margin-top: 2.5rem;
}
.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 2.5rem;
}
.footer-col h4 {
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--accent);
    display: inline-block;
    padding-bottom: 4px;
}
.social-links {
    margin-top: 1.2rem;
    display: flex;
    gap: 12px;
}
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    border-radius: 50%;
    border: 1px solid #333;
    transition: all 0.3s ease;
    text-decoration: none;
}
.social-links a:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent);
    transform: translateY(-3px);
}
.footer-contact {
    list-style: none;
    padding: 0;
}
.footer-contact li {
    color: #999;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sys-info {
    list-style: none;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #666;
}
.sys-info li { margin-bottom: 0.5rem; }
.footer-bottom {
    border-top: 1px solid #1a1a1a;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
.back-to-top {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border: 1px solid var(--accent);
    padding: 5px 12px;
    border-radius: 8px;
    transition: 0.3s;
}
.back-to-top:hover {
    background: var(--accent);
    color: #000;
}

/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-terminal { max-width: 100%; }
}
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .nav-links { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .skills-compact { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
    .hero-buttons { flex-direction: column; }
    .btn { justify-content: center; }
}
