/* ==========================================================================
   FINI INSTRUMENTS — CORPORATE STYLESHEET
   ========================================================================== */

/* ── SYSTEM VARIABLES ────────────────────────────────────────────────────── */
:root {
    --primary: #007bfb;
    --dark: #003b8e;
    --cyan: #00c8ff;
    --light: #f4f9ff;
    --text: #182848;
    --globe-size: 200px;
    --globe-size-mobile: 150px;
    --orbit-radius: 220px;
    --orbit-radius-mobile: 135px;
    --total-items: 7; /* Update this when adding/removing .logo-item elements */
}

/* ── BASE & GLOBAL RESETS ────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Red Hat Display', sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    transition: 0.3s ease;
}

/* ── THE REVOLVING GLOBE & LOGO ORBIT SYSTEM ─────────────────────────────── */
.globe-stage {
    position: relative;
    width: 100%;
    height: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Revolving Globe in Center */
.center-globe {
    position: absolute;
    width: var(--globe-size);
    height: var(--globe-size);
    border-radius: 50%;
    background: #001f4f;
    box-shadow: 
        0 0 35px rgba(0, 123, 251, 0.4),        /* outer glow */
        inset -15px -15px 40px rgba(0, 0, 0, 0.8),  /* shadow: light source top-left */
        inset 10px 10px 30px rgba(255, 255, 255, 0.1); /* highlight: light source top-left */
    overflow: hidden;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid overlay mapping rotation */
/* Seamlessly looping map overlay */
.globe-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../templates/imgs/world-map.png");
    background-repeat: repeat;
    /* No need to set background-position here; keyframe 0% state defines the start */
    background-size: 300px 100%; /* Tile width must match keyframe shift amount (300px) for seamless loop */
    opacity: 0.25; /* Subtle blend into the dark container */
    filter: brightness(0) invert(10) opacity(100); /* Keeps map visual clean/light */
    pointer-events: none;
    z-index: 10;
    
    /* Triggers the seamless background shift */
    animation: spinGlobe 40s linear infinite;
}

/* 
   Shifting the background-position by exactly the defined tile width (300px) 
   guarantees a mathematically perfect, infinite seamless loop.
*/
@keyframes spinGlobe {
    0% {
        background-position: 0 center;
    }
    100% {
        background-position: -300px center; 
    }
}

/* Realistic overlay shadow */
.globe-shading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.5) 70%, rgba(0,0,0,0.9) 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 11;
}

/* Orbit Path Indicator */
.logo-orbit {
    position: absolute;
    width: calc(var(--orbit-radius) * 2);
    height: calc(var(--orbit-radius) * 2);
    border: 1px dashed rgba(0, 123, 251, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Individual Orbiting Items (Distributed mathematically) */
.logo-item {
    position: absolute;
    width: 100px;
    height: 100px;
    background: #FFFFFF1;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 59, 142, 0.08);
    border: 1px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    /* Animation triggers rotation along orbit while maintaining orientation */
    animation: orbitAnimation 40s linear infinite;
    animation-delay: calc(var(--i) * (-40s / var(--total-items)));
}

.logo-item:hover {
    box-shadow: 0 8px 25px rgba(0, 123, 251, 0.25);
    z-index: 20;
}

.logo-item img.trust-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.85;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.logo-item:hover img.trust-logo {
    filter: none;
    opacity: 1;
    transform: scale(1.08);
}

/* ── ANIMATION KEYFRAMES ────────────────────────────────────────────────── */
@keyframes orbitAnimation {
    0% {
        transform: rotate(0deg) translateX(var(--orbit-radius)) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(var(--orbit-radius)) rotate(-360deg);
    }
}

@keyframes orbitAnimationMobile {
    0% {
        transform: rotate(0deg) translateX(var(--orbit-radius-mobile)) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(var(--orbit-radius-mobile)) rotate(-360deg);
    }
}

/* ── RESPONSIVE ADAPTATIONS ──────────────────────────────────────────────── */
@media (max-width: 991px) {
    .globe-stage {
        height: 380px;
    }
}

@media (max-width: 768px) {
    :root {
        --globe-size: var(--globe-size-mobile);
        --orbit-radius: var(--orbit-radius-mobile); /* Propagate mobile radius to base variable */
    }
    
    .globe-stage {
        height: 300px;
    }
    
    .logo-orbit {
        width: calc(var(--orbit-radius-mobile) * 2);
        height: calc(var(--orbit-radius-mobile) * 2);
    }
    
    .logo-item {
        width: 52px;
        height: 52px;
        padding: 6px;
        animation-name: orbitAnimationMobile;
        animation-duration: 35s;
        animation-delay: calc(var(--i) * (-35s / var(--total-items)));
    }
}