/* ===== Base & Typography ===== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #064e3b;
    color: #fefdf8;
}

/* ===== Scroll Reveal Animations ===== */
.reveal-section {
    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-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-section {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal-section.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Navbar Scroll State ===== */
.navbar-scrolled {
    background-color: rgba(254, 253, 248, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

.navbar-scrolled .menu-line {
    background-color: #064e3b !important;
}

.navbar-scrolled .font-display,
.navbar-scrolled .font-accent {
    color: #064e3b !important;
}

.navbar-scrolled a:not(.inline-block) {
    color: #064e3b !important;
}

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    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.2s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.4s; }

/* ===== Hamburger Animation ===== */
.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

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

.menu-open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

/* ===== Button & Link Focus States ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #fef3c7;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ===== Image Hover Transitions ===== */
img {
    display: block;
    max-width: 100%;
}

/* ===== Smooth Image Loading ===== */
img {
    background-color: #d1fae5;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #064e3b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #047857;
}

/* ===== Input Autofill ===== */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #022c22 inset !important;
    -webkit-text-fill-color: #fefdf8 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== Print Styles ===== */
@media print {
    nav, #contact, .reveal-section {
        opacity: 1 !important;
        transform: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
