/* ECULAB Powersport — overrides minimaux + animations (le gros est dans Tailwind config) */

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: #0d1117;
    overflow-x: hidden;
}

/* Scrollbar dark theme */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #0d1117;
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 6px;
    border: 3px solid #0d1117;
}
::-webkit-scrollbar-thumb:hover {
    background: #6e7681;
}

::selection {
    background-color: rgba(255, 87, 34, 0.3);
    color: #e6edf3;
}

*:focus-visible {
    outline: 2px solid #FF5722;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   ANIMATIONS — scroll reveal, glow, circuit draw, ECU cube 3D
   ============================================================ */

/* --- Scroll reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }
.reveal-delay-6 { transition-delay: 0.48s; }

/* --- Tilt card --- */
.tilt-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
    transform-style: preserve-3d;
    will-change: transform;
}

/* --- Circuit background SVG --- */
.hero-circuit-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 75%);
}
.hero-circuit-bg path,
.hero-circuit-bg line {
    stroke: #e6edf3;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: circuit-draw 4s ease-out forwards;
}
.hero-circuit-bg path:nth-child(3n) { animation-delay: 0.3s; }
.hero-circuit-bg path:nth-child(3n+1) { animation-delay: 0.6s; }
.hero-circuit-bg path:nth-child(3n+2) { animation-delay: 0.9s; }
.hero-circuit-bg circle.node {
    fill: #FF5722;
    opacity: 0;
    animation: node-fade-in 0.6s ease-out forwards, node-pulse 2.5s ease-in-out infinite;
}
.hero-circuit-bg circle.node:nth-child(odd) { animation-delay: 2s, 2.6s; }
.hero-circuit-bg circle.node:nth-child(even) { animation-delay: 2.4s, 3s; }

@keyframes circuit-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes node-fade-in {
    to { opacity: 0.7; }
}
@keyframes node-pulse {
    0%, 100% { opacity: 0.4; r: 3; }
    50% { opacity: 1; r: 4; filter: drop-shadow(0 0 8px #FF5722); }
}

/* ============================================================
   PLANÈTE ECULAB — sphère 3D avec schéma électrique moto
   ============================================================ */
.planet-wrapper {
    position: relative;
    width: 420px;
    height: 420px;
    margin: 0 auto;
    perspective: 1000px;
}

/* Glow externe pulsé */
.planet-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.18) 0%, transparent 60%);
    animation: planet-glow-pulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes planet-glow-pulse {
    from { opacity: 0.6; transform: scale(0.95); }
    to   { opacity: 1;   transform: scale(1.05); }
}

/* La sphère elle-même */
.planet {
    position: absolute;
    inset: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        inset -30px -30px 80px rgba(0, 0, 0, 0.7),
        inset 20px 20px 50px rgba(255, 87, 34, 0.08),
        0 0 60px rgba(255, 87, 34, 0.25);
    background: radial-gradient(circle at 35% 30%, #2a1810 0%, #1c2128 40%, #0d1117 100%);
}

/* Surface qui défile horizontalement → illusion de rotation planétaire */
.planet-surface {
    position: absolute;
    inset: 0;
    width: 200%;
    height: 100%;
    animation: planet-spin 40s linear infinite;
}
@keyframes planet-spin {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Ombrage sphérique 3D (overlay) */
.planet-shading {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0.5) 0%, transparent 50%);
    pointer-events: none;
}

/* Anneaux orbitaux avec texte qui tourne */
.orbit-ring {
    position: absolute;
    inset: 0;
    transform-origin: center;
}
.orbit-ring text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    fill: #FF5722;
}
.orbit-1 { animation: orbit-spin 30s linear infinite; }
.orbit-2 { animation: orbit-spin 45s linear infinite reverse; }
.orbit-3 { animation: orbit-spin 60s linear infinite; }

.orbit-2 text { fill: #e6edf3; font-size: 10px; opacity: 0.7; }
.orbit-3 text { fill: #8b949e; font-size: 9px; opacity: 0.5; }

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Petites étoiles autour */
.planet-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.planet-stars .star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #e6edf3;
    border-radius: 50%;
    opacity: 0.6;
    animation: star-twinkle 3s ease-in-out infinite;
}
@keyframes star-twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.5); }
}

/* --- Signal wave (RPM line) --- */
.signal-wave path {
    stroke: #FF5722;
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    animation: signal-draw 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 6px rgba(255, 87, 34, 0.6));
}
@keyframes signal-draw {
    from { stroke-dashoffset: 1500; opacity: 0.4; }
    to   { stroke-dashoffset: 0; opacity: 1; }
}

/* --- Floating particles --- */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #FF5722;
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.2; }
    50% { transform: translateY(-40px) translateX(10px); opacity: 0.7; }
}

/* --- Hero gradient pulse --- */
.hero-glow {
    animation: glow-pulse 6s ease-in-out infinite alternate;
}
@keyframes glow-pulse {
    from { opacity: 0.4; transform: translate(-50%, 0) scale(1); }
    to   { opacity: 0.7; transform: translate(-50%, 0) scale(1.1); }
}

/* --- Marquee brands ticker --- */
.marquee {
    display: flex;
    overflow: hidden;
    user-select: none;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee-scroll 30s linear infinite;
    flex-shrink: 0;
    white-space: nowrap;
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --- Respect prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .ecu-3d { animation: none; }
    .marquee-track { animation: none; }
    .hero-circuit-bg path,
    .hero-circuit-bg line,
    .signal-wave path { animation: none; stroke-dashoffset: 0; }
    .hero-glow { animation: none; }
}
