/* ============================================
   The Old Barn Porch, Sourdough Co.
   Custom Styles & Animations
   ============================================ */

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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #FF6B4A;
    color: white;
}

/* --- Geometric Hero Shapes --- */
.geo-shape {
    position: absolute;
    pointer-events: none;
}

.geo-circle-1 {
    width: 600px;
    height: 600px;
    border: 2px solid rgba(255, 107, 74, 0.1);
    border-radius: 50%;
    top: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.geo-circle-2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 107, 74, 0.06);
    border-radius: 50%;
    bottom: 10%;
    left: 5%;
    animation: float 10s ease-in-out infinite reverse;
}

.geo-rect-1 {
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 107, 74, 0.15);
    top: 25%;
    right: 8%;
    transform: rotate(45deg);
    animation: spin 20s linear infinite;
}

.geo-triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid rgba(255, 107, 74, 0.08);
    top: 40%;
    left: 3%;
    animation: float 6s ease-in-out infinite;
}

.geo-dot-grid {
    display: grid;
    grid-template-columns: repeat(5, 8px);
    gap: 12px;
    bottom: 15%;
    right: 15%;
    opacity: 0.3;
}

.geo-dot-grid span {
    width: 4px;
    height: 4px;
    background-color: #FF6B4A;
    border-radius: 50%;
}

/* --- Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes spin {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

/* --- Scroll Reveal (below the fold only) --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.hidden-reveal {
    opacity: 0;
    transform: translateY(40px);
}

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

/* --- Navbar --- */
#navbar {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

#navbar.scrolled .font-display,
#navbar.scrolled span:not(.text-coral-500) {
    color: #1a1a1a !important;
}

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

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

/* --- Image hover transitions --- */
img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .geo-circle-1 {
        width: 300px;
        height: 300px;
    }
    
    .geo-circle-2 {
        width: 150px;
        height: 150px;
    }
    
    .geo-rect-1 {
        width: 60px;
        height: 60px;
    }
    
    .geo-triangle {
        display: none;
    }
}
