/* Responsive Design */

/* Tablet Large (1024px and below) */
@media (max-width: 1024px) {
    .cv-grid {
        grid-template-columns: 1fr;
    }

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

    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .title-name {
        font-size: 3.5rem;
    }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(15, 18, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 0;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        width: 100%;
        padding: 1.5rem;
        font-size: 1.2rem;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link::before {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Sections */
    .section {
        padding: 4rem 1.5rem;
    }

    /* Hero */
    .title-name {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .hero-description p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 3rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Section Headers */
    .section-title {
        font-size: 2.5rem;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Stages */
    .stage-header {
        flex-direction: column;
        text-align: center;
    }

    .stage-company {
        font-size: 1.5rem;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    /* Veille */
    .veille-item,
    .veille-item:nth-child(even) {
        flex-direction: column;
        align-items: stretch;
    }

    .veille-date {
        width: 100%;
    }

    .veille-content::before {
        display: none;
    }

    /* Contact */
    .contact-social {
        flex-direction: column;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile (640px and below) */
@media (max-width: 640px) {

    /* Typography */
    .title-greeting {
        font-size: 1.2rem;
    }

    .title-name {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        flex-direction: column;
    }

    .subtitle-highlight {
        margin-left: 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .category-subtitle {
        font-size: 1.5rem;
    }

    /* Cards */
    .project-card,
    .stage-card {
        padding: 1.5rem;
    }

    .project-icon,
    .stage-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    /* Timeline */
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-dot {
        left: -2rem;
        width: 12px;
        height: 12px;
    }

    .timeline-content {
        padding: 1rem;
    }

    /* Contact */
    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem;
    }
}

/* Mobile Small (480px and below) */
@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .title-name {
        font-size: 2rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-social {
        gap: 1rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .project-title,
    .veille-title {
        font-size: 1.2rem;
    }

    .stage-company {
        font-size: 1.3rem;
    }
}

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    * {
        animation-duration: 0.5s !important;
    }

    .project-card:hover,
    .stage-card:hover,
    .timeline-content:hover {
        transform: none;
    }

    .social-link:hover {
        transform: translateY(-5px);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --bg-dark: hsl(220, 20%, 5%);
        --bg-card: hsl(220, 20%, 12%);
        --text-primary: hsl(0, 0%, 100%);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-indicator {
        animation: none;
    }

    .timeline-dot {
        animation: none;
    }

    .new-badge {
        animation: none;
    }
}

/* Print styles */
@media print {

    #particles-js,
    .navbar,
    .scroll-indicator,
    .footer {
        display: none;
    }

    .section {
        page-break-after: always;
        min-height: auto;
    }

    body {
        background: white;
        color: black;
    }
}