/**
 * Earnest Marine — Custom Stylesheet (custom.css)
 * Nautical Theme, Cartography, Animations & Micro-interactions
 */

/* ========================================================
   BASE DEFAULTS & SMOOTH RENDERING
======================================================== */
body {
    background-color: #F7F8FA;
    color: #102A43;
    font-family: 'Inter', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Offset fixed header on all subpages */
body.subpage {
    padding-top: 5rem;
    /* 80px */
}

@media (min-width: 640px) {
    body.subpage {
        padding-top: 6rem;
        /* 96px */
    }
}

/* Background Nautical Grids */
.bg-nautical-grid {
    background-image:
        linear-gradient(to right, rgba(11, 59, 112, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(11, 59, 112, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

.bg-nautical-grid-dark {
    background-image:
        linear-gradient(to right, rgba(245, 169, 0, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
}

/* Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================================
   LEAFLET PRECISION CARTOGRAPHIC MARITIME MAP
======================================================== */
.leaflet-container {
    background-color: #041628 !important;
    font-family: 'Space Mono', monospace !important;
}

.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    border-radius: 2px !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: #08233f !important;
    color: #F5A900 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: bold;
}

.leaflet-bar a:hover {
    background-color: #0b3b70 !important;
    color: #ffffff !important;
}

.leaflet-tooltip {
    background: #041628 !important;
    color: #ffffff !important;
    border: 1px solid #1B3A5D !important;
    font-family: 'Space Mono', monospace !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    border-radius: 2px !important;
    white-space: nowrap;
}

.leaflet-tooltip-top:before {
    border-top-color: #041628 !important;
}

.leaflet-control-attribution {
    background: rgba(4, 22, 40, 0.85) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 9px !important;
    font-family: 'Space Mono', monospace !important;
}

.leaflet-control-attribution a {
    color: #F5A900 !important;
}

/* Custom Port & Beacon Markers */
.port-leaflet-marker {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.port-leaflet-marker:hover {
    transform: scale(1.3);
    z-index: 9999 !important;
}

.hq-pulse-beacon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.hq-pulse-ring {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(245, 169, 0, 0.4);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.hq-beacon-core {
    position: relative;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #F5A900;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 10px #F5A900;
}

.port-beacon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.port-beacon-core {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #38bdf8;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
    transition: all 0.2s ease;
}

.port-beacon.active-marker .port-beacon-core {
    width: 12px;
    height: 12px;
    background-color: #F5A900;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 14px #F5A900;
}

.port-beacon.active-marker::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #F5A900;
    animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ========================================================
   HERO VIDEO & MARITIME MARQUEE
======================================================== */
.hero-vignette {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.171) 45%, rgba(255, 255, 255, 0.151) 100%);
}

@keyframes marqueeScroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.animate-marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
    will-change: transform;
}

.animate-marquee-track:hover {
    animation-play-state: paused;
}

/* ========================================================
   GLOBAL SCROLL & FADE ANIMATION SYSTEM (USAL.js)
======================================================== */
[data-usal] {
    will-change: opacity, transform;
}

/* Product Catalog Anchor Scroll Offset for Smart Header + Quick Jump */
.product-catalog-card {
    scroll-margin-top: 150px;
}

@media (min-width: 640px) {
    .product-catalog-card {
        scroll-margin-top: 170px;
    }
}

/* Transition Delays */
.delay-75 {
    transition-delay: 75ms;
}

.delay-100 {
    transition-delay: 100ms;
}

.delay-150 {
    transition-delay: 150ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-250 {
    transition-delay: 250ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-350 {
    transition-delay: 350ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

.delay-600 {
    transition-delay: 600ms;
}

/* Card and Interactive Hover (Visual elevation only, no movement on hover) */
.hover-lift {
    transition: box-shadow 300ms ease, border-color 200ms ease !important;
}

.hover-lift:hover {
    box-shadow: 0 20px 30px -10px rgba(11, 59, 112, 0.16) !important;
}

/* Button Shimmer / Light Sweep */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(60deg,
            rgba(255, 255, 255, 0) 20%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 80%);
    transform: rotate(25deg);
    pointer-events: none;
}

.btn-shimmer:hover::after {
    left: 140%;
    transition: left 700ms ease-in-out;
}

/* Subtle Pulse Glow */
@keyframes pulse-subtle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.04);
    }
}

.animate-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

/* Respect Accessibility Motion Preference */
@media (prefers-reduced-motion: reduce) {

    .reveal-ready .reveal-init,
    .reveal-ready .fade-up,
    .reveal-ready .fade-down,
    .reveal-ready .fade-left,
    .reveal-ready .fade-right,
    .reveal-ready .zoom-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ========================================================
   ANIMATED PAGE PRELOADER
======================================================== */
@keyframes loaderLogoPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.88;
    }
}

@keyframes loaderTaglinePulse {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }
}

.loader-logo {
    animation: loaderLogoPulse 2s ease-in-out infinite;
}

.loader-tagline {
    animation: loaderTaglinePulse 2s ease-in-out infinite;
}

.loader-subline {
    animation: loaderTaglinePulse 2.4s ease-in-out infinite;
}

#page-loader.loader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), visibility 600ms !important;
}

/* ========================================================
   DESKTOP NAVIGATION DROPDOWNS
   Mega-menus for Products (double col), Services (with images), Ports (double col)
======================================================== */
.nav-dropdown {
    position: relative;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown:hover .nav-chevron,
.nav-dropdown:focus-within .nav-chevron {
    transform: rotate(180deg);
}