/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.portfolio-hero {
    padding: 180px 6% 100px;
    text-align: center;
    background: radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.1), transparent 60%);
}
.portfolio-hero h1 { font-size: 3.8rem; margin-bottom: 20px; }
.portfolio-hero .lead { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* ══════════════════════════════════════════
   GRILLE DE PROJETS
══════════════════════════════════════════ */
.portfolio-grid-section {
    padding: 60px 6% 100px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── CARTE PROJET ── */
/* ➕ POUR AJOUTER UN PROJET : dupliquer cette carte et son .modal-overlay associé */
/* border-radius unique posé sur la carte + overflow:hidden : garantit un arrondi
   propre et uniforme sur les 4 coins, y compris pour le bloc image du haut. */
.project-card-thumb {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    display: flex;
    flex-direction: column;
}
.project-card-thumb:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px -16px rgba(37, 99, 235, 0.3);
    border-color: rgba(37, 99, 235, 0.4);
}

/* ── VISUEL DE COUVERTURE ── */
.card-media {
    position: relative;
    height: 180px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.card-media-icon {
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card-thumb:hover .card-media-icon {
    transform: scale(1.15) rotate(-4deg);
}
.card-media::after {
    /* léger voile en bas du visuel pour ancrer les badges qui chevauchent le bord */
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
    pointer-events: none;
}
.card-media-badges {
    position: absolute; top: 16px; left: 16px; right: 16px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
    z-index: 1;
}

/* Dégradés de couverture — un par projet, même famille de traitement (135deg, 2 teintes) */
.card-media-1 { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.card-media-2 { background: linear-gradient(135deg, #7c3aed, #db2777); }
.card-media-3 { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.card-media-4 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.card-media-5 { background: linear-gradient(135deg, #059669, #2563eb); }

.badge {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; padding: 5px 12px; border-radius: 20px;
    white-space: nowrap;
}
.badge-blue   { background: rgba(37, 99, 235, 0.12);  color: var(--secondary);  border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-green  { background: rgba(16, 185, 129, 0.12); color: #059669;            border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed;            border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-amber  { background: rgba(245, 158, 11, 0.12); color: #b45309;            border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-pink   { background: rgba(236, 72, 153, 0.12); color: #db2777;            border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-orange { background: rgba(234, 88, 12, 0.12);  color: #c2410c;            border: 1px solid rgba(234, 88, 12, 0.3); }
/* Sur le visuel coloré, les badges passent en verre dépoli clair pour rester lisibles
   quelle que soit la teinte du dégradé, en light comme en dark mode. */
.card-media-badges .badge {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ── CORPS DE CARTE ── */
.card-body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-feature-chip {
    align-self: flex-start;
    margin-bottom: 12px;
}
.project-card-thumb h3 {
    font-size: 1.15rem; font-weight: 700; color: var(--text-white);
    margin-bottom: 8px; line-height: 1.35;
}
.card-body > p {
    font-size: 0.875rem; color: var(--text-muted);
    margin-bottom: 12px; flex-grow: 1;
}
.card-location {
    font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 18px; display: flex; align-items: center; gap: 6px;
}
.card-location i { color: var(--primary); font-size: 0.75rem; }

/* Stack + CTA en bas de carte */
.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: auto;
}
.card-stack-tags {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.tool-tag {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
}
.card-cta {
    font-size: 0.85rem; font-weight: 700;
    color: var(--secondary);
    display: flex; align-items: center; gap: 8px;
    transition: gap 0.2s, color 0.2s;
}
.project-card-thumb:hover .card-cta { gap: 12px; color: var(--primary); }

/* ── PLACEHOLDER CARTE ── */
.project-placeholder {
    cursor: default;
    opacity: 0.55;
    pointer-events: none;       /* non cliquable */
}
.project-placeholder:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}
.badge-soon {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px; border-radius: 20px;
    display: inline-block; margin-bottom: 14px;
}

/* ══════════════════════════════════════════
   MODAL — OVERLAY
══════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}
.modal-overlay.is-open {
    display: flex;
    animation: modalFadeIn 0.25s ease forwards;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── MODAL — CONTENU ── */
.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 24px;
    width: 100%;
    max-width: 880px;
    position: relative;
    box-shadow: 0 30px 80px -20px var(--shadow-color);
    animation: modalScaleUp 0.25s ease forwards;
    flex-shrink: 0;
}
@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── BOUTON FERMER ── */
.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted);
    font-size: 0.9rem; transition: all 0.2s;
    z-index: 10;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.1); color: #dc2626; border-color: rgba(239, 68, 68, 0.3); }

/* ── MODAL — EN-TÊTE ── */
.modal-header {
    padding: 44px 48px 32px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header-badges {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 20px;
}
.modal-header h2 {
    font-size: 2rem; color: var(--text-white); margin-bottom: 6px; line-height: 1.2;
}
.modal-header-subtitle {
    font-size: 0.95rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 7px; margin-bottom: 22px;
}
.modal-header-subtitle i { color: var(--primary); font-size: 0.8rem; }
.modal-header-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.demo-note {
    font-size: 0.75rem; color: var(--text-muted);
    font-style: italic;
    display: flex; align-items: center; gap: 5px;
}

/* ── MODAL — BODY ── */
.modal-body { padding: 0 48px; }

.modal-section { padding: 36px 0; border-bottom: 1px solid var(--border-color); }
.modal-section:last-child { border-bottom: none; }
.modal-section-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── MÉTRIQUES ── */
.modal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    transition: 0.3s;
}
.metric-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}
.metric-value {
    font-size: 1.9rem; font-weight: 800; color: var(--text-white);
    line-height: 1.1; margin-bottom: 8px;
}
.metric-value .metric-accent { color: var(--secondary); }
.metric-label { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }

/* ── AVANT / APRÈS (PSR) ── */
.modal-psr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.psr-block {
    border-radius: 16px;
    padding: 28px 22px;
    border-left: 4px solid transparent;
}
.psr-block-problem  { background: rgba(239, 68, 68, 0.05);  border-left-color: #ef4444; }
.psr-block-solution { background: rgba(37, 99, 235, 0.05);  border-left-color: var(--primary); }
.psr-block-result   { background: rgba(16, 185, 129, 0.05); border-left-color: #10b981; }

.psr-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; margin-bottom: 14px;
}
.psr-block-problem  .psr-icon { background: rgba(239, 68, 68, 0.12);  color: #dc2626; }
.psr-block-solution .psr-icon { background: rgba(37, 99, 235, 0.12);  color: var(--secondary); }
.psr-block-result   .psr-icon { background: rgba(16, 185, 129, 0.12); color: #059669; }

.psr-title { font-size: 1rem; font-weight: 700; color: var(--text-white); margin-bottom: 14px; }
.psr-list  { list-style: none; padding: 0; margin: 0; }
.psr-list li {
    font-size: 0.84rem; color: var(--text-muted);
    padding: 6px 0; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}
.psr-list li:last-child { border-bottom: none; }
.psr-block-problem  .psr-list li::before { content: '×'; color: #dc2626;         font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.psr-block-solution .psr-list li::before { content: '→'; color: var(--secondary); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.psr-block-result   .psr-list li::before { content: '✓'; color: #059669;         font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── STACK TECHNIQUE ── */
.modal-stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.stack-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    transition: 0.3s;
}
.stack-card:hover { border-color: rgba(37, 99, 235, 0.35); transform: translateY(-4px); }
.stack-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(37, 99, 235, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--secondary);
    margin: 0 auto 12px;
}
.stack-name { font-size: 0.9rem; font-weight: 700; color: var(--text-white); margin-bottom: 6px; }
.stack-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; margin: 0; }

/* ── FLUX AUTOMATISÉ ── */
.modal-flow {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(37, 99, 235, 0.3) transparent;
}
.flow-step {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-white);
    text-align: center;
    min-width: 130px;
    max-width: 150px;
    flex-shrink: 0;
    line-height: 1.4;
}
.flow-step-num {
    display: block;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
    color: var(--secondary); text-transform: uppercase;
    margin-bottom: 4px;
}
.flow-arrow {
    color: var(--secondary); font-size: 1rem;
    padding: 0 10px; flex-shrink: 0;
}

/* ── MODAL — FOOTER ── */
.modal-footer {
    padding: 28px 48px 40px;
    display: flex; flex-wrap: wrap; gap: 14px;
}

/* ── COMPARATIF OFFRES ── */
.compare-block {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 18px;
    padding: 28px 28px 22px;
}
.compare-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #7c3aed; margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
}
.compare-title i { font-size: 0.9rem; }
.compare-row {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}
.compare-row:last-child { border-bottom: none; padding-bottom: 0; }
.compare-label {
    min-width: 200px; font-size: 0.85rem; font-weight: 600; color: var(--text-white);
}
.compare-label span { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.compare-features {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1;
}
.compare-feat {
    font-size: 0.78rem; color: var(--text-muted);
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 20px; padding: 3px 10px;
}
.compare-feat-new {
    font-size: 0.78rem; font-weight: 700; color: #c2410c;
    background: rgba(234, 88, 12, 0.1); border: 1px solid rgba(234, 88, 12, 0.28);
    border-radius: 20px; padding: 3px 10px;
    display: flex; align-items: center; gap: 5px;
}
.compare-feat-new::before { content: '✦'; font-size: 0.65rem; }

/* ══════════════════════════════════════════
   CTA FINAL
══════════════════════════════════════════ */
.portfolio-cta {
    padding: 100px 6%;
    text-align: center;
    background: linear-gradient(160deg, var(--bg-dark) 0%, rgba(37, 99, 235, 0.06) 50%, var(--bg-dark) 100%);
    border-top: 1px solid rgba(37, 99, 235, 0.12);
    position: relative;
    overflow: hidden;
}
.portfolio-cta::before {
    content: ''; position: absolute;
    top: -50%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
    pointer-events: none;
}
.portfolio-cta-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.portfolio-cta h2 { font-size: 2.6rem; margin-bottom: 16px; }
.portfolio-cta p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .portfolio-hero h1 { font-size: 2.4rem; }
    .portfolio-hero { padding: 150px 5% 70px; }
    .projects-grid { grid-template-columns: 1fr; }
    .modal-header  { padding: 44px 24px 28px; }
    .modal-body    { padding: 0 24px; }
    .modal-footer  { padding: 24px 24px 36px; }
    .modal-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-psr-grid     { grid-template-columns: 1fr; }
    .modal-stack-grid   { grid-template-columns: repeat(2, 1fr); }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-content {
        border-radius: 24px 24px 0 0;
        max-height: 95vh;
        overflow-y: auto;
    }
    .portfolio-cta h2 { font-size: 2rem; }
}
@media (max-width: 479px) {
    .modal-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-stack-grid   { grid-template-columns: repeat(2, 1fr); }
    .modal-header h2    { font-size: 1.5rem; }
}
