/* ============================================
   Safe Harbor Behavioral Health — Custom Styles
   ============================================ */

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

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

body {
    min-height: 100vh;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(61, 43, 31, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C0603C;
    transition: width 0.3s ease;
}

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

/* Mobile Menu */
#mobile-menu {
    box-shadow: none;
}

#mobile-menu.open {
    box-shadow: 0 20px 60px rgba(61, 43, 31, 0.15);
}

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

.menu-line {
    transition: all 0.3s ease;
}

#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: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-content {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-image-stack {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

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

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

.shape-circle-1 {
    top: 10%;
    right: 5%;
    width: 400px;
    height: 400px;
    background: #C0603C;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.shape-rect-1 {
    top: 60%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: #DDC9A8;
    border-radius: 30px;
    transform: rotate(45deg);
    animation: float 6s ease-in-out infinite reverse;
}

.shape-triangle-1 {
    top: 20%;
    left: 5%;
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 173px solid #FBC49A;
    opacity: 0.1;
    animation: spin 20s linear infinite;
}

.shape-circle-2 {
    bottom: 10%;
    left: 10%;
    width: 150px;
    height: 150px;
    background: #FDE4CC;
    border-radius: 50%;
    animation: float 10s ease-in-out infinite;
}

.shape-rect-2 {
    top: 40%;
    left: 45%;
    width: 100px;
    height: 100px;
    background: #C0603C;
    border-radius: 20px;
    transform: rotate(20deg);
    opacity: 0.08;
    animation: float 7s ease-in-out infinite reverse;
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Services Section
   ============================================ */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* ============================================
   About Section
   ============================================ */
.about-image-grid {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-image-grid.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-content {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-content.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Approach Section
   ============================================ */
.approach-step {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.approach-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.approach-step:nth-child(1) { transition-delay: 0.1s; }
.approach-step:nth-child(2) { transition-delay: 0.2s; }
.approach-step:nth-child(3) { transition-delay: 0.3s; }

/* ============================================
   Contact Form
   ============================================ */
#contact-form input,
#contact-form textarea {
    transition: all 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(192, 96, 60, 0.15);
}

#contact-form button {
    position: relative;
    overflow: hidden;
}

#contact-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

#contact-form button:hover::before {
    left: 100%;
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .shape-circle-1 {
        width: 200px;
        height: 200px;
    }

    .shape-rect-1 {
        width: 100px;
        height: 100px;
    }

    .shape-triangle-1 {
        border-left-width: 50px;
        border-right-width: 50px;
        border-bottom-width: 87px;
    }

    .shape-circle-2 {
        width: 80px;
        height: 80px;
    }

    .shape-rect-2 {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   Focus & Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #C0603C;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #navbar,
    .geo-shape,
    .animate-bounce {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }
}
