/* ============================================================
   Mobile view styles — NorthEdge Digital
   Desktop is untouched: mobile-only elements are hidden by
   default and every override lives inside max-width queries.
   ============================================================ */

/* Mobile-only elements stay hidden on desktop */
.navbar-toggle,
.mobile-menu,
.contact-popup-topbar {
    display: none;
}

/* Duplicated ticker items only exist for the mobile marquee loops */
.hero-features .hero-feature-clone,
.services-points .services-point-clone {
    display: none;
}

/* Mobile-only process description (replaces the CTA button on phones) */
.process-lead-mobile {
    display: none;
}

/* Mobile-only CTA shown under the last process step */
.process-cta-mobile {
    display: none;
}

/* Line break that only takes effect on mobile */
.mobile-break {
    display: none;
}

/* Wrapper is layout-neutral on desktop; clips the marquee on mobile. */
.hero-features-viewport {
    display: contents;
}

/* The <picture> wrappers around the hero slides must not affect layout:
   with display:contents the imgs lay out exactly as before on desktop */
.hero-track picture {
    display: contents;
}

@media (max-width: 768px) {

    html {
        scroll-padding-top: 4.75rem;
    }

    /* ---------- Navbar ---------- */

    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1.15rem;
    }

    .navbar-menu,
    .navbar-social {
        display: none;
    }

    .navbar-logo {
        margin-left: 0;
    }

    .navbar-logo img {
        height: 2.35rem;
        max-width: 60vw;
    }

    .navbar-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 50%;
        background: rgba(22, 28, 42, 0.85);
        cursor: pointer;
    }

    .navbar-toggle span {
        display: block;
        width: 0.85rem;
        height: 2px;
        border-radius: 2px;
        background: #fff;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .navbar-toggle span + span {
        margin-top: 2px;
    }

    .navbar-toggle.is-open span:nth-child(1) {
        transform: translateY(4px) rotate(45deg);
    }

    .navbar-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggle.is-open span:nth-child(3) {
        transform: translateY(-4px) rotate(-45deg);
    }

    /* Let the blurred overlay show through behind the logo/toggle */
    body.has-mobile-menu .navbar {
        background: transparent;
    }

    body.has-mobile-menu {
        overflow: hidden;
    }

    /* ---------- Mobile side menu overlay ---------- */

    .mobile-menu:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 90;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 6.5rem 1.5rem 1.75rem;
        overflow: hidden;
    }

    .mobile-menu::before {
        content: "";
        position: absolute;
        inset: -8%;
        background: #05070f url("../img/hero-section/hero-bg_1.png") center / cover no-repeat;
        filter: blur(26px) brightness(0.95);
    }

    .mobile-menu::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(2, 5, 10, 0.38);
    }

    .mobile-menu > * {
        position: relative;
        z-index: 1;
    }

    .mobile-menu-nav {
        margin-top: auto;
    }

    .mobile-menu-nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2.1rem;
        list-style: none;
    }

    .mobile-menu-nav a {
        color: #fff;
        font-family: "Inter", sans-serif;
        font-size: 1.05rem;
        font-weight: 400;
        letter-spacing: 0.01em;
        text-decoration: none;
    }

    .mobile-menu-social {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        margin-top: 2.1rem;
        padding-top: 1.6rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .mobile-menu-social a {
        display: block;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 50%;
        overflow: hidden;
    }

    .mobile-menu-social img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-menu-footer {
        margin-top: auto;
        color: rgba(207, 207, 207, 0.85);
        font-family: "Inter", sans-serif;
        font-size: 0.78rem;
        line-height: 1.55;
        text-align: center;
    }

    /* ---------- Hero ---------- */

    .hero {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100svh;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hero-track {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transform: none;
        margin: 0;
    }

    .hero-bg1 {
        position: absolute;
        inset: 0;
    }

    .hero-slide {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .hero-copy {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        z-index: 5;
        margin-top: auto;
        width: 100%;
        max-width: none;
        padding: 0 1.4rem;
        text-align: center;
    }

    .hero-copy h1 {
        font-size: min(clamp(1.6rem, 8vw, 2.4rem), 7.5vh);
        line-height: 1.2;
    }

    .hero-sub {
        margin: min(1.15rem, 2vh) auto 0;
        max-width: 22rem;
        font-size: min(0.95rem, 2.2vh);
    }

    .hero-cta {
        position: relative;
        display: flex;
        justify-content: center;
        width: 100%;
        max-width: none;
        margin: min(1.6rem, 2.5vh) auto 0;
        padding: min(0.6rem, 1.4vh) 3.2rem;
        font-size: min(0.95rem, 2.1vh);
    }

    .hero-cta-arrow {
        position: absolute;
        top: 50%;
        right: 0.4rem;
        transform: translateY(-50%);
        width: min(2.1rem, 4.5vh);
        height: min(2.1rem, 4.5vh);
    }

    /* Bottom ticker: titles only, dot-separated, auto-scrolling marquee. */
    .hero-features-viewport {
        display: block;
        flex-shrink: 0;
        width: 100%;
        overflow: hidden;
    }

    .hero-features {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        width: max-content;
        max-width: none;
        margin: 0;
        padding: min(2.75rem, 5vh) 0 min(1.5rem, 2.5vh);
        will-change: transform;
        animation: hero-features-scroll 22s linear infinite;
    }

    .hero-features .hero-feature-clone {
        display: flex;
    }

    .hero-features li {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0;
        transform: none !important;
        opacity: 1 !important;
    }

    .hero-features li::after {
        content: "\2022";
        margin-left: 1rem;
        margin-right: 1rem;
        color: #fff;
        font-size: 0.7rem;
    }

    .feature-icon,
    .hero-features p {
        display: none;
    }

    .hero-features .header6 {
        margin-bottom: 0;
        font-size: min(0.83rem, 1.85vh);
        white-space: nowrap;
    }

    .hero-features .hero-feature-suffix {
        display: none;
    }

    @keyframes hero-features-scroll {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(-50%);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .hero-features {
            width: 100%;
            overflow-x: auto;
            padding: min(2.75rem, 5vh) 1.15rem min(1.5rem, 2.5vh);
            animation: none;
            scrollbar-width: none;
        }

        .hero-features-viewport {
            overflow-x: auto;
            scrollbar-width: none;
        }

        .hero-features-viewport::-webkit-scrollbar,
        .hero-features::-webkit-scrollbar {
            display: none;
        }
    }

    /* ---------- Partners carousel ---------- */

    /* Bigger logos, but slimmer box padding so the strip height stays the same */
    .partners-box {
        padding: 0.7rem 0;
    }

    .partners-set {
        --logo-gap: 0.75rem;
    }

    .partners-set img {
        width: 10rem;
        height: 3.55rem;
    }

    /* ---------- About ---------- */

    .about {
        display: flex;
        min-height: 36rem;
        box-shadow: none;
    }

    .about-bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        /* translateY pushes the wave lower in the section; the rotation
           tilts it and the scale keeps the edges covered */
        transform: translateY(22%) rotate(25deg) scale(1.2);
    }

    /* Shift the whole coin group lower along with the wave */
    .about-coins {
        transform: translateY(3rem);
    }

    /* Text sits at the top, coins float in their own space below it */
    .about-content {
        position: relative;
        inset: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        width: 100%;
        padding: 3rem 0 22rem;
    }

    .about-block {
        padding: 0 1.4rem;
    }

    .about-block-bottom {
        display: none;
    }

    .about-label {
        font-size: 1rem;
    }

    .about-content h2 {
        font-size: clamp(1.85rem, 7.5vw, 2.35rem);
    }

    .about-title-white,
    .about-title-blue {
        white-space: nowrap;
    }

    .about-block-top .about-copy-lines {
        width: max-content;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .about-block-top .about-copy-line {
        display: block;
        white-space: nowrap;
    }

    .about-block-top .about-copy {
        font-size: clamp(0.72rem, 3.1vw, 0.82rem);
        line-height: 1.55;
    }

    /* Arrangement: small Solana top-center, Tether mid-left, big Bitcoin right */
    .coin-left1 {
        top: auto;
        bottom: 15.5rem;
        left: 32%;
        width: 5rem;
    }

    .coin-left2 {
        top: auto;
        bottom: 8rem;
        left: 6%;
        width: 6.75rem;
    }

    .coin-right2 {
        top: auto;
        bottom: 5.5rem;
        right: 4%;
        width: 11.5rem;
    }

    .coin-right1 {
        display: none;
    }

    /* ---------- Services ---------- */

    .services-wavechart {
        display: none;
    }

    .services-intro {
        grid-template-columns: 1fr;
    }

    .services-intro-copy {
        text-align: center;
    }

    .services-label {
        font-size: 1rem;
    }

    .services-lead {
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(0.55rem, 2.85vw, 0.95rem);
    }

    .services-tag {
        display: none;
    }

    .services-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        margin-top: 2.25rem;
        gap: 0.85rem;
    }

    /* Icon left, title + copy stacked on the right. */
    .service-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 0.85rem;
        row-gap: 0.25rem;
        align-items: start;
        height: auto;
    }

    .service-card img {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
        width: 2.75rem;
        height: 3.75rem;
        margin: 0;
    }

    .service-card h3 {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        font-size: clamp(1.2rem, 3.6vw, 1.05rem);
        white-space: normal;
    }

    .service-card p {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        font-size: clamp(0.78rem, 2.7vw, 0.88rem);
        line-height: 1.45;
    }

    .service-card-line {
        display: inline;
        white-space: normal;
    }

    /* The marquee row must not inflate the grid track, otherwise the
       whole detail block (and the dashboard stack) grows offscreen */
    .services-detail {
        grid-template-columns: minmax(0, 1fr);
        padding-left: 0;
        padding-right: 0;
    }

    /* Slightly wider than the content column so the art fills the
       screen, but leaves room for the card-swap cascade */
    .services-pies {
        width: 108vw;
        max-width: none;
        margin: 0 0 0 calc(50% - 54vw);
    }

    .services-pies .pie {
        width: 100%;
    }

    /* Strategy / Performance / Data & Insights / Optimization points scroll
       as an endless horizontal carousel (items are cloned by JS for the loop) */
    .services-points {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        /* Spacing lives on the items (not gap) so translateX(-50%)
           loops exactly onto the cloned set */
        gap: 0;
        width: max-content;
        max-width: none;
        margin: 2.25rem 0 0;
        will-change: transform;
        animation: services-points-scroll 30s linear infinite;
    }

    .services-points .services-point-clone {
        display: flex;
    }

    .services-points li {
        flex: 0 0 auto;
        width: 72vw;
        margin-right: 1.5rem;
    }

    @keyframes services-points-scroll {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(-50%);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .services-points {
            width: 100%;
            overflow-x: auto;
            animation: none;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;
        }

        .services-points::-webkit-scrollbar {
            display: none;
        }

        .services-points li {
            scroll-snap-align: start;
        }
    }

    /* ---------- Process: description replaces the CTA button ---------- */

    .process-copy {
        text-align: center;
    }

    .process-label {
        font-size: 1rem;
    }

    .process-cta {
        display: none;
    }

    /* The mobile CTA reappears under the last process step */
    .process-cta.process-cta-mobile {
        display: inline-flex;
        justify-self: center;
        margin-top: 0.5rem;
    }

    .process-lead-mobile {
        display: block;
        margin: 1.15rem auto 1.75rem;
        max-width: 30rem;
        color: #9ca3af;
        font-family: "Inter", sans-serif;
        font-style: italic;
        font-size: 0.95rem;
        line-height: 1.6;
        text-align: center;
    }

    /* ---------- Stats: number on the left, label beside it ---------- */

    .stats-bridge {
        padding-bottom: 5.5rem;
    }

    .process {
        padding-top: 4.5rem;
    }

    .stats-bridge ul {
        grid-template-columns: 1fr;
        row-gap: 1.75rem;
        padding-top: 2.75rem;
    }

    .stats-bridge li {
        display: grid;
        grid-template-columns: 1fr 1.15fr;
        align-items: center;
        column-gap: 1rem;
    }

    .stats-bridge strong {
        margin-bottom: 0;
        text-align: right;
        font-size: 2.4rem;
    }

    /* "6 Years+" becomes "6 Yrs+" on phones */
    .stats-bridge strong .stat-unit-full {
        display: none;
    }

    .stats-bridge strong .stat-unit-short {
        display: inline;
    }

    .stats-bridge span {
        text-align: left;
        font-family: "Figtree", sans-serif;
        font-size: 1.15rem;
        font-weight: 600;
    }

    /* ---------- Why Northedge: one-row auto-sliding card carousel ---------- */

    .why-us-section {
        overflow: hidden;
    }

    /* Swipeable snap carousel: the next card peeks at the right edge and
       JS auto-advances one card at a time (pausing while the user swipes) */
    .why-us-grid {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .why-us-grid::-webkit-scrollbar {
        display: none;
    }

    .why-us-grid .why-card {
        flex: 0 0 auto;
        width: 76vw;
        max-width: none;
        margin-right: 1rem;
        scroll-snap-align: start;
    }

    /* ---------- Ads partner carousel (bigger cards on small screens) ---------- */

    .ads-partner-inner {
        --ads-slots: 1.8;
        /* Full viewport width instead of the padded content width */
        --ads-span: 100vw;
    }

    /* Break the carousel box out of the section padding to the screen edges */
    .ads-partner-box {
        margin-left: calc(50% - 50vw);
    }

    /* Footer copyright wraps into two fixed rows */
    .mobile-break {
        display: inline;
    }

    /* ---------- Contact section (in-page): centered heading, form,
       then phone/telegram on one row ---------- */

    .contact-section:not(.is-popup-open) .contact-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        text-align: center;
    }

    /* Flatten the copy block so its children can be reordered
       around the form (details row must come after the form) */
    .contact-section:not(.is-popup-open) .contact-copy {
        display: contents;
    }

    .contact-section:not(.is-popup-open) .contact-label {
        order: 1;
        margin-bottom: 0.6rem;
        color: #b9c0cc;
        font-size: 1rem;
        text-align: center;
    }

    .contact-section:not(.is-popup-open) .contact-copy h2 {
        order: 2;
        margin-bottom: 1.9rem;
        font-size: clamp(1.7rem, 7.5vw, 2.1rem);
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }

    .contact-section:not(.is-popup-open) .contact-lead,
    .contact-section:not(.is-popup-open) .contact-features {
        display: none;
    }

    .contact-section:not(.is-popup-open) .contact-form {
        order: 3;
        /* The section centers text; fields keep their labels top-left */
        text-align: left;
    }

    .contact-section:not(.is-popup-open) .contact-details {
        order: 4;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 1.9rem;
    }

    /* ---------- Contact popup: full-screen appointment form ---------- */

    .contact-section.is-popup-open .contact-inner {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        padding: 0.85rem 1.25rem 2rem;
        gap: 1.4rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .contact-section.is-popup-open .contact-popup-topbar {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        min-height: 2.75rem;
        padding-right: 3.25rem;
    }

    .contact-section.is-popup-open .contact-popup-topbar img {
        display: block;
        height: 2.35rem;
        width: auto;
        mix-blend-mode: screen;
    }

    .contact-section.is-popup-open .contact-popup-close {
        top: 1rem;
        right: 1.25rem;
        width: 2.35rem;
        height: 2.35rem;
        border: 1px solid rgba(255, 255, 255, 0.55);
        background: transparent;
        color: transparent;
        font-size: 0;
    }

    .contact-section.is-popup-open .contact-popup-close::before,
    .contact-section.is-popup-open .contact-popup-close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0.72rem;
        height: 1.5px;
        background: #fff;
        border-radius: 1px;
    }

    .contact-section.is-popup-open .contact-popup-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .contact-section.is-popup-open .contact-popup-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .contact-section.is-popup-open .contact-popup-topbar,
    .contact-section.is-popup-open .contact-copy,
    .contact-section.is-popup-open .contact-form {
        width: 100%;
    }

    .contact-section.is-popup-open .contact-copy {
        margin-top: auto;
        text-align: center;
    }

    .contact-section.is-popup-open .contact-label {
        display: block;
        width: 100%;
        margin-bottom: 0.6rem;
        color: #b9c0cc;
        font-size: 1.1rem;
        text-align: center;
    }

    .contact-section.is-popup-open .contact-copy h2 {
        display: block;
        width: 100%;
        font-size: clamp(1.6rem, 7.5vw, 2.05rem);
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }

    .contact-section.is-popup-open .contact-copy h2 span {
        display: block;
        text-align: center;
    }

    .contact-section.is-popup-open .contact-lead,
    .contact-section.is-popup-open .contact-features {
        display: none;
    }

    .contact-section.is-popup-open .contact-form {
        width: 100%;
        max-width: 26rem;
        margin: 0 auto auto;
    }

    .contact-section.is-popup-open .contact-form button[type="submit"] {
        margin-top: 1.25rem;
        border-radius: 999px;
    }

    .popup-field-time .popup-field-label {
        right: 5.75rem;
    }

    .datetime-gmt-picker button {
        min-width: 4.85rem;
        max-width: 6.1rem;
        padding: 0 0.7rem 0 0.55rem;
        font-size: 0.78rem;
    }
}
