/* ===== Custom Styles for Rice Law Office ===== */

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

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

/* Selection */
::selection {
    background-color: rgba(26, 58, 42, 0.15);
    color: #1a3a2a;
}

/* ===== Navigation ===== */
.nav-link {
    position: relative;
}

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

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

/* Navbar scroll state */
.navbar-scrolled {
    background-color: rgba(245, 242, 235, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.06);
}

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.menu-open .menu-line:first-child {
    transform: translateY(4px) rotate(45deg);
}

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

.menu-open .menu-line:nth-child(3) {
    width: 24px;
    transform: translateY(-4px) rotate(-45deg);
}

/* ===== Hero ===== */
@keyframes scroll-line {
    0% { top: -12px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 32px; opacity: 0; }
}

.scroll-line {
    animation: scroll-line 1.8s ease-in-out infinite;
}

/* Floating cards animation */
@keyframes float-1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

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

.reveal-up-floating:nth-child(1) {
    animation: float-1 5s ease-in-out infinite;
}

.reveal-up-floating:nth-child(2) {
    animation: float-2 6s ease-in-out infinite;
    animation-delay: 1s;
}

/* ===== Reveal Animations ===== */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-up-floating {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up-floating.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-up:nth-child(1) { transition-delay: 0ms; }
.reveal-up:nth-child(2) { transition-delay: 100ms; }
.reveal-up:nth-child(3) { transition-delay: 200ms; }
.reveal-up:nth-child(4) { transition-delay: 300ms; }

/* ===== Mobile Links ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* ===== Form Focus ===== */
input:focus,
textarea:focus {
    background-color: #fff;
}

/* ===== Smooth image loading ===== */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ===== Thin scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #9bb88e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #71995f;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 767px) {
    .reveal-up-floating {
        display: none;
    }
}

/* ===== Print styles ===== */
@media print {
    nav, #contact, footer {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
