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

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

body {
    margin: 0;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a120b;
}
::-webkit-scrollbar-thumb {
    background: #d45d2e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b84420;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(26, 18, 11, 0.08);
    box-shadow: 0 1px 20px rgba(26, 18, 11, 0.06);
}

/* Hero geometric animations */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

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

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

.hero-geo:nth-child(1) { animation: float-slow 8s ease-in-out infinite; }
.hero-geo:nth-child(2) { animation: float-medium 6s ease-in-out infinite; }
.hero-geo:nth-child(3) { animation: float-fast 7s ease-in-out infinite; }
.hero-geo:nth-child(4) { animation: float-medium 5s ease-in-out infinite; }
.hero-geo:nth-child(5) { animation: float-slow 9s ease-in-out infinite; }

/* Service card hover */
.service-card {
    transform: translateY(0);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

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

/* Scroll reveal base */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children */
.stagger-children > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }

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

#mobile-menu:not(.open) {
    opacity: 0;
    pointer-events: none;
}

/* Mobile menu button active state */
#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menu-btn.active .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile link */
.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-geo { animation: none !important; }
    .reveal, .reveal.revealed,
    .stagger-children > * {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    html { scroll-behavior: auto; }
    * { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Focus visible */
:focus-visible {
    outline: 2px solid #d45d2e;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: #d45d2e;
    color: #fefdf8;
}
