/* ========================================
   EP Technology - Shared Styles
   ======================================== */

/* Material Symbol Baseline */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* Brand Gradient */
.bg-brand-gradient {
    background: linear-gradient(135deg, #a93200 0%, #d1430a 100%);
}

.text-gradient-brand {
    background: linear-gradient(135deg, #a93200 0%, #d1430a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient {
    background: linear-gradient(135deg, #a93200, #df2161);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Logo container - handles non-transparent background */
.logo-img {
    height: 70px;
    width: auto;
    mix-blend-mode: multiply;
    object-fit: contain;
}

/* Glassmorphism Nav */
.glass-nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Mobile Menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Scroll Animations */
.reveal {
    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);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

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

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Button hover glow */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
    opacity: 1;
}

/* Service card hover lift */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(169, 50, 0, 0.08);
}

/* Timeline line animation */
.timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e4bebc, transparent);
}

@media (min-width: 768px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Portfolio filter active */
.filter-btn.active {
    background-color: #a93200;
    color: white;
}

/* Form focus styles */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #a93200;
}

/* Map grayscale */
.map-container iframe {
    filter: grayscale(100%) contrast(1.1);
    transition: filter 0.7s ease;
}

.map-container:hover iframe {
    filter: grayscale(0%) contrast(1);
}

/* Smooth scroll for whole page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f6f3f2;
}

::-webkit-scrollbar-thumb {
    background: #e4bebc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a93200;
}

/* Pulse animation for status dot */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Hero text entrance */
@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-animate-delay-1 {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
    opacity: 0;
}

.hero-animate-delay-2 {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
}

.hero-animate-delay-3 {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
    opacity: 0;
}

/* ========================================
   Hero Galaxy Particles Canvas
   ======================================== */
.hero-particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* ========================================
   Hero Image Interactive Effects
   ======================================== */

/* 3D Perspective Container */
.hero-image-perspective {
    perspective: 1000px;
    perspective-origin: center center;
    overflow: visible;
}

/* Mobile adjustments for hero */
@media (max-width: 639px) {
    .hero-image-perspective {
        perspective: 600px;
    }
    .hero-orbit-ring-1 {
        top: -12px;
        left: -12px;
        right: -12px;
        bottom: -12px;
    }
    .hero-orbit-ring-2 {
        top: -24px;
        left: -24px;
        right: -24px;
        bottom: -24px;
    }
    .hero-glow {
        width: 160px;
        height: 160px;
    }
}

/* Main image wrapper with smooth 3D transform */
.hero-image-wrapper {
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    animation: heroFloat 6s ease-in-out infinite;
}

.hero-image-wrapper:hover {
    box-shadow: 0 30px 60px -12px rgba(169, 50, 0, 0.25),
                0 18px 36px -18px rgba(0, 0, 0, 0.3);
}

/* Scroll-driven zoom effect on the image */
.hero-image-zoom {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* Mouse-tracking glow overlay */
.hero-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(209, 67, 10, 0.35) 0%, rgba(169, 50, 0, 0.1) 40%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
    z-index: 5;
    mix-blend-mode: screen;
    filter: blur(20px);
}

.hero-image-wrapper:hover .hero-glow {
    opacity: 1;
}

/* Floating animation for the wrapper */
@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-8px) rotateX(1deg) rotateY(-0.5deg);
    }
    50% {
        transform: translateY(-14px) rotateX(0deg) rotateY(0.5deg);
    }
    75% {
        transform: translateY(-6px) rotateX(-1deg) rotateY(0deg);
    }
}

/* When mouse is over, pause the float and let JS handle transforms */
.hero-image-wrapper.is-hovering {
    animation-play-state: paused;
}

/* Ensure float animation runs on mobile (touch devices) */
@media (hover: none) and (pointer: coarse) {
    .hero-image-wrapper {
        animation: heroFloat 6s ease-in-out infinite !important;
    }
}

/* Orbit rings around the image */
.hero-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(169, 50, 0, 0.1);
    pointer-events: none;
    z-index: -1;
}

.hero-orbit-ring-1 {
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    animation: orbitSpin 20s linear infinite;
    border-style: dashed;
    border-color: rgba(169, 50, 0, 0.08);
}

.hero-orbit-ring-2 {
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    animation: orbitSpin 30s linear infinite reverse;
    border-color: rgba(223, 33, 97, 0.06);
}

/* Small dot on orbit ring */
.hero-orbit-ring-1::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(169, 50, 0, 0.4);
}

.hero-orbit-ring-2::before {
    content: '';
    position: absolute;
    bottom: 10%;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(223, 33, 97, 0.3);
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Floating particle animation */
.hero-float-particle {
    animation: particleFloat 5s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(8px, -12px); }
    66% { transform: translate(-6px, -6px); }
}

/* Scroll progress indicator glow on section */
.hero-image-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(169, 50, 0, 0.3), rgba(223, 33, 97, 0.2), transparent, transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-image-wrapper.scrolled::after {
    opacity: 1;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-image-wrapper {
        animation: none !important;
    }
    .hero-orbit-ring {
        animation: none !important;
    }
    .hero-float-particle {
        animation: none !important;
    }
    .hero-image-zoom {
        transition: none !important;
    }
}

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 100px;
    right: 24px;
    background: #1c1b1b;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 200;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
