#scrolly {
    position: relative;
    background-color: var(--scrolly-background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.elem_chart {
    position: -webkit-sticky;
    position: sticky;
    top: 30px;
    left: 0;
    max-width: 1920px;
    height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    transform-origin: center center;
    transform: scale(var(--scale, 1));
    z-index: 10;
    pointer-events: none;
}

.elem_subtitle_desk {
    width: 100%;
    background-color: var(--scrolly-background);
    color: #FFF;
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(12px, 1.5vw, 20px);
    line-height: normal;
    padding: 20px 10px;
    font-style: normal;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.elem_wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.elem_subtitle_desk.show_subtitle {
    opacity: 1;
}


.elem_legend_left {
    opacity: 0;
    transition: opacity 0.5s ease;
    width: var(--desktop-legend-left-width);
    margin-right: 20px;
    /* background-color: red;  /* debug */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.elem_chart.show_legend .elem_legend_left {
    opacity: 1;
}


.el_lg_l {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 3px solid #FFF;
    padding-right: 10px;
    min-height: var(--desktop-elem-width);
    color: #FFF;
    text-align: right;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.el_lg_l_title {
    color: #FFF;
    text-align: right;
}

.elem_legend_right {
    opacity: 0;
    transition: opacity 0.5s ease;
    width: var(--desktop-legend-right-width);
    margin-left: 20px;
    border-left: 3px solid #FFF;
    /* background-color: red;    /* debug */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
}

.elem_chart.show_legend .elem_legend_right {
    opacity: 1;
}


.el_lg_r {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    padding-left: 20px;
}

.el_lg_r_block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.el_lg_r_title {
    color: #FFF;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-align: left;
}

.el_lg_r_type {
    color: #FFF;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-align: left;
    padding: 10px 20px;
}

.el_lg_r_delimiter {
    margin-top: 20px;
}

.el_lg_r_elem {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFF;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.2;
}

.el_lg_r_elem img {
    width: 34px;
    height: 34px;
    display: block;
    flex: 0 0 34px;
}

.elem_cnt {
    width: fit-content;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}


.elem_row {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 10px auto;
}


.elem {
    position: relative;
    width: var(--desktop-elem-width);
    height: var(--desktop-elem-width);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    background-color: transparent;
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    /* Hardware acceleration to stabilize the edges */
    will-change: transform;
    backface-visibility: hidden;
    cursor: default;
}

.elem.landed {
    opacity: 1;
    transform: translate(0, 0) !important;
}

.elem.cursor_pointer {
    cursor: pointer !important;
}

/* Elements styles */
.el_symbol {
    color: #FFF;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(22px, 30px, 60px);
    line-height: clamp(1.1, 1.15, 1.3);
    font-weight: 600;
    z-index: 15;
    text-align: center;
}

.el_name {
    color: #FFF;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(11px, 1.6vw, 1.25rem);
    line-height: clamp(1.4, 1.5vw, 1.6);
    text-align: center;
    z-index: 15;
}

.el_strong {
    font-weight: 600;
}

/* Colors & Shapes */
.bg_blue {
    background-color: #228496;
}

.bg_lilac {
    background-color: #813F98;
}

.bg_pink {
    background-color: #E31C48;
}

.txt_blue {
    color: #228496 !important;
}

.txt_lilac {
    color: #813F98 !important;
}

.txt_pink {
    color: #E31C48 !important;
}

.sh_square,
.sh_diamond,
.sh_octagon,
.sh_circle,
.sh_star {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sh_diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.sh_octagon {
    width: 110%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.sh_circle {
    border-radius: 50%;
}

.sh_inner_border {
    outline: 2px solid white;
    outline-offset: -12px;
}

.sh_star {
    clip-path: polygon(50% 0%, 65% 15%,
            85% 15%, 85% 35%,
            100% 50%, 85% 65%,
            85% 85%, 65% 85%,
            50% 100%, 35% 85%,
            15% 85%, 15% 65%,
            0% 50%, 15% 35%,
            15% 15%, 35% 15%);
}

.sh_cross_v,
.sh_cross_h {
    position: absolute;
    z-index: 1;
}

.sh_cross_v {
    width: 80px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}


.sh_cross_h {
    width: 100%;
    height: 80px;
    top: 50%;
    transform: translateY(-50%);
}

/* Trigger Styling for Scrollama */
.scroll_trigger_area {
    position: relative;
    margin-top: -100vh;
    z-index: 20;
    pointer-events: none;
}

.step {
    position: relative;
    height: 110vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    pointer-events: none;
    /* background: rgba(255, 0, 0, 0.185); */
}

/* .step:nth-child(even) {
    background: rgba(255, 255, 0, 0.411);
} */

.step .step_content {
    max-width: 600px;
    background-color: #343852;
    z-index: 20;
    opacity: 1;
    padding: 50px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.step .step_type {
    width: fit-content;
    padding: 5px 10px;
    color: #FFF;
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: clamp(24, 1.5vw, 28px);
    font-style: normal;
    font-weight: 600;
}

.step p {
    color: #FFF;
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: clamp(24, 1.5vw, 28px);
    font-style: normal;
    font-weight: 400;
}

.title_step {
    height: 130vh !important;
}

.title_step_wrapper {
    position: absolute;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    top: 20%;
}

.title_step_wrapper .title_cnt {
    background-color: var(--scrolly-background);
    color: #FFF;
    text-align: center;
}

h1 {
    color: #FFF;
    text-align: center;
    font-family: "sole_display", Georgia, Times, "Times New Roman", serif;
    font-size: 8rem;
    font-style: normal;
    font-weight: 700;
    line-height: 7rem;
    margin-block-start: 0;
    margin-block-end: 0;
}

h1 div {
    font-size: 50px;
    line-height: 60px;
    padding-top: 30px;
    white-space: nowrap;
}

.subtitle {
    color: #FFF;
    text-align: center;
    font-family: "sole_headline", Georgia, Times, "Times New Roman", Serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 28px;
    padding: 20px;
}


/* .title_shape_left,
.title_shape_right {
    width: calc((100% - 650px) / 2);
} */

.title_shape_left img,
.title_shape_right img {
    width: 100%;
    height: auto;
}

.title_scroll {
    position: absolute;
    bottom: 50vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: fit-content;
    color: #FFF;
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.title_scroll img {
    width: 24px;
    height: auto;
}

.pause_step {
    height: 200vh;
    pointer-events: none;
}



/* Tooltip */
#global_tooltip {
    position: fixed;
    pointer-events: none;
    visibility: hidden;
    z-index: 99;
    top: 0;
    left: 0;
    top: -1000px;
    left: -1000px;
    transition: opacity 0.2s ease;
    width: 180px;
    background: #FFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
}

#global_tooltip.active {
    visibility: visible;
}

#global_tooltip::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Freccia a SINISTRA (punta al mouse che è a sinistra) */
#global_tooltip.dir-right::after {
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent #FFF transparent transparent;
}

/* Freccia a DESTRA (punta al mouse che è a destra) */
#global_tooltip.dir-left::after {
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #FFF;
}

/* Freccia in BASSO (punta al mouse che è sotto) */
#global_tooltip.dir-top::after {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-color: #FFF transparent transparent transparent;
}

.elem_chart.interactive {
    pointer-events: auto !important;
}

hr {
    width: 100%;
}

.tt_type {
    color: #FFF;
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.5vw, 16px);
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    padding: 6px 10px;
}

.tt_atomic_cnt {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tt_atomic_n {
    color: var(--text-color);
    text-align: left;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(12px, 1.5vw, 14px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding-top: 5px;
}

.tt_mass {
    color: var(--text-color);
    text-align: right;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(12px, 1.5vw, 14px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.tt_name {
    color: var(--text-color);
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.5vw, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding-top: 10px;
}

.tt_symbol {
    color: var(--text-color);
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(40px, 1.5vw, 52px);
    font-style: normal;
    font-weight: 600;
    line-height: clamp(20px, 1.5vw, 25px);
}

.tt_import {
    color: var(--text-color);
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.5vw, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.tt_import_val {
    color: var(--text-color);
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(20px, 1.5vw, 24px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.tt_import_unit {
    color: var(--text-color);
    text-align: center;
    font-family: "SoleSans", Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.5vw, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.tap_icon {
    width: 70px;
    height: 70px;
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    transition: 0.3s ease;
}

.tap_icon.icon_active {
    opacity: 1;
}

.tap_icon img {
    width: 100%;
    height: auto;
}

/* Tablet e Laptop */
@media only screen and (max-width: 1024px) {
    .scroll_trigger_area {
        margin-top: 0;
    }

    .elem_chart {
        position: fixed;
        width: 100vw !important;
        left: 0;
        display: flex;
        transform-origin: center center;
    }
}

@media only screen and (min-width: 769px) {

    #row_1_2,
    #row_4_5,
    #lg_row_1_2 {
        display: none;
    }
}

/* Mobile */
@media only screen and (max-width: 768px) {

    .elem_chart {
        top: 25px;
    }

    #scrolly {
        overflow-x: hidden;
    }

    #scrolly.is-finished .elem_chart {
        position: absolute;
        top: auto;
        bottom: 0;
    }

    h1 {
        font-size: 50px;
        line-height: 60px;
    }



    .subtitle {}


    .stop-scrolling {
        height: 100%;
        overflow: hidden;
    }

    .elem_subtitle_mob_finto {
        width: 100%;
        height: 50px;
        background-color: var(--scrolly-background);
        color: #FFF;
        text-align: center;
        font-family: "SoleSans", Arial, Helvetica, sans-serif;
        font-size: clamp(12px, 1.5vw, 20px);
        line-height: normal;
        padding: 20px 10px;
        font-style: normal;
        font-weight: 500;
        opacity: 0;
        transition: opacity 0.5s ease;
    }

    .elem_subtitle_mob {
        width: 100%;
        position: fixed;
        z-index: 50;
        top: 50px;
        transform: translateY(-100%);
        height: 35px;
        background-color: var(--scrolly-background);
        color: #FFF;
        text-align: center;
        font-family: "SoleSans", Arial, Helvetica, sans-serif;
        font-size: clamp(12px, 1.5vw, 20px);
        line-height: normal;
        font-style: normal;
        font-weight: 500;
        transition: all 0.5s ease;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .elem_subtitle_mob.show_subtitle {
        transform: translateY(0);
    }

    .elem_info {
        display: inline-block;
        width: 20px;
        height: 20px;
        background: var(--scrolly-background);
        color: white;
        border-radius: 50%;
        border: 1px solid #FFF;
        text-align: center;
        font-size: 14px;
        line-height: 16px;
        cursor: pointer;
        margin-left: 10px;
        pointer-events: auto;
        font-size: clamp(12px, 1.5vw, 20px);
    }

    .elem_subtitle_mob.is-open .elem_info {
        background: #FFF;
        color: var(--scrolly-background);
    }

    .elem_subtitle_mob.is-open .elem_info::before {
        content: '✕';
    }

    .elem_subtitle_mob:not(.is-open) .elem_info::before {
        content: 'i';
    }

    /* Hide the original 'i' text since we use ::before */
    .elem_info {
        font-size: clamp(12px, 1.5vw, 20px);
    }

    .elem_info::before {
        font-size: 14px;
        /* Restore font size for the icon */
    }


    .elem_info_overlay_cnt {
        position: fixed;
        top: 85px;
        left: 0;
        width: 100%;
        height: 100%;
        background: #343852;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        visibility: hidden;
        opacity: 0;
        transition: 0.3s ease;
        z-index: 60;
    }

    .elem_info_overlay_cnt.active {
        visibility: visible;
        opacity: 1;
    }


    .elem_info_overlay_content {
        color: #FFF;
        padding: 20px;
        border-radius: 12px;
        width: 100%;
        position: relative;
        text-align: left;
    }


    .elem_legend_left {
        width: var(--mobile-legend-left-width);
        margin-right: 0;
    }

    .el_lg_l {
        min-height: var(--mobile-elem-width);
        padding-right: 0;
        padding-left: 2px;
        font-size: 10px;
        font-weight: 300;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        border-left: 1px solid #FFF;
        border-right: none;
        text-align: center;
    }

    .el_lg_r_title {
        color: #FFF;
        font-family: "SoleSans", Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: normal;
        text-align: left;
        padding-bottom: 15px;
    }

    .el_lg_r_type {
        color: #FFF;
        font-family: "SoleSans", Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: normal;
        text-align: left;
        padding: 10px 20px;
        width: 130px;
    }

    .el_lg_r_delimiter {
        margin-top: 20px;
        padding-top: 20px;
        width: 300px;
        border-top: 1px solid #FFFF;
    }

    .el_lg_r_elem {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #FFF;
        font-family: "SoleSans", Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 600;
        line-height: 1.2;
    }

    .el_lg_r_elem img {
        width: 24px;
        height: 24px;
        display: block;
        flex: 0 0 24px;
    }


    .elem_cnt {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .elem_row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
        margin: 2px auto;
    }

    #row_1,
    #row_2,
    #row_4,
    #row_5,
    #lg_row_1,
    #lg_row_2 {
        display: none;
    }


    .elem {
        margin: 0 2px;
        width: var(--mobile-elem-width);
        height: var(--mobile-elem-width);
    }

    .el_strong {
        font-weight: 400;
    }


    .sh_square,
    .sh_diamond,
    .sh_octagon,
    .sh_circle,
    .sh_star {
        padding: 2px;
        word-break: break-all;
    }

    .sh_cross_v {
        width: 40px;
    }


    .sh_cross_h {
        height: 40px;
        top: 50%;
    }

    .sh_inner_border {
        outline: 1px solid white;
        outline-offset: -8px;
    }

    .step .step_content {
        max-width: 85%;
        padding: 40px 15px 20px;
    }

    .title_step {
        height: 130vh !important;
    }

    .title_step_wrapper {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        height: 100%;
        top: 0;
        padding-top: 0;
    }


    .title_step_wrapper .title_cnt {
        max-width: 100%;
        padding: 10px;
    }


    .title_shape_bottom img {
        width: 100%;
        height: auto;
    }


    .pause_step {
        height: 120vh;
    }

    .tap_icon {
        width: 40px;
        width: 40px;
        bottom: -20px;
    }
}


@media only screen and (max-height: 740px) {
    .el_lg_l {
        min-height: var(--small-mobile-elem-width);
        font-size: 10px;
        font-weight: 300;
    }

    .elem {
        margin: 0 2px;
        width: var(--small-mobile-elem-width);
        height: var(--small-mobile-elem-width);
    }

    .el_name {
        font-size: 9px;
        line-height: 12px;
    }

    .sh_cross_v {
        width: 40px;
    }

    .sh_cross_h {
        height: 40px;
        top: 50%;
    }

    .sh_inner_border {
        outline: 1px solid white;
        outline-offset: -2px;
    }
}

@media only screen and (max-height: 670px) {
    .elem_chart {
        top: 40px;
    }

    .elem_subtitle_mob {
        pointer-events: auto;
        padding: 10px;
    }

    .el_lg_l {
        min-height: var(--extra-small-mobile-elem-width);
        font-size: 10px;
        font-weight: 300;
    }

    .elem {
        margin: 0 2px;
        width: var(--extra-small-mobile-elem-width);
        height: var(--extra-small-mobile-elem-width);
    }

    .el_name {
        font-size: 8px;
        line-height: 11px;
    }

    .sh_cross_v {
        width: 35px;
    }

    .sh_cross_h {
        height: 35px;
        top: 50%;
    }

    .sh_inner_border {
        outline: 1px solid white;
        outline-offset: -2px;
    }
}