/**
 * KAEJ - Landing Page Styles
 * Automatisation pour PME
 */

:root {
    --mouse-x: 50%;
    --mouse-y: 50%;
}

html {
    scroll-padding-top: 100px;
}

body {
    background: linear-gradient(to bottom, #0f172a 0%, #020617 100%);
    background-attachment: fixed;
    color: #94a3b8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- TEXTURE & SPOTLIGHT --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.spotlight-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.03), transparent 40%);
}

/* --- CARDS --- */
.glow-card,
.price-box,
.bio-glass,
.calc-panel {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 5px rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glow-card::before,
.price-box::before,
.bio-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.15), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.glow-card:hover::before,
.price-box:hover::before,
.bio-glass:hover::before {
    opacity: 1;
}

.glow-card:hover,
.price-box:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px -10px rgba(59, 130, 246, 0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #64748B;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.glow-card:hover .card-icon {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    transform: scale(1.1) rotate(-3deg);
}

/* --- TERMINAL --- */
.terminal-window {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%;
    max-width: 800px;
    position: relative;
}

.nav-active {
    color: #fff !important;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transition: text-shadow 0.3s;
}

/* --- ANIMATIONS --- */
.api-flow {
    position: relative;
    height: 50px;
    margin-top: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.api-node {
    width: 28px;
    height: 28px;
    background: #222;
    border-radius: 4px;
    border: 1px solid #444;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 10px;
}

.api-line {
    position: absolute;
    left: 30px;
    right: 30px;
    top: 50%;
    height: 1px;
    background: #333;
    z-index: 1;
}

.api-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #3B82F6;
    border-radius: 50%;
    box-shadow: 0 0 10px #3B82F6;
    top: 50%;
    transform: translateY(-50%);
    animation: flowMove 2s infinite linear;
}

@keyframes flowMove {
    0% { left: 30px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: calc(100% - 36px); opacity: 0; }
}

.ia-scan-ui {
    height: 60px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-beam {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #8B5CF6;
    box-shadow: 0 0 15px #8B5CF6;
    top: 0;
    animation: scanMove 2.5s infinite ease-in-out;
}

@keyframes scanMove {
    0% { top: 0; opacity: 0.5; }
    50% { top: 100%; opacity: 1; }
    100% { top: 0; opacity: 0.5; }
}

/* --- VISUALS --- */
.excel-ui {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.fx-bar {
    background: #252526;
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
}

.excel-grid {
    display: grid;
    grid-template-columns: 20px 1fr 1fr;
}

.cell {
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 4px;
    color: #ccc;
    text-align: center;
}

.cell.head {
    background: #333;
    color: #fff;
    font-weight: bold;
}

.cell.active {
    border: 2px solid #10B981;
    position: relative;
}

.ds-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    margin-top: 20px;
}

.ds-cell {
    height: 12px;
    background: #334155;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.ds-cell.filled {
    background: #10b981;
    border-color: #059669;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
    transition: background 0.1s;
}

/* Workflow */
.wf-item {
    position: relative;
    padding: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.wf-item:hover {
    border-left-color: #3B82F6;
    background: rgba(255, 255, 255, 0.03);
}

.wf-dot {
    position: absolute;
    left: -5px;
    top: 24px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #020617;
    border: 2px solid #333;
    transition: 0.3s;
}

.wf-item:hover .wf-dot {
    background: #3B82F6;
    border-color: #3B82F6;
    box-shadow: 0 0 10px #3B82F6;
}

.wf-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    position: absolute;
    right: 10px;
    top: 0;
    pointer-events: none;
    transition: 0.3s;
}

.wf-item:hover .wf-number {
    color: #ffffff;
    transform: translateY(-5px);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Bio */
.bio-glass {
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.avatar-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 24px;
    padding: 3px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: 0.5s;
}

.bio-glass:hover .avatar-img {
    filter: grayscale(0%);
}

/* Calculator */
.calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #334155;
    border-radius: 5px;
    outline: none;
    margin-top: 10px;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3B82F6;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Bar Animation */
.bar-human {
    width: 0%;
    transition: none;
    will-change: width;
}

.bar-human.animate {
    width: 100%;
    transition: width 6s linear;
}

.bar-agent {
    width: 0%;
    transition: none;
    will-change: width;
}

.bar-agent.animate {
    width: 100%;
    transition: width 2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Navigation visible par défaut */
.nav-container {
    transform: translateY(0);
    transition: transform 0.8s;
}

/* Contenu visible par défaut */
#main-content {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    pointer-events: all;
    transition: all 1s;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.code-line {
    margin-bottom: 4px;
    display: block;
    min-height: 1.4em;
}

.cursor-blink {
    display: inline-block;
    width: 6px;
    height: 14px;
    background: #3B82F6;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --- MOBILE MENU SLIDE-DOWN --- */
#mobile-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    transform: translateY(-150%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

#mobile-menu.open {
    transform: translateY(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.mobile-link {
    font-size: 1rem;
    color: #cbd5e1;
    font-weight: 500;
    padding: 0.75rem 0;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.2s;
}

.mobile-link:hover {
    color: #3b82f6;
}

/* Section ROI - même fond que le reste */
.roi-section {
    background: transparent;
}

/* --- ACCESSIBILITÉ --- */

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #3B82F6;
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
    .bio-glass {
        padding: 24px 16px;
    }
    .wf-number {
        font-size: 2rem;
    }
    .terminal-window {
        max-width: 100%;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .bar-human.animate,
    .bar-agent.animate { transition: none !important; width: 100% !important; }
}
