/* Custom Global Styles & Animation Overrides */

/* Ensure Noto Sans is used everywhere except for icons */
body, input, textarea, button, select {
    font-family: 'Noto Sans', sans-serif !important;
}

.hero-title-text {
    font-family: 'Stack Sans Notch', sans-serif !important;
    will-change: mask-image, -webkit-mask-image;
}

html {
    scroll-behavior: smooth;
}

/* Page Fade-In */
body {
    opacity: 0;
    animation: pageFadeIn 0.6s ease-out forwards;
}

body.loaded {
    opacity: 1;
}

/* Custom Button Effect */
a.bg-primary, button.bg-primary, .custom-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    outline: 0 !important;
    border: 0 !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    color: #fff !important;
    border-radius: 50px !important;
    background-color: var(--color-primary) !important;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(0,0,0,0.05)) !important;
    box-shadow: 0 4px 11px 0 rgba(0, 100, 50, 0.2), 0 1px 3px 0 rgba(0, 120, 60, 0.25) !important;
    transition: all .2s ease-out !important;
    transform: translateY(0) !important;
}

a.bg-primary:hover, button.bg-primary:hover, .custom-btn:hover {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.25), rgba(0,0,0,0)) !important;
    box-shadow: 0 4px 11px 0 rgba(0, 100, 50, 0.2), 0 1px 3px 0 rgba(0, 120, 60, 0.25) !important; /* Kept identical to base state so it doesn't rise optically */
    transform: translateY(0) !important; /* Zeroed out to strictly prevent physical rise */
}

a.bg-primary:active, button.bg-primary:active, .custom-btn:active {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(0,0,0,0.05)) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 2px 4px 0 rgba(0, 100, 50, 0.15) !important;
    transform: translateY(2px) !important; /* clicks in */
}

/* Language Toggle Haptic Effect */
.lang-toggle {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.lang-toggle:active {
    transform: translateY(2px) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
}



@keyframes pageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scroll State for Navbar (Handled by JS) */
.navbar.scrolled {
    background: rgba(242, 249, 245, 0.95) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.025) !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Mobile Nav Menu Active State (Handled by JS) */
.nav-links.active {
    right: 0 !important;
}

/* Mobile Navbar Styles under Media Query */
@media (max-width: 768px) {
    .nav-links {
        gap: 2rem !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    .nav-links a {
        font-size: 1.5rem !important;
        padding: 0.5rem 1.5rem !important;
        display: inline-block !important;
    }
    .nav-links li {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Diagonal Background Overlay Accents */
.about-section {
    position: relative;
    isolation: isolate;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary, #007D4B);
    opacity: 0.05;
    transform: skewY(3deg);
    transform-origin: top left;
    z-index: 0;
    pointer-events: none;
}

.contact-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-color: var(--color-primary, #007D4B);
    opacity: 0.15;
    transform: skewY(6deg);
    transform-origin: bottom left;
    z-index: 0;
    pointer-events: none;
}

/* Contact Form Animation Styles */
#contact-form-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease-in-out, margin-top 0.8s ease-in-out;
    width: 100%;
}

#contact-form-wrapper.open {
    max-height: 1500px;
    opacity: 1;
    margin-top: 2rem;
}

/* Language Transition Fade Effect (Handled by JS) */
.lang-fade {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.lang-fade.hidden {
    display: revert !important;
    opacity: 0;
}

/* Contact Form Solid White Background Focus State */
.contact-form-container.bg-white-active {
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: rgba(0, 125, 75, 0.2) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 125, 75, 0.1), 0 8px 10px -6px rgba(0, 125, 75, 0.1) !important;
}

/* Custom Animation Keyframes & Helper Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.3s;
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* PDF Viewer Maximize Feature */
body.pdf-maximized {
    overflow: hidden !important;
}

body.pdf-maximized .navbar {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.pdf-maximized .project-container,
body.pdf-maximized section {
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.pdf-viewer-wrapper {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.pdf-viewer-wrapper.maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    box-shadow: none !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #f2f9f5 !important;
    animation: pdfMaximize 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pdfMaximize {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bouncing Scroll Indicator Animation */
@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

.animate-bounce-down {
    animation: bounce-down 1.5s infinite ease-in-out;
}

/* Cargo Train Scroll Animation Helpers */
#cargo-train {
    transform: translateX(-600px);
    will-change: transform;
}

.tail-light {
    transform-origin: center;
}

/* Responsive positioning adjustments for zoomed / short viewports to prevent train/text/button conflicts */
@media (max-height: 850px) {
    .hero-train-container {
        bottom: 30% !important;
    }
    .hero-cta {
        margin-top: 1.25rem !important;
    }
    .scroll-indicator {
        margin-top: 2.5rem !important;
    }
    .hero-content-overlay {
        padding-bottom: 3rem !important;
    }
}

@media (max-height: 720px) {
    .hero-train-container {
        bottom: 27% !important;
    }
    .hero-title-text {
        font-size: clamp(2rem, 6vw, 4.2rem) !important;
    }
    .scroll-indicator {
        display: none !important; /* Hide scroll indicator to free up critical vertical space */
    }
    .hero-cta {
        margin-top: 1rem !important;
    }
    .hero-content-overlay {
        padding-bottom: 2rem !important;
    }
}

@media (max-height: 580px) {
    .hero-train-container {
        bottom: 24% !important;
    }
    .hero-title-text {
        font-size: clamp(1.6rem, 5vw, 3.4rem) !important;
    }
    .hero-cta {
        margin-top: 0.5rem !important;
        padding: 0.5rem 1.5rem !important; /* Make CTA button slightly more compact */
    }
    .hero-content-overlay {
        padding-bottom: 1rem !important;
    }
}