/* ==========================================================================
   FinRadar Homepage Styles
   Dependencies: finradar-design-system.css (--fr-* CSS variables)
                 splide-core.min.css (carousel base)
   ========================================================================== */


/* ==========================================================================
   Section 1: Full-width Breakout + Inner Container
   ========================================================================== */

.fr-homepage {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background: var(--fr-bg);
}

.fr-homepage__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--fr-space-lg);
}


/* ==========================================================================
   Section 2: Hero
   ========================================================================== */

.fr-hero {
    position: relative;
    padding: 120px 0 80px;
    overflow: hidden;
    background: var(--fr-bg);
}

/* Radar background – inline SVG for reliable animation */
.fr-hero__radar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Dark mode: brighter radar */
[data-theme="dark"] .fr-hero__radar {
    opacity: 0.85;
}

.fr-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.fr-hero__eyebrow {
    margin-bottom: var(--fr-space-md);
    color: var(--fr-green);
}

.fr-hero__title {
    font-family: var(--fr-font);
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 800;
    letter-spacing: -2.5px;
    line-height: 1.05;
    margin-bottom: var(--fr-space-lg);
    color: var(--fr-green);
}

/* Gradient text (progressive enhancement) */
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .fr-hero__title {
        background: linear-gradient(135deg, var(--fr-green), var(--fr-green-light), var(--fr-green-light));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Dark mode gradient text */
[data-theme="dark"] .fr-hero__title {
    background: linear-gradient(135deg, #4ade80, #6ee7b7, #a7f3d0); /* decorative mesh gradient - no design system equivalent */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fr-hero__subtitle {
    font-family: var(--fr-font);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    line-height: 1.4;
    color: var(--fr-text);
    max-width: 700px;
    margin: 0 auto var(--fr-space-md);
}

.fr-hero__desc {
    font-family: var(--fr-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fr-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--fr-space-xl);
}

.fr-hero__ctas {
    display: flex;
    gap: var(--fr-space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.fr-hero__cta {
    min-width: 180px;
}

.fr-hero__note {
    font-family: var(--fr-font);
    font-size: 14px;
    color: var(--fr-text-muted);
    margin-top: var(--fr-space-md);
}


/* ==========================================================================
   Section 3: Stats Ticker
   ========================================================================== */

.fr-stats {
    padding: var(--fr-space-xl) 0;
    background: var(--fr-card-bg);
    border-top: 1px solid var(--fr-border);
    border-bottom: 1px solid var(--fr-border);
}

.fr-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--fr-space-lg);
    text-align: center;
}

.fr-stats__number {
    font-family: var(--fr-font);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: var(--fr-green);
    display: block;
    letter-spacing: -1px;
}

.fr-stats__label {
    font-family: var(--fr-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--fr-text-muted);
    display: block;
    margin-top: var(--fr-space-xs);
}


/* ==========================================================================
   Section 4: Feature Cards
   ========================================================================== */

.fr-features {
    padding: var(--fr-space-2xl) 0;
}

.fr-features__section-title {
    text-align: center;
    margin-bottom: var(--fr-space-sm);
}

.fr-features__section-desc {
    text-align: center;
    color: var(--fr-text-secondary);
    font-family: var(--fr-font);
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--fr-space-xl);
}

.fr-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--fr-space-lg);
}

.fr-features__card {
    text-align: center;
    padding: var(--fr-space-xl);
}

.fr-features__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--fr-space-md);
    background: var(--fr-green-bg-hover);
    border-radius: var(--fr-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fr-green);
}

.fr-features__card-title {
    font-family: var(--fr-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--fr-text);
    margin-bottom: var(--fr-space-sm);
}

.fr-features__card-desc {
    font-family: var(--fr-font);
    font-size: 14px;
    color: var(--fr-text-muted);
    line-height: 1.6;
}

/* Feature card stagger animation */
.fr-features__card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].fr-revealed .fr-features__card {
    opacity: 1;
    transform: translateY(0);
}

.fr-features .fr-features__card:nth-child(1) { transition-delay: 0s; }
.fr-features .fr-features__card:nth-child(2) { transition-delay: 0.1s; }
.fr-features .fr-features__card:nth-child(3) { transition-delay: 0.15s; }
.fr-features .fr-features__card:nth-child(4) { transition-delay: 0.2s; }
.fr-features .fr-features__card:nth-child(5) { transition-delay: 0.25s; }
.fr-features .fr-features__card:nth-child(6) { transition-delay: 0.3s; }
.fr-features .fr-features__card:nth-child(7) { transition-delay: 0.35s; }
.fr-features .fr-features__card:nth-child(8) { transition-delay: 0.4s; }
.fr-features .fr-features__card:nth-child(9) { transition-delay: 0.45s; }


/* ==========================================================================
   Section 5: Screenshot Carousel
   ========================================================================== */

.fr-carousel-section {
    padding: var(--fr-space-2xl) 0;
    background: var(--fr-card-bg);
}

.fr-carousel-section__title {
    text-align: center;
    margin-bottom: var(--fr-space-sm);
}

.fr-carousel-section__desc {
    text-align: center;
    color: var(--fr-text-secondary);
    font-family: var(--fr-font);
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--fr-space-xl);
}

.fr-carousel-section__track {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--fr-space-lg);
}

/* Splide arrow overrides */
.fr-carousel .splide__arrow {
    background: var(--fr-card-bg);
    border: 1px solid var(--fr-border);
    width: 48px;
    height: 48px;
    border-radius: var(--fr-radius-pill);
    box-shadow: var(--fr-shadow-md);
    opacity: 1;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.fr-carousel .splide__arrow--prev {
    left: 0.5em;
}

.fr-carousel .splide__arrow--next {
    right: 0.5em;
}

.fr-carousel .splide__arrow:hover {
    border-color: var(--fr-green);
    box-shadow: var(--fr-shadow-glow);
}

.fr-carousel .splide__arrow svg {
    fill: var(--fr-text);
    width: 20px;
    height: 20px;
}

/* Splide pagination dots */
.fr-carousel .splide__pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: var(--fr-space-md) 0 0;
    margin: 0;
    list-style: none;
}

.fr-carousel .splide__pagination li {
    line-height: 0;
}

.fr-carousel .splide__pagination__page {
    background: var(--fr-border);
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    max-width: 8px;
    max-height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-block;
    opacity: 1;
}

.fr-carousel .splide__pagination__page.is-active {
    background: var(--fr-green);
}

.fr-carousel__slide-inner {
    text-align: center;
}

.fr-carousel__slide-img {
    width: 100%;
    border-radius: var(--fr-radius-xl);
    border: 1px solid var(--fr-border);
    box-shadow: var(--fr-shadow-lg);
}

.fr-carousel__slide-caption {
    font-family: var(--fr-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--fr-text-secondary);
    margin-top: var(--fr-space-md);
}


/* ==========================================================================
   Section 6: Tutorial Videos
   ========================================================================== */

.fr-videos {
    padding: var(--fr-space-2xl) 0;
}

.fr-videos__title {
    text-align: center;
    margin-bottom: var(--fr-space-sm);
}

.fr-videos__desc {
    text-align: center;
    color: var(--fr-text-secondary);
    font-family: var(--fr-font);
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--fr-space-xl);
}

.fr-videos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--fr-space-lg);
}

.fr-videos__card {
    text-align: left;
}

.fr-videos__placeholder {
    aspect-ratio: 16 / 9;
    background: var(--fr-bg);
    border-radius: var(--fr-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--fr-space-md);
    margin-bottom: var(--fr-space-md);
    color: var(--fr-text-muted);
    border: 1px solid var(--fr-border);
}

.fr-videos__card-title {
    font-family: var(--fr-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--fr-text);
    margin-bottom: var(--fr-space-xs);
}

.fr-videos__card-desc {
    font-family: var(--fr-font);
    font-size: 14px;
    color: var(--fr-text-muted);
    line-height: 1.6;
}

.fr-videos__embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: var(--fr-space-md);
    border-radius: var(--fr-radius-md);
    overflow: hidden;
    border: 1px solid var(--fr-border);
}

.fr-videos__embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}


/* ==========================================================================
   Section 7: Email Signup / Final CTA
   ========================================================================== */

.fr-cta {
    padding: var(--fr-space-2xl) 0 calc(var(--fr-space-2xl) + 20px);
    background: var(--fr-card-bg);
    text-align: center;
    border-top: 1px solid var(--fr-border);
}

.fr-cta__title {
    font-family: var(--fr-font);
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    color: var(--fr-text);
    margin-bottom: var(--fr-space-md);
    letter-spacing: -1px;
}

.fr-cta__subtitle {
    font-family: var(--fr-font);
    font-size: 18px;
    color: var(--fr-text-secondary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto var(--fr-space-xl);
}

.fr-cta__form {
    max-width: 500px;
    margin: 0 auto;
}

.fr-cta__input-wrap {
    display: flex;
    gap: var(--fr-space-sm);
}

.fr-cta__email {
    flex: 1;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

.fr-cta__submit {
    white-space: nowrap;
}

.fr-cta__status {
    margin-top: var(--fr-space-sm);
    font-family: var(--fr-font);
    font-size: 14px;
}

.fr-cta__status--success {
    color: var(--fr-green);
}

.fr-cta__status--error {
    color: var(--fr-red);
}

.fr-cta__note {
    font-family: var(--fr-font);
    font-size: 13px;
    color: var(--fr-text-muted);
    margin-top: var(--fr-space-md);
}


/* ==========================================================================
   Section 8: Section Reveal Animation
   ========================================================================== */

[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].fr-revealed {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   Section 9: Responsive -- Tablet (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .fr-hero {
        padding: 80px 0 60px;
    }

    .fr-hero__title {
        letter-spacing: -1.5px;
    }

    .fr-hero__cta {
        min-width: auto;
        width: 100%;
        max-width: 280px;
    }

    .fr-stats__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--fr-space-md);
    }

    .fr-features__grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .fr-carousel .splide__arrow {
        display: none;
    }

    .fr-carousel-section__track {
        padding: 0 var(--fr-space-md);
    }

    .fr-cta__input-wrap {
        flex-direction: column;
    }

    .fr-cta__submit {
        width: 100%;
    }
}


/* ==========================================================================
   Section 10: Responsive -- Mobile (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .fr-hero {
        padding: 60px 0 40px;
    }

    .fr-hero__title {
        letter-spacing: -1px;
    }

    .fr-hero__subtitle {
        font-size: 16px;
        margin-bottom: var(--fr-space-sm);
    }

    .fr-hero__desc {
        margin-bottom: var(--fr-space-lg);
    }

    .fr-hero__ctas {
        flex-direction: column;
        align-items: center;
    }

    .fr-hero__cta {
        width: 100%;
        max-width: 300px;
    }

    .fr-hero__note {
        margin-top: var(--fr-space-sm);
    }

    /* Compact stats - keep in one row */
    .fr-stats {
        padding: var(--fr-space-md) 0;
    }

    .fr-stats__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--fr-space-xs);
    }

    .fr-stats__number {
        font-size: 22px;
        letter-spacing: -0.5px;
    }

    .fr-stats__label {
        font-size: 11px;
    }

    /* Compact feature cards - inline icon with title */
    .fr-features {
        padding: var(--fr-space-lg) 0;
    }

    .fr-features__section-desc {
        margin-bottom: var(--fr-space-md);
    }

    .fr-features__grid {
        grid-template-columns: 1fr;
        gap: var(--fr-space-sm);
    }

    .fr-features__card {
        padding: var(--fr-space-sm) var(--fr-space-md);
        text-align: left;
        display: grid;
        grid-template-columns: 28px 1fr;
        grid-template-rows: auto auto;
        column-gap: var(--fr-space-sm);
        row-gap: 2px;
        align-items: start;
    }

    .fr-features__icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        margin: 0;
        grid-row: 1;
        grid-column: 1;
        background: var(--fr-green-bg-hover);
        border-radius: 6px;
    }

    .fr-features__icon svg {
        width: 14px;
        height: 14px;
    }

    .fr-features__card-title {
        font-size: 15px;
        margin-bottom: 0;
        grid-row: 1;
        grid-column: 2;
        line-height: 28px;
    }

    .fr-features__card-desc {
        font-size: 13px;
        line-height: 1.4;
        grid-row: 2;
        grid-column: 2;
    }

    /* Compact carousel */
    .fr-carousel-section {
        padding: var(--fr-space-xl) 0;
    }

    .fr-carousel-section__track {
        padding: 0 var(--fr-space-sm);
    }

    /* Compact videos */
    .fr-videos {
        padding: var(--fr-space-xl) 0;
    }

    .fr-videos__grid {
        grid-template-columns: 1fr;
        gap: var(--fr-space-md);
    }

    /* Compact CTA */
    .fr-cta {
        padding: var(--fr-space-xl) 0;
    }

    .fr-cta__title {
        font-size: 24px;
    }
}


/* ==========================================================================
   Section 11: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .fr-hero__radar {
        display: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .fr-features__card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
