/* ============================================
   EMBARK FUNDS — SHARED STYLES
   Extracted from inline <style> blocks across all pages.
   ============================================ */

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #C9A961 0%, #a07d4a 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4b56f 0%, #C9A961 100%);
}

/* === Scroll Progress Bar === */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #C9A961 0%, #ffffff 100%);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 20px rgba(201, 169, 97, 0.8);
}

/* === Page Load Animation === */
body {
    animation: fadeInBody 0.8s ease-out;
}

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

/* === Glassmorphism Navigation === */
.glass-nav {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* === Hero Parallax Animation === */
@keyframes heroParallax {
    0%   { transform: scale(1.15); opacity: 0.3; }
    50%  { transform: scale(1);    opacity: 0.45; }
    100% { transform: scale(1.15); opacity: 0.3; }
}

.hero-image {
    animation: heroParallax 30s infinite ease-in-out;
    will-change: transform;
}

.parallax-bg {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* === Fade In Animations === */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* === Staggered Animation === */
.stagger-item {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-item.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* === Hover Underline Animation === */
.hover-underline-animation {
    position: relative;
}

.hover-underline-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #C9A961 0%, #ffffff 100%);
    transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-underline-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* === Image Reveal Animation === */
.reveal-container {
    width: 100%;
    height: 0;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.reveal-container.is-animating {
    animation: revealBottomToTop 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes revealBottomToTop {
    0%   { height: 0; }
    100% { height: 500px; }
}

.reveal-container img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.8);
    transition: filter 2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s ease;
}

.reveal-container.is-animating img {
    filter: grayscale(0%) brightness(1);
}

.reveal-container:hover img {
    transform: scale(1.05);
}

/* === Glassmorphism Cards === */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(201, 169, 97, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* === Circle Icon Container === */
.circle-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 2rem auto;
}

.circle-border {
    position: absolute;
    inset: 0;
    border: 2px solid;
    border-radius: 50%;
    transition: all 0.5s ease;
}

.benefit-card:hover .circle-border {
    border-color: #C9A961 !important;
    background: rgba(201, 169, 97, 0.1);
    transform: scale(1.1);
}

/* === Horizontal Scroll === */
.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 1.5rem;
    padding: 2rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #C9A961 transparent;
}

.horizontal-scroll::-webkit-scrollbar { height: 8px; }
.horizontal-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #C9A961 0%, #a07d4a 100%); border-radius: 10px; }

/* === Video Card === */
.video-card {
    min-width: 400px;
    max-width: 400px;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.video-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.video-card:hover::before { opacity: 1; }
.video-card img { transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.video-card:hover img { transform: scale(1.1); }

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(201, 169, 97, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 40px rgba(201, 169, 97, 0.4);
}

.video-card:hover .video-play-icon {
    background: rgba(255, 255, 255, 0.95);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 15px 50px rgba(255, 255, 255, 0.5);
}

.video-play-icon i {
    margin-left: 5px;
    color: #000;
    font-size: 28px;
}

/* === Section Number === */
.section-number {
    opacity: 0.05;
    font-size: 12rem;
    font-weight: 700;
    position: absolute;
    top: -2rem;
    left: 0;
    line-height: 1;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.bg-white .section-number { opacity: 0.15; }

/* === Navigation Dots === */
#nav-dots {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(15, 23, 42, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot:hover {
    background: rgba(201, 169, 97, 0.6);
    border-color: rgba(201, 169, 97, 0.8);
    transform: scale(1.3);
}

.nav-dot.active {
    background: #C9A961;
    border-color: #C9A961;
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(201, 169, 97, 0.8);
}

.nav-dot::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-dot:hover::before { opacity: 1; }

/* === Buttons === */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before { width: 300px; height: 300px; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(201, 169, 97, 0.4); }

/* === Interest Popup Modal === */
#interest-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#interest-popup.active { opacity: 1; pointer-events: auto; }
#interest-popup.active .popup-content { transform: scale(1); }

.popup-content {
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.8);
}

.popup-content::-webkit-scrollbar { width: 6px; }
.popup-content::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.popup-content::-webkit-scrollbar-thumb { background: #C9A961; border-radius: 10px; }

/* === Custom Checkbox === */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.custom-checkbox:checked { background: #C9A961; border-color: #C9A961; }
.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}
.custom-checkbox:hover { border-color: #C9A961; }

/* === Calculator Container === */
.calculator-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* === Simulation Tool Modal === */
#calc-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#calc-modal.active { opacity: 1; pointer-events: auto; }

.calc-modal-inner {
    width: 100%;
    max-width: 1280px;
    height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transform: scale(0.96) translateY(24px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(201, 169, 97, 0.15);
}

#calc-modal.active .calc-modal-inner { transform: scale(1) translateY(0); }

.calc-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.calc-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f5f5f0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.calc-modal-title span.dot {
    width: 6px;
    height: 6px;
    background: #C9A961;
    border-radius: 50%;
    display: inline-block;
}

.calc-modal-close {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.calc-modal-close:hover { background: #C9A961; border-color: #C9A961; color: #000; }

.calc-modal-iframe-wrap { flex: 1; overflow: hidden; position: relative; }
.calc-modal-iframe-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

/* === Mobile Carousel System === */
.m-carousel-outer { position: relative; }
.m-carousel-nav { display: none; }

/* === Responsive === */
@media (max-width: 768px) {
    .section-number {
        font-size: 4rem;
        position: relative;
        top: 0;
        display: block;
        margin-bottom: 0.5rem;
    }

    .md\:w-1\/4.fade-in-section {
        display: flex;
        flex-direction: column;
    }

    .md\:w-1\/4.fade-in-section h2 {
        padding-top: 0 !important;
        margin-top: 0;
    }

    #nav-dots { display: none; }

    .video-card { min-width: 300px; max-width: 300px; }

    .popup-content {
        max-height: 95vh;
        max-width: calc(100vw - 2rem) !important;
        margin: 0 auto;
    }

    .popup-content > div:last-child { padding: 1.5rem !important; }

    .calculator-iframe {
        height: 1400px !important;
        border-radius: 12px !important;
    }

    .spv-card-mini { min-width: 0; }

    /* Carousel */
    .m-carousel-outer { overflow: hidden; }

    .m-carousel-track {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
    }

    .m-carousel-track > * {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        transform: none !important;
        box-sizing: border-box;
    }

    .m-carousel-track > *.is-visible { transform: none !important; }

    .m-carousel-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 1.25rem;
        gap: 1rem;
    }

    .m-carousel-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 1;
    }

    .m-carousel-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        border: none;
        background: rgba(128, 128, 128, 0.35);
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 0;
        flex-shrink: 0;
    }

    .m-carousel-dot.active {
        background: #C9A961;
        width: 22px;
        border-radius: 4px;
    }

    .m-carousel-arrow {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1.5px solid rgba(201, 169, 97, 0.45);
        background: transparent;
        color: #C9A961;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 13px;
        flex-shrink: 0;
    }

    .m-carousel-arrow:hover { background: #C9A961; color: #000; border-color: #C9A961; }
    .m-carousel-arrow:disabled { opacity: 0.25; cursor: not-allowed; }

    .m-carousel-dark .m-carousel-dot { background: rgba(255, 255, 255, 0.2); }
    .m-carousel-dark .m-carousel-dot.active { background: #C9A961; }
    .m-carousel-dark .m-carousel-arrow { border-color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.85); }
    .m-carousel-dark .m-carousel-arrow:hover { background: #C9A961; color: #000; border-color: #C9A961; }

    #section-features .m-carousel-track > * { padding-bottom: 0.5rem; }

    #calc-modal { padding: 0; }
    .calc-modal-inner { border-radius: 0; height: 100vh; }
}

@media (max-width: 374px) {
    .popup-content { max-width: calc(100vw - 1rem) !important; }
    .popup-content > div:last-child { padding: 1.25rem !important; }
    .video-card { min-width: 280px; max-width: 280px; }
}

/* === Video Slider === */
.video-slider-wrapper { position: relative; }

.video-slider-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.video-slider-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    background: #fff;
    color: #141c25;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.video-slider-btn:hover {
    background: #C9A961;
    border-color: #C9A961;
    color: #000;
    box-shadow: 0 4px 20px rgba(201, 169, 97, 0.35);
}

/* Responsive video cards — fit iPhone 15 viewport */
@media (max-width: 768px) {
    .video-card {
        min-width: min(400px, calc(100vw - 48px));
        max-width: min(400px, calc(100vw - 48px));
    }
}

/* Clip section-number overflow within its container (comparison section no longer has overflow-hidden) */
#comparison .md\:w-1\/4 {
    overflow: hidden;
}

/* Calculator iframe responsive height */
@media (max-width: 768px) {
    .calculator-iframe {
        height: 1600px !important;
    }
}
