/* ═══════════════════════════════════════════════════════════════
   STM LANDING PAGE — Design System Components
   Uses tokens from main.css (:root variables)
   All sizing in rem, consistent density scale
   ═══════════════════════════════════════════════════════════════ */

/* --- STM Design Tokens --- */
:root {
    /* Spacing scale (4px base) */
    --stm-space-xs: 0.25rem;
    --stm-space-sm: 0.5rem;
    --stm-space-md: 1rem;
    --stm-space-lg: 1.5rem;
    --stm-space-xl: 2rem;
    --stm-space-2xl: 3rem;
    --stm-space-3xl: 4rem;
    --stm-space-4xl: 6rem;
    --stm-space-5xl: 8rem;

    /* Type scale — fluid */
    --stm-text-xs: 0.75rem;
    --stm-text-sm: 0.875rem;
    --stm-text-base: 1rem;
    --stm-text-lg: 1.125rem;
    --stm-text-xl: 1.25rem;
    --stm-text-2xl: clamp(1.25rem, 2vw, 1.5rem);
    --stm-text-3xl: clamp(1.5rem, 3vw, 2rem);
    --stm-text-4xl: clamp(2rem, 4vw, 2.75rem);
    --stm-text-display: clamp(2.5rem, 6vw, 4.5rem);

    /* Radii */
    --stm-radius-sm: 0.5rem;
    --stm-radius-md: 0.75rem;
    --stm-radius-lg: 1rem;
    --stm-radius-xl: 1.5rem;

    /* Shadows — blue-tinted */
    --stm-shadow-sm: 0 0.125rem 0.5rem -0.0625rem rgba(28, 63, 170, 0.06);
    --stm-shadow-md: 0 0.5rem 1.5rem -0.25rem rgba(28, 63, 170, 0.08);
    --stm-shadow-lg: 0 1rem 2.5rem -0.5rem rgba(28, 63, 170, 0.1);
    --stm-shadow-xl: 0 1.5rem 3rem -0.5rem rgba(28, 63, 170, 0.14);

    /* Semantic */
    --stm-red: #ef4444;
    --stm-red-light: #fef2f2;
}

/* --- Tag / Label Component --- */
.stm-tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--trader-green-light);
    color: var(--trader-green-dark);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: var(--stm-text-xs);
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stm-tag--light {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Section Foundations --- */
.stm-section {
    padding: var(--stm-space-4xl) var(--stm-space-lg);
}

.stm-section--alt {
    background: var(--light-bg);
}

.stm-section-header {
    max-width: 40rem;
    margin: 0 auto var(--stm-space-3xl);
    text-align: center;
}

.stm-section-header .stm-tag {
    margin-bottom: var(--stm-space-lg);
}

.stm-section-header h2 {
    font-size: var(--stm-text-4xl);
    margin-bottom: var(--stm-space-md);
    color: var(--dark);
}

.stm-section-header h2 span {
    color: var(--trader-green);
}

.stm-section-header p {
    font-size: var(--stm-text-lg);
    color: var(--gray);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   0. TRANSPARENT NAV — White text/logo over dark hero
   Only active on STM page (body.stm-page), before scroll
   ═══════════════════════════════════════════════════════════════ */
body.stm-page header:not(.scrolled) {
    background: transparent;
}

body.stm-page header:not(.scrolled) .logo__img--dark {
    display: none;
}

body.stm-page header:not(.scrolled) .logo__img--light {
    display: block;
}

body.stm-page header:not(.scrolled) .nav-links a {
    color: rgba(255, 255, 255, 0.85);
}

body.stm-page header:not(.scrolled) .nav-links a:hover {
    color: var(--white);
}

body.stm-page header:not(.scrolled) .mobile-menu-btn {
    color: var(--white);
}

body.stm-page header:not(.scrolled) .btn-primary {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

body.stm-page header:not(.scrolled) .btn-primary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   1. HERO — Dark gradient with subtle grid pattern
   ═══════════════════════════════════════════════════════════════ */
.stm-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stm-hero__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0d1b3e 0%, var(--dark) 50%, #0a1225 100%);
}

.stm-hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(28, 63, 170, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 63, 170, 0.05) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.stm-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: var(--stm-space-5xl);
    padding-bottom: var(--stm-space-4xl);
}

.stm-hero__inner .stm-tag {
    animation: stm-fadeUp 0.8s var(--ease-out-expo) 0.1s both;
}

.stm-hero__title {
    font-size: var(--stm-text-display);
    color: var(--white);
    margin-top: var(--stm-space-lg);
    margin-bottom: var(--stm-space-lg);
    line-height: 1.08;
    letter-spacing: -0.03em;
    animation: stm-fadeUp 0.8s var(--ease-out-expo) 0.25s both;
}

.stm-hero__title span {
    color: var(--trader-green);
    position: relative;
}

.stm-hero__title span::after {
    content: '';
    position: absolute;
    bottom: 0.05em;
    left: 0;
    right: 0;
    height: 0.1em;
    background: var(--trader-green);
    opacity: 0.4;
    border-radius: 0.25rem;
}

.stm-hero__subtitle {
    font-size: var(--stm-text-lg);
    color: rgba(255, 255, 255, 0.7);
    max-width: 48rem;
    margin: 0 auto var(--stm-space-lg);
    line-height: 1.7;
    animation: stm-fadeUp 0.8s var(--ease-out-expo) 0.35s both;
}

.stm-hero__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--stm-space-lg);
    font-size: var(--stm-text-sm);
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: var(--stm-space-2xl);
    animation: stm-fadeUp 0.8s var(--ease-out-expo) 0.4s both;
}

.stm-hero__divider {
    width: 1px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.2);
}

.stm-hero__actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: var(--stm-space-xl);
    animation: stm-fadeUp 0.8s var(--ease-out-expo) 0.5s both;
}

.stm-hero__cta {
    font-size: var(--stm-text-base);
    padding: 1.125rem 2.75rem;
}

.stm-hero__link {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: var(--stm-text-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stm-hero__link:hover {
    color: var(--white);
}

.stm-hero__link i {
    transition: transform 0.3s var(--ease-out-expo);
}

.stm-hero__link:hover i {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════
   2. INTRO — Description below hero
   ═══════════════════════════════════════════════════════════════ */
.stm-intro {
    padding: var(--stm-space-3xl) var(--stm-space-lg);
    background: var(--white);
}

.stm-intro__inner {
    max-width: 52rem;
    margin: 0 auto;
    text-align: center;
}

.stm-intro__title {
    font-size: var(--stm-text-4xl);
    color: var(--dark);
    margin-bottom: var(--stm-space-lg);
}

.stm-intro__title span {
    color: var(--trader-green);
}

.stm-intro__text {
    font-size: var(--stm-text-xl);
    color: var(--gray);
    line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════
   3. COMPARE — Before / After side-by-side
   ═══════════════════════════════════════════════════════════════ */
.stm-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--stm-space-xl);
    max-width: 64rem;
    margin: 0 auto;
}

.stm-compare__card {
    background: var(--white);
    border-radius: var(--stm-radius-xl);
    padding: var(--stm-space-2xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--stm-shadow-sm);
    transition: var(--transition-medium);
}

.stm-compare__card:hover {
    box-shadow: var(--stm-shadow-md);
    transform: translateY(-0.25rem);
}

.stm-compare__card--before {
    border-top: 3px solid var(--stm-red);
}

.stm-compare__card--after {
    border-top: 3px solid var(--trader-green);
}

.stm-compare__card h3 {
    font-size: var(--stm-text-2xl);
    margin-bottom: var(--stm-space-xs);
}

.stm-compare__card--before h3 {
    color: var(--stm-red);
}

.stm-compare__card--after h3 {
    color: var(--trader-green);
}

.stm-compare__subtitle {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    margin-bottom: var(--stm-space-lg);
}

.stm-compare__list {
    display: flex;
    flex-direction: column;
    gap: var(--stm-space-md);
}

.stm-compare__list li {
    display: flex;
    align-items: flex-start;
    gap: var(--stm-space-md);
    font-size: var(--stm-text-sm);
    color: var(--dark);
    line-height: 1.6;
}

.stm-compare__card--before .stm-compare__list li i {
    color: var(--stm-red);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.stm-compare__card--after .stm-compare__list li i {
    color: var(--trader-green);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   4. HOW IT WORKS — Horizontal 3-step
   ═══════════════════════════════════════════════════════════════ */
.stm-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--stm-space-2xl);
    max-width: 60rem;
    margin: 0 auto;
}

.stm-steps__step {
    text-align: center;
}

.stm-steps__number {
    width: 4rem;
    height: 4rem;
    background: var(--trader-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--stm-space-lg);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: var(--stm-text-2xl);
    box-shadow: 0 0 0 0.5rem rgba(28, 63, 170, 0.08);
    transition: var(--transition-medium);
}

.stm-steps__step:hover .stm-steps__number {
    box-shadow: 0 0 0 0.75rem rgba(28, 63, 170, 0.12);
    transform: scale(1.08);
}

.stm-steps__body h3 {
    font-size: var(--stm-text-xl);
    color: var(--dark);
    margin-bottom: var(--stm-space-sm);
}

.stm-steps__body p {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   5. FEATURES — Responsive grid of cards
   ═══════════════════════════════════════════════════════════════ */
.stm-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--stm-space-xl);
    max-width: 64rem;
    margin: 0 auto;
}

.stm-feature {
    background: var(--white);
    padding: var(--stm-space-xl);
    border-radius: var(--stm-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--stm-shadow-sm);
    transition: var(--transition-medium);
}

.stm-feature:hover {
    box-shadow: var(--stm-shadow-md);
    transform: translateY(-0.25rem);
    border-color: var(--trader-blue);
}

.stm-feature__icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, rgba(28, 63, 170, 0.08), rgba(75, 199, 125, 0.08));
    border-radius: var(--stm-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--trader-blue);
    margin-bottom: var(--stm-space-lg);
    transition: var(--transition-medium);
}

.stm-feature:hover .stm-feature__icon {
    background: linear-gradient(135deg, var(--trader-blue), var(--trader-green));
    color: var(--white);
}

.stm-feature h3 {
    font-size: var(--stm-text-base);
    color: var(--dark);
    margin-bottom: var(--stm-space-sm);
}

.stm-feature p {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   6. PRICING — Three-card layout with featured center
   ═══════════════════════════════════════════════════════════════ */
.stm-pricing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--stm-space-xl);
    max-width: 64rem;
    margin: 0 auto;
    align-items: start;
}

.stm-pricing__card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--stm-radius-xl);
    padding: var(--stm-space-2xl);
    box-shadow: var(--stm-shadow-md);
    position: relative;
    transition: var(--transition-medium);
    cursor: pointer;
}

.stm-pricing__card:hover {
    box-shadow: var(--stm-shadow-lg);
}

.stm-pricing__card--featured {
    border: 2px solid var(--trader-blue);
    box-shadow: var(--stm-shadow-xl);
    transform: scale(1.04);
    z-index: 1;
}

.stm-pricing__card.is-selected {
    border-color: var(--trader-green);
    box-shadow: 0 0 0 0.25rem rgba(75, 199, 125, 0.2), var(--stm-shadow-lg);
}

/* Badge */
.stm-pricing__badge {
    position: absolute;
    top: -0.875rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--trader-blue);
    color: var(--white);
    padding: 0.4rem 1.25rem;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: var(--stm-text-xs);
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

/* Corner ribbon */
.stm-pricing__ribbon {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 6.875rem;
    height: 6.875rem;
    overflow: hidden;
    z-index: 2;
}

.stm-pricing__ribbon span {
    position: absolute;
    display: block;
    width: 9.375rem;
    padding: 0.5rem 0;
    background: var(--trader-green);
    color: var(--white);
    font-size: var(--stm-text-xs);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    right: -2.1875rem;
    top: 1.5625rem;
    transform: rotate(45deg);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Header */
.stm-pricing__header {
    margin-bottom: var(--stm-space-lg);
}

.stm-pricing__header h3 {
    font-size: var(--stm-text-xl);
    color: var(--dark);
}

/* Price display */
.stm-pricing__price-wrap {
    margin-bottom: var(--stm-space-md);
}

.stm-pricing__regular {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    text-decoration: line-through;
    margin-bottom: var(--stm-space-xs);
}

.stm-pricing__price {
    font-family: 'Outfit', sans-serif;
    font-size: var(--stm-text-4xl);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
}

.stm-pricing__period {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    font-weight: 400;
}

.stm-pricing__savings {
    font-size: var(--stm-text-sm);
    font-weight: 600;
    color: var(--trader-green);
    min-height: 1.25rem;
    margin-bottom: var(--stm-space-lg);
}

/* CTA button */
.stm-pricing__cta {
    width: 100%;
    text-align: center;
    justify-content: center;
    margin-bottom: var(--stm-space-xl);
}

/* Feature list */
.stm-pricing__features {
    display: flex;
    flex-direction: column;
    gap: var(--stm-space-md);
    padding-top: var(--stm-space-lg);
    border-top: 1px solid var(--border-color);
}

.stm-pricing__features li {
    display: flex;
    align-items: center;
    gap: var(--stm-space-sm);
    font-size: var(--stm-text-sm);
    color: var(--dark);
}

.stm-pricing__features li i {
    color: var(--trader-green);
    font-size: var(--stm-text-xs);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   7. PROMO BANNERS — Inline callouts in pricing section
   ═══════════════════════════════════════════════════════════════ */
.stm-banner {
    max-width: 40rem;
    margin: 0 auto var(--stm-space-xl);
    padding: var(--stm-space-md) var(--stm-space-xl);
    border-radius: var(--stm-radius-lg);
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: var(--stm-text-sm);
    color: var(--white);
}

.stm-banner--green {
    background: linear-gradient(135deg, var(--trader-green), var(--trader-green-dark));
}

.stm-banner--gold {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.stm-banner strong {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════
   8. FAQ — Accordion
   ═══════════════════════════════════════════════════════════════ */
.stm-faq {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--stm-space-md);
}

.stm-faq__item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--stm-radius-lg);
    overflow: hidden;
    transition: var(--transition-medium);
}

.stm-faq__item:hover {
    border-color: var(--trader-blue);
}

.stm-faq__toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stm-space-xl);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: var(--stm-text-base);
    font-weight: 600;
    color: var(--dark);
    text-align: left;
    gap: var(--stm-space-md);
}

.stm-faq__icon {
    font-size: var(--stm-text-sm);
    color: var(--gray);
    transition: transform 0.3s var(--ease-out-expo);
    flex-shrink: 0;
}

.stm-faq__item.is-open .stm-faq__icon {
    transform: rotate(180deg);
}

.stm-faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out-expo);
}

.stm-faq__answer p {
    padding: 0 var(--stm-space-xl) var(--stm-space-xl);
    font-size: var(--stm-text-sm);
    color: var(--gray);
    line-height: 1.7;
}

.stm-faq__answer a {
    color: var(--trader-green);
    font-weight: 500;
}

.stm-faq__answer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   9. FINAL CTA — Centered call to action
   ═══════════════════════════════════════════════════════════════ */
.stm-final-cta {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto;
}

.stm-final-cta h2 {
    font-size: var(--stm-text-4xl);
    color: var(--dark);
    margin-bottom: var(--stm-space-md);
}

.stm-final-cta p {
    font-size: var(--stm-text-lg);
    color: var(--gray);
    margin-bottom: var(--stm-space-xl);
    line-height: 1.7;
}

.stm-final-cta .btn {
    font-size: var(--stm-text-base);
    padding: 1.125rem 3rem;
}

/* ═══════════════════════════════════════════════════════════════
   10. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 64rem) {
    .stm-compare {
        grid-template-columns: 1fr;
        max-width: 32rem;
        margin: 0 auto;
    }

    .stm-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .stm-pricing {
        grid-template-columns: 1fr;
        max-width: 24rem;
        margin: 0 auto;
    }

    .stm-pricing__card--featured {
        transform: none;
        order: -1;
    }
}

/* Mobile */
@media (max-width: 48rem) {
    .stm-section {
        padding: var(--stm-space-3xl) var(--stm-space-md);
    }

    .stm-hero__title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .stm-hero__inner {
        padding-top: var(--stm-space-4xl);
        padding-bottom: var(--stm-space-3xl);
    }

    .stm-hero__subtitle {
        font-size: var(--stm-text-base);
    }

    .stm-hero__meta {
        flex-direction: column;
        gap: var(--stm-space-sm);
    }

    .stm-hero__divider {
        display: none;
    }

    .stm-hero__actions {
        flex-direction: column;
        gap: var(--stm-space-md);
    }

    .stm-steps {
        grid-template-columns: 1fr;
        max-width: 24rem;
        margin: 0 auto;
    }

    .stm-features {
        grid-template-columns: 1fr;
        max-width: 24rem;
        margin: 0 auto;
    }

    .stm-section-header {
        margin-bottom: var(--stm-space-2xl);
    }

    .stm-faq__toggle {
        padding: var(--stm-space-lg);
    }

    .stm-faq__answer p {
        padding: 0 var(--stm-space-lg) var(--stm-space-lg);
    }
}

/* Small mobile */
@media (max-width: 30rem) {
    .stm-hero__cta {
        width: 100%;
        max-width: 20rem;
    }

    .stm-final-cta .btn {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   11. ANIMATIONS & DELIGHT
   ═══════════════════════════════════════════════════════════════ */

/* Hero entrance */
@keyframes stm-fadeUp {
    from {
        opacity: 0;
        transform: translateY(1.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle hover pulse on hero CTA */
.stm-hero__cta:hover {
    animation: stm-pulse 1.5s ease infinite;
}

@keyframes stm-pulse {
    0%, 100% { box-shadow: 0 0.25rem 1.5rem -0.25rem rgba(28, 63, 170, 0.4); }
    50% { box-shadow: 0 0.25rem 2rem -0.125rem rgba(28, 63, 170, 0.6); }
}

/* Feature icon entrance */
.stm-feature:hover .stm-feature__icon {
    animation: stm-iconPop 0.4s var(--ease-out-expo);
}

@keyframes stm-iconPop {
    from { transform: scale(0.8) rotate(-5deg); }
    to { transform: scale(1) rotate(0); }
}

/* Stagger reveal children */
.stm-section .reveal {
    transition-delay: calc(var(--step, 0) * 0.08s);
}

/* ═══════════════════════════════════════════════════════════════
   12. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
