/**
 * ==================== ORGANIC & DISPROPORTIONATE DESIGN ====================
 * 
 * Ce système de design brise les formes rectangulaires classiques pour
 * introduire des courbes asymétriques, des angles inattendus et des
 * effets de flou cinétique (motion blur) au survol.
 * 
 * =========================================================================== */

:root {
    --organic-radius-1: 30% 70% 70% 30% / 30% 30% 70% 70%;
    --organic-radius-2: 50% 50% 20% 80% / 25% 80% 20% 75%;
    --organic-radius-3: 67% 33% 47% 53% / 37% 20% 80% 63%;
    --blood-glow: 0 0 20px rgba(139, 0, 0, 0.4);
    --motion-blur: blur(4px);
}

/* --- Barre de Navigation Organique --- */
.nav-organic {
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
    border-radius: 0 0 40px 10px / 0 0 20px 50px;
    margin: 0 10px;
    padding: 0.5rem 2rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-organic:hover {
    border-radius: 0 0 20px 40px / 0 0 50px 20px;
    border-bottom-color: rgba(139, 0, 0, 0.5);
}

/* --- Boutons Asymétriques --- */
.btn-organic {
    position: relative;
    padding: 0.75rem 1.5rem;
    background: #0d0d0d;
    color: #fff;
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: var(--organic-radius-1);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.btn-organic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.2), transparent);
    transition: 0.5s;
}

.btn-organic:hover {
    border-radius: var(--organic-radius-2);
    box-shadow: var(--blood-glow);
    transform: translateY(-2px) scale(1.02);
    border-color: #8B0000;
}

.btn-organic:hover::before {
    left: 100%;
}

.btn-organic:hover span {
    filter: var(--motion-blur);
    animation: motion-shake 0.3s infinite;
}

/* --- Cartes Produits Organiques --- */
.product-card-organic {
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px 8px 32px 12px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.product-card-organic:hover {
    border-radius: 12px 32px 8px 24px;
    border-color: rgba(139, 0, 0, 0.4);
    transform: translateY(-8px);
    background: rgba(18, 18, 18, 0.8);
}

/* --- Carrousel de Décryptage --- */
.carousel-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px 4px 20px 8px;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease, transform 1.2s ease;
    transform: scale(1.1);
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
}

.carousel-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: #8B0000;
    width: 18px;
    border-radius: 4px;
}

/* --- Effet de Flou Cinétique (Motion Blur) --- */
@keyframes motion-shake {
    0% { transform: translate(0, 0); filter: blur(0px); }
    25% { transform: translate(1px, -1px); filter: blur(1px); }
    50% { transform: translate(-1px, 1px); filter: blur(2px); }
    75% { transform: translate(1px, 1px); filter: blur(1px); }
    100% { transform: translate(0, 0); filter: blur(0px); }
}

.hover-motion:hover {
    animation: motion-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* --- Navigation : console orbitale --- */
.nav-organic {
    overflow: visible;
    isolation: isolate;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 28px 56px 22px 48px / 42px 24px 48px 30px;
    background: linear-gradient(108deg, rgba(20, 7, 8, 0.95), rgba(7, 7, 9, 0.86) 46%, rgba(22, 7, 10, 0.92));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 16px 58px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(139, 0, 0, 0.1);
    backdrop-filter: blur(24px) saturate(150%);
}

.nav-organic::before,
.nav-organic::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.nav-organic::before {
    width: 170px;
    height: 44px;
    right: 16%;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(139, 0, 0, 0.28);
    filter: blur(22px);
}

.nav-organic::after {
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 22px 48px 17px 42px / 36px 20px 42px 26px;
}

.nav-organic:hover {
    border-radius: 46px 25px 52px 20px / 28px 46px 22px 46px;
    border-color: rgba(181, 18, 24, 0.62);
    transform: translateX(-50%) translateY(-2px);
}

.nav-sculpted-shell {
    position: relative;
    z-index: 1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px 10px;
    flex-wrap:nowrap !important;
    min-height:52px !important;
    overflow: visible;
}
.nav-sculpted-shell .nav-access{flex:0 1 auto; justify-content:flex-end; gap:6px; min-width:0; max-width:60%;}

.nav-brand-orbit {
    border: 0;
    padding: 0;
    background: transparent;
}

.nav-brand-mark {
    position: relative;
    display: grid;
    place-items: center;
}

.nav-brand-mark::before {
    content: '';
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(181, 18, 24, 0.46);
    border-radius: 42% 58% 65% 35% / 42% 35% 65% 58%;
    animation: navOrbit 7s linear infinite;
}

.nav-route-cluster {
    gap: 3px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 18px 34px 19px 29px / 27px 17px 32px 20px;
    background: rgba(255, 255, 255, 0.035);
}

.btn-organic.nav-route,
.btn-organic.nav-join {
    min-height: 34px;
    padding: 0.52rem 0.82rem;
    border: 1px solid transparent;
    border-radius: 13px 24px 12px 20px / 18px 11px 22px 13px;
    background: transparent;
    letter-spacing: 0.055em;
}

.btn-organic.nav-route::before,
.btn-organic.nav-join::before {
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.22), transparent);
}

.btn-organic.nav-route:hover,
.btn-organic.nav-route.is-active {
    transform: translateY(-1px) rotate(-1deg);
    border-color: rgba(181, 18, 24, 0.54);
    border-radius: 23px 12px 25px 11px / 13px 23px 12px 24px;
    background: linear-gradient(135deg, rgba(181, 18, 24, 0.3), rgba(255,255,255,0.04));
    box-shadow: 0 7px 22px rgba(139, 0, 0, 0.22);
}

.btn-organic.nav-route:hover span,
.btn-organic.nav-route.is-active span {
    filter: none;
    animation: none;
}

.btn-organic.nav-join {
    padding-inline: 1.05rem;
    border-color: rgba(181, 18, 24, 0.68);
    background: linear-gradient(135deg, rgba(181, 18, 24, 0.78), rgba(62, 0, 4, 0.94));
    box-shadow: 0 8px 26px rgba(139, 0, 0, 0.34), 0 1px 0 rgba(255,255,255,0.22) inset;
}

.nav-login-link {
    position: relative;
    border-radius: 16px 8px 18px 10px;
}

.nav-login-link::after {
    content: '';
    position: absolute;
    right: 11px;
    bottom: 5px;
    left: 11px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 240ms ease;
}

.nav-login-link:hover::after { transform: scaleX(1); }

.nav-identity {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 28px 13px 26px 16px / 18px 27px 16px 28px;
    background: rgba(255,255,255,0.045);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

.nav-logout {
    border: 1px solid rgba(181, 18, 24, 0.3);
    border-radius: 42% 58% 48% 52% / 58% 37% 63% 42%;
    background: rgba(139, 0, 0, 0.16);
}

.nav-logout:hover { transform: rotate(14deg) scale(1.08); background: rgba(181, 18, 24, 0.34); }

@keyframes navOrbit { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
    .nav-organic { border-radius: 22px 33px 16px 29px / 30px 18px 31px 20px; }
    .nav-sculpted-shell { padding-inline: 0.75rem; }
    .nav-identity { padding-inline: 0.5rem; }
    .nav-access { gap: 0.2rem; }
}

/* --- Navigation mobile : éclats organiques --- */
.nav-mobile-toggle {
    position: relative;
    display: grid;
    width: 38px;
    height: 36px;
    padding: 8px 9px;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 15px 9px 17px 10px / 11px 17px 10px 16px;
    background: rgba(255,255,255,0.045);
    transition: transform 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease);
}

.nav-mobile-toggle span {
    display: block;
    height: 1px;
    width: 100%;
    background: rgba(255,255,255,0.82);
    transform-origin: center;
    transition: transform 260ms var(--ease), opacity 180ms var(--ease);
}

.nav-mobile-toggle.is-open {
    border-color: rgba(181,18,24,0.62);
    background: rgba(139,0,0,0.21);
    transform: rotate(-4deg);
}

.nav-mobile-toggle.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-mobile-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.nav-mobile-toggle.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-nav-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top;
    transition: grid-template-rows 320ms var(--ease), opacity 200ms var(--ease), transform 320ms var(--ease);
}

.mobile-nav-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mobile-nav-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: hidden;
    padding: 0 11px 11px;
}

.mobile-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px 9px 20px 11px / 12px 20px 10px 19px;
    background: rgba(255,255,255,0.035);
    color: var(--text-soft);
    font: 500 0.7rem/1 'JetBrains Mono', monospace;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    transition: transform 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
}

.mobile-route:hover,
.mobile-route.is-active {
    transform: translateY(-2px) rotate(-1deg);
    border-color: rgba(181,18,24,0.48);
    background: linear-gradient(135deg, rgba(139,0,0,0.25), rgba(255,255,255,0.04));
    color: #fff;
}

/* --- Scrollbar Mystérieuse --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); background-clip: padding-box; }

/* --- OPSEC: recherche ultra fluide + forme originale --- */
.nav-route{transition:transform .24s cubic-bezier(.22,1,.36,1),background .24s,border-color .24s,box-shadow .24s,border-radius .45s cubic-bezier(.22,1,.36,1)!important}
.nav-route:active{transform:scale(.94) !important}
.nav-brand-orbit .om-brand-logo{will-change:transform}
.nav-brand-orbit:hover .om-brand-logo{transform:rotate(-7deg) scale(1.06) !important}
.om-hist button{position:relative;overflow:hidden;border-radius:10px 14px 10px 14px / 14px 10px 14px 10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);color:#d4d4d8;font-size:11px;padding:6px 10px;transition:transform .18s cubic-bezier(.34,1.56,.64,1),background .18s,border-color .18s,color .18s}
.om-hist button:hover{transform:translateY(-1px) scale(1.02);background:rgba(181,18,24,.18);border-color:rgba(181,18,24,.45);color:#fff}
.om-hist button:active{transform:scale(.94)}
@media (prefers-reduced-motion: reduce){.nav-route,.om-hist button{transition:none!important}}
