/* ==========================================================================
   APE Distribution Kits — Homepage
   Scoped to .ape-home-page (body) and .ape-home (main content)
   ========================================================================== */

:root {
    --ape-blue: #1f78ff;
    --ape-sky: #74d4ff;
    --ape-bg: #f7fbff;
    --ape-text: #20364b;
    --ape-muted: #64788d;
    --ape-nav-bg: #ffffff;
    --ape-nav-height: 78px;
    --ape-content-width: min(1240px, 92%);
    --ape-shadow: 0 24px 60px rgba(23, 66, 122, 0.08);
}

.ape-home .container::before,
.ape-home .container::after {
    display: none !important;
    content: none !important;
}

/* --------------------------------------------------------------------------
   Page base
   -------------------------------------------------------------------------- */

.ape-home-page {
    font-family: Inter, sans-serif;
    background: var(--ape-bg);
    color: var(--ape-text);
    line-height: 1.7;
}

.ape-home * {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Public header — brand | nav | actions (single desktop row)
   -------------------------------------------------------------------------- */

.ape-home-page #mainNav.ape-public-header.navbar-default {
    /* Override creative.css `header { background-image }` and `#mainNav { background:#000 }` */
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    background-size: auto !important;
    background-position: initial !important;
    border: 0;
    border-top: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    margin-bottom: 0;
    min-height: var(--ape-nav-height);
    max-height: none;
    font-family: Inter, sans-serif;
    text-align: left;
    color: #40556d;
    z-index: 1030;
}

.ape-home-page #mainNav.ape-public-header.navbar-default.affix {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 0;
    border-top: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.ape-home-page #mainNav.ape-public-header .ape-public-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 28px;
    min-height: var(--ape-nav-height);
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 24px;
    box-sizing: border-box;
}

.ape-home-page #mainNav.ape-public-header .ape-public-brand.site-brand {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    flex-shrink: 1;
    min-width: 0;
    max-width: 300px;
    margin-right: 12px;
}

.ape-home-page #mainNav.ape-public-header .ape-public-brand-link.site-brand-link,
.ape-home-page #mainNav.ape-public-header .navbar-brand.site-brand-link {
    float: none;
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    height: auto !important;
    max-height: none;
    margin: 0;
    padding: 0;
    color: #17375e !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    overflow: visible;
}

.ape-home-page #mainNav.ape-public-header .ape-public-brand-link.site-brand-link:focus,
.ape-home-page #mainNav.ape-public-header .ape-public-brand-link.site-brand-link:focus-visible {
    outline: 2px solid #1f68b2;
    outline-offset: 3px;
    border-radius: 4px;
}

.ape-home-page #mainNav.ape-public-header .site-brand-title,
.ape-home-page #mainNav.ape-public-header .ape-public-brand-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: 100%;
    color: #17375e;
    font-size: clamp(15px, 1vw, 18px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
    white-space: normal;
}

.ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle {
    display: none;
    float: none;
    border-color: rgba(31, 120, 255, 0.35);
    color: #1f4e7a;
    text-transform: none;
    margin: 0;
    opacity: 1;
    background-color: rgba(31, 120, 255, 0.08);
    border-radius: 10px;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle:hover,
.ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle:focus {
    background-color: rgba(31, 120, 255, 0.14);
    border-color: rgba(31, 120, 255, 0.45);
    color: #1f4e7a;
}

.ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle .fa {
    color: #1f4e7a;
}

.ape-home-page #mainNav.ape-public-header .ape-public-menu.navbar-collapse {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    float: none;
    width: auto;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* Desktop: always show menu row (override Bootstrap collapse) */
@media (min-width: 992px) {
    .ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle {
        display: none !important;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu.collapse,
    .ape-home-page #mainNav.ape-public-header .ape-public-menu.collapsing {
        display: flex !important;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 0;
    }
}

.ape-home-page #mainNav.ape-public-header .ape-public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 8px 22px;
    white-space: nowrap;
    min-width: 0;
}

.ape-home-page #mainNav.ape-public-header .ape-public-nav-link,
.ape-home-page #mainNav.ape-public-header .ape-nav-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #40556d !important;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    position: relative;
}

.ape-home-page #mainNav.ape-public-header .ape-public-nav-link:hover,
.ape-home-page #mainNav.ape-public-header .ape-public-nav-link:focus,
.ape-home-page #mainNav.ape-public-header .ape-nav-trigger:hover,
.ape-home-page #mainNav.ape-public-header .ape-nav-trigger:focus {
    color: var(--ape-blue) !important;
    background: transparent;
    text-decoration: none;
    outline: none;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-trigger:focus-visible,
.ape-home-page #mainNav.ape-public-header .ape-public-nav-link:focus-visible {
    outline: 2px solid #1f68b2;
    outline-offset: 3px;
    border-radius: 4px;
}

.ape-home-page #mainNav.ape-public-header .ape-public-nav-link.is-active,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.is-active>.ape-nav-trigger {
    color: var(--ape-blue) !important;
    font-weight: 600;
}

.ape-home-page #mainNav.ape-public-header .ape-public-nav-link.is-active::after,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.is-active>.ape-nav-trigger::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    height: 2px;
    background: var(--ape-blue);
    border-radius: 2px;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-caret {
    font-size: 10px;
    opacity: 0.75;
    line-height: 1;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    float: none;
    min-width: 240px;
    margin: 0;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #dce7f3;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(30, 60, 100, 0.12);
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.open>.ape-nav-dropdown-menu,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown:hover>.ape-nav-dropdown-menu,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown:focus-within>.ape-nav-dropdown-menu {
    display: block;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li>a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    color: #183150;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li>a:hover,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li>a:focus {
    background: #eef6ff;
    color: #1f68b2;
    text-decoration: none;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li.active>a,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li.active>a:hover,
.ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li.active>a:focus {
    background: #e8f2fc;
    color: #1f68b2;
}

.ape-home-page #mainNav.ape-public-header .ape-public-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 14px;
    white-space: nowrap;
}

.ape-home-page #mainNav.ape-public-header .ape-public-actions>* {
    flex: 0 0 auto;
}

.ape-home-page #mainNav.ape-public-header .ape-admin-link,
.ape-home-page #mainNav.ape-public-header .ape-user-trigger,
.ape-home-page #mainNav.ape-public-header .ape-language-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    color: #40556d !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    background: transparent;
}

.ape-home-page #mainNav.ape-public-header .ape-admin-link:hover,
.ape-home-page #mainNav.ape-public-header .ape-admin-link:focus,
.ape-home-page #mainNav.ape-public-header .ape-user-trigger:hover,
.ape-home-page #mainNav.ape-public-header .ape-user-trigger:focus,
.ape-home-page #mainNav.ape-public-header .ape-language-trigger:hover,
.ape-home-page #mainNav.ape-public-header .ape-language-trigger:focus {
    color: var(--ape-blue) !important;
    background: transparent;
    text-decoration: none;
}

.ape-home-page #mainNav.ape-public-header .img-user {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 auto;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-user-name {
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-user-dropdown,
.ape-home-page #mainNav.ape-public-header .ape-nav-lang-dropdown {
    position: relative;
}

.ape-home-page #mainNav.ape-public-header .ape-nav-user-dropdown>.dropdown-menu,
.ape-home-page #mainNav.ape-public-header .ape-nav-lang-dropdown>.dropdown-menu {
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid #dce7f3;
    box-shadow: 0 12px 30px rgba(30, 60, 100, 0.12);
    z-index: 1060;
}

.ape-public-footer {
    background: #17263b;
    color: #ffffff;
    padding: 36px 0 28px;
    margin-top: 48px;
    text-align: center;
}

.ape-public-footer-inner {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.ape-public-footer-lead {
    margin: 0 auto 16px;
    max-width: 64ch;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.ape-public-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin: 0 0 16px;
}

.ape-public-footer-nav a {
    color: #7cc7ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.ape-public-footer-nav a:hover,
.ape-public-footer-nav a:focus {
    color: #ffffff;
    text-decoration: underline;
}

.ape-public-footer-copy {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

/* Laptop: tighter gaps, still one row */
@media (max-width: 1199px) and (min-width: 992px) {
    .ape-home-page #mainNav.ape-public-header .ape-public-navbar {
        gap: 20px;
        padding: 8px 18px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-brand.site-brand {
        flex: 0 1 auto;
        max-width: 260px;
        margin-right: 8px;
    }

    .ape-home-page #mainNav.ape-public-header .site-brand-title,
    .ape-home-page #mainNav.ape-public-header .ape-public-brand-text {
        font-size: 14px;
        line-height: 1.15;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-brand-link.site-brand-link,
    .ape-home-page #mainNav.ape-public-header .navbar-brand.site-brand-link {
        font-size: inherit;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav {
        gap: 8px 14px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav-link,
    .ape-home-page #mainNav.ape-public-header .ape-nav-trigger,
    .ape-home-page #mainNav.ape-public-header .ape-admin-link,
    .ape-home-page #mainNav.ape-public-header .ape-user-trigger,
    .ape-home-page #mainNav.ape-public-header .ape-language-trigger {
        font-size: 13px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-actions {
        gap: 10px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-user-name {
        max-width: 84px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu {
        gap: 12px;
    }
}

/* Tablet / mobile: hamburger + stacked panel */
@media (max-width: 991px) {
    :root {
        --ape-nav-height: 68px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-navbar {
        flex-wrap: wrap;
        gap: 0;
        min-height: var(--ape-nav-height);
        padding: 8px max(16px, env(safe-area-inset-left, 0px)) 8px max(16px, env(safe-area-inset-right, 0px));
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-brand.site-brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: min(220px, calc(100vw - 90px));
        margin-right: 0;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-brand-link.site-brand-link,
    .ape-home-page #mainNav.ape-public-header .navbar-brand.site-brand-link {
        font-size: inherit;
        padding: 0;
        max-width: 100%;
    }

    .ape-home-page #mainNav.ape-public-header .site-brand-title,
    .ape-home-page #mainNav.ape-public-header .ape-public-brand-text {
        max-width: 100%;
        font-size: 13px;
        line-height: 1.15;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu-toggle {
        display: inline-flex !important;
        flex: 0 0 auto;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu.navbar-collapse {
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        padding: 8px 0 16px;
        border-top: 1px solid rgba(31, 120, 255, 0.12);
    }

    /* Override Bootstrap ≥768 display:block !important so hamburger works to 991 */
    .ape-home-page #mainNav.ape-public-header .ape-public-menu.collapse {
        display: none !important;
        height: auto !important;
        overflow: hidden;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu.collapse.in {
        display: flex !important;
        overflow: visible;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-menu.collapsing {
        display: flex !important;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav,
    .ape-home-page #mainNav.ape-public-header .ape-public-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        gap: 0;
        white-space: normal;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav-link,
    .ape-home-page #mainNav.ape-public-header .ape-nav-trigger,
    .ape-home-page #mainNav.ape-public-header .ape-admin-link,
    .ape-home-page #mainNav.ape-public-header .ape-user-trigger,
    .ape-home-page #mainNav.ape-public-header .ape-language-trigger {
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        padding: 12px 4px;
        white-space: nowrap;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav-link.is-active::after,
    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.is-active>.ape-nav-trigger::after {
        display: none;
    }

    .ape-home-page #mainNav.ape-public-header .ape-public-nav-link.is-active,
    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.is-active>.ape-nav-trigger {
        color: var(--ape-blue) !important;
        background: rgba(31, 120, 255, 0.08);
        border-radius: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown {
        width: 100%;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu {
        position: static;
        transform: none;
        float: none;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0 0 8px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        display: none;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu::before {
        display: none;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown:hover>.ape-nav-dropdown-menu,
    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown:focus-within>.ape-nav-dropdown-menu {
        display: none;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown.open>.ape-nav-dropdown-menu {
        display: block;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-dropdown-menu>li>a {
        padding-left: 28px;
        white-space: normal;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-user-name {
        max-width: 180px;
    }

    .ape-home-page #mainNav.ape-public-header .ape-nav-user-dropdown>.dropdown-menu,
    .ape-home-page #mainNav.ape-public-header .ape-nav-lang-dropdown>.dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0;
        box-shadow: none;
        border: 0;
        background: transparent;
    }

    .ape-public-footer-inner {
        width: min(1180px, calc(100% - 32px));
    }

    .ape-public-footer-nav {
        gap: 4px 14px;
    }
}

@media (max-width: 575px) {
    .ape-home-page #mainNav.ape-public-header .ape-public-brand.site-brand {
        max-width: min(200px, calc(100vw - 90px));
    }

    .ape-home-page #mainNav.ape-public-header .site-brand-title,
    .ape-home-page #mainNav.ape-public-header .ape-public-brand-text {
        font-size: 12.5px;
    }
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */

.ape-home .container {
    width: min(1180px, 92%);
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
}

.ape-home .hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #1d73f4, #69d2ff);
    display: flex;
    align-items: center;
    color: #fff;
    position: relative;
    padding: var(--ape-nav-height) 0 150px;
}

.ape-home .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.ape-home .hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    padding: 8px 16px;
    border-radius: 30px;
}

.ape-home .hero h1 {
    font-size: 4.5rem;
    line-height: 0.95;
    margin: 20px 0;
}

.ape-home .hero p {
    max-width: 560px;
    font-size: 1.08rem;
}

.ape-home .btn {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 26px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
}

.ape-home .btn-white {
    background: #fff;
    color: #1d73f4;
}

.ape-home .btn-ghost {
    border: 2px solid #fff;
    color: #fff;
    margin-left: 12px;
}

.photo {
    background: #fff;
    border-radius: 32px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .12);
}

.hero-image {
    width: 100%;
    display: block;
    border-radius: 24px;
    object-fit: cover;
}

.visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef7ff;
    overflow: hidden;
}

.visual img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.ape-home .photo-placeholder {
    height: 480px;
    border: 2px dashed #c7d8eb;
    border-radius: 24px;
    background: #eef7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6f89a6;
}

.ape-home .wave {
    position: absolute;
    bottom: 0;
    width: 100%;
}

.ape-home section {
    padding: 60px 0;
}

.ape-home .head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 55px;
}

.ape-home .head h2 {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.ape-home .head p {
    color: var(--ape-muted);
}

.ape-home .problem {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 30px;
    align-items: center;
}

.ape-home .box {
    background: #fff;
    padding: 40px;
    border-radius: 28px;
    box-shadow: var(--ape-shadow);
}

.ape-home .arrow {
    text-align: center;
    font-size: 3rem;
    color: #7fc6ff;
}

.ape-home .portal {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.ape-home .item {
    display: grid;
    grid-template-columns: 340px 1fr;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--ape-shadow);
}

.ape-home .item:nth-child(even) {
    grid-template-columns: 1fr 340px;
}

.ape-home .item:nth-child(even) .visual {
    order: 2;
}

.ape-home .visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef7ff;
    color: #6c87a2;
    font-weight: 800;
    font-size: 1.4rem;
    padding: 30px;
    min-height: 300px;
}

.ape-home .content {
    padding: 50px;
}

.ape-home .content h3 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.ape-home .content p {
    color: var(--ape-muted);
}

.ape-home .content a {
    display: inline-block;
    margin-top: 18px;
    color: var(--ape-blue);
    font-weight: 800;
    text-decoration: none;
}

.ape-home .personas {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.ape-home .persona {
    background: #fff;
    padding: 28px;
    border-radius: 24px;
    box-shadow: var(--ape-shadow);
    text-align: center;
}

.ape-home .persona h4 {
    margin-top: 10px;
}

.ape-home .trust {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.ape-home .trust div {
    background: #fff;
    padding: 28px;
    border-radius: 18px;
    text-align: center;
    color: #8ea0b6;
    box-shadow: var(--ape-shadow);
}

.ape-home .cta-section {
    padding: 0;
}

.ape-home .cta {
    background: linear-gradient(135deg, #1d73f4, #69d2ff);
    padding: 70px;
    border-radius: 36px;
    color: #fff;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.ape-home-footer {
    background: #17263d;
    color: #fff;
    padding: 60px;
    margin-top: 90px;
}

.ape-home-footer .container {
    width: var(--ape-content-width);
    max-width: 1180px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {

    .ape-home .hero-grid,
    .ape-home .problem,
    .ape-home .item,
    .ape-home .item:nth-child(even),
    .ape-home .personas,
    .ape-home .trust {
        grid-template-columns: 1fr;
    }

    .ape-home .item:nth-child(even) .visual {
        order: 0;
    }

    .ape-home .hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 767px) {
    .ape-home-page {
        max-width: 100%;
        overflow-x: hidden;
    }

    html {
        max-width: 100%;
        overflow-x: hidden;
    }

    .ape-home .hero {
        padding-top: calc(var(--ape-nav-height) + 24px);
        min-height: auto;
    }
}

/* .portal .item {
    display: grid;
    grid-template-columns: 36% 64%;
    min-height: 360px;
} */
.portal .item {
    display: grid;
    grid-template-columns: 36% 64%;
    align-items: stretch;
    overflow: hidden;
    border-radius: 34px;
    background: #fff;
}

.portal .item.reverse {
    grid-template-columns: 64% 36%;
}

.portal .item .visual {
    overflow: hidden;
    background: #eef7ff;
    padding: 0;
}

.portal .item .visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 24px;
}

.portal .item .visual {
    overflow: hidden;
    display: flex;
}

.portal .item {
    overflow: hidden;
    border-radius: 32px;
}

.portal .item .visual {
    overflow: hidden;
}

.portal .item .visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Portal cards — stack image above content on mobile */
@media (max-width: 767px) {
    .explore-program {
        padding: 36px 0 64px;
    }

    .explore-program>.container {
        width: 100%;
        max-width: 100%;
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .ape-home .explore-program .head,
    .explore-program .head {
        max-width: 100%;
        width: 100%;
        margin: 0 0 30px;
        padding: 0;
        box-sizing: border-box;
    }

    .ape-home .explore-program .head h2,
    .explore-program .head h2 {
        font-size: clamp(24px, 6.5vw, 28px);
        line-height: 1.25;
        margin: 0 0 8px;
    }

    .ape-home .explore-program .head p,
    .explore-program .head p {
        margin: 0;
        font-size: 16px;
        line-height: 1.55;
    }

    .ape-home .portal,
    .portal {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
        max-width: 100%;
    }

    .ape-home .item,
    .ape-home .item:nth-child(even),
    .portal .item,
    .portal .item.reverse {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        grid-template-columns: none;
        width: 100%;
        max-width: 100%;
        min-height: 0;
        height: auto;
        box-sizing: border-box;
        overflow: hidden;
    }

    .ape-home .item .visual,
    .ape-home .item:nth-child(even) .visual,
    .portal .item .visual,
    .portal .item.reverse .visual {
        order: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        min-height: 190px;
        height: 200px;
        max-height: 230px;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 0;
    }

    .ape-home .item .visual img,
    .portal .item .visual img,
    .portal .item.reverse .visual img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: 0;
        display: block;
    }

    /* PNG illustrations: keep full artwork visible */
    .portal .item .visual img[src$=".png"],
    .portal .item.reverse .visual img[src$=".png"] {
        object-fit: contain;
        object-position: center;
        padding: 12px;
        box-sizing: border-box;
        background: #eef7ff;
    }

    .ape-home .item .content,
    .portal .item .content,
    .portal .item.reverse .content {
        order: 2;
        width: 100%;
        max-width: none;
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        height: auto;
        margin: 0;
        padding: 24px 22px 26px;
        box-sizing: border-box;
        text-align: left;
    }

    .ape-home .item .content h3,
    .portal .item .content h3 {
        font-size: 20px;
        line-height: 1.25;
        margin: 0 0 10px;
        max-width: 100%;
    }

    .ape-home .item .content p,
    .portal .item .content p {
        width: 100%;
        max-width: none;
        margin: 0 0 22px;
        font-size: 15px;
        line-height: 1.6;
    }

    .ape-home .item .content a,
    .portal .item .content a {
        position: static;
        display: inline-flex;
        align-items: center;
        margin-top: 0;
        max-width: 100%;
    }
}

.why-play {
    padding: 72px 0 8px;
}

.why-play .container {
    width: min(1200px, 92%);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.explore-program {
    padding: 44px 0 90px;
}

.section-head {
    text-align: center;
    max-width: 920px;
    margin: 0 auto 54px;
}

.why-play .section-head {
    margin-bottom: 32px;
}

.section-head h2 {
    font-size: 42px;
    line-height: 1.15;
    margin-bottom: 16px;
    color: #1d344c;
}

.section-head p {
    font-size: 20px;
    line-height: 1.55;
    color: #6b7f95;
}

.why-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px;
    row-gap: 22px;
    align-items: stretch;
    margin: 0 auto;
}

.why-benefit {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    margin: 0;
    padding: 26px;
    text-align: left;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #E3EBF5;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(31, 111, 235, 0.04);
    transition:
        border-color 220ms ease,
        transform 220ms ease,
        box-shadow 220ms ease;
}

.why-benefit:last-child {
    grid-column: 1 / -1;
    width: min(100%, 56%);
    max-width: 640px;
    justify-self: center;
}

.why-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #eef7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 220ms ease;
}

.why-benefit-body {
    min-width: 0;
    flex: 1 1 auto;
}

.why-benefit h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px;
    color: #1d344c;
    text-align: left;
}

.why-benefit p {
    font-size: 16px;
    line-height: 1.6;
    color: #5f748a;
    margin: 0;
    text-align: left;
    max-width: 36em;
}

.why-benefit:hover {
    border-color: var(--ape-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(31, 111, 235, 0.08);
}

.why-benefit:hover .why-icon {
    transform: scale(1.06);
}

@media (max-width: 991px) {
    .why-benefits {
        column-gap: 22px;
        row-gap: 18px;
    }

    .why-benefit {
        padding: 22px;
    }

    .why-benefit:last-child {
        width: min(100%, 70%);
    }
}

@media (max-width: 767px) {
    .why-play {
        padding: 52px 0 0;
    }

    .why-play .section-head {
        margin-bottom: 24px;
    }

    .section-head h2 {
        font-size: 30px;
    }

    .section-head p {
        font-size: 17px;
    }

    .why-benefits {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .why-benefit {
        gap: 14px;
        padding: 20px;
    }

    .why-benefit:last-child {
        width: 100%;
        max-width: none;
    }

    .why-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 24px;
    }

    .why-benefit h3 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .why-benefit p {
        font-size: 16px;
        line-height: 1.55;
        max-width: none;
    }
}


/* Footer  */
.ape-home-footer {
    background: #17263b;
    color: #ffffff;
    padding: 30px 0 36px;
    text-align: center;
}

/* 
.ape-home-footer .container {
    max-width: 100%;
}

.footer-content {
    max-width: 100%;
    text-align: center;
}

.footer-content h3 {
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
}

.footer-content p {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.88);
}
    */

/* .footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin: 2px 0;
} */

.footer-nav a {
    color: #7cc7ff;
    text-decoration: none;
    font-weight: 700;
}

.footer-nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Front Page — Hero */

.hero-playful {
    background: linear-gradient(135deg, #1577f2 0%, #35a9ff 100%);
    color: #fff;
    min-height: 680px;
    padding: 96px 0 72px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-playful>.container.hero-playful-grid,
.hero-playful-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 64px;
    align-items: center;
    width: min(1200px, 92%);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.35;
    margin-bottom: 28px;
    white-space: normal;
    box-sizing: border-box;
}

.hero-copy {
    min-width: 0;
    text-align: left;
}

.hero-copy h1 {
    font-size: 62px;
    line-height: 1.02;
    font-weight: 900;
    margin: 0;
}

.hero-copy h1 .hero-title-main,
.hero-copy h1 .hero-title-accent {
    display: block;
}

.hero-copy h1 .hero-title-main {
    color: #fff;
}

.hero-copy h1 .hero-title-accent {
    color: #ffe45c;
}

.hero-copy p {
    max-width: 580px;
    font-size: 20px;
    line-height: 1.55;
    margin: 26px 0 0;
    text-align: left;
}

.hero-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    margin-top: 36px;
}

.hero-playful .hero-actions .btn {
    margin-top: 0;
    margin-left: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.btn-white {
    background: #fff;
    color: #1976f3;
}

.btn-outline-white {
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .75);
    background: transparent;
}

.hero-visual {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-visual img {
    display: block;
    width: 100%;
    max-width: 580px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 38px;
    border: 10px solid #fff;
    box-shadow:
        0 8px 24px rgba(15, 40, 80, 0.08),
        0 28px 56px rgba(15, 40, 80, 0.14);
}

@media (max-width: 1199px) {
    .hero-playful {
        min-height: 640px;
        padding: 80px 0 64px;
    }

    .hero-playful-grid {
        gap: 56px;
    }

    .hero-copy h1 {
        font-size: 54px;
        line-height: 1.03;
    }

    .hero-copy p {
        font-size: 19px;
        max-width: 540px;
    }

    .hero-visual img {
        max-width: 520px;
    }
}

@media (max-width: 991px) {
    .hero-playful {
        min-height: 0;
        height: auto;
        padding: calc(var(--ape-nav-height) + 24px) 0 56px;
        overflow: hidden;
    }

    .hero-playful-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 40px;
        width: min(1200px, 94%);
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero-copy h1 {
        font-size: 44px;
        line-height: 1.04;
        max-width: 100%;
    }

    .hero-copy p {
        font-size: 18px;
        max-width: 100%;
        width: 100%;
        margin-top: 22px;
    }

    .hero-actions {
        flex-wrap: wrap;
        margin-top: 28px;
        gap: 14px;
        max-width: 100%;
    }

    .hero-playful .hero-actions .btn {
        white-space: normal;
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero-visual {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .hero-visual img {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-width: 8px;
        border-radius: 32px;
    }
}

@media (max-width: 767px) {
    .hero-playful {
        min-height: auto;
        height: auto;
        display: block;
        align-items: stretch;
        padding-top: calc(var(--ape-nav-height) + 32px);
        padding-bottom: 48px;
        padding-left: max(20px, env(safe-area-inset-left, 0px));
        padding-right: max(20px, env(safe-area-inset-right, 0px));
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .hero-playful>.container.hero-playful-grid,
    .hero-playful-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        grid-template-columns: none;
        gap: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    /* Flatten copy so title / desc / CTA can reorder around the image */
    .hero-copy {
        display: contents;
        text-align: left;
        min-width: 0;
    }

    .hero-badge {
        order: 1;
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 0 0 12px;
        padding: 8px 14px;
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        box-sizing: border-box;
    }

    .hero-copy h1 {
        order: 2;
        position: static;
        width: 100%;
        max-width: 100%;
        margin: 0;
        font-size: clamp(36px, 10vw, 48px);
        line-height: 1.05;
        letter-spacing: -0.02em;
        word-break: normal;
        overflow-wrap: normal;
        text-align: left;
        box-sizing: border-box;
    }

    .hero-copy h1 br {
        display: none;
    }

    .hero-copy h1 .hero-title-main,
    .hero-copy h1 .hero-title-accent {
        display: block;
        max-width: 100%;
    }

    .hero-copy p {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 16px 0 0;
        padding: 0;
        font-size: 18px;
        line-height: 1.55;
        text-align: left;
        box-sizing: border-box;
    }

    .hero-visual {
        order: 4;
        position: static;
        right: auto;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin: 24px 0 0;
        min-width: 0;
        box-sizing: border-box;
    }

    .hero-visual img {
        position: static;
        right: auto;
        top: auto;
        left: auto;
        transform: none;
        display: block;
        width: 100%;
        max-width: 420px;
        height: auto;
        margin: 0 auto;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        border-width: 6px;
        border-radius: 28px;
        box-shadow:
            0 6px 16px rgba(15, 40, 80, 0.08),
            0 18px 36px rgba(15, 40, 80, 0.12);
        box-sizing: border-box;
    }

    .hero-actions {
        order: 5;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        margin: 24px 0 0;
        box-sizing: border-box;
    }

    .hero-playful .hero-actions .btn,
    .ape-home .hero-playful .hero-actions .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: 52px;
        margin: 0;
        padding: 14px 18px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        box-sizing: border-box;
    }
}