/* =============================================
   CoreBase — Premium Design System
   ============================================= */

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* ---------- Navbar Scroll Effect ---------- */
.navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ---------- Scroll-Driven Animations ---------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 400ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 500ms; }

/* Slide-in variants */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-left.visible,
.animate-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale-in */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Hero Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #c084fc 40%, #FF6600 70%, #ffffff 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating dots pattern */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100vh) translateX(40px);
        opacity: 0;
    }
}

/* Typed text cursor */
.typed-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background: #FF6600;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Glow pulse on CTA buttons */
.cta-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.cta-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #714B67, #FF6600, #714B67);
    background-size: 200% 200%;
    animation: glowRotate 3s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cta-glow:hover::before {
    opacity: 1;
}

@keyframes glowRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Glassmorphism Cards ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(113, 75, 103, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(113, 75, 103, 0.25);
}

/* Dark glass variant */
.glass-card-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card-dark:hover {
    transform: translateY(-6px);
    border-color: rgba(113, 75, 103, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ---------- Section Dividers ---------- */
.wave-divider {
    position: relative;
}

.wave-divider::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23f9fafb' d='M0,48L48,42.7C96,37,192,27,288,32C384,37,480,59,576,64C672,69,768,59,864,48C960,37,1056,27,1152,26.7C1248,27,1344,37,1392,42.7L1440,48L1440,80L0,80Z'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
    z-index: 1;
    pointer-events: none;
}

.wave-divider-white::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,48L48,42.7C96,37,192,27,288,32C384,37,480,59,576,64C672,69,768,59,864,48C960,37,1056,27,1152,26.7C1248,27,1344,37,1392,42.7L1440,48L1440,80L0,80Z'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
}

.wave-divider-navy::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%230F172A' d='M0,48L48,42.7C96,37,192,27,288,32C384,37,480,59,576,64C672,69,768,59,864,48C960,37,1056,27,1152,26.7C1248,27,1344,37,1392,42.7L1440,48L1440,80L0,80Z'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
}

/* ---------- Stats Counter ---------- */
.stat-number {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.stat-item {
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 50%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(113, 75, 103, 0.3), transparent);
}

.stat-item:last-child::after {
    display: none;
}

/* ---------- Testimonial Cards ---------- */
.testimonial-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 16px;
    font-size: 8rem;
    font-family: Georgia, serif;
    color: rgba(113, 75, 103, 0.07);
    line-height: 1;
    pointer-events: none;
}

.testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(113, 75, 103, 0.12);
}

/* ---------- Pricing Cards ---------- */
.pricing-card {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card:hover {
    transform: translateY(-10px);
}

.pricing-card.featured {
    border: 2px solid #714B67;
    box-shadow: 0 0 0 4px rgba(113, 75, 103, 0.1);
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #714B67, #FF6600);
}

/* ---------- Icon Containers ---------- */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-card:hover .icon-box,
.group:hover .icon-box {
    transform: scale(1.12) rotate(-5deg);
}

/* ---------- Partner / Trust Badges ---------- */
.trust-badge {
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.trust-badge:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
}

/* ---------- Process Timeline ---------- */
.timeline-step {
    position: relative;
    padding-left: 3rem;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: 0.9rem;
    top: 2.5rem;
    bottom: -2rem;
    width: 2px;
    background: linear-gradient(to bottom, #714B67, rgba(113, 75, 103, 0.15));
}

.timeline-step:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #714B67, #8F6483);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 0 0 4px rgba(113, 75, 103, 0.15);
}

/* ---------- Values Grid Cards ---------- */
.value-card {
    position: relative;
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    border: 1px solid #f1f5f9;
    transition: all 0.4s ease;
    overflow: hidden;
}

.value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #714B67, #FF6600);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.value-card:hover::before {
    transform: scaleX(1);
}

.value-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

/* ---------- Floating Labels (Contact Form) ---------- */
.form-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #714B67;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(113, 75, 103, 0.1);
}

.form-label {
    position: absolute;
    left: 1.25rem;
    top: 1rem;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.25s ease;
    background: transparent;
    padding: 0 0.25rem;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: -0.6rem;
    left: 1rem;
    font-size: 0.75rem;
    color: #714B67;
    font-weight: 600;
    background: white;
}

/* ---------- Page Hero Banners (Services, About) ---------- */
.page-hero {
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(113, 75, 103, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(255, 102, 0, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* ---------- Active Nav Link ---------- */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FF6600;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---------- CoreBase Logo Animation ---------- */
.corebase-logo {
    cursor: pointer;
    overflow: visible;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.05));
}

.cube-part {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.core-sun {
    transform-origin: 100px 100px;
    opacity: 0;
    transform: scale(0) rotate(0deg);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-link:hover .face-top {
    transform: translateY(-22px);
}

.brand-link:hover .face-left {
    transform: translate(-18px, 12px);
}

.brand-link:hover .face-right {
    transform: translate(18px, 12px);
}

.brand-link:hover .core-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: spinSun 5s linear infinite;
}

@keyframes spinSun {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 768px) {
    .stat-item::after {
        display: none;
    }

    .wave-divider::after {
        height: 40px;
    }

    .hero-particle {
        width: 3px;
        height: 3px;
    }
}

@media (max-width: 640px) {
    .glass-card:hover {
        transform: translateY(-4px);
    }

    .pricing-card:hover {
        transform: translateY(-6px);
    }
}
