/* Version immersive de la page d'accueil (test) : cartes empilées au scroll, fond qui change de couleur,
   barre de progression. Tout est facultatif : sans ce fichier, la page reste la page d'accueil normale. */

@property --glow {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(0, 0, 0, 0);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #bf953f, #fbf5b7, #bf953f);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
    z-index: 1000;
    pointer-events: none;
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 78% 35%, var(--glow), transparent 70%),
        radial-gradient(ellipse 45% 40% at 15% 85%, var(--glow), transparent 70%);
    transition: --glow 0.9s ease;
}

@media (prefers-reduced-motion: no-preference) {
    /* Tablette et téléphone : pas d'empilement (cartes trop hautes), mais une carte « au point » :
       celle qui occupe le centre de l'écran est nette et pleine taille, les autres reculent. */
    .immersif .project-card {
        transform-origin: 50% 50%;
        will-change: scale;
        transition: transform 0.5s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, opacity 0.8s cubic-bezier(0.5, 0, 0, 1);
    }

    .immersif .showcase-grid.stacking {
        gap: 28px;
        padding-bottom: 12vh;
    }

    .immersif .showcase-grid.stacking .project-card {
        position: sticky;
        top: calc(24px + var(--i, 0) * 16px);
        transform-origin: 50% 0;
        will-change: scale;
        /* pas de transition sur scale/filter : ils suivent le scroll image par image */
        transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, opacity 0.8s cubic-bezier(0.5, 0, 0, 1);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
        background: rgba(10, 14, 26, 0.92);
    }

    .immersif header {
        will-change: opacity, transform;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress { display: none; }
    .ambient { transition: none; }
}

/* Tablette étroite (iPad mini, 600-768 px) : même mise en page que l'iPad Pro, carte à l'horizontale
   (icône à gauche, texte à droite), au lieu de la carte en colonne du portail. */
@media (min-width: 600px) and (max-width: 768px) {
    .immersif .project-card {
        flex-direction: row;
        min-height: 230px;
    }

    .immersif .card-visual {
        width: 240px;
        min-width: 240px;
        height: auto;
        border-radius: 20px 0 0 20px;
    }

    .immersif .card-visual::after {
        display: block;
    }

    .immersif .card-body {
        padding: 22px 22px;
    }

    .immersif .card-features {
        grid-template-columns: 1fr 1fr;
    }

    .immersif .card-footer-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Téléphone : cartes en colonne, l'icône s'affiche en entier (au lieu d'une bande rognée) */
@media (max-width: 599px) {
    .immersif .card-visual {
        height: clamp(200px, 48vw, 300px);
    }

    .immersif .card-visual .card-screenshot {
        object-fit: contain;
        object-position: center;
        padding: 14px 0;
        border-radius: 0;
    }
}

/* Tablette (600-1100 px) : en-tête et quatre arguments plus compacts, pour arriver plus vite aux applis */
@media (min-width: 600px) and (max-width: 1100px) {
    .immersif header {
        padding: 28px 20px 16px;
    }

    .immersif .header-logo {
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }

    .immersif header h1 {
        font-size: 3rem;
        margin-bottom: 14px;
    }

    .immersif header p {
        font-size: 1rem;
    }

    .immersif .value-proposition {
        grid-template-columns: 1fr 1fr;
        gap: 10px 18px;
        margin-bottom: 28px;
    }

    .immersif .value-card {
        display: grid;
        grid-template-columns: 44px 1fr;
        column-gap: 14px;
        align-items: start;
        text-align: left;
        padding: 10px 6px;
    }

    .immersif .value-card i {
        grid-row: 1 / span 2;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    .immersif .value-card h4 {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .immersif .value-card p {
        font-size: 0.8rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .immersif .value-proposition {
        gap: 2px 18px;
        margin-bottom: 18px;
    }

    /* Encart « Nouveau pour la rentrée » : deux offres côte à côte, texte réduit à l'essentiel */
    .immersif .offer-block {
        padding: 18px 20px;
        margin-bottom: 20px;
    }

    .immersif .offer-block > h2 {
        font-size: 1.25rem;
        margin-bottom: 4px !important;
    }

    .immersif .offer-block > p {
        font-size: 0.85rem;
        margin-bottom: 12px !important;
    }

    .immersif .offer-grid {
        flex-wrap: nowrap !important;
        gap: 12px !important;
    }

    .immersif .offer-card {
        min-width: 0 !important;
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }

    .immersif .offer-card h3 {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
    }

    .immersif .offer-card p {
        font-size: 0.8rem;
        margin-bottom: 6px !important;
        line-height: 1.4;
    }

    .immersif .offer-card p:nth-of-type(2) {
        font-size: 1.15rem !important;
        margin-bottom: 8px !important;
    }

    .immersif .offer-note {
        display: none;
    }

    .immersif .offer-card .btn-contact {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }
}

/* ---------- Accessibilité (audit) ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

/* Les quatre arguments sont des titres de niveau 2 (pas de saut de niveau après le h1), même aspect qu'avant */
.value-card h2 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 700;
}

@media (min-width: 600px) and (max-width: 1100px) {
    .immersif .value-card h2 {
        font-size: 1rem;
        margin-bottom: 4px;
    }
}

/* Contraste : sous-titres des cartes (4,2:1 -> plus de 4,5:1) */
.card-subtitle {
    color: #a8b6c9;
}

.tag {
    font-size: 0.75rem;
}

/* Zones tactiles d'au moins 44 px */
.btn-contact,
.cookie-btn {
    min-height: 44px;
}

footer a {
    display: inline-block;
    padding: 14px 6px;
    margin: -14px -6px;
}

/* Focus clavier visible */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid #fbf5b7;
    outline-offset: 3px;
    border-radius: 12px;
}

/* ---------- Filtres par champ d'apprentissage ---------- */
.ca-filter {
    display: none;
    margin: 0 0 22px;
}

.immersif .ca-filter {
    display: block;
}

.ca-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ca-btn {
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ca-btn b {
    color: var(--accent-gold);
    margin-right: 4px;
}

.ca-btn:hover {
    border-color: rgba(212, 175, 55, 0.5);
    color: #fff;
}

.ca-btn[aria-pressed="true"] {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #0c121c;
    font-weight: 700;
}

.ca-btn[aria-pressed="true"] b {
    color: #0c121c;
}

.ca-status {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 1.3em;
}

.tag.tag-ca {
    background: rgba(212, 175, 55, 0.14);
    color: #f1d77a;
    font-weight: 700;
}

.ca-btn:disabled,
.ca-btn.is-empty {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
}

.ca-btn:disabled:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.14);
}

/* Tablette et téléphone : tous les champs sur une seule ligne (défilement latéral si l'écran est vraiment étroit) */
@media (max-width: 1100px) {
    .ca-filter-row {
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 2px 2px 6px;
    }

    .ca-filter-row::-webkit-scrollbar {
        display: none;
    }

    .ca-btn {
        flex: 0 0 auto;
        padding: 8px 11px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .ca-btn b {
        margin-right: 3px;
    }
}

@media (min-width: 700px) and (max-width: 1100px) {
    .ca-filter-row {
        justify-content: center;
    }
}

.ca-filter {
    max-width: 100%;
}

/* La ligne de boutons ne doit pas élargir la page : largeur nulle au calcul, 100 % à l'affichage */
.ca-filter-row {
    width: 0;
    min-width: 100%;
}

.immersif .project-card {
    filter: none !important;
}

/* iPad mini et tablettes étroites : un peu plus serré pour que les six champs tiennent sans défilement */
@media (min-width: 600px) and (max-width: 800px) {
    .ca-filter-row {
        gap: 4px;
    }

    .ca-btn {
        padding: 8px 8px;
        font-size: 0.76rem;
    }
}
