/* =========================
Decode Features — Styles (lean)
========================= */

.decode-features {
    width: 100%;
    display: block;
    margin: 40px auto 24px;
}

/* Escopa o reset para não afetar a página toda */
.decode-features li {
    list-style: none;
}

.decode-features__wrap {
    max-width: clamp(320px, 92vw, 620px);
    margin-inline: auto;
    /* evita pintar fora da tela */
    content-visibility: auto;
    contain-intrinsic-size: 520px;
}

.decode-features__title {
    text-align: center;
    color: #fff;
    font-size: clamp(22px, 6.5vw, 28px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0px 0 38px 0;
}

.features-carousel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--ring);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-4) var(--space-3);
    /* isola repaints internos sem afetar layout */
    contain: paint style;
}

.features-carousel__viewport {
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    outline: none;
}

/* track animado por transform */
.features-carousel__track {
    display: flex;
    align-items: stretch;
    width: 100%;
    /* remover will-change permanente (custoso) */
    transition: transform 420ms cubic-bezier(.22, .9, .2, 1);
}

.features-slide {
    flex: 0 0 100%;
    padding: 2px;
    /* micro gutter */
    /* render preguiçoso das lâminas fora de vista */
    content-visibility: auto;
    contain-intrinsic-size: 360px 360px;
    /* bate com o aspect 1:1 + caption */
}

.features-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--ring);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    /* otimiza subpixel em bordas/gradiente */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.features-card img {
    display: block;
    width: 90%;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
}

.features-card figcaption {
    text-align: start;
    padding: 14px 14px 16px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 800;
    border-top: 1px solid var(--ring);
}

.features-card b {
    color: var(--accent);
}

/* Dots (bars) */
.features-dots {
    display: grid;
    grid-auto-flow: column;
    gap: 8px;
    margin-top: 14px;
    justify-content: center;
    align-items: center;
}

.features-dot {
    --bar-w: 34px;
    --bar-h: 4px;
    --bar-bg: rgba(255, 77, 77, 0.25);
    --bar-fg: var(--accent);

    appearance: none;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    position: relative;
    width: var(--bar-w);
    height: var(--bar-h);
    border-radius: 999px;
    outline: none;
}

.features-dot:focus-visible .features-dot__bar {
    box-shadow: 0 0 0 3px rgba(255, 77, 77, .35);
}

.features-dot__bar {
    position: absolute;
    inset: 0;
    background: var(--bar-bg);
    border-radius: inherit;
    overflow: hidden;
}

.features-dot__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: scaleX(var(--progress, 0));
    transform-origin: left center;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: transform 120ms linear;
    border-radius: inherit;
}

/* Active glow */
.features-dot.is-active .features-dot__bar {
    box-shadow: 0 0 10px rgba(255, 77, 77, .35);
}

/* Hover lift só em desktop/pointer fino */
@media (hover:hover) and (pointer:fine) {
    .features-card {
        transition: transform .2s ease;
    }

    .features-card:hover {
        transform: translateY(-2px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .features-carousel__track {
        transition: none;
    }

    .features-dot__bar::after {
        transition: none;
    }
}

/* Screen reader only */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}