/* ============================================
   Hsu, Yim, Leung and Koo LLP - Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(209, 90, 56, 0.2);
    color: #1A1410;
}

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

.geo-circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(209, 90, 56, 0.08) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.geo-circle-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(224, 192, 104, 0.12) 0%, transparent 70%);
    bottom: 10%;
    left: 5%;
    border-radius: 50%;
}

.geo-rect-1 {
    width: 120px;
    height: 120px;
    background: rgba(209, 90, 56, 0.06);
    top: 20%;
    right: 38%;
    transform: rotate(45deg);
    border-radius: 8px;
}

.geo-rect-2 {
    width: 80px;
    height: 80px;
    background: rgba(224, 192, 104, 0.1);
    bottom: 25%;
    right: 42%;
    transform: rotate(20deg);
    border-radius: 4px;
}

.geo-triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid rgba(209, 90, 56, 0.05);
    top: 40%;
    left: 2%;
    transform: rotate(-15deg);
}

.geo-dots {
    width: 100px;
    height: 100px;
    background-image: radial-gradient(circle, rgba(209, 90, 56, 0.15) 1px, transparent 1px);
    background-size: 12px 12px;
    bottom: 15%;
    left: 15%;
    opacity: 0.5;
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.8s ease forwards;
}

.hero-reveal:nth-child(1) { animation-delay: 0.1s; }
.hero-reveal:nth-child(2) { animation-delay: 0.25s; }
.hero-reveal:nth-child(3) { animation-delay: 0.4s; }
.hero-reveal:nth-child(4) { animation-delay: 0.55s; }
.hero-reveal:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-image {
    opacity: 0;
    transform: translateX(40px);
    animation: heroImageSlide 1s ease 0.3s forwards;
}

@keyframes heroImageSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
    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; }

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #d15a38, #e0c068);
    transition: height 0.4s ease;
}

.service-card:hover::before {
    height: 100%;
}

/* ============================================
   Navbar Scroll State
   ============================================ */
.nav-scrolled {
    background: rgba(254, 253, 251, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-scrolled .logo-text {
    color: #1A1410;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s 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; }

/* Menu button animation */
.menu-line {
    display: block;
}

.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-open .menu-line:nth-child(3) {
    width: 6px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Back to Top Button
   ============================================ */
#back-to-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

#back-to-top:hover {
    transform: scale(1.1);
}

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

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

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

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

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

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .geo-circle-1 {
        width: 300px;
        height: 300px;
    }
    
    .geo-circle-2 {
        width: 200px;
        height: 200px;
    }
    
    .geo-rect-1,
    .geo-rect-2,
    .geo-triangle,
    .geo-dots {
        display: none;
    }
    
    .hero-reveal {
        opacity: 1;
        transform: translateY(0);
    }
    
    .hero-image {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Stack hero on mobile */
    #hero {
        padding-top: 100px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .geo-rect-1,
    .geo-rect-2 {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    nav, #back-to-top, .geo-shape {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
