/* ===== Custom Styles for Anton Stassiy Real Estate ===== */

/* Base resets & smooth scrolling */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background-color: rgba(13, 148, 136, 0.3);
    color: #f1f5f9;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scrollLine {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
    51% {
        transform-origin: bottom;
    }
    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Staggered reveal delays */
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.reveal:nth-child(5) { transition-delay: 0.5s; }

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

#navbar {
    backdrop-filter: blur(0px);
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.05);
}

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

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fadeInUp 0.5s ease-out forwards;
}

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

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.5rem;
}

/* ===== Custom Select Dropdown ===== */

select option {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* ===== Image hover containers ===== */

.overflow-hidden {
    position: relative;
}

.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 15, 30, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

/* ===== Form focus styles ===== */

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.5);
}

/* ===== Button press effect ===== */

button:active,
a:active {
    transform: scale(0.98);
}

/* ===== Responsive adjustments ===== */

@media (max-width: 768px) {
    .font-serif {
        line-height: 1.15;
    }
}

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

/* ===== Print styles ===== */

@media print {
    nav,
    #contact-form,
    .animate-scroll-line {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
