/* ============================================================
   BTS SIO — RESPONSIVE & ANIMATIONS
   Breakpoints: Mobile S (≤360) · M (≤480) · L (≤600)
                Tablet (≤768) · Laptop (≤1024)
                Large (≥1200) · XL (≥1400) · 4K (≥2560)
   ============================================================ */

/* ─────────────────────────────────────────────
   REDUCED MOTION SUPPORT
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal-left, .reveal-right {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─────────────────────────────────────────────
   REVEAL ANIMATIONS (triggered via JS IntersectionObserver)
   ───────────────────────────────────────────── */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Cascade delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ─────────────────────────────────────────────
   HERO NAME READY ANIMATION
   ───────────────────────────────────────────── */
.hero-content h1.hero-name-ready {
    animation: heroShimmer 3s ease-in-out infinite alternate;
}

@keyframes heroShimmer {
    0%   { filter: brightness(1); }
    100% { filter: brightness(1.12); }
}

/* ─────────────────────────────────────────────
   SKILL BARS — start at 0, animated by JS
   ───────────────────────────────────────────── */

.level-bar {
    width: 0 !important;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.level-bar.animated {
    width: var(--target-width) !important;
}

/* ─────────────────────────────────────────────
   NAVBAR — shrink on scroll
   ───────────────────────────────────────────── */

.profil-navbar {
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.profil-navbar.is-scrolled {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ─────────────────────────────────────────────
   BURGER MENU — visible on mobile only
   ───────────────────────────────────────────── */
.sio-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;  /* touch target */
    min-height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
}

.sio-burger:hover,
.sio-burger:focus-visible {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.4);
    outline: none;
}

.sio-burger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sio-burger.is-open .sio-burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sio-burger.is-open .sio-burger-line:nth-child(2) {
    opacity: 0;
}
.sio-burger.is-open .sio-burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile dropdown menu */
.sio-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideDown 0.25s ease;
}

.sio-mobile-menu.is-open {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sio-mobile-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    min-height: 44px; /* touch target */
    transition: all 0.2s ease;
}

.sio-mobile-menu a:hover,
.sio-mobile-menu a.active {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
    color: #fdba74;
}

/* ─────────────────────────────────────────────
   BACK TO TOP BUTTON
   ───────────────────────────────────────────── */

.sio-back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1e40af, #f97316);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 900;
}

.sio-back-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.sio-back-top:hover {
    box-shadow: 0 12px 32px rgba(30, 64, 175, 0.55);
    transform: translateY(-3px);
}

/* ─────────────────────────────────────────────
   SCROLL PROGRESS BAR
   ───────────────────────────────────────────── */

.sio-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #1e40af, #f97316);
    z-index: 2000;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
   PROJECT FILTER BAR (injected by JS)
   ───────────────────────────────────────────── */

.projet-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    justify-content: center;
}

.projet-filter-btn {
    padding: 0.45rem 1.2rem;
    border-radius: 50px;
    border: 1.5px solid rgba(30, 64, 175, 0.2);
    background: #fff;
    color: #1e40af;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    min-height: 36px;
    letter-spacing: 0.3px;
}

.projet-filter-btn:hover {
    background: #dbeafe;
    border-color: #1e40af;
}

.projet-filter-btn.active {
    background: linear-gradient(135deg, #1e40af, #f97316);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.3);
}

.projet-card.hidden-card {
    display: none;
}

/* ─────────────────────────────────────────────
   TIMELINE MOBILE TOGGLE BUTTON (injected by JS)
   ───────────────────────────────────────────── */

.evo-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(30, 64, 175, 0.08);
    border: 1.5px solid rgba(30, 64, 175, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1e40af;
    transition: all 0.22s ease;
    flex-shrink: 0;
    align-self: center;
}

.evo-toggle-btn i {
    transition: transform 0.25s ease;
}

.evo-toggle-btn.is-open i {
    transform: rotate(180deg);
}

/* ─────────────────────────────────────────────
   TOUCH ACTIVE STATE for interactive cards
   ───────────────────────────────────────────── */

.why-card.touch-active,
.soft-card.touch-active,
.projet-card.touch-active,
.option-card.touch-active {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : LAPTOP (≤ 1024px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3.2rem;
    }

    .why-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.8rem;
    }

    .projets-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .projet-card.featured {
        grid-column: span 2;
    }

    .section-header h2 {
        font-size: 2.4rem;
    }

    .why-header h2 {
        font-size: 2.4rem;
    }

    .options-header h2 {
        font-size: 2.4rem;
    }

    .skill-level {
        width: 240px;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : TABLET (≤ 768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Navbar */
    .profil-nav-inner {
        flex-wrap: wrap;
    }

    .profil-nav-siblings {
        display: none !important; /* replaced by burger menu */
    }

    .sio-burger {
        display: flex;
    }

    .evo-toggle-btn {
        display: flex;
    }

    /* Hero */
    .hero-section {
        min-height: 85vh;
        padding: 5rem 1.5rem 3rem;
    }

    .hero-content h1 {
        font-size: 2.6rem;
    }

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

    .btn-hero-main {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Sections */
    section {
        padding: 3.5rem 0;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .section-header h2,
    .why-header h2,
    .options-header h2 {
        font-size: 2rem;
    }

    /* Why grid */
    .why-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .why-card {
        padding: 2rem;
    }

    /* Timeline */
    .evolution-timeline {
        padding-left: 0;
    }

    .evo-year {
        width: 74px !important;
        min-width: 74px !important;
        height: 74px !important;
        font-size: 0.75rem !important;
    }

    .evo-content {
        padding: 1.2rem;
    }

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

    .projet-card.featured {
        grid-column: span 1;
    }

    .projet-filter-bar {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    /* Competences */
    .comp-category {
        padding: 2rem 1.5rem;
    }

    .skill-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .skill-level {
        width: 100%;
    }

    .skill-info {
        min-width: unset;
    }

    /* Soft Skills */
    .section-soft-skills .col-lg-4 {
        width: 100%;
    }

    .soft-card {
        padding: 2rem;
    }

    /* Options */
    .section-options .col-lg-8,
    .section-options .col-lg-4 {
        width: 100%;
    }

    .option-card {
        padding: 2rem;
    }

    /* CTA */
    .cta-box {
        padding: 2rem 1.5rem;
    }

    .candidature-mmi-facts {
        grid-template-columns: 1fr 1fr;
    }

    .btn-cta-main {
        font-size: 1rem;
        padding: 1.1rem 2rem;
    }

    /* Back-to-top */
    .sio-back-top {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : MOBILE L (≤ 600px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* Hero */
    .hero-section {
        padding: 4.5rem 1rem 2.5rem;
    }

    .hero-content h1 {
        font-size: 2.1rem;
    }

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

    /* Section padding */
    section {
        padding: 3rem 0;
    }

    .section-header h2,
    .why-header h2,
    .options-header h2 {
        font-size: 1.8rem;
    }

    .why-card {
        padding: 1.5rem;
    }

    .why-icon {
        width: 72px;
        height: 72px;
        font-size: 2.4rem;
    }

    /* Timeline */
    .evolution-item {
        gap: 0.8rem;
    }

    .evo-year {
        width: 60px !important;
        min-width: 60px !important;
        height: 60px !important;
        font-size: 0.68rem !important;
        border-radius: 10px !important;
    }

    /* Projects */
    .projet-card {
        padding: 1.5rem;
    }

    .projet-visual {
        width: 72px;
        height: 72px;
        font-size: 2.5rem;
    }

    .projet-content h3 {
        font-size: 1.4rem;
    }

    /* Competences */
    .category-header h3 {
        font-size: 1.4rem;
    }

    /* Options */
    .option-card h3 {
        font-size: 1.4rem;
    }

    /* CTA */
    .candidature-mmi-header h2 {
        font-size: 1.3rem;
    }

    .candidature-mmi-facts {
        grid-template-columns: 1fr;
    }

    .btn-cta-main {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
        padding: 1rem 1.5rem;
    }

    /* Back-to-top smaller */
    .sio-back-top {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        bottom: 1rem;
        right: 1rem;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : MOBILE M (≤ 480px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    /* Hero */
    .hero-content h1 {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .btn-hero-main {
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Sections */
    section {
        padding: 2.5rem 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .section-header p {
        font-size: 0.95rem;
    }

    .why-header h2 {
        font-size: 1.6rem;
    }

    .why-intro {
        font-size: 1rem;
    }

    /* Timeline — linear layout */
    .evolution-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .evo-year {
        width: 100% !important;
        min-width: unset !important;
        height: auto !important;
        padding: 0.5rem 1rem !important;
        border-radius: 10px !important;
        font-size: 0.82rem !important;
        text-align: center;
    }

    .evo-toggle-btn {
        display: none !important; /* full linear layout — no toggle needed */
    }

    /* Soft Skills */
    .soft-card {
        padding: 1.5rem;
    }

    .soft-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    /* Filter bar */
    .projet-filter-bar {
        gap: 0.4rem;
    }

    .projet-filter-btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.9rem;
    }

    /* CTA */
    .mmi-fact {
        padding: 0.9rem 1rem;
    }

    .option-card {
        padding: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : MOBILE S (≤ 360px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 360px) {
    /* Hero */
    .hero-content h1 {
        font-size: 1.55rem;
        letter-spacing: -0.5px;
    }

    .btn-hero-main {
        font-size: 0.85rem;
        padding: 0.8rem 1.2rem;
    }

    /* General */
    .section-header h2,
    .why-header h2,
    .options-header h2 {
        font-size: 1.4rem;
    }

    .why-card,
    .projet-card,
    .comp-category,
    .soft-card {
        padding: 1.2rem;
    }

    /* Timeline pill */
    .evo-year {
        font-size: 0.75rem !important;
    }

    /* CTA */
    .candidature-mmi-header h2 {
        font-size: 1.1rem;
    }

    .btn-cta-main {
        font-size: 0.85rem;
        padding: 0.9rem 1rem;
    }

    .projet-filter-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : LARGE SCREEN (≥ 1200px)
   ═══════════════════════════════════════════════════ */
@media (min-width: 1200px) {
    .projets-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .projet-card.featured {
        grid-column: span 3;
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 2rem;
        align-items: start;
    }

    .projet-card.featured .projet-visual {
        width: 180px;
        height: 180px;
        font-size: 5rem;
        margin-bottom: 0;
    }

    .competences-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : XL SCREEN (≥ 1400px)
   ═══════════════════════════════════════════════════ */
@media (min-width: 1400px) {
    .hero-content h1 {
        font-size: 5.5rem;
    }

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

    .section-header h2,
    .why-header h2,
    .options-header h2 {
        font-size: 3.5rem;
    }

    .why-card {
        padding: 3.5rem;
    }

    .projet-card {
        padding: 3rem;
    }

    .soft-card {
        padding: 3.5rem;
    }

    section {
        padding: 6rem 0;
    }

    .container {
        max-width: 1320px;
    }
}

/* ═══════════════════════════════════════════════════
   BREAKPOINT : 4K / ULTRA-WIDE (≥ 2560px)
   ═══════════════════════════════════════════════════ */
@media (min-width: 2560px) {
    /* Scale up the container */
    .container {
        max-width: 2000px;
    }

    /* Hero */
    .hero-content h1 {
        font-size: 8rem;
        letter-spacing: -2px;
    }

    .hero-subtitle {
        font-size: 1.8rem;
        max-width: 1400px;
    }

    .btn-hero-main {
        font-size: 1.4rem;
        padding: 1.6rem 4rem;
        border-radius: 60px;
    }

    /* Typography scale */
    .section-header h2,
    .why-header h2,
    .options-header h2 {
        font-size: 5rem;
    }

    .section-header p,
    .why-intro,
    .options-header p {
        font-size: 1.5rem;
        max-width: 1200px;
    }

    /* Section padding */
    section {
        padding: 9rem 0;
    }

    .section-header {
        margin-bottom: 5rem;
    }

    /* Project grid */
    .projets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3.5rem;
    }

    /* Cards */
    .why-card {
        padding: 5rem;
        border-radius: 36px;
    }

    .why-card h3 {
        font-size: 2.2rem;
    }

    .why-card p {
        font-size: 1.2rem;
    }

    .why-number {
        font-size: 6rem;
    }

    .projet-card {
        padding: 4rem;
        border-radius: 36px;
    }

    .projet-content h3 {
        font-size: 2.4rem;
    }

    .projet-desc {
        font-size: 1.2rem;
    }

    .projet-visual {
        width: 140px;
        height: 140px;
        font-size: 5rem;
    }

    .projet-visual.small {
        width: 100px;
        height: 100px;
        font-size: 3.5rem;
    }

    .soft-card {
        padding: 5rem;
        border-radius: 36px;
    }

    .soft-card h3 {
        font-size: 2.2rem;
    }

    .soft-icon {
        width: 110px;
        height: 110px;
        font-size: 3.5rem;
    }

    .comp-category {
        padding: 4rem;
        border-radius: 36px;
    }

    .category-header h3 {
        font-size: 2.4rem;
    }

    .skill-name {
        font-size: 1.4rem;
    }

    .skill-desc {
        font-size: 1.1rem;
    }

    .skill-level {
        width: 500px;
        height: 14px;
    }

    .option-card {
        padding: 4.5rem;
        border-radius: 36px;
    }

    .option-card h3 {
        font-size: 2.4rem;
    }

    .option-card p {
        font-size: 1.2rem;
    }

    .option-card li {
        font-size: 1.1rem;
    }

    /* Timeline */
    .evo-year {
        width: 120px !important;
        min-width: 120px !important;
        height: 120px !important;
        font-size: 1.1rem !important;
        border-radius: 18px !important;
    }

    .evo-content {
        padding: 2.5rem 3rem;
        border-radius: 20px;
    }

    .evo-content h4 {
        font-size: 1.5rem;
    }

    .evo-content p {
        font-size: 1.1rem;
    }

    /* CTA */
    .candidature-mmi-header h2 {
        font-size: 2.4rem;
    }

    .candidature-mmi-intro {
        font-size: 1.3rem;
    }

    .mmi-fact strong {
        font-size: 0.95rem;
    }

    .mmi-fact span,
    .mmi-fact a {
        font-size: 1.1rem;
    }

    .btn-cta-main {
        font-size: 1.4rem;
        padding: 1.6rem 4rem;
        border-radius: 60px;
    }

    /* Navbar */
    .profil-navbar {
        padding: 1.2rem 3rem;
    }

    .profil-nav-back {
        font-size: 1.1rem;
        padding: 0.6rem 1.6rem;
    }

    .sio-nav-title {
        font-size: 1rem;
    }

    .profil-nav-siblings a {
        font-size: 1rem;
        padding: 0.5rem 1.2rem;
    }

    /* Filter bar */
    .projet-filter-btn {
        font-size: 1rem;
        padding: 0.65rem 1.8rem;
        min-height: 48px;
    }

    /* Back to top */
    .sio-back-top {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
        bottom: 3rem;
        right: 3rem;
    }

    /* Progress bar */
    .sio-progress-bar {
        height: 5px;
    }

    /* Section badge */
    .section-badge {
        font-size: 1rem;
        padding: 0.7rem 1.8rem;
    }

    /* Why icon */
    .why-icon {
        width: 140px;
        height: 140px;
        font-size: 5rem;
        border-radius: 40px;
    }
}
