@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    :root {
        --primary: #0A2558;
        /* Solid deep navy */
        --secondary: #D90429;
        /* Confident crimson */
        --dark: #020617;
        --accent: #1E40AF;
        --surface: #F8FAFC;
        --text-main: #1E293B;
        --border-subtle: rgba(148, 163, 184, 0.2);
    }

    .dark {
        --surface: #0F172A;
        --text-main: #F1F5F9;
        --border-subtle: rgba(255, 255, 255, 0.05);
    }

    body {
        @apply font-sans;
        letter-spacing: -0.01em;
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    html {
        overflow-x: hidden;
        scroll-behavior: smooth;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        @apply font-display tracking-tight;
    }
}

@layer components {

    /* Grain Texture */
    .bg-grain {
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    }

    /* Handcrafted Card */
    .card-human {
        @apply bg-white dark:bg-slate-900 border border-slate-200/60 dark:border-slate-800/60 transition-all duration-300;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    }

    .card-human:hover {
        @apply -translate-y-1;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    }

    /* Custom Transitions */
    .transition-natural {
        transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

    /* Asymmetrical Underline */
    .link-underline {
        @apply relative transition-colors duration-300;
    }

    .link-underline::after {
        content: '';
        @apply absolute bottom-[-2px] left-0 w-0 h-[2px] bg-secondary transition-all duration-500 ease-out italic;
    }

    .link-underline:hover::after {
        @apply w-full;
    }

    /* Imperfect Border Radius */
    .rounded-organic {
        border-radius: 20px 10px 18px 12px;
    }

    /* Developer Credit Link */
    .developer-link {
        @apply relative transition-all duration-500 ease-out;
    }

    .developer-link::after {
        content: '';
        @apply absolute bottom-[-2px] left-0 w-0 h-[1px] bg-white/40 transition-all duration-500 ease-out;
    }

    .developer-link:hover::after {
        @apply w-full;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    @apply bg-transparent;
}

::-webkit-scrollbar-thumb {
    @apply bg-slate-300 dark:bg-slate-800 rounded-full;
}

/* Parallax tweak */
.bg-offset {
    transform: translate3d(var(--x, 0), var(--y, 0), 0);
}

/* Tracking Dashboard Feel */
.status-tag {
    @apply px-3 py-1 rounded-full text-[10px] font-bold uppercase tracking-widest border;
}

.status-in-transit {
    @apply bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800;
}

.status-delivered {
    @apply bg-green-50 text-green-700 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800;
}

/* Showcase Section Styles */
.glass-premium {
    @apply bg-white/80 dark:bg-slate-900/80 backdrop-blur-xl border border-white/20 dark:border-white/5;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.float-slow {
    animation: float-anim 8s ease-in-out infinite;
}

.float-med {
    animation: float-anim 5s ease-in-out infinite;
}

.float-fast {
    animation: float-anim 3s ease-in-out infinite;
}

@keyframes float-anim {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }
}

.hover-lift {
    @apply transition-all duration-700 cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-lift:hover {
    @apply -translate-y-6 scale-[1.02] shadow-2xl;
}

/* Network Map Styles */
.terminal-dot {
    @apply absolute w-4 h-4 rounded-full bg-secondary shadow-[0_0_15px_rgba(217, 4, 41, 0.8)] z-20;
}

.terminal-pulse {
    @apply absolute inset-0 rounded-full bg-secondary/40 animate-ping;
}

.transit-path {
    fill: none;
    stroke: #D90429;
    stroke-width: 2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 12px rgba(217, 4, 41, 0.7));
}

.network-container {
    @apply relative w-full aspect-[2/1] overflow-hidden rounded-[3rem] bg-slate-950 shadow-2xl border border-white/5;
}

/* Journey Section Styles */
.journey-card {
    @apply transition-all duration-700 cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.journey-card:hover {
    @apply -translate-y-4 scale-[1.03] shadow-2xl;
    box-shadow: 0 40px 80px -15px rgba(11, 60, 140, 0.15);
}

#journey-path {
    transition: stroke-dashoffset 0.1s linear;
}

@media (max-width: 1023px) {
    .journey-step {
        @apply translate-y-0 !important;
    }
}

/* Refined Industry Verticals Section - Human Touch */
.industry-card {
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.shadow-card-layered {
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 30px 60px -12px rgba(0, 0, 0, 0.25);
}

.industry-noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.glass-material {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.1),
        0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Industry Specific Tints - Material Feel */
.card-tea .glass-material {
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.7), rgba(5, 27, 64, 0.8));
    border-top: 1px solid rgba(74, 222, 128, 0.2);
}

.card-fashion .glass-material {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(5, 27, 64, 0.85));
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.card-tech .glass-material {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.7), rgba(5, 27, 64, 0.8));
    border-top: 1px solid rgba(96, 165, 250, 0.2);
}

.inner-glow-light {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.industry-card h3 {
    letter-spacing: -0.025em;
    font-weight: 800;
}

.industry-card p {
    letter-spacing: 0.01em;
    text-wrap: balance;
}

/* Hover refinement: Subtle light shift */
.industry-card:hover .glass-material {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}

.card-tea:hover .glass-material {
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.8), rgba(5, 27, 64, 0.9));
}

.card-fashion:hover .glass-material {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(5, 27, 64, 0.95));
}

.card-tech:hover .glass-material {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(5, 27, 64, 0.9));
}

@media (max-width: 1023px) {
    .industry-card {
        height: 480px !important;
        transform: none !important;
        margin-bottom: 2rem;
    }

    .industry-card .glass-material {
        padding: 1.5rem !important;
    }
}

/* Success Stories Section Styles */
.case-study-item {
    @apply transition-all duration-1000 relative;
}

.shadow-premium {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.04),
        0 10px 20px rgba(0, 0, 0, 0.02),
        0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.case-overlay-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
    opacity: 0.8;
    transition: opacity 0.5s ease;
}

.case-study-item:hover .case-overlay-gradient {
    opacity: 0.9;
}

.case-study-item:hover .case-hover-lift {
    transform: translateY(-4px);
}

.float-slow-reverse {
    animation: float-anim-reverse 8s ease-in-out infinite;
}

@keyframes float-anim-reverse {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(20px) rotate(-1deg);
    }
}

#success-stories .glass-premium {
    @apply bg-black/30 backdrop-blur-xl border-white/5;
}

/* Route Indicator Lines */
.case-study-item img {
    @apply grayscale-[20%] group-hover:grayscale-0 transition-all duration-1000 group-hover:scale-[1.03];
}

/* Specific Tints for Case Studies */
.border-orange-500\/20 {
    border-color: rgba(249, 115, 22, 0.2);
}

.border-blue-500\/20 {
    border-color: rgba(59, 130, 246, 0.2);
}

.case-study-item .bg-orange-500\/10 {
    background-color: rgba(249, 115, 22, 0.1);
}

.case-study-item .text-orange-600 {
    color: #ea580c;
}

/* Timeline specific styles */
.timeline-path {
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #ef4444);
    border-radius: 100px;
    width: 100%;
    z-index: 0;
}

.timeline-dot {
    @apply w-3.5 h-3.5 rounded-full border-2 border-white shadow-md z-10 transition-all duration-500;
    flex-shrink: 0;
    margin-top: -1px;
}

.case-study-item:hover .timeline-dot {
    @apply scale-125 border-primary;
}

/* Responsive adjustments for Case Studies */
@media (max-width: 1023px) {
    .case-study-item {
        @apply mb-32;
    }

    .case-study-item .rounded-\[3rem\] {
        border-radius: 1.5rem;
    }

    .case-study-item img {
        height: 350px !important;
    }

    .case-study-item .glass-premium {
        @apply p-6;
    }
}

/* Swiper Pagination Refinement */
.caseSwiper .swiper-pagination-bullet {
    @apply bg-white/40 !important;
    width: 6px;
    height: 6px;
    transition: all 0.3s ease;
}

.caseSwiper .swiper-pagination-bullet-active {
    @apply bg-white !important;
    width: 24px;
    border-radius: 4px;
}

#success-stories .glass-premium {
    @apply bg-black/30 backdrop-blur-xl border-white/5;
}

/* Back to Top Button Standardization */
#back-to-top {
    @apply fixed w-12 h-12 bg-primary text-white rounded-full shadow-2xl flex items-center justify-center transition-all duration-500 z-[999] opacity-0 pointer-events-none;
}

#back-to-top.visible {
    @apply opacity-100 pointer-events-auto;
}

#back-to-top:hover {
    @apply bg-secondary -translate-y-2;
}

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}