/* ============================================
   ENHANCEMENTS.CSS - Premium Interactive Layer
   HOLISYS - Award-Worthy Visual Enhancement
   ============================================
   Pure CSS, zero dependencies, fully static.
   ============================================ */

/* ------------------------------------------
   1. PAGE LOAD ENTRANCE SYSTEM
   ------------------------------------------ */
body {
    opacity: 0;
    animation: pageEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes pageEntrance {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Staggered hero elements */
.hero__eyebrow {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero__title {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero__subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero__cta {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.hero__signals {
    opacity: 0;
    animation: heroReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(var(--reveal-y, 20px));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------------------
   2. SCROLL REVEAL SYSTEM
   ------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger delays for grid children */
.reveal-stagger>.reveal:nth-child(1) {
    transition-delay: 0ms;
}

.reveal-stagger>.reveal:nth-child(2) {
    transition-delay: 80ms;
}

.reveal-stagger>.reveal:nth-child(3) {
    transition-delay: 160ms;
}

.reveal-stagger>.reveal:nth-child(4) {
    transition-delay: 240ms;
}

.reveal-stagger>.reveal:nth-child(5) {
    transition-delay: 320ms;
}

.reveal-stagger>.reveal:nth-child(6) {
    transition-delay: 400ms;
}

.reveal-stagger>.reveal:nth-child(7) {
    transition-delay: 480ms;
}

.reveal-stagger>.reveal:nth-child(8) {
    transition-delay: 560ms;
}

/* Direction variants */
.reveal--left {
    opacity: 0;
    transform: translateX(-40px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--right {
    opacity: 0;
    transform: translateX(40px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--left.revealed,
.reveal--right.revealed {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* ------------------------------------------
   3. CARD HOVER POLISH
   ------------------------------------------ */
.card {
    transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15),
        0 8px 16px -8px rgba(0, 0, 0, 0.1);
}

/* Glassmorphism hover overlay */
.card--feature {
    position: relative;
    overflow: hidden;
}

.card--feature::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.card--feature:hover::after {
    opacity: 1;
}

.card--feature:hover {
    transform: translateY(-8px) rotateX(2deg);
}

/* ------------------------------------------
   4. IMAGE ENHANCEMENTS
   ------------------------------------------ */

/* Zoom on scroll (controlled via JS) */
.img-zoom {
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.img-zoom img {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.img-zoom.in-view img {
    transform: scale(1.05);
}

/* Hover micro-depth */
.card__image {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card__image {
    transform: scale(1.03);
}

/* Cinematic reveal mask */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-bg-primary);
    z-index: 1;
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
    transform: scaleX(1);
}

.img-reveal.revealed::before {
    transform: scaleX(0);
}

/* ------------------------------------------
   5. TEXT MOTION EFFECTS
   ------------------------------------------ */

/* Word stagger reveal container */
.text-reveal .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.revealed .word {
    opacity: 1;
    transform: translateY(0);
}

/* Animated gradient heading */
.gradient-text {
    background: linear-gradient(90deg,
            var(--color-primary) 0%,
            var(--color-primary-light) 25%,
            var(--color-accent) 50%,
            var(--color-primary-light) 75%,
            var(--color-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 10s linear infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Letter tracking micro animation */
.hover-track {
    transition: letter-spacing 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-track:hover {
    letter-spacing: 0.1em;
}

/* ------------------------------------------
   6. BUTTON UPGRADE SYSTEM
   ------------------------------------------ */

/* Magnetic effect handled by JS, CSS provides smooth transition */
.btn {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Ripple effect container */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
    z-index: -1;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Micro bounce on hover */
.btn:hover {
    transform: scale(1.03);
}

.btn:active {
    transform: scale(0.98);
}

/* Glow pulse on primary CTA */
.btn--primary {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    animation: ctaGlow 3s ease-in-out infinite;
}

@keyframes ctaGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }

    50% {
        box-shadow: 0 0 20px 2px rgba(220, 38, 38, 0.15);
    }
}

.btn--primary:hover {
    animation: none;
    box-shadow: 0 8px 24px -4px rgba(220, 38, 38, 0.4);
}

/* ------------------------------------------
   7. SECTION TRANSITION SEPARATORS
   ------------------------------------------ */
.section-wave {
    position: relative;
    overflow: hidden;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.section-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

.section-wave--flip svg {
    transform: rotate(180deg);
}

/* Gradient fade between sections */
.section-fade {
    position: relative;
}

.section-fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--color-bg-secondary));
    pointer-events: none;
}

/* Animated divider line */
.divider-animated {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    margin: var(--space-8) auto;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.divider-animated.revealed {
    width: 120px;
}

/* ------------------------------------------
   8. NAVIGATION ENHANCEMENTS
   ------------------------------------------ */

/* Sticky nav with enhanced blur */
.header.scrolled {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

.scroll-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light), var(--color-accent));
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* Active link smooth sliding underline */
.nav__link {
    position: relative;
}

.nav__link::after {
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------
   9. BACKGROUND AMBIENT EFFECTS
   ------------------------------------------ */

/* Hero background image */
.hero__bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.12;
    z-index: 0;
}

/* Hero radial glow */
.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
            rgba(220, 38, 38, 0.12) 0%,
            rgba(220, 38, 38, 0.05) 40%,
            transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

/* Gradient mesh behind sections */
.section--bg-secondary {
    position: relative;
}

.section--bg-secondary::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}

/* Subtle noise texture overlay */
.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ------------------------------------------
   10. FLUID TYPOGRAPHY
   ------------------------------------------ */
h1,
.hero__title {
    font-size: clamp(2rem, 5vw + 1rem, 3.75rem) !important;
}

h2 {
    font-size: clamp(1.5rem, 3vw + 0.5rem, 3rem) !important;
}

h3 {
    font-size: clamp(1.25rem, 2vw + 0.3rem, 1.875rem) !important;
}

/* ------------------------------------------
   11. WHATSAPP FLOATING BUTTON
   ------------------------------------------ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: 0;
    background: #25D366;
    color: white;
    border-radius: 50px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

.whatsapp-float.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.whatsapp-float:hover {
    padding-right: 20px;
    gap: 10px;
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
    color: white;
}

.whatsapp-float__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.whatsapp-float__label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-float:hover .whatsapp-float__label {
    max-width: 140px;
}

/* Pulse ring */
.whatsapp-float::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid rgba(37, 211, 102, 0.4);
    animation: whatsappPulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Notification dot */
.whatsapp-float__dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: dotBounce 1.5s ease-in-out infinite;
}

@keyframes dotBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ------------------------------------------
   12. TEXT MARQUEE
   ------------------------------------------ */
.marquee-section {
    overflow: hidden;
    padding: var(--space-6) 0;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-8);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    white-space: nowrap;
    user-select: none;
}

.marquee-item::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ------------------------------------------
   13. STICKY MOBILE CTA BAR
   ------------------------------------------ */
.sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-cta.visible {
    transform: translateY(0);
}

.sticky-cta .btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .sticky-cta {
        display: block;
    }

    /* Bump WhatsApp button up above sticky CTA */
    .whatsapp-float {
        bottom: 80px;
    }
}

/* ------------------------------------------
   14. CLIENT LOGOS SECTION
   ------------------------------------------ */
.clients-section {
    padding: var(--space-12) 0;
    background: var(--color-bg-primary);
}

.clients-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
}

.client-logo {
    width: 100px;
    height: 80px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.5);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.client-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* ------------------------------------------
   15. COUNTER ANIMATION POLISH
   ------------------------------------------ */
.stat__value {
    transition: color 0.3s ease;
}

.card--stat:hover .stat__value {
    color: var(--color-primary-light);
}

/* ------------------------------------------
   16. SCROLL-TRIGGERED MINI CTA
   ------------------------------------------ */
.mini-cta {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1040;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-6);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-width: 260px;
}

.mini-cta.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.mini-cta__text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
    line-height: var(--leading-snug);
}

.mini-cta__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    border: none;
}

@media (max-width: 768px) {
    .mini-cta {
        display: none;
    }
}

/* ------------------------------------------
   17. PREFERS REDUCED MOTION
   ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body {
        opacity: 1;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .reveal--left,
    .reveal--right {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }

    .whatsapp-float {
        opacity: 1;
        transform: none;
    }

    .whatsapp-float::before {
        animation: none;
    }

    .btn--primary {
        animation: none;
    }
}

/* ------------------------------------------
   18. EXTRA POLISH
   ------------------------------------------ */

/* Smooth page transitions between states */
html {
    scroll-behavior: smooth;
}

/* Image loading states */
img {
    transition: opacity 0.4s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
    opacity: 1;
}

/* Focus ring enhancement */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Selection color */
::selection {
    background: rgba(220, 38, 38, 0.15);
    color: var(--color-text-primary);
}

/* Dark section selection */
.section--bg-dark ::selection {
    background: rgba(220, 38, 38, 0.4);
    color: white;
}

/* Smooth image hover for project cards */
article.card {
    overflow: hidden;
}

article.card .card__image {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

article.card:hover .card__image {
    transform: scale(1.05);
}

/* Enhanced hero grid animation */
.hero__grid {
    animation: gridPulse 4s ease-in-out infinite alternate;
}

@keyframes gridPulse {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.6;
    }
}

/* Stats highlighting on the dark section */
.impact-metrics .card--stat {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.impact-metrics .card--stat:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.3);
    transform: translateY(-6px);
}

/* Footer link hover enhancement */
.footer__link {
    position: relative;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer__link:hover {
    padding-left: 4px;
}

/* Badge subtle animation */
.badge {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
}