/* ============================================================================
   ANDERCODE — HOME
   Portada enfocada en claridad, navegación rápida y experiencia responsive.
============================================================================ */

.home-page {
    --home-primary: var(--mlf-primary, #7c3aed);
    --home-primary-dark: var(--mlf-primary-dark, #5b21b6);
    --home-text: #17151f;
    --home-muted: #686474;
    --home-border: #ebe8f0;
    --home-soft: #f8f6ff;
    --home-radius: 20px;
    overflow: hidden;
    background: #fff;
    color: var(--home-text);
}

.home-page h1,
.home-page h2,
.home-page h3 {
    border-left: 0;
    padding-left: 0;
}

.home-page a:hover,
.home-page .btn:hover {
    text-decoration: none;
}

.home-page .btn {
    border-radius: 14px;
    font-weight: 700;
}

.home-page .btn-lg {
    padding-top: .85rem;
    padding-bottom: .85rem;
    font-size: 1rem;
}

/* HERO --------------------------------------------------------------------- */
.home-hero {
    position: relative;
    background:
        radial-gradient(circle at 85% 15%, rgba(124, 58, 237, .16), transparent 34%),
        radial-gradient(circle at 10% 90%, rgba(63, 55, 201, .08), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8f6ff 100%);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .26;
    pointer-events: none;
    background-image: radial-gradient(rgba(124, 58, 237, .22) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 85%);
    animation: homeHeroGridDrift 18s linear infinite;
    will-change: background-position;
}

.home-hero .container {
    position: relative;
    z-index: 1;
}

.home-eyebrow,
.home-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--home-primary-dark);
    background: rgba(124, 58, 237, .09);
    border: 1px solid rgba(124, 58, 237, .12);
    border-radius: 999px;
    padding: .45rem .75rem;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.home-eyebrow i {
    animation: homeHeroCodeSwing 4.8s ease-in-out infinite;
    transform-origin: 50% 50%;
}

.home-hero-title {
    max-width: 760px;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: .98;
    letter-spacing: -.055em;
    color: var(--home-text);
}

.home-hero-title span {
    display: block;
    color: var(--home-primary);
}

.home-hero-lead {
    max-width: 690px;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.7;
    color: var(--home-muted);
}

.home-btn-soft {
    color: var(--home-text);
    border: 1px solid var(--home-border);
    box-shadow: 0 8px 24px rgba(23, 21, 31, .05);
}

.home-btn-soft:hover {
    color: var(--home-primary-dark);
    border-color: rgba(124, 58, 237, .25);
    background: #fff;
}

.home-trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem 1.25rem;
    color: #514c5c;
    font-size: .92rem;
    font-weight: 600;
}

.home-trust-list i {
    color: var(--home-primary);
    margin-right: .3rem;
    animation: homeHeroTrustPulse 3.8s ease-in-out infinite;
}

.home-trust-list span:nth-child(2) i {
    animation-delay: -1.25s;
}

.home-trust-list span:nth-child(3) i {
    animation-delay: -2.5s;
}

.home-hero-panel {
    position: relative;
    padding: 1.25rem;
    border: 1px solid rgba(124, 58, 237, .12);
    border-radius: 30px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 30px 70px rgba(61, 43, 100, .14);
    backdrop-filter: blur(12px);
}

.home-hero-image-wrap {
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    aspect-ratio: 4 / 3;
}

.home-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    animation: homeHeroImageFloat 9s ease-in-out infinite;
    will-change: transform;
}

.home-floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 220px;
    padding: .85rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(124, 58, 237, .1);
    box-shadow: 0 16px 35px rgba(38, 28, 62, .13);
    will-change: transform;
}

.home-floating-card-top {
    top: 12%;
    left: -12%;
    animation: homeHeroCardTopFloat 6.8s ease-in-out infinite;
}

.home-floating-card-bottom {
    right: -8%;
    bottom: 10%;
    animation: homeHeroCardBottomFloat 7.6s ease-in-out -2.2s infinite;
}

.home-floating-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--home-primary), var(--home-primary-dark));
    animation: homeHeroIconBreathe 4.6s ease-in-out infinite;
    transform-origin: center;
}

.home-floating-card-bottom .home-floating-icon {
    animation-delay: -1.7s;
}

.home-floating-card strong,
.home-floating-card small {
    display: block;
}

.home-floating-card strong {
    color: var(--home-text);
    font-size: .88rem;
}

.home-floating-card small {
    color: var(--home-muted);
    font-size: .72rem;
    margin-top: .08rem;
}

@keyframes homeHeroGridDrift {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 56px 28px;
    }
}

@keyframes homeHeroImageFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1.02);
    }
    35% {
        transform: translate3d(5px, -7px, 0) scale(1.035);
    }
    70% {
        transform: translate3d(-4px, 4px, 0) scale(1.028);
    }
}

@keyframes homeHeroCardTopFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(-.25deg);
    }
    50% {
        transform: translate3d(7px, -10px, 0) rotate(.35deg);
    }
}

@keyframes homeHeroCardBottomFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(.2deg);
    }
    45% {
        transform: translate3d(-8px, -7px, 0) rotate(-.35deg);
    }
    75% {
        transform: translate3d(-3px, 3px, 0) rotate(.1deg);
    }
}

@keyframes homeHeroIconBreathe {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(-5deg) scale(1.055);
    }
}

@keyframes homeHeroCodeSwing {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-2px) rotate(-6deg);
    }
}

@keyframes homeHeroTrustPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.13);
    }
}

/* ACCESOS RÁPIDOS ---------------------------------------------------------- */
.home-quick-access {
    position: relative;
    z-index: 3;
    margin-top: -30px;
    padding-bottom: 3rem;
}

.home-quick-card {
    height: 100%;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem;
    color: var(--home-text);
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(23, 21, 31, .08);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.home-quick-card:hover {
    color: var(--home-text);
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, .22);
    box-shadow: 0 18px 40px rgba(80, 55, 130, .13);
}

.home-quick-icon {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 14px;
    color: var(--home-primary);
    background: var(--home-soft);
    font-size: 1.1rem;
}

.home-quick-card strong,
.home-quick-card small {
    display: block;
}

.home-quick-card strong {
    font-size: .96rem;
}

.home-quick-card small {
    margin-top: .1rem;
    color: var(--home-muted);
    font-size: .75rem;
}

.home-quick-arrow {
    margin-left: auto;
    color: #b2adba;
    font-size: .78rem;
}

/* SECCIONES ---------------------------------------------------------------- */
.home-section {
    padding: 5.5rem 0;
}

.home-section-soft {
    background: var(--home-soft);
    border-top: 1px solid #f0edf5;
    border-bottom: 1px solid #f0edf5;
}

.home-section-title {
    margin: .85rem 0 .75rem;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.home-section-copy {
    max-width: 760px;
    color: var(--home-muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

/* RUTAS -------------------------------------------------------------------- */
.home-route-card {
    height: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1.25rem;
    color: var(--home-text);
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    box-shadow: 0 10px 24px rgba(23, 21, 31, .04);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.home-route-card:hover {
    color: var(--home-text);
    transform: translateY(-5px);
    border-color: rgba(124, 58, 237, .25);
    box-shadow: 0 16px 35px rgba(70, 48, 115, .1);
}

.home-route-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    margin-bottom: auto;
    border-radius: 14px;
    color: var(--home-primary);
    background: var(--home-soft);
    font-size: 1.35rem;
}

.home-route-card strong {
    margin-top: 1.1rem;
    font-size: 1.05rem;
}

.home-route-card small {
    margin-top: .2rem;
    color: var(--home-muted);
    line-height: 1.4;
}

/* CURSOS ------------------------------------------------------------------- */
.home-course-tabs {
    gap: .5rem;
}

.home-course-tabs .nav-link {
    border-radius: 12px;
    color: #5d5768;
    background: #f5f3f8;
    font-weight: 700;
    padding: .7rem 1rem;
}

.home-course-tabs .nav-link.active {
    color: #fff;
    background: var(--home-primary);
}

.home-course-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    background: #fff;
    box-shadow: 0 10px 28px rgba(23, 21, 31, .05);
    transition: transform .24s ease, box-shadow .24s ease;
}

.home-course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(56, 42, 87, .11);
}

.home-course-image-link {
    overflow: hidden;
    display: block;
    background: #f5f4f7;
    aspect-ratio: 16 / 9;
}

.home-course-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.home-course-card:hover .home-course-image {
    transform: scale(1.035);
}

.home-course-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.home-course-body h3 {
    margin: .7rem 0 .55rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.home-course-body p {
    margin-bottom: 1rem;
    color: var(--home-muted);
    font-size: .9rem;
    line-height: 1.6;
}

.home-platform-badge,
.home-news-label {
    align-self: flex-start;
    display: inline-flex;
    padding: .28rem .55rem;
    border-radius: 999px;
    color: var(--home-primary-dark);
    background: rgba(124, 58, 237, .09);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.home-platform-hotmart {
    color: #b42318;
    background: #fff1f0;
}

.home-text-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--home-primary);
    font-weight: 800;
}

.home-text-link i {
    font-size: .75rem;
    transition: transform .2s ease;
}

.home-text-link:hover {
    color: var(--home-primary-dark);
}

.home-text-link:hover i {
    transform: translateX(3px);
}

.home-empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--home-muted);
    border: 1px dashed #d9d4df;
    border-radius: var(--home-radius);
    background: #faf9fb;
}

/* HERRAMIENTAS ------------------------------------------------------------- */
.home-section-dark {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 75% 20%, rgba(124, 58, 237, .28), transparent 30%),
        linear-gradient(135deg, #17121f 0%, #21162f 55%, #17121f 100%);
}

.home-section-dark::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .08;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 24px 24px;
}

.home-section-dark .container {
    position: relative;
    z-index: 1;
}

.home-section-kicker-light {
    color: #e8dfff;
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.1);
}

.home-section-copy-light {
    color: #bbb3c6;
}

.home-tool-card {
    height: 100%;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(8px);
    transition: transform .22s ease, background .22s ease, border-color .22s ease;
}

.home-tool-card:hover {
    color: #fff;
    transform: translateY(-4px);
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.18);
}

.home-tool-card > i {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: rgba(124, 58, 237, .72);
    font-size: 1.25rem;
}

.home-tool-card strong {
    margin-top: auto;
    font-size: 1.02rem;
}

.home-tool-card small {
    margin: .3rem 0 1rem;
    color: #bdb5c7;
    line-height: 1.45;
}

.home-tool-card span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #e8dfff;
    font-size: .82rem;
    font-weight: 800;
}

.home-tool-card span i {
    font-size: .7rem;
}

/* NOTICIAS ----------------------------------------------------------------- */
.home-featured-news,
.home-secondary-news {
    overflow: hidden;
    color: var(--home-text);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    background: #fff;
    box-shadow: 0 10px 30px rgba(23, 21, 31, .05);
    transition: transform .22s ease, box-shadow .22s ease;
}

.home-featured-news {
    height: 100%;
    display: block;
}

.home-featured-news:hover,
.home-secondary-news:hover {
    color: var(--home-text);
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(61, 45, 95, .1);
}

.home-featured-news-image-wrap {
    overflow: hidden;
    aspect-ratio: 16 / 8.5;
    background: #f5f4f7;
}

.home-featured-news-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.home-featured-news:hover .home-featured-news-image {
    transform: scale(1.025);
}

.home-featured-news-body {
    padding: 1.4rem;
}

.home-featured-news-body h3 {
    margin: .8rem 0 .6rem;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.25;
}

.home-featured-news-body p {
    color: var(--home-muted);
    line-height: 1.65;
}

.home-secondary-news {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: stretch;
}

.home-secondary-news > img {
    width: 100%;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
}

.home-secondary-news > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
}

.home-secondary-news h3 {
    margin: .65rem 0 .8rem;
    font-size: 1rem;
    line-height: 1.35;
}

.home-secondary-news .home-text-link {
    margin-top: auto;
}

/* CIERRE ------------------------------------------------------------------- */
.home-about-strip {
    padding: 0 0 5.5rem;
    background: #fff;
}

.home-about-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8f6ff, #fff);
    border: 1px solid rgba(124, 58, 237, .12);
}

.home-about-box h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.15rem);
    letter-spacing: -.025em;
}

.home-about-box p {
    max-width: 760px;
    color: var(--home-muted);
}

/* RESPONSIVE --------------------------------------------------------------- */
@media (min-width: 992px) {
    .home-page .py-lg-6 {
        padding-top: 6rem !important;
        padding-bottom: 6rem !important;
    }
}

@media (max-width: 1199.98px) {
    .home-floating-card-top {
        left: -4%;
    }

    .home-floating-card-bottom {
        right: -3%;
    }
}

@media (max-width: 991.98px) {
    .home-hero {
        text-align: center;
    }

    .home-hero-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .home-hero .d-flex,
    .home-trust-list {
        justify-content: center;
    }

    .home-hero-panel {
        max-width: 620px;
        margin: 1rem auto 0;
    }

    .home-floating-card-top {
        left: 2%;
    }

    .home-floating-card-bottom {
        right: 2%;
    }

    .home-section {
        padding: 4.5rem 0;
    }

    .home-tool-card {
        min-height: 200px;
    }

    .home-about-strip {
        padding-bottom: 4.5rem;
    }
}

@media (max-width: 767.98px) {
    .home-hero-title {
        font-size: clamp(2.4rem, 13vw, 3.5rem);
    }

    .home-quick-access {
        margin-top: -18px;
        padding-bottom: 2rem;
    }

    .home-quick-card {
        flex-direction: column;
        align-items: flex-start;
        min-height: 145px;
    }

    .home-quick-arrow {
        display: none;
    }

    .home-route-card {
        min-height: 160px;
        padding: 1rem;
    }

    .home-course-tabs {
        justify-content: flex-start;
    }

    .home-secondary-news {
        grid-template-columns: 120px 1fr;
    }

    .home-secondary-news > img {
        min-height: 150px;
    }

    .home-about-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .home-hero-panel {
        padding: .75rem;
        border-radius: 22px;
    }

    .home-hero-image-wrap {
        border-radius: 16px;
    }

    .home-floating-card {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: .7rem;
        text-align: left;
        animation: none;
        transform: none;
        will-change: auto;
    }

    .home-quick-card small {
        display: none;
    }

    .home-quick-card {
        min-height: 118px;
        padding: .85rem;
    }

    .home-route-card small {
        font-size: .72rem;
    }

    .home-section {
        padding: 3.8rem 0;
    }

    .home-featured-news-image-wrap {
        aspect-ratio: 16 / 10;
    }

    .home-secondary-news {
        grid-template-columns: 1fr;
    }

    .home-secondary-news > img {
        height: 180px;
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *,
    .home-page *::before,
    .home-page *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }

    .home-hero-image,
    .home-floating-card,
    .home-floating-icon,
    .home-eyebrow i,
    .home-trust-list i {
        transform: none !important;
    }
}
