@font-face {
    font-family: 'Inter';
    src: url('../assets/images/download-pages/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    background-color: #0f0f0f;
    color: #FFFFFF;
    display: flex;
    justify-content: center;
    /* safe: when the content is taller than the window, start at the top instead of clipping it. */
    align-items: safe center;
}

.container {
    width: 100%;
    max-width: 1600px;
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: auto;
}

.main-content-download-marti {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 100vh;
}

.phone-container {
    flex: 0 0 55%;
    /* Lets the column hold its 55% instead of growing to fit the image and pushing the text off screen. */
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
}

.phone-image-telephone {
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    align-self: flex-end;
}

.content-container {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-left: 0;
    padding-right: 50px;
}

.main-title {
    font-size: clamp(56px, 5vw, 76px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    text-align: center;
}

.main-title span {
    display: block;
}

/* Ensure store icons are side-by-side */
.content-container .app-stores {
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.green-text {
    color: #00b24d;
}

.download-button-link {
    text-decoration: none;
    margin-bottom: 30px;
    max-width: 400px;
    max-height: 150px;
    padding: 0 10px;
    display: inline-block;
    overflow: hidden;
}

.download-button-img {
    max-width: 400px !important;
    max-height: 100px !important;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease-in-out;
}

.app-stores {
    display: flex;
    flex-direction: row !important;
    gap: 15px;
    align-items: center;
}

.store-button {
    display: none;
}

.store-icon {
    height: 48px;
    width: auto;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.store-icon:hover {
    transform: scale(1.05);
}

.download-button-link:hover .download-button-img {
    transform: scale(1.03);
}

.store-text {
    display: none;
}

.store-text span {
    font-size: 12px;
}

.store-text strong {
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 992px) {
    html, body { overflow: auto; }
    .main-content-download-marti {
        flex-direction: column;
        text-align: center;
        height: auto;
        min-height: 100vh;
        justify-content: flex-start;
    }

    .content-container {
        align-items: center;
        text-align: center;
        padding-left: 16px;
        padding-right: 16px;
        margin-top: 0;
        flex: 0 1 auto;
        max-width: 90vw;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .phone-container { order: 2; flex-grow: 1; width: 100%; }
    .content-container { order: 1; }
    .phone-image-telephone { width: 100%; max-width: 100vw; height: auto; max-height: none; }

    .main-title { font-size: clamp(40px, 11vw, 72px); text-align: center; margin: 24px 0 28px; }

    .content-container .app-stores { width: 100%; max-width: 420px; padding: 0; box-sizing: border-box; gap: 8px; justify-content: center; margin: 0 auto; }
    .store-icon { height: 40px; }

    .download-button-new {
        font-size: 20px;
    }
}

/* Tablet large (iPad Air/Pro widths) */
@media (min-width: 993px) and (max-width: 1200px) {
    html, body { overflow: auto; }
    .container { height: auto; min-height: 100vh; }
    .main-content-download-marti { flex-direction: column; text-align: center; height: auto; min-height: 100vh; justify-content: flex-start; }

    .content-container {
        order: 1;
        align-items: center;
        text-align: center;
        padding-left: 16px;
        padding-right: 16px;
        margin-top: 0;
        max-width: 80vw;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        flex: 0 1 auto;
    }

    .phone-container { order: 2; flex-grow: 1; width: 100%; }
    .phone-image, .phone-image-telephone { width: 100%; max-width: 100vw; height: auto; max-height: 60vh; }

    .main-title { text-align: center; margin: 32px 0 28px; }

    .content-container .app-stores { width: 100%; max-width: 420px; padding: 0; box-sizing: border-box; gap: 8px; justify-content: center; margin: 0 auto; }
}

@media (max-width: 576px) {
    .content-container { padding-left: 16px; padding-right: 16px; flex: 0 1 auto; max-width: 80vw; width: 100%; margin: 0 auto; }

    /* Override inline dimensions for mobile to ensure responsive sizing */
    .download-button-link { max-width: 70vw; width: 100%; margin: 0 auto 30px; display: block; }
    .download-button-img { width: 100% !important; height: auto !important; max-width: 100% !important; max-height: none !important; }

    .download-button-new {
        font-size: 18px;
        padding: 12px 25px;
    }

    .content-container .app-stores { width: 100%; max-width: 420px; padding: 0; box-sizing: border-box; gap: 8px; justify-content: center; margin: 0 auto; }
    .store-icon { height: 32px; }
}

/* Strict mobile viewport: no scrollbars and fully contained layout */
@media (max-width: 932px) {
    html, body { overflow-x: hidden; overflow-y: auto; }
    .container { height: 100vh; }
    .main-content-download-marti { height: 100vh; min-height: 100vh; justify-content: flex-start; }
    .phone-container { order: 2; flex-grow: 1; width: 100%; }
    .content-container { order: 1; max-width: 80vw; width: 100%; margin: 0 auto; padding-left: 16px; padding-right: 16px; flex: 0 1 auto; }
    .download-button-link { max-width: 62vw; }
    .content-container .app-stores { max-width: 420px; }
    .phone-image, .phone-image-telephone { width: 100%; max-width: 100vw; height: auto; max-height: 50vh; }
}

/* Desktop wide: keep phone container anchored to bottom while text stays centered */
@media (min-width: 1201px) {
    .phone-container { align-self: flex-end; }
}

/* Focused fix for 930px–999px to keep the title visible */
@media (min-width: 930px) and (max-width: 999px) {
    .main-content-download-marti { flex-direction: column; align-items: center; justify-content: flex-start; }
    .content-container { order: 1; align-items: center; text-align: center; max-width: 84vw; width: 100%; margin: 0 auto; padding-left: 16px; padding-right: 16px; flex: 0 1 auto; }
    .main-title { text-align: center; }
    .phone-container { order: 2; width: 100%; }
    .phone-image, .phone-image-telephone { width: 100%; max-width: 100vw; height: auto; max-height: 56vh; }
    .content-container .app-stores { justify-content: center; }
}

/*
 * On computers (mouse or trackpad) one QR code replaces the download button and store badges. It
 * holds an Adjust link that sends each phone to its own store. Phones and tablets can't scan their
 * own screen, so they keep the button and badges.
 */
/* Caption centred under the code; the column places the pair (right on desktop, centred below 1200px). */
.qr {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.qr img {
    display: block;
    width: 220px;
    height: 220px;
    border-radius: 16px;
}

@media (hover: hover) and (pointer: fine) {
    .phone-only { display: none !important; }
    .qr { display: flex; }
}
