/* ==========================================================
   TAPPITRACK — HOMEPAGE SECTIONS (below the hero)
   Builds on components/page.css. Markup: index.html
   Trust band + logo marquee, solutions (sticky frame), platform
   tabs, product categories and industry cards.
   ========================================================== */

/* ---------- Trust band + client logo marquee ---------- */

.hm-trust {
    padding-block: clamp(64px, 8vw, 104px);
    text-align: center;
}

.hm-trust h2 {
    margin: 0 auto 12px;
    font-size: clamp(24px, 2.5vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hm-trust > .tt-container > p {
    margin: 0 0 28px;
    color: var(--tt-muted);
    font-size: 19px;
}

.hm-trust .pg-actions {
    justify-content: center;
}

.hm-trust .btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.hm-trust .btn-outline {
    color: var(--tt-blue);
    border-color: var(--tt-blue);
}

/* Two copies of the list scroll left as one track; moving it by half its
   width lands the second copy exactly where the first started. */
.hm-logos {
    margin-top: clamp(40px, 5vw, 64px);
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.hm-logos-track {
    display: flex;
    width: max-content;
    animation: hm-marquee 40s linear infinite;
}

.hm-logos:hover .hm-logos-track {
    animation-play-state: paused;
}

.hm-logos ul {
    display: flex;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
    margin: 0;
    padding: 0 clamp(20px, 2.5vw, 36px);
    list-style: none;
}

.hm-logos img {
    display: block;
    width: auto;
    max-width: 220px;
    height: auto;
    max-height: 84px;
}

@keyframes hm-marquee {
    to { transform: translateX(-50%); }
}

/* ---------- Solutions: sticky frame + scrolling list ---------- */

.hm-svc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
}

.hm-svc-side {
    position: sticky;
    top: calc(var(--tt-header-height) + 32px);
}

.hm-svc-side .pg-heading {
    margin-bottom: 32px;
}

.hm-svc-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    background: var(--tt-navy);
    border-radius: var(--tt-radius-lg);
}

/* Navy tint so the badge, dots and caption read on any photo. */
.hm-svc-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 26, 58, 0.3), rgba(7, 26, 58, 0.78));
}

.hm-svc-strip {
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateY(calc(var(--i) * -100%));
    transition: transform 700ms var(--tt-ease);
}

.hm-svc-strip li {
    height: 100%;
}

.hm-svc-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-svc-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    color: var(--tt-white);
    background: var(--tt-blue);
    border: 8px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background-clip: padding-box;
}

.hm-svc-badge svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hm-svc-dots {
    position: absolute;
    top: 40px;
    right: 28px;
    z-index: 1;
    display: flex;
    gap: 6px;
}

.hm-svc-dots i {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    transition: width 300ms var(--tt-ease), background-color 300ms ease;
}

.hm-svc-dots i.is-active {
    width: 24px;
    background: var(--tt-white);
}

.hm-svc-frame figcaption {
    position: absolute;
    right: 24px;
    bottom: 22px;
    left: 24px;
    z-index: 1;
    color: var(--tt-white);
}

.hm-svc-frame figcaption strong {
    display: block;
    font-family: var(--tt-font-heading);
    font-size: 22px;
}

.hm-svc-frame figcaption span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

.hm-svc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-svc-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 32px;
    align-items: start;
    padding: 30px 0;
    border-top: 1px solid var(--tt-border);
}

.hm-svc-item:last-child {
    border-bottom: 1px solid var(--tt-border);
}

.hm-svc-thumb {
    display: none;
}

.hm-svc-item h3 {
    margin: 0 0 8px;
    font-size: clamp(22px, 2vw, 28px);
}

.hm-svc-item h3 a {
    color: var(--tt-dark);
    text-decoration: none;
    transition: color 250ms ease;
}

.hm-svc-item.is-active h3 a,
.hm-svc-item h3 a:hover {
    color: var(--tt-blue);
}

.hm-svc-item p {
    margin: 0;
    color: var(--tt-muted);
    font-size: 17px;
    line-height: 1.7;
}

.hm-svc-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    color: var(--tt-blue);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.hm-svc-more svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* ---------- Industries: heading row + icon cards (dark section) ---------- */

/* Site navy (same as the hero and footer) with a soft brand-blue glow. */
.hm-dark {
    color: var(--tt-navy-text);
    background: var(--tt-navy-glow), var(--tt-navy);
}

.hm-ind-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px 64px;
    align-items: end;
    margin-bottom: clamp(32px, 4vw, 56px);
}

.hm-ind-head h2 {
    margin: 0;
    color: var(--tt-white);
    font-size: clamp(30px, 3.6vw, 48px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hm-ind-head p {
    margin: 0;
    color: var(--tt-navy-text);
    font-size: 18px;
    line-height: 1.7;
}

.hm-ind {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-ind-card {
    display: block;
    height: 100%;
    padding: 32px 26px;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--tt-navy-line);
    border-radius: var(--tt-radius);
    text-decoration: none;
    transition: background-color 250ms ease, border-color 250ms ease, transform 250ms var(--tt-ease);
}

.hm-ind-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(110, 168, 255, 0.55);
    transform: translateY(-4px);
}

.hm-ind-card svg {
    width: 36px;
    height: 36px;
    margin-bottom: 28px;
    fill: none;
    stroke: var(--tt-blue-light);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hm-ind-card h3 {
    margin: 0 0 12px;
    color: var(--tt-white);
    font-size: 21px;
}

.hm-ind-card p {
    margin: 0;
    color: var(--tt-navy-text);
    font-size: 15px;
    line-height: 1.65;
}

/* ---------- Platform tabs ---------- */

.hm-tablist {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.hm-tablist::-webkit-scrollbar {
    display: none;
}

.hm-tablist button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    color: var(--tt-text);
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hm-tablist button:hover {
    color: var(--tt-blue);
    border-color: var(--tt-blue);
}

.hm-tablist button[aria-selected="true"] {
    color: var(--tt-white);
    background: var(--tt-blue);
    border-color: var(--tt-blue);
}

.hm-tablist svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hm-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(32px, 6vw, 80px);
    padding: clamp(24px, 4vw, 48px);
    background: var(--tt-white);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius-lg);
    animation: hm-fade 400ms var(--tt-ease);
}

.hm-panel[hidden] {
    display: none;
}

.hm-panel h3 {
    margin: 0 0 14px;
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 800;
}

.hm-panel p {
    margin: 0 0 24px;
    color: var(--tt-muted);
    font-size: 17px;
    line-height: 1.7;
}

@keyframes hm-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Product categories ---------- */

.hm-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-products a {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 26px 22px;
    color: inherit;
    background: var(--tt-light);
    border: 1px solid transparent;
    border-radius: var(--tt-radius);
    text-decoration: none;
    transition: background-color 200ms ease, border-color 200ms ease;
}

.hm-products a:hover {
    background: var(--tt-white);
    border-color: var(--tt-blue);
}

.hm-products .pg-icon {
    margin: 0 0 8px;
    background: var(--tt-white);
}

.hm-products strong {
    color: var(--tt-dark);
    font-family: var(--tt-font-heading);
    font-size: 18px;
}

.hm-products em {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: var(--tt-blue);
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
}

.hm-products em svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* ---------- How it works: dark step cards ---------- */

#how .pg-steps li {
    background: var(--tt-navy-glow), var(--tt-navy);
    border-color: var(--tt-navy);
    border-top-color: var(--tt-blue);
    box-shadow: 0 18px 40px rgba(7, 26, 58, 0.16);
}

#how .pg-steps li::before {
    color: #FF5A63;   /* lighter brand red: readable on navy */
}

#how .pg-steps h3 {
    color: var(--tt-white);
}

#how .pg-steps p {
    color: var(--tt-navy-text);
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .hm-ind {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .hm-svc {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-svc-side {
        position: static;
    }

    .hm-svc-frame {
        display: none;
    }

    /* Without the frame, each service shows its own photo. */
    .hm-svc-item {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 0;
    }

    .hm-svc-thumb {
        display: block;
        margin: 0;
        overflow: hidden;
        aspect-ratio: 16 / 9;
        border-radius: var(--tt-radius);
    }

    .hm-svc-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hm-ind-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-panel .pg-media {
        order: -1;
    }

    .hm-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hm-tablist {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .hm-ind {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .hm-panel {
        animation: none;
    }

    /* Static, wrapped logo row; the duplicate copy is not needed. */
    .hm-logos {
        mask-image: none;
    }

    .hm-logos-track {
        width: auto;
        animation: none;
    }

    .hm-logos ul {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 32px;
    }

    .hm-logos ul[aria-hidden] {
        display: none;
    }

    .hm-svc-strip,
    .hm-svc-dots i,
    .hm-ind-card {
        transition: none;
    }

    .hm-ind-card:hover {
        transform: none;
    }
}
