/* ===== Custom Styles for Cruz Ornamental Iron Work ===== */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    position: relative;
}

/* ===== Geometric Decorative Shapes ===== */
.geo-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0.04;
}

.geo-circle-1 {
    top: 15%;
    left: -5%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 3px solid #ff5a2e;
    animation: float 20s ease-in-out infinite;
}

.geo-circle-2 {
    bottom: 10%;
    right: -3%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 2px solid #ff8056;
    animation: float 15s ease-in-out infinite reverse;
}

.geo-triangle {
    top: 40%;
    right: 5%;
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid #ff5a2e;
    animation: spin 30s linear infinite;
}

.geo-rect-1 {
    top: 60%;
    left: 8%;
    width: 100px;
    height: 100px;
    border: 2px solid #ff8056;
    transform: rotate(45deg);
    animation: float 12s ease-in-out infinite;
}

.geo-rect-2 {
    top: 20%;
    left: 40%;
    width: 60px;
    height: 60px;
    border: 2px solid #ff5a2e;
    transform: rotate(20deg);
    animation: spin 25s linear infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

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

/* ===== Navbar ===== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff5a2e;
    transition: width 0.3s ease;
}

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

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(17, 14, 22, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 90, 46, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu ===== */
.menu-line {
    display: block;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* ===== Service Cards ===== */
.service-card {
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(255, 90, 46, 0.1);
}

/* ===== Gallery ===== */
.gallery-item {
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ===== Testimonials ===== */
.testimonial-card {
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(255, 90, 46, 0.08);
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hidden by default for scroll reveal - progressive enhancement via JS */
.reveal-hidden {
    opacity: 0;
    transform: translateY(40px);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-hidden {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .reveal-hidden.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===== Back to Top ===== */
#backToTop {
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:not(.visible) {
    pointer-events: none;
}

#backToTop:hover {
    box-shadow: 0 8px 30px rgba(255, 90, 46, 0.4);
}

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

::-webkit-scrollbar-track {
    background: #1e1a25;
}

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

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

/* ===== Selection ===== */
::selection {
    background: rgba(255, 90, 46, 0.3);
    color: #fff;
}

/* ===== Form Focus States ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ===== Mobile responsiveness ===== */
@media (max-width: 768px) {
    .geo-shape {
        display: none;
    }
}

/* ===== 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-hidden {
        opacity: 1;
        transform: none;
    }
}
