
/* =========================================
   ALIEN PLANET / CLIENTS SECTION
   ========================================= */
#clients {
    position: relative;
    overflow: hidden;
    background: #000; /* Fallback */
    /* Remove standard padding if we want full canvas immersion, 
       but keeping some to frame the content is good. 
       Let's keep the override from previous CSS: 
       padding-top: 2rem; padding-bottom: 5rem; */
}

#alien-canvas {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Let clicks pass through if needed, though we track mouse on it in JS usually */
}

/* Ensure content is above canvas */
#clients .container {
    position: relative;
    z-index: 2;
}

/* Container for the physics items */
.gravity-wrapper {
    position: relative;
    width: 100%;
    min-height: 500px; /* Give it space */
    margin-top: 2rem;
    overflow: hidden; /* Keep items inside */
    /* border: 1px dashed rgba(255,255,255,0.1); Debugging boundary */
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.01); /* Faint container hint */
    box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
}

/* 
   THE "SHARDS" (Client Logos) 
   Style: Ancient Alien Data Crystals / Holographic Shards
*/
.gravity-item {
    position: absolute; /* Controlled by JS */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 4rem;
    
    background: rgba(10, 20, 30, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 
        0 0 15px rgba(0, 243, 255, 0.05),
        inset 0 0 20px rgba(0, 243, 255, 0.05);
    
    border-radius: 4px; 
    /* Polygon clip for "Shard" look - random corners handled here via uniform clip or varied? 
       Let's go with a consistent tech-shape */
    clip-path: polygon(
        15px 0, 100% 0, 
        100% calc(100% - 15px), calc(100% - 15px) 100%, 
        0 100%, 0 15px
    );

    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.2rem;
    
    transition: box-shadow 0.3s, background 0.3s, color 0.3s;
    user-select: none;
    cursor: pointer;
    will-change: transform;
}

/* Hover/Active State for Shards */
.gravity-item:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 
        0 0 30px rgba(0, 243, 255, 0.3),
        inset 0 0 10px rgba(0, 243, 255, 0.2);
    z-index: 100; /* Bring to front */
}

/* Teleportation / Entry Animation Classes */
.shimmer-in {
    animation: tele-shimmer 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes tele-shimmer {
    0% {
        opacity: 0;
        transform: scale(0) rotate(45deg);
        filter: blur(20px) brightness(3);
    }
    50% {
        opacity: 0.8;
        filter: blur(5px) brightness(2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg); /* JS will overwrite transform, so we might need to handle this carefully or use a wrapper */
        filter: blur(0px) brightness(1);
    }
}

/* 
   Since JS controls transform directly (x, y, rotation), 
   CSS animations on 'transform' will conflict.
   Optimized Approach: 
   - Animate a child element for the visual flare 
   - OR use an 'initial-scale' property in JS 
   - OR use a wrapper div where the wrapper is moved by Physics, and the inner div animates.
   
   Let's stick to the current structure (<a> tags). 
   The JS "UpdatePhysics" overwrites 'transform' every frame.
   
   Solution:
   We will add the "teleport" effect via a CSS filter and Opacity, 
   and maybe a 'scale' variable in the physics engine, rather than CSS keyframes on transform.
   
   But we can use a ::before pseudo element for a flash effect!
*/

.gravity-item::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: var(--accent-primary);
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.gravity-item.teleporting::before {
    animation: flash-bang 0.5s ease-out forwards;
}

@keyframes flash-bang {
    0% { opacity: 0; }
    10% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* =========================================
   CONTACT SECTION REVAMP
   ========================================= */
#contact {
    position: relative;
    overflow: hidden;
    /* Animated Grid Background */
    background: 
        linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.9)),
        repeating-linear-gradient(0deg, transparent 0, transparent 49px, rgba(0, 243, 255, 0.05) 50px),
        repeating-linear-gradient(90deg, transparent 0, transparent 49px, rgba(0, 243, 255, 0.05) 50px);
    background-size: 100% 100%, 100px 100px, 100px 100px;
    animation: grid-scroll 20s linear infinite;
}

@keyframes grid-scroll {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 100px, 0 0; }
}

/* 3D Flip Card Container */
.flip-card {
    background-color: transparent;
    width: 400px;
    height: 240px;
    perspective: 1000px; /* Enable 3D */
    margin-top: 2rem;
}

/* Inner Container: Positioner */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* FLIP ON HOVER */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Common Card Face Styles */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 2rem;
    
    /* Glassmorphism / Premium Paper */
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* FRONT FACE (Contact Info) */
.flip-card-front {
    color: #fff;
    align-items: flex-start;
    border-left: 4px solid var(--accent-primary);
}

.card-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #d4af37, #f1c40f); /* Golden Chip */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.chip::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; width: 100%; height: 1px;
    background: rgba(0,0,0,0.3);
}

.card-brand {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.card-details {
    text-align: left;
    width: 100%;
}

.card-details p {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-details i {
    color: var(--accent-primary);
    width: 20px;
}

.card-footer {
    width: 100%;
    text-align: right;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    opacity: 0.8;
}

/* BACK FACE (Logo) */
.flip-card-back {
    background: linear-gradient(135deg, #050507, #1a0b2e);
    color: white;
    transform: rotateY(180deg); /* Start flipped */
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-secondary);
}

.flip-card-back i {
    filter: drop-shadow(0 0 20px var(--accent-primary));
}

@media (max-width: 600px) {
    .flip-card {
        width: 100%;
        max-width: 350px;
        height: 220px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* =========================================
   FOOTER REVAMP
   ========================================= */
#main-footer {
    position: relative;
    background: #020205;
    color: #fff;
    padding: 4rem 0 2rem;
    overflow: hidden;
    border-top: 1px solid rgba(0, 243, 255, 0.1);
}

#footer-canvas {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.3;
}

.relative-z {
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand-col {
    max-width: 400px;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version {
    font-size: 0.8rem;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 10px;
}

.tagline {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
}

.footer-tech-col {
    font-family: 'Courier New', monospace; /* Tech font */
    text-align: right;
}

.tech-row {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: rgba(0, 243, 255, 0.7);
}

.tech-label {
    opacity: 0.6;
    margin-right: 10px;
}

.tech-value {
    font-weight: bold;
    color: #fff;
}

.blink {
    animation: blinker 1.5s linear infinite;
    color: #0f0; /* Green for online */
}

@keyframes blinker {
    50% { opacity: 0; }
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
}

@media (max-width: 600px) {
    .footer-grid {
        flex-direction: column;
        text-align: center;
    }
    .footer-tech-col {
        text-align: center;
        width: 100%;
        margin-top: 1rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}


/* =========================================
   HEADER / NAV REVAMP
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    
    /* Initial Transparent State with slight gradient for readability */
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    border-bottom: 1px solid transparent;
}

/* Scrolled State: Sophisticated Glass Tech */
.navbar.scrolled {
    padding: 1rem 4rem;
    background: rgba(5, 5, 10, 0.85); /* Dark Glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.15); /* Neon Edge */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.navbar.scrolled::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}

/* Logo Sizing */
.logo img {
    height: 40px;
    transition: transform 0.3s;
}

.navbar.scrolled .logo img {
    transform: scale(0.9);
}

/* Nav Links Container */
.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

/* Hover Effect: Holographic Glow & Underline */
.nav-links a:not(.cta-button):hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
}

.nav-links a:not(.cta-button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-links a:not(.cta-button):hover::after {
    width: 100%;
}

/* CTA Button Styling override for Header */
.navbar .cta-button {
    padding: 0.6rem 1.8rem;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.navbar .cta-button:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.navbar .cta-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.navbar .cta-button:hover::before {
    left: 100%;
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    .navbar.scrolled {
        padding: 0.8rem 1.5rem;
    }
    .nav-links {
        display: none; /* Mobile menu logic normally here, but we'll stick to basic responsive hiding for now or simple changes */
    }
}
