/* =========================================
   HOME PAGE STYLES
   ========================================= */

/* Hero Section */
.hero-section {
    position: relative;
    padding: 120px 0 160px;
    background: radial-gradient(circle at 50% 50%, rgba(var(--primary-hue), var(--primary-sat), 90%, 0.1) 0%, transparent 60%);
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark-mode .hero-title {
    background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Background Grids/Dots (Optional aesthetics) */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    opacity: 0.5;
    z-index: 0;
}

/* Services Preview */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px -10px rgba(var(--primary-hue), var(--primary-sat), 60%, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.service-card:hover .service-icon {
    background: var(--color-primary);
    color: white;
}

/* Tech Stack Marquee (Optional or Grid) */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    opacity: 0.7;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

.tech-grid:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.tech-item i {
    font-size: 3rem;
    transition: transform 0.3s ease;
}

.tech-item:hover i {
    transform: scale(1.2);
    color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

/* =========================================
   CODE SYNTAX HIGHLIGHTING (Typewriter)
   ========================================= */
.code-keyword {
    color: #ff7b72;
}

.code-variable {
    color: #ffa657;
}

.code-string {
    color: #a5d6ff;
}

.code-function {
    color: #d2a8ff;
}

.code-comment {
    color: #8b949e;
}

.code-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: var(--color-primary);
    vertical-align: middle;
    margin-left: 4px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* =========================================
   HERO ANIMATIONS
   ========================================= */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-delayed {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 6s ease-in-out infinite;
    animation-delay: 1s;
}

/* Background dot grid pattern */
.bg-dot-grid {
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* =========================================
   STATS COUNTER SECTION
   ========================================= */
.stats-item {
    position: relative;
}

.stats-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: var(--border-color);
}

.stats-item:last-child::after {
    display: none;
}

@media (max-width: 768px) {
    .stats-item:nth-child(2)::after {
        display: none;
    }
}

/* =========================================
   CLIENT LOGOS / MARQUEE SECTION
   ========================================= */
.logo-marquee {
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    overflow: hidden;
}

.logo-track {
    width: max-content;
    align-items: center;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    animation: marquee 35s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Individual logo item wrapper */
.client-logo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    /* Responsive width: auto-sizes to image, with min/max guard */
    min-width: 60px;
    max-width: 200px;
    padding: 0 4px;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
    /* Greyscale all logos by default for a clean, unified look */
    filter: grayscale(1) opacity(0.45);
}

.client-logo-item:hover {
    filter: grayscale(0) opacity(1);
    transform: scale(1.06);
}

/* The actual <img> inside */
.client-logo-item img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Prevent blurry rendering on non-retina with fractional sizes */
    image-rendering: -webkit-optimize-contrast;
}

/* Dark mode: brighten slightly so greyscale logos stay visible */
.dark-mode .client-logo-item {
    filter: grayscale(1) opacity(0.35) brightness(1.6);
}
.dark-mode .client-logo-item:hover {
    filter: grayscale(0) opacity(1) brightness(1);
}

/* Dark-mode variant: swap to the -dark src when dark mode is active */
.client-logo-item img.logo-dark-variant {
    display: none;
}
.dark-mode .client-logo-item img.logo-light-variant {
    display: none;
}
.dark-mode .client-logo-item img.logo-dark-variant {
    display: block;
}

/* Square logo: constrain width = height so it doesn't stretch */
.client-logo-item.logo-square {
    width: 48px;
    max-width: 48px;
}

/* Skeleton pulse shown while logos are loading */
.client-logo-skeleton {
    flex-shrink: 0;
}

/* =========================================
   FAQ ACCORDION
   ========================================= */
.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-item.active .faq-trigger {
    color: var(--color-primary);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.active .faq-content {
    max-height: 500px;
}

/* =========================================
   FILLED STAR ICONS
   ========================================= */
.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}

/* =========================================
   LINE CLAMP UTILITY
   ========================================= */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   DARK MODE TRUSTPILOT FIX
   ========================================= */
.dark .trustpilot-widget-wrapper .trustpilot-widget {
    filter: invert(0);
}

/* =========================================
   PORTFOLIO HOVER EFFECTS
   ========================================= */
.portfolio-item:hover {
    transform: translateY(-5px);
}

/* =========================================
   PROCESS STEP RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .process-step::before {
        display: none;
    }
}

/* =========================================
   AVATAR STACK - HERO SOCIAL PROOF
   ========================================= */
.avatar-stack {
    display: flex;
}

.avatar-stack img,
.avatar-stack>div {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On parent hover, spread avatars apart */
.avatar-stack:hover img,
.avatar-stack:hover>div {
    margin-left: 4px;
    margin-right: 4px;
}

.avatar-stack:hover img:first-child,
.avatar-stack:hover>div:first-child {
    margin-left: 0;
}

.avatar-stack img:hover,
.avatar-stack>div:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Glow effect on hover */
.avatar-stack img:hover {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
}

/* Star pulse animation */
@keyframes star-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.star-animated:hover {
    animation: star-pulse 0.6s ease-in-out;
}

/* =========================================
   SERVICE CARDS - HOMEPAGE
   ========================================= */
.service-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.service-card-link:hover {
    text-decoration: none;
}

/* Ensure card content stretches and CTA sticks to the bottom */
.service-card-link > div {
    display: flex;
    flex-direction: column;
}

.service-card-link > div > div:last-child {
    margin-top: auto;
}


/* Card icon bounce animation */
@keyframes icon-bounce {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(3deg);
    }

    75% {
        transform: scale(1.05) rotate(-1deg);
    }
}

.service-card-link:hover .material-symbols-outlined,
.service-card-link:hover .fa-wordpress {
    animation: icon-bounce 0.5s ease;
}