/* Mode Caméléon — styles chargés avec cameleon.js ; sans effet tant que le mode est inactif. */

.cam-toggle {
    display: inline-flex; align-items: center; gap: 0.6rem;
    margin-left: auto; margin-right: 1.25rem;
    padding: 0.45rem 0.85rem;
    background: transparent;
    border: 1px solid var(--glass-border-hover);
    border-radius: 999px;
    color: var(--text-primary);
    font-family: var(--font-mono); font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.cam-toggle:hover, .cam-toggle:focus-visible { border-color: var(--accent); color: #fff; outline: none; }
.cam-switch {
    position: relative; width: 30px; height: 16px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.12); transition: background 0.3s;
}
.cam-switch span {
    position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--text-primary); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cam-toggle.on { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-glow); }
.cam-toggle.on .cam-switch { background: var(--accent); }
.cam-toggle.on .cam-switch span { transform: translateX(14px); background: #fff; }

/* Portes de profil */
.cam-doors {
    position: fixed; inset: 0; z-index: 3000;
    display: grid; place-items: center; padding: 1.5rem;
    background: rgba(2, 4, 10, 0.72); backdrop-filter: blur(10px);
    animation: cam-fade 0.25s ease-out;
}
.cam-doors[hidden] { display: none; }
.cam-doors-panel {
    position: relative; width: min(920px, 100%); max-height: calc(100vh - 3rem); overflow: auto;
    padding: 2.5rem; border-radius: 16px; border: 1px solid var(--glass-border-hover);
    background: rgba(10, 15, 26, 0.92);
    animation: cam-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cam-kicker { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.5rem; }
.cam-doors h2 { font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); color: #fff; margin: 0 0 0.6rem; }
.cam-sub { color: var(--text-muted); margin: 0 0 1.75rem; max-width: 60ch; }
.cam-door-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cam-door {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; text-align: left;
    padding: 1.4rem; border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--glass-border-hover);
    color: var(--text-primary); font-family: var(--font-body);
    transition: var(--transition-smooth);
}
.cam-door i { width: 28px; height: 28px; color: var(--accent); }
.cam-door strong { font-family: var(--font-heading); font-size: 1.1rem; color: #fff; }
.cam-door span { color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }
.cam-door:hover, .cam-door:focus-visible {
    outline: none; transform: translateY(-4px);
    border-color: var(--accent); box-shadow: 0 12px 40px -10px var(--accent-glow);
}
.cam-guess {
    margin-top: 1.25rem; display: inline-flex; align-items: center; gap: 0.5rem;
    background: none; border: none; color: var(--gold); cursor: pointer;
    font-family: var(--font-mono); font-size: 0.85rem; padding: 0.5rem 0;
}
.cam-guess i { width: 16px; height: 16px; }
.cam-guess:hover, .cam-guess:focus-visible { text-decoration: underline; outline: none; }
.cam-close {
    position: absolute; top: 1rem; right: 1rem; width: 40px; height: 40px;
    display: grid; place-items: center; border-radius: 50%;
    background: none; border: 1px solid transparent; color: var(--text-muted); cursor: pointer;
}
.cam-close:hover, .cam-close:focus-visible { border-color: var(--glass-border-hover); color: #fff; outline: none; }

/* Bandeau du profil actif */
.cam-bar {
    position: fixed; left: 50%; bottom: 3.25rem; transform: translateX(-50%); z-index: 1500;
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.55rem 0.6rem 0.55rem 1rem; border-radius: 999px;
    background: rgba(10, 15, 26, 0.9); border: 1px solid var(--accent);
    box-shadow: 0 10px 40px -10px var(--accent-glow); backdrop-filter: blur(12px);
    color: var(--text-primary); font-size: 0.88rem; white-space: nowrap;
    animation: cam-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cam-bar[hidden] { display: none; }
.cam-bar i { width: 16px; height: 16px; color: var(--accent); }
.cam-bar button, .cam-tip button {
    padding: 0.4rem 0.8rem; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border-hover);
    color: var(--text-primary); font-size: 0.8rem; font-family: var(--font-body);
}
.cam-bar button:hover, .cam-bar button:focus-visible, .cam-tip button:hover { border-color: var(--accent); outline: none; }

/* Suggestion d'adaptation */
.cam-tip {
    position: fixed; right: 1.5rem; bottom: 7rem; z-index: 1500; max-width: 340px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
    padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid var(--gold);
    background: rgba(10, 15, 26, 0.94); color: var(--text-primary); font-size: 0.9rem;
    animation: cam-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cam-tip span { flex-basis: 100%; }

/* Blocs propres à un profil */
.cam-block { padding-top: 6rem; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.cam-card {
    display: flex; flex-direction: column; gap: 0.6rem; padding: 1.6rem; border-radius: 12px;
    color: var(--text-primary); text-decoration: none; transition: var(--transition-smooth);
}
.cam-card i { width: 26px; height: 26px; color: var(--accent); }
.cam-card h4 { font-family: var(--font-heading); font-size: 1.15rem; color: #fff; margin: 0; }
.cam-card p { color: var(--text-muted); margin: 0; line-height: 1.6; flex: 1; }
.cam-example { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); }
.cam-app:hover, .cam-app:focus-visible { transform: translateY(-4px); border-color: var(--accent); outline: none; }
.cam-steps {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2rem;
    color: var(--text-muted); font-size: 0.92rem;
}
.cam-steps div { padding: 1rem; border-left: 2px solid var(--accent); background: rgba(255, 255, 255, 0.02); }
.cam-steps strong { color: var(--accent); margin-right: 0.3rem; }
.cam-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.cam-note { margin-top: 0.8rem; color: var(--text-muted); font-size: 0.88rem; max-width: 60ch; }

/* Transition de recomposition (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; }

@keyframes cam-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cam-rise { from { opacity: 0; transform: translate(var(--tx, 0), 12px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.cam-bar { --tx: -50%; }

@media (max-width: 900px) {
    .cam-door-list, .cam-steps { grid-template-columns: 1fr; }
    .cam-doors-panel { padding: 1.75rem 1.25rem; }
}
@media (max-width: 768px) {
    .cam-toggle { margin-right: 0.5rem; padding: 0.4rem 0.6rem; }
    .cam-toggle-text { font-size: 0.72rem; }
    .cam-bar { bottom: 3.75rem; font-size: 0.8rem; max-width: calc(100vw - 1.5rem); }
    .cam-tip { left: 0.75rem; right: 0.75rem; max-width: none; bottom: 8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cam-doors, .cam-doors-panel, .cam-bar, .cam-tip { animation: none; }
    .cam-door:hover, .cam-app:hover { transform: none; }
}

/* ── Transformation visible : thème de couleur par profil ─────────────────── */
body[data-cameleon="client"] { --accent: #f59e0b; --accent-glow: rgba(245, 158, 11, 0.35); --cam-tint: rgba(245, 158, 11, 0.16); }
body[data-cameleon="entreprise"] { --accent: #818cf8; --accent-glow: rgba(129, 140, 248, 0.35); --cam-tint: rgba(129, 140, 248, 0.16); }
body[data-cameleon="utilisateur"] { --accent: #10b981; --accent-glow: rgba(16, 185, 129, 0.35); --cam-tint: rgba(16, 185, 129, 0.16); }
body[data-cameleon] .bg-gradient-overlay {
    background: radial-gradient(ellipse at 75% 30%, var(--cam-tint) 0%, transparent 55%),
                radial-gradient(ellipse at 10% 90%, var(--cam-tint) 0%, transparent 45%);
    transition: background 0.8s;
}
body[data-cameleon] .shimmer-text {
    background-image: linear-gradient(90deg, var(--text-primary) 0%, var(--accent) 50%, var(--text-primary) 100%);
}
body[data-cameleon] .btn-primary { background: var(--accent); border-color: var(--accent); color: #05070d; font-weight: 600; }
body[data-cameleon] .hero-tagline { color: var(--text-primary); }

/* Premier écran en deux colonnes : présentation + sélection du profil */
body[data-cameleon] #home {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center;
    padding: 7rem 6% 4rem;
}
body[data-cameleon] .hero-content { max-width: none; }
body[data-cameleon] .hero-name { font-size: clamp(2.4rem, 5vw, 4.2rem); }
body[data-cameleon] .hero-desc { margin-bottom: 2rem; }
.cam-stage { position: relative; z-index: 2; animation: cam-stage-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cam-stage-title { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }

.cam-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.cam-shots .cam-shot:first-child { grid-column: 1 / -1; }
.cam-shot {
    position: relative; display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 10;
    border: 1px solid var(--glass-border-hover); background: #0a0f1a; text-decoration: none;
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
    animation: cam-stage-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.3s;
}
.cam-shot:nth-child(2) { animation-delay: 0.08s; }
.cam-shot:nth-child(3) { animation-delay: 0.16s; }
.cam-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 0.6s; }
.cam-shot:hover, .cam-shot:focus-visible { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 20px 60px -15px var(--accent-glow); outline: none; }
.cam-shot:hover img { transform: scale(1.04); }
.cam-shot-label {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 0.9rem 1rem 0.75rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    background: linear-gradient(to top, rgba(2, 4, 10, 0.95), rgba(2, 4, 10, 0));
}
.cam-shot-label strong { color: #fff; font-family: var(--font-heading); font-size: 1rem; }
.cam-shot-label em { color: var(--accent); font-style: normal; font-family: var(--font-mono); font-size: 0.75rem; }

.cam-proofs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.cam-proof {
    display: flex; flex-direction: column; gap: 0.2rem; padding: 1.25rem 1.3rem; border-radius: 12px;
    background: rgba(255, 255, 255, 0.025); border: 1px solid var(--glass-border-hover);
    animation: cam-stage-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cam-proof:nth-child(2) { animation-delay: 0.08s; }
.cam-proof:nth-child(3) { animation-delay: 0.16s; }
.cam-proof:nth-child(4) { animation-delay: 0.24s; }
.cam-proof-n { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.cam-proof strong { color: #fff; font-size: 0.98rem; }
.cam-proof span:last-child { color: var(--text-muted); font-size: 0.85rem; }
.cam-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.cam-chips span {
    padding: 0.35rem 0.75rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--text-primary); border: 1px solid var(--glass-border-hover); background: rgba(255, 255, 255, 0.03);
}

/* Balayage de couleur pendant la transformation */
.cam-wash {
    position: fixed; inset: 0; z-index: 2500; pointer-events: none;
    animation: cam-wash 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.cam-wash-client { background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.55), rgba(2, 4, 10, 0.95) 70%); }
.cam-wash-entreprise { background: radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.55), rgba(2, 4, 10, 0.95) 70%); }
.cam-wash-utilisateur { background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.55), rgba(2, 4, 10, 0.95) 70%); }
@keyframes cam-wash {
    0% { clip-path: circle(0% at 50% 50%); opacity: 1; }
    45% { clip-path: circle(80% at 50% 50%); opacity: 1; }
    100% { clip-path: circle(80% at 50% 50%); opacity: 0; }
}
@keyframes cam-stage-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1024px) {
    body[data-cameleon] #home { grid-template-columns: 1fr; gap: 2rem; padding-top: 6.5rem; }
}
@media (max-width: 640px) {
    .cam-shots { grid-template-columns: 1fr 1fr; }
    .cam-proofs { grid-template-columns: 1fr 1fr; }
    .cam-proof-n { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cam-stage, .cam-shot, .cam-proof { animation: none; }
}

/* Section « Services » de la page classique : un profil Caméléon actif affiche ses propres blocs. */
body[data-cameleon] #services { display: none; }
