/* ============================================
   A Perfect Touch Wallpapering — Custom Styles
   ============================================ */

/* Base Reset & Smooth Scrolling */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Animations
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(12deg); }
    50% { transform: translateY(-20px) rotate(12deg); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation Classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

.animate-scroll {
    animation: scroll 1.5s ease-in-out infinite;
}

/* Reveal Animations */
.reveal-up {
    opacity: 0;
    animation: revealUp 0.8s ease-out forwards;
}

.reveal-left {
    opacity: 0;
    animation: revealLeft 0.8s ease-out forwards;
}

.reveal-right {
    opacity: 0;
    animation: revealRight 0.8s ease-out forwards;
}

/* Staggered delays for reveal-up elements */
.reveal-up:nth-child(1) { animation-delay: 0.1s; }
.reveal-up:nth-child(2) { animation-delay: 0.2s; }
.reveal-up:nth-child(3) { animation-delay: 0.3s; }
.reveal-up:nth-child(4) { animation-delay: 0.4s; }
.reveal-up:nth-child(5) { animation-delay: 0.5s; }
.reveal-up:nth-child(6) { animation-delay: 0.6s; }

/* Hero staggered reveals */
#hero .reveal-up:nth-child(1) { animation-delay: 0.1s; }
#hero .reveal-up:nth-child(2) { animation-delay: 0.2s; }
#hero .reveal-up:nth-child(3) { animation-delay: 0.3s; }
#hero .reveal-up:nth-child(4) { animation-delay: 0.5s; }

/* Intersection Observer fallback — add .visible class */
.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    animation: none;
}

/* ============================================
   Hero Shapes
   ============================================ */

.hero-shape {
    will-change: transform;
}

/* ============================================
   Navbar
   ============================================ */

#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(10, 37, 64, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Service Cards
   ============================================ */

.service-card {
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ============================================
   Gallery Items
   ============================================ */

.gallery-item {
    cursor: pointer;
}

.gallery-item img {
    will-change: transform;
}

/* ============================================
   Testimonial Cards
   ============================================ */

.testimonial-card {
    transition: transform 0.5s ease, background-color 0.5s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* ============================================
   Mobile Menu
   ============================================ */

#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-link {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-link:last-child {
    border-bottom: none;
}

/* ============================================
   Form Styles
   ============================================ */

input:focus,
select:focus,
textarea:focus {
    outline: none;
}

textarea {
    min-height: 120px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
    
    #hero h1 {
        font-size: 2.75rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    #about .relative > div:first-child img {
        height: 350px;
    }
    
    .gallery-item img {
        height: 250px;
    }
}

@media (max-width: 360px) {
    #hero h1 {
        font-size: 2.25rem;
    }
    
    .font-serif.text-4xl {
        font-size: 2rem;
    }
}

/* ============================================
   Selection Color
   ============================================ */

::selection {
    background-color: rgba(0, 212, 170, 0.3);
    color: #0A2540;
}

/* ============================================
   Focus Visible for Accessibility
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #00D4AA;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        animation: none;
    }
}
