/* Global Styles */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    /* Cognisys Brand Colors */
    --color-deep-purple: #35008b;
    --color-violet: #7c3aed;
    --color-orange: #f97316;
    --color-coral: #c2410c;
    --color-yellow: #fbbf24;

    --color-dark: #0f172a;
    /* Slate 900 */
    --color-light: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-light);
    color: var(--color-dark);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.03em;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Custom Utilities */
.text-gradient-brand {
    background: linear-gradient(135deg, var(--color-deep-purple), var(--color-violet), var(--color-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 5s ease infinite;
}

.text-gradient-warm {
    background: linear-gradient(135deg, var(--color-orange), var(--color-coral), var(--color-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, var(--color-deep-purple), var(--color-violet));
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--color-orange), var(--color-yellow));
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glassmorphism 2.0 (Trendy) */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-deep-purple), var(--color-orange), var(--color-yellow));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button Refinements */
.btn-primary {
    background: linear-gradient(135deg, var(--color-deep-purple), var(--color-violet));
    color: white;
    box-shadow: 0 10px 20px -10px rgba(53, 0, 139, 0.5);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-violet), var(--color-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(53, 0, 139, 0.6);
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.open {
    max-height: 400px;
    /* arbitrary large value */
    opacity: 1;
}

/* Carousel Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- Scrollytelling Styles --- */

/* Infinite Marquee Animation */
@keyframes scroll-partners {
    from {
        transform: translateX(0);
    }
    to {
        /* calc(-100% - 4rem) accounts for the container width plus the 64px (4rem) gap */
        transform: translateX(calc(-100% - 4rem));
    }
}

.animate-scroll {
    animation: scroll-partners 30s linear infinite;
    display: flex;
}

/* Optional: Pause on hover to allow partners to be read easily */
.group:hover .animate-scroll {
    animation-play-state: paused;
}

@keyframes scan-horizontal {
    0% { left: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.animate-scan-horizontal {
    animation: scan-horizontal 4s linear infinite;
}

/* 1. The Complexity (Parallax) */
.parallax-section {
    perspective: 1px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.parallax-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* 2. The Core (Horizontal Scroll) */
.horizontal-scroll-container {
    position: relative;
    height: 300vh;
    /* Determines length of scroll */
}

.horizontal-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: var(--color-dark);
    /* Contrast */
}

.horizontal-track {
    display: flex;
    gap: 4rem;
    padding: 0 5vw;
    will-change: transform;
}

/* 3. The Impact (Curtain Reveal) */
.curtain-section {
    position: relative;
    z-index: 10;
    /* Ensure it covers the footer initially if needed */
}

/* Bento Grid Utilities */
.bento-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(124, 58, 237, 0.2);
    /* Violet/Purple shadow */
    border-color: var(--color-violet);
}

/* Marquee Animation */
.animate-marquee {
    animation: marquee 30s linear infinite;
    width: max-content;
    /* Ensure container is wide enough */
}

.animate-marquee:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half the width (the original set) */
    }
}

/* --- HUD Interface (Advantage Protocol) --- */
.hud-card {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.hud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--color-orange);
    border-left: 2px solid var(--color-orange);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.hud-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--color-orange);
    border-right: 2px solid var(--color-orange);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.hud-card:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--color-orange);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.1);
}

.hud-card:hover::before,
.hud-card:hover::after {
    width: 100%;
    height: 100%;
    opacity: 0.1;
    border-color: var(--color-orange);
}

/* --- Horizontal Accordion (Vision Horizon) --- */
.accordion-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: auto;
}

@media (min-width: 768px) {
    .accordion-wrapper {
        flex-direction: row;
        height: 600px;
        /* Fixed height for horizontal expansion */
    }
}

.accordion-item {
    position: relative;
    flex: 1;
    background: var(--color-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: flex 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    min-height: 100px;
    /* Mobile min-height */
}

/* Expand on hover (Desktop) */
@media (min-width: 768px) {
    .accordion-item:hover {
        flex: 3;
    }
}

.accordion-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: opacity 0.5s ease;
    filter: grayscale(100%);
}

.accordion-item:hover .accordion-bg {
    opacity: 0.6;
    filter: grayscale(0%);
}

.accordion-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    transform: translateY(0);
}

/* Vertical text for collapsed state */
.accordion-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@media (max-width: 767px) {
    .accordion-label {
        position: static;
        transform: none;
        margin-bottom: 0.5rem;
    }
}

.accordion-item:hover .accordion-label {
    opacity: 0;
    /* Hide vertical label on expand */
}

.accordion-detail {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.1s;
}

.accordion-item:hover .accordion-detail {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767px) {
    .accordion-item {
        flex: none;
        height: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
    }

    .accordion-label {
        display: none;
    }

    .accordion-detail {
        position: relative;
        opacity: 1 !important;
        transform: none !important;
    }
}