/* ============================================
   UnKrowned Construction LLC — 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 */
::selection {
    background-color: rgba(74, 222, 128, 0.2);
    color: #0D2B45;
}

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

/* Fade-in for hero elements (above the fold — always visible) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation-name: fadeIn;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-fill-mode: forwards;
}

/* Scroll line animation */
@keyframes scrollLine {
    0% {
        top: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 200%;
        opacity: 0;
    }
}

.animate-scroll-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
    animation: scrollLine 2s ease-in-out infinite;
}

/* ============================================
   Navigation
   ============================================ */

.nav-logo-text {
    transition: color 0.3s ease;
}

.nav-logo-sub {
    transition: color 0.3s ease;
}

/* Navbar scroll state */
nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(13, 43, 69, 0.06);
}

nav.scrolled .nav-logo-text {
    color: #0D2B45;
}

nav.scrolled .nav-logo-sub {
    color: #1A4F78;
}

nav.scrolled .menu-line {
    background-color: #0D2B45;
}

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

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

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

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

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

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.25rem;
}

/* ============================================
   Service Cards
   ============================================ */

.service-card {
    transition: background-color 0.5s ease;
}

.service-card:hover {
    background-color: #0A1628;
}

/* ============================================
   Work Gallery
   ============================================ */

.work-gallery-item {
    position: relative;
    overflow: hidden;
}

.work-gallery-item img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Process Steps
   ============================================ */

.process-step {
    opacity: 1;
}

/* ============================================
   Scroll Reveal (below the fold only)
   Gated behind prefers-reduced-motion for accessibility */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1; /* Default: visible — JS adds animation */
        transform: translateY(0);
        transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

/* ============================================
   Form Styles
   ============================================ */

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 767px) {
    .font-display.text-5xl {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .font-display.text-5xl {
        font-size: 3.25rem;
    }
}

@media (min-width: 1024px) {
    .font-display.text-5xl {
        font-size: 3.75rem;
    }
}

/* ============================================
   Focus Visible for Accessibility
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4ADE80;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    nav, #contact, footer, .animate-scroll-line {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .font-display, .font-body {
        color: #000 !important;
    }
}
