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

:root {
    --primary: #0a4d7a;
    --secondary: #0891b2;
    --accent: #f59e0b;
    --dark: #0f172a;
    --light: #f1f5f9;
    --gradient: linear-gradient(135deg, #0a4d7a 0%, #0891b2 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== HEADER / NAVIGATION ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header--scrolled {
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
}

.header__logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__nav {
    display: flex;
    gap: 2rem;
}

.header__link {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.header__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.header__link:hover {
    color: var(--accent);
}

.header__link:hover::after {
    width: 100%;
}

/* ========== HERO SECTION ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 5% 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(8, 145, 178, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero__container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.hero__subtitle {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero__description {
    font-size: 1.2rem;
    color: rgba(241, 245, 249, 0.8);
    line-height: 1.8;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero__cta {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

.hero__image-wrapper {
    position: relative;
    animation: fadeInRight 1s ease;
}

.hero__image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.hero__image-wrapper::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--accent);
    border-radius: 20px;
    z-index: 0;
}

/* ========== BUTTONS ========== */
.button {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    display: inline-block;
}

.button--primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.4);
}

.button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.6);
}

.button--secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--secondary);
}

.button--secondary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* ========== PROJECTS SECTION ========== */
.projects {
    padding: 100px 5%;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header__subtitle {
    font-size: 1.2rem;
    color: rgba(241, 245, 249, 0.7);
}

.projects__grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    height: 380px;
    display: flex;
    align-items: flex-end;
    background: #1e293b center center / cover no-repeat;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    user-select: none;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.9) 100%);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(8, 145, 178, 0.3);
}

.project-card__content {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 1.75rem;
    color: #fff;
    z-index: 3;
    transform: translateY(calc(100% - 70px));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease, backdrop-filter 0.4s ease;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.2) 0%, rgba(2, 6, 23, 0.78) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-sizing: border-box;
}

.project-card:not(.project-card--cta):hover .project-card__content {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.25) 0%, rgba(2, 6, 23, 0.9) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-card:hover .project-card__content {
    transform: translateY(0);
}

.project-card__title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--accent);
}

.project-card__description {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-card:hover .project-card__description {
    opacity: 1;
    transform: translateY(0);
}

.project-card__link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: #0f172a;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* ---- Background animé des cartes ---- */
.card-bg {
    position: absolute;
    inset: 0;
    background: center center / cover no-repeat;
    transition: opacity 0.35s ease;
    z-index: 0;
}

/* ---- Boutons navigation carte ---- */
.card-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 100%;
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    font-family: "Segoe UI Symbol", "Apple Symbols", "Arial", sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
}

.project-card:hover .card-nav {
    opacity: 1;
}

.card-nav:hover {
    background: var(--accent);
    color: #0f172a;
    border-color: var(--accent);
}

.card-nav--prev { left: 0.75rem; }
.card-nav--next { right: 0.75rem; }

/* ---- Indicateurs (dots) ---- */
.card-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 4;
    opacity: 1;
}

.card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.card-dot--active {
    background: var(--accent);
    transform: scale(1.3);
}

.project-card--soon::after {
    content: 'En cours';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-card--cta {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    justify-content: center;
    align-items: center;
}

.project-card--cta:hover {
    border-color: var(--accent);
    transform: none;
    box-shadow: none;
}

.project-card--cta .project-card__content,
.project-card--cta:hover .project-card__content {
    position: relative;
    inset: auto;
    transform: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-top: none !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
}

.project-card--cta .project-card__description {
    opacity: 1 !important;
    transform: none !important;
}

.project-card__cta-icon {
    font-size: 3rem;
    font-weight: 200;
    color: var(--accent);
    line-height: 1;
}

.project-card__cta-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 50px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-card__cta-link:hover {
    background: var(--accent);
    color: #0f172a;
}


/* ========== CONTACT SECTION ========== */
.contact {
    padding: 100px 5%;
    background: linear-gradient(135deg, rgba(10, 77, 122, 0.1) 0%, rgba(8, 145, 178, 0.1) 100%);
    position: relative;
}

.contact__container {
    max-width: 1200px;
    margin: 0 auto;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact__info-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-info-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.contact-info-item__icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-info-item__content {
    flex: 1;
}

.contact-info-item__label {
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.25rem;
}

.contact-info-item__link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-info-item__link:hover {
    color: var(--accent);
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field__label {
    font-weight: 600;
    color: var(--light);
}

.form-field__input,
.form-field__textarea {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-field__input:focus,
.form-field__textarea:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.1);
}

.form-field__textarea {
    resize: vertical;
    min-height: 150px;
}

/* ========== TERMINAL ANIMATION ========== */
.terminal {
    background: #0d1117;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: fadeInRight 1s ease;
    width: 100%;
}

.terminal__bar {
    background: #1c2128;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal__dot--red    { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green  { background: #28c840; }

.terminal__filename {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'Fira Code', 'Courier New', monospace;
}

.terminal__body {
    padding: 1.5rem;
    min-height: 320px;
}

.terminal__code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #e6edf3;
    white-space: pre;
    margin: 0;
}

/* Coloration syntaxique */
.t-keyword  { color: #ff7b72; }
.t-func     { color: #d2a8ff; }
.t-string   { color: #a5d6ff; }
.t-value    { color: #79c0ff; }
.t-comment  { color: #8b949e; font-style: italic; }
.t-prop     { color: #ffa657; }

/* Curseur clignotant */
.terminal__cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #58a6ff;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ========== FOOTER ========== */
.footer {
    padding: 2rem 5%;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__text {
    color: rgba(241, 245, 249, 0.7);
}

/* ========== PARTICLES BACKGROUND ========== */
.particles-background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .hero__container,
    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero__image-wrapper {
        order: -1;
    }

    .header__nav {
        gap: 1rem;
    }

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

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }

    .header__nav {
        gap: 0.5rem;
    }

    .header__link {
        font-size: 0.9rem;
    }

    .hero {
        padding: 100px 1rem 60px;
    }

    .hero__cta {
        flex-direction: column;
    }

    .project-card {
        height: 300px;
    }

    .contact,
    .projects {
        padding: 60px 1rem;
    }
}

/* ========== MOBILE : BOUTON "VOIR LE PROJET" ========== */
.card-see-more {
    display: none;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.card-see-more--active,
.card-see-more:active {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== MOBILE : BOTTOM SHEET ========== */
.card-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    display: none;
}

.card-sheet--open {
    transform: translateY(0);
}

.card-sheet__handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0.75rem auto 1rem;
}

.card-sheet__close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.card-sheet__close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.card-sheet__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.card-sheet__desc {
    font-size: 0.9rem;
    color: rgba(241, 245, 249, 0.8);
    line-height: 1.6;
}

/* ========== ACTIVATION MOBILE UNIQUEMENT ========== */
@media (max-width: 1024px) {
    .project-card {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(8, 145, 178, 0.16);
    }

    .project-card:active {
        transform: none;
        box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.22), 0 8px 24px rgba(8, 145, 178, 0.2);
    }

    /* Masquer les flèches, afficher le bouton et le sheet */
    .card-nav {
        display: none;
    }

    .card-see-more,
    .card-sheet {
        display: block;
    }

    /* Les dots remontent au-dessus du bouton */
    .card-dots {
        bottom: 3.5rem;
    }

    /* Désactiver le hover CSS (pas de survol sur mobile) */
    .project-card:hover .project-card__content {
        transform: translateY(calc(100% - 70px));
        background: rgba(10, 15, 30, 0.35);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-top: none;
    }

    .project-card:hover .project-card__description {
        opacity: 0;
        transform: translateY(10px);
    }
}

@media (max-width: 1024px) {
    .project-card__content {
        padding-bottom: 4rem; /* espace sous le titre pour le bouton */
        bottom: 3.5rem;
        padding-top: 0.75rem;
    }
    .project-card__title {
        font-size: 1.3rem;
    }
}