/* ===== STYLES PRINCIPAUX — MONSEF CHAKIR ===== */

:root {
    --bg: #0a0a12;
    --surface: #111120;
    --accent-start: #7c3aed;
    --accent-end: #06b6d4;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: rgba(124, 58, 237, 0.25);
    --glass: rgba(17, 17, 32, 0.7);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-start), var(--accent-end));
    border-radius: 10px;
}

/* === Layout === */
section {
    padding: 8rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* === Progress Bar === */
#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    z-index: 10000;
    transition: width 0.1s linear;
}

/* === Navigation === */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: right;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* === Hero === */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 70px;
    max-width: 100%;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.badge-open {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.grad-text {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter-container {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    min-height: 1.5em;
}

#typewriter {
    color: var(--accent-end);
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.stat-item {
    text-align: left;
    background: var(--glass);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Buttons === */
.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* === Skills === */
.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
}

.skill-category-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: block;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.skill-name {
    font-weight: 600;
}

.skill-pct {
    color: var(--text-secondary);
    font-weight: 700;
}

.skill-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

/* === Projects === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.projects-grid .project-card:nth-child(3) {
    grid-column: span 2;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.project-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.project-tag {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--border);
    color: #a78bfa;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-features {
    list-style: none;
    margin-bottom: 2rem;
}

.project-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: 800;
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* === Timeline === */
.timeline {
    position: relative;
    max-width: 800px;
    margin-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-start), var(--accent-end));
}

.timeline-item {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 4rem;
}

.timeline-dot {
    position: absolute;
    left: -11px;
    top: 10px;
    width: 20px;
    height: 20px;
    background: var(--bg);
    border: 3px solid var(--accent-end);
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
}

.timeline-date {
    color: var(--accent-end);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-school {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: block;
}

/* === Contact === */
.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    max-width: 500px;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s;
}

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

    .hero-inner-right {
        order: -1;
    }

    .hero-desc {
        margin: 0 auto 3rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid .project-card:nth-child(3) {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}