/* ============================================
   HOUSE OF FLATS INC — Custom Styles
   Premium Dark Luxury Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-dark: #0e0b08;
    --color-brown: #1a1410;
    --color-card: #221c16;
    --color-border: #3a2e24;
    --color-terra: #c4835a;
    --color-terra-light: #d4a07a;
    --color-sand: #e8d4be;
    --color-sand-light: #f2e6d8;
    --color-muted: #8a7a6e;
    --color-gold: #c9a84c;
}

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

body {
    background-color: var(--color-dark);
    color: var(--color-sand);
}

::selection {
    background: var(--color-terra);
    color: var(--color-dark);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-terra);
}

/* --- Navbar --- */
#navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(14, 11, 8, 0.8);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s ease, background 0.4s ease;
}

#navbar.scrolled {
    border-bottom-color: var(--color-border);
    background: rgba(14, 11, 8, 0.95);
}

/* --- Floating Stat Cards --- */
.floating-card-1 {
    animation: floatA 5s ease-in-out infinite;
}
.floating-card-2 {
    animation: floatB 5.5s ease-in-out infinite;
}
.floating-card-3 {
    animation: floatC 4.8s ease-in-out infinite;
}
.floating-card-4 {
    animation: floatD 6s ease-in-out infinite;
}

@keyframes floatA {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes floatB {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(-0.5deg); }
}
@keyframes floatC {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
@keyframes floatD {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50% { transform: translateY(-14px) rotate(1deg); }
}

/* --- Service Cards --- */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-terra), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* --- Review Cards --- */
.review-card {
    position: relative;
}

.review-card::after {
    content: '"';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: 'Playfair Display', serif;
    font-size: 6rem;
    line-height: 1;
    color: var(--color-terra);
    opacity: 0.06;
    pointer-events: none;
}

/* --- Intersection Observer Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.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; }

/* --- Mobile Menu --- */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-terra);
    transition: width 0.3s ease;
}

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

/* --- Mobile menu transition --- */
#mobileMenu {
    animation: slideDown 0.3s ease forwards;
}

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

#mobileMenu.closing {
    animation: slideUp 0.25s ease forwards;
}

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

/* --- Select dropdown styling --- */
select option {
    background: var(--color-brown);
    color: var(--color-sand);
}

/* --- Button focus styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-terra);
    outline-offset: 2px;
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    .floating-card-1 {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-2 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-3 {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-4 {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        animation: none;
    }

    #hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-stack {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .hero-stack .space-y-8 {
        order: 1;
    }

    .hero-stack .relative {
        order: 2;
        min-h-auto;
    }
}

/* --- Print --- */
@media print {
    #navbar, .floating-card-1, .floating-card-2, .floating-card-3, .floating-card-4 {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}
