/* ============================================================
   BRAIN MODULE
   ============================================================ */

.brain-module {
    background: #02061E url('../img/bg.jpg') no-repeat center / cover;
    border-radius: 24px;
    padding: 90px 0;
    color: #fff;
    overflow: hidden;
    margin-bottom: 50px;
    height: 1650px;
}


/* ---- Intro heading ---- */

.bm-intro {
    margin: 0 auto 70px;
}

.bm-intro .dv-section-title {
    margin-bottom: 44px;
}

.bm-intro .dv-section-title p {
    /* color: rgba(255, 255, 255, 0.5); */
    font-size: 13px;
}

.bm-intro-heading {
    max-width: 980px;
    margin-bottom: 26px;
}

.bm-intro-heading .dv-line-lg  {
    opacity: 0.5 !important;
}

.bm-intro .dv-section-title p:before {
    background: #da4536;
    top: 31%;
}

.bm-heading {
    font-size: 72px;
    letter-spacing: -0.02em;
    padding: 28px 20px;
}

.bm-desc {
    max-width: 620px;
    margin: 0 auto;
    font-size: 20px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

/* ---- Layout ---- */

.bm-wrapper {
    align-items: flex-start;
    gap: 40px;
}

.bm-list {
    flex: 0 0 100%;
    max-width: 100%;
    order: 2;
}

.bm-visual {
    flex: 0 0 100%;
    max-width: 100%;
    order: 1;
    margin-bottom: 20px;
}

@media (min-width: 992px) {
    .bm-list {
        flex: 0 0 calc(42% - 20px);
        max-width: calc(42% - 20px);
        order: 1;
    }

    .bm-visual {
        flex: 1;
        order: 2;
        margin-bottom: 0;
    }
}

/* ---- List (left) ---- */

.bm-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 110px;
}

.bm-list-nav {
    display: none;
}

.bm-item-toggle {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
    padding: 17px 30px;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
    color: #fff;
    transition: all 0.25s ease;
}

.bm-item.is-active .bm-item-toggle {
    padding: 30px;
}

.bm-item:not(.is-active) .bm-item-toggle:hover {
    opacity: 0.7;
}

.bm-item {
    background:transparent;
    border-radius: 10px;
    transition: background 0.75s ease;
}

.bm-item.is-active {
    background: #FFF; 
    
}

.bm-num {
    flex-shrink: 0;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 1);
    font-weight: bold;
    padding: 0 10px;
}


.bm-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.bm-item-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s ease;
}

.bm-item-panel-inner {
    overflow: hidden;
}

.bm-item.is-active .bm-item-panel {
    grid-template-rows: 1fr;
}

/* .bm-item.is-active .bm-item-toggle {
    background: #fff;
    border-radius: 16px 16px 0 0;
} */

.bm-item-toggle .bm-num {
    position: relative;
    padding: 7px 10px;
}

.bm-item-toggle .bm-num .dv-line {
    background-color: #FFF !important;
    top: -3px;
}

.bm-item.is-active .bm-num {
    color: #000;
    font-weight: 700;
    font-size: 18px;
}
.bm-item.is-active .bm-num .dv-line {
    background-color: #f5833d !important;
}

.bm-item.is-active .bm-title {
    color: #02061E;
}

.bm-item.is-active .bm-item-panel-inner {
    /* background: #fff;
    border-radius: 0 0 16px 16px; */
    padding: 0 30px 28px;
}

.bm-item.is-active .bm-item-panel-inner p {
    color: #000;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 18px;
}

.bm-item-img {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.bm-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Visual (right) ---- */

.bm-stage {
    position: relative;
    width: 100%;
    /* max-width: 620px; */
    aspect-ratio: 1764 / 1556;
    margin: 0 auto;
}

.bm-brain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bm-brain.is-active {
    opacity: 1;
}

.bm-highlight {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.75s ease;
    pointer-events: none;
    /* mix-blend-mode: overlay; */
}

.bm-highlight.is-active {
    opacity: 1;
}

.bm-marker {
    position: absolute;
    left: var(--bm-x);
    top: var(--bm-y);
    transform: translate(-50%, -50%);
    /* background: rgba(2, 6, 30, 0.35); */
    /* border: 1px solid rgba(255, 255, 255, 0.5); */
    /* padding: 5px 9px; */
    color: #fff;
    font-size: 18px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
    display: none;
    font-family: 'NB Grotesk';
    font-weight: bold;
    line-height: 2;
}

.bm-marker .dv-line-left {
    left:-12px;
    top:-3px;
}

.bm-marker .dv-line-right {
    right:-12px;
    top:-3px;
}

.bm-stage[data-bm-view="front"] .bm-marker[data-view="front"],
.bm-stage[data-bm-view="back"] .bm-marker[data-view="back"] {
    display: block;
}

.bm-marker:hover,
.bm-marker:focus-visible,
.bm-marker.is-active {
    color: #000;
}

.bm-marker:hover .dv-line,
.bm-marker:focus-visible .dv-line,
.bm-marker.is-active .dv-line {
    background-color: #000 !important;
}

.bm-rotate {
    display: block;
    margin: 24px auto 0;
    background: none;
    border: 0;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.bm-rotate:hover {
    opacity: 1;
    transform: scale(1.05);
}

.bm-rotate img {
    height: 28px;
    width: auto;
    display: block;
}

/* ---- Responsive ---- */
/* Applies through the iPad range too — matches the .bm-list/.bm-visual
   two-column switch at min-width: 992px above. */


@media (max-width: 1540px) {
    .bm-items {padding-left: 50px;}
}

@media (max-width: 1250px) {
    .bm-items {padding-left: 0;}
}

@media (max-width: 991px) {

    .brain-module {
        height: auto;
    }

    .bm-visual {
        margin: 0 auto;
        max-width: 600px;
    }

    .brain-module {
        border-radius: 16px;
        padding: 60px 0 20px;
        overflow: visible;
    }
    


    .bm-wrapper {
        gap:30px
    }

    .bm-intro {
        margin-bottom: 40px;
    }

    .bm-list {
        overflow: visible !important;
    }

    .bm-rotate {
        margin-top: 10px;
    }

    .bm-heading {
        font-size: 34px;
        padding: 16px 8px;
    }

    .bm-desc {
        font-size: 17px;
    }

    .bm-item-toggle {
        padding: 14px 12px;
        gap: 10px;
    }

    .bm-title {
        font-size: 12px;
    }

    .bm-marker {
        font-size: 13px;
        line-height: 1.8;        
    }

    .bm-marker .dv-line-right {
        right:-7px;
        opacity: 0.4;
    }

    .bm-marker .dv-line-left {
        left:-7px;
        opacity: 0.4;
    }

    .bm-item {
        box-shadow: 5px 1px 19px rgba(0,0,0,0.1);
    }

    .bm-item.is-active .bm-num {
        font-size: 14px;
    }

    .bm-item.is-active .bm-item-panel-inner {
        padding: 0 20px 20px;
    }

    .bm-item.is-active .bm-item-toggle {
        padding: 25px 20px 20px;
    }

    /* Card slider: the list becomes a horizontal swiper (see brain-module.js) —
       every .bm-item already renders in its .is-active look (full card, expanded
       panel) since JS adds that class to all of them on mobile; the current
       slide is simply whichever one is in view, the rest overflow off-screen. */
    .bm-list {
        overflow: hidden;
    }

    .bm-items {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding-left: 0;
    }

    .bm-item {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
    }

    /* Slides are equal height (stretched by .bm-items); anchor the image
       to the bottom of each card instead of letting content vary height. */
    .bm-item-panel {
        display: flex;
        flex: 1;
        min-height: 0;
    }

    .bm-item-panel-inner {
        display: flex;
        flex-direction: column;
        flex: 1;
        width: 100%;
    }

    .bm-item-img {
        margin-top: auto;
    }

    .bm-rotate img {
        height: 15px;
    }

    /* Slider nav: arrows + progress line, matching the company "Signals over
       time" slider — white variant for this module's dark background. */
    .bm-list-nav {
        display: flex;
        align-items: center;
        gap: 18px;
        margin-top: 24px;
    }

    .bm-nav-arrows {
        display: flex;
        gap: 12px;
        flex-shrink: 0;
    }

    .bm-nav-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: 0.3s;
    }

    .bm-nav-btn:hover {
        background: #fff;
        border-color: #fff;
    }

    .bm-nav-btn:hover svg path {
        stroke: #02061E;
    }

    .bm-nav-btn.swiper-button-disabled {
        opacity: 0.3;
        cursor: default;
    }

    .bm-nav-progress {
        position: relative;
        flex: 1;
        height: 2px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        overflow: hidden;
    }

    .bm-nav-progressbar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: #fff;
        transition: width 0.3s ease;
    }
}
