/* Pages "Nos réalisations" ketsu : fond bleu du site, blocs blancs, une seule palette */

:root {
    --bleu: #74D0F1;
    --encre: #1a1a2e;
    --rose: #ED228A;
    --ease: cubic-bezier(0.65, 0, 0.25, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Varela Round', sans-serif;
    color: #fff;
    line-height: 1.6;
    background: var(--bleu);
    overflow-x: hidden;
}

/* Décor : cercles flottants, écho de la pièce du site */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}
body::before {
    width: 48vmin;
    height: 48vmin;
    right: -14vmin;
    top: -12vmin;
    background: rgba(255, 255, 255, 0.16);
    animation: float-a 12s ease-in-out infinite alternate;
}
body::after {
    width: 36vmin;
    height: 36vmin;
    left: -12vmin;
    bottom: -10vmin;
    background: rgba(237, 34, 138, 0.22);
    animation: float-b 15s ease-in-out infinite alternate;
}
@keyframes float-a { to { transform: translate(-5vmin, 6vmin) scale(1.08); } }
@keyframes float-b { to { transform: translate(6vmin, -5vmin) scale(1.12); } }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0.9rem 1.4rem 2.4rem; }

/* En-tête compact : uniquement le retour au site, la page tient sans scroller */
header.page-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.8rem;
}

.back {
    color: #fff;
    text-decoration: none;
    border: 1.5px solid #fff;
    border-radius: 999px;
    padding: 0.35em 1em;
    font-size: 0.9rem;
    transition: background 200ms ease, color 200ms ease;
}
.back:hover { background: #fff; color: var(--encre); }

h1 {
    font-weight: 400;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    margin: 0;
    letter-spacing: 0.01em;
}
h1::after {
    content: "";
    display: block;
    width: 84px;
    height: 5px;
    border-radius: 3px;
    margin-top: 0.6rem;
    background: var(--rose);
    transform-origin: left center;
    animation: trait-grow 900ms var(--ease) 400ms backwards;
}
@keyframes trait-grow { from { transform: scaleX(0); } }

.subtitle {
    margin: 0.3rem 0 1rem;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    opacity: 0.92;
}

/* utilitaire accessibilité */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Rangée compétences : pastilles (desktop) ou menu déroulant (mobile) + CTA Gensai */
.comp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.1rem;
}

/* Menu déroulant (mobile uniquement) */
.competences-select { display: none; position: relative; flex: 1 1 auto; }
.competences-select select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--encre);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath d='M4 8l8 8 8-8' fill='none' stroke='%231a1a2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.9em center;
    border: 0;
    border-radius: 999px;
    padding: 0.55em 2.4em 0.55em 1.1em;
    box-shadow: 0 4px 14px rgba(11, 34, 73, 0.15);
    cursor: pointer;
}

/* Navigation entre les compétences (une seule palette, pas de couleur par catégorie) */
.competences-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.competences-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    padding: 0.35em 0.95em;
    transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}
.competences-nav a:hover { border-color: #fff; }
.competences-nav a.current {
    background: #fff;
    border-color: #fff;
    color: var(--encre);
}

/* Lien Gensai : pastille à la suite des compétences, couleurs Gensai (site externe) */
.gensai-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3em 0.95em;
    border-radius: 999px;
    background: linear-gradient(120deg, #0ABAB5, #12d3cd);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(10, 186, 181, 0.35);
    transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.gensai-cta img { width: 20px; height: 20px; object-fit: contain; border-radius: 50%; }
.gensai-cta .ext { font-size: 0.85em; opacity: 0.9; }
.gensai-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(10, 186, 181, 0.45); }

/* Slider en boucle : une carte au centre, une à gauche, une à droite */
.carousel { position: relative; }

.projects {
    position: relative;
    min-height: 520px;                 /* la hauteur suit la carte centrale (ajustée par JS) */
    transition: min-height 650ms var(--ease);
    overflow-x: clip;                  /* les cartes hors-champ ne créent jamais de scroll horizontal */
}

.project-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: min(48%, 620px);            /* carte centrale large pour montrer le texte */
    background: #fff;
    color: var(--encre);
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 24px rgba(11, 34, 73, 0.10);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.7);
    transition: transform 700ms var(--ease), opacity 550ms ease, box-shadow 550ms var(--ease);
    will-change: transform, opacity;
}

/* positions du slider */
.project-card.pos-center {
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
    transform: translateX(-50%) scale(1);
    box-shadow: 0 24px 52px rgba(11, 34, 73, 0.24);
}
.project-card.pos-left {
    opacity: 0.45;                      /* transparence des cartes latérales */
    pointer-events: auto;
    z-index: 2;
    transform: translateX(-128%) scale(0.78);
    cursor: pointer;
}
.project-card.pos-right {
    opacity: 0.45;
    pointer-events: auto;
    z-index: 2;
    transform: translateX(28%) scale(0.78);
    cursor: pointer;
}
.project-card.pos-hidden-left  { transform: translateX(-190%) scale(0.6); }
.project-card.pos-hidden-right { transform: translateX(90%) scale(0.6); }

/* texte complet uniquement au centre */
.project-card .desc {
    font-size: 0.9rem;
    margin: 0;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card.pos-center .desc {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
    overflow: visible;
}

/* animation douce du visuel de la carte centrale */
.project-card .thumb img { transition: transform 700ms var(--ease); }
.project-card.pos-center .thumb img {
    animation: thumb-live 9s ease-in-out infinite alternate;
}
@keyframes thumb-live {
    from { transform: scale(1); }
    to   { transform: scale(1.06); }
}

.project-card .thumb {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #e8f6fc, #d3edf8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    overflow: hidden;
}
.project-card .thumb span {
    font-size: 1.3rem;
    color: #3A8EBA;
}
.project-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease);
}
.project-card:hover .thumb img { transform: scale(1.05); }

.project-card .body { padding: 1.1rem 1.3rem 1.5rem; }
.project-card h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.4rem; }
.project-card .meta { margin: 0 0 0.7rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.project-card .mission {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--rose);
    background: rgba(237, 34, 138, 0.10);
    border-radius: 999px;
    padding: 0.2em 0.8em;
}
.project-card .annee {
    display: inline-block;
    font-size: 0.78rem;
    color: #556;
    background: rgba(11, 34, 73, 0.07);
    border-radius: 999px;
    padding: 0.2em 0.8em;
}

/* Logos de marque : affichés entiers, jamais rognés */
.project-card .thumb-logo { background: #fff; }
.project-card .thumb-logo img {
    object-fit: contain;
    width: 78%;
    height: 78%;
    margin: auto;
}
/* Flèches (même picto que la page d'accueil, tourné), position FIXE à l'écran */
.arrow {
    position: absolute;
    top: 210px;                /* ancrées, elles ne bougent pas quand la carte grandit */
    z-index: 5;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--encre);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(11, 34, 73, 0.22);
    transition: transform 200ms var(--ease);
}
.arrow:hover { transform: scale(1.12); }
.arrow-prev { left: -6px; }
.arrow-prev svg { transform: rotate(90deg); }
.arrow-next { right: -6px; }
.arrow-next svg { transform: rotate(-90deg); }

/* Sans JavaScript : liste verticale classique, tout visible */
html:not(.js) .projects { min-height: 0; }
html:not(.js) .project-card {
    position: static;
    opacity: 1;
    transform: none;
    width: 100%;
    max-width: 620px;
    margin: 0 auto 1.5rem;
    pointer-events: auto;
}
html:not(.js) .project-card .desc { -webkit-line-clamp: unset; line-clamp: unset; display: block; overflow: visible; }
html:not(.js) .arrow { display: none; }

/* Apparition fluide en cascade (classe .in ajoutée par projets.js).
   Sans JavaScript, tout reste visible : l'animation ne s'applique que si html.js.
   Les cartes projets gèrent leur transform via --lift/--sc (emphase centrale). */
html.js .reveal:not(.project-card) {
    opacity: 0;
    transform: translateY(34px) scale(0.97);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
    transition-delay: var(--d, 0ms);
}
html.js .reveal:not(.project-card).in {
    opacity: 1;
    transform: translateY(0) scale(1);
}
html.js .project-card.reveal:not(.in) { opacity: 0; }

/* Footer en blanc */
footer.page-foot {
    margin-top: 2.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255,255,255,0.35);
    font-size: 0.85rem;
    color: #fff;
    text-align: center;
}
footer.page-foot a { color: #fff; }

@media (max-width: 900px) {
    .project-card { width: min(62%, 520px); }
    .project-card.pos-left  { transform: translateX(-112%) scale(0.74); }
    .project-card.pos-right { transform: translateX(12%) scale(0.74); }
}
@media (max-width: 560px) {
    .project-card { width: 86%; }
    .project-card.pos-left  { transform: translateX(-104%) scale(0.7); }
    .project-card.pos-right { transform: translateX(4%) scale(0.7); }
    .arrow { top: 150px; width: 42px; height: 42px; }
    .arrow-prev { left: -4px; }
    .arrow-next { right: -4px; }
}

/* Mobile : le menu déroulant remplace les pastilles (gain de place pour les projets) */
@media (max-width: 767px) {
    .competences-nav { display: none; }
    .competences-select { display: block; }
    .gensai-cta { flex: 0 0 auto; }
    .comp-row { gap: 0.6rem; }
    .subtitle { display: none; }       /* redondant avec le menu déroulant */
    h1::after { margin-bottom: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    .project-card, .project-card .thumb img { transition: none; }
    body::before, body::after { animation: none; }
    h1::after { animation: none; }
}
