/* ===================================
   Landing page (index.html)
   =================================== */
.tp-hero {
    padding: 4.5rem 0 0;
    background: var(--bg-color);
    overflow: hidden;
}

.tp-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 3rem;
    align-items: center;
}

.tp-eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tp-hero-title {
    font-size: clamp(2.4rem, 5.2vw, 3.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.tp-hero-sub {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 30rem;
    margin-bottom: 2rem;
}

/* Each store image is baked onto the exact colour of the section it sits on,
   so it has no visible edge. */
.tp-shot {
    display: block;
    width: 100%;
    height: auto;
}

/* The hero photo's arm runs off the left edge of the image; soften that edge */
.tp-hero-media .tp-shot {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%);
    mask-image: linear-gradient(to right, transparent 0, #000 9%);
}

.tp-shot--fade {
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}

/* ---------- Runner track ---------- */
.tp-track {
    position: relative;
    height: 210px;
    margin-top: -40px;
    overflow: hidden;
    pointer-events: none;
}

.tp-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    height: 12px;
    background: url('../runners/ground.png') repeat-x 0 0 / auto 12px;
    image-rendering: pixelated;
    opacity: 0.85;
}

/* A runner's x position is -80px + p * (100vw + 160px), where p is its progress (0 to 1).
   Cacti use the same formula, so the hops in tp-hop line up with them at any width. */
.tp-cactus {
    position: absolute;
    bottom: 22px;
    left: calc(var(--p) * (100vw + 160px) - 62px);
    width: 25px;
    height: 52px;
    background: url('../runners/cactus-small.png') no-repeat center bottom / contain;
    image-rendering: pixelated;
}

.tp-cactus--lg {
    width: 38px;
    height: 75px;
    left: calc(var(--p) * (100vw + 160px) - 68px);
    background-image: url('../runners/cactus-large.png');
}

.tp-runner {
    position: absolute;
    left: 0;
    bottom: 24px;
    animation: tp-across var(--d, 10s) linear var(--delay, 0s) infinite both;
    will-change: transform;
}

.tp-hop {
    display: block;
    animation: tp-hop var(--d, 10s) linear var(--delay, 0s) infinite both;
}

.tp-sprite {
    display: block;
    width: var(--w);
    height: var(--h);
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: calc(var(--w) * var(--n)) var(--h);
    animation: tp-frames var(--step, 0.45s) steps(var(--n)) infinite;
}

.tp-sprite--trex {
    --w: 66px;
    --h: 70px;
    --n: 2;
    --step: 0.24s;
    background-image: url('../runners/trex.png');
    image-rendering: pixelated;
}

.tp-sprite--neongod {
    --w: 58px;
    --h: 82px;
    --n: 4;
    background-image: url('../runners/neongod.png');
}

.tp-sprite--sardar {
    --w: 58px;
    --h: 78px;
    --n: 4;
    background-image: url('../runners/sardar.png');
}

.tp-sprite--veer {
    --w: 58px;
    --h: 76px;
    --n: 4;
    background-image: url('../runners/veer.png');
}

@keyframes tp-frames {
    to {
        background-position: calc(-1 * var(--w) * var(--n)) 0;
    }
}

@keyframes tp-across {
    from {
        transform: translateX(-80px);
    }

    to {
        transform: translateX(calc(100vw + 80px));
    }
}

/* Two hops, centred on the cacti at 30% and 68% of the way across */
@keyframes tp-hop {
    0%,
    23% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }

    30% {
        transform: translateY(-72px);
        animation-timing-function: ease-in;
    }

    37%,
    61% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }

    68% {
        transform: translateY(-94px);
        animation-timing-function: ease-in;
    }

    75%,
    100% {
        transform: translateY(0);
    }
}

/* ---------- Feature rows ---------- */
.tp-section {
    padding: 5rem 0;
}

.tp-section--white {
    background: #fff;
}

.tp-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.tp-feature > * {
    min-width: 0;
}

.tp-feature--reverse .tp-feature-media {
    order: -1;
}

.tp-feature-media {
    max-width: 420px;
    width: 100%;
    justify-self: center;
}

.tp-feature-title {
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin-bottom: 1rem;
}

.tp-feature-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 30rem;
    margin-bottom: 1.25rem;
}

.tp-list {
    list-style: none;
    display: grid;
    gap: 0.7rem;
    max-width: 30rem;
}

.tp-list li {
    position: relative;
    padding-left: 1.6rem;
}

.tp-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 9px;
    height: 9px;
    background: var(--text-primary);
}

/* ---------- Small facts ---------- */
.tp-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tp-fact {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 1.75rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tp-fact:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.35);
}

.tp-fact h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.tp-fact p {
    color: var(--text-secondary);
}

/* ---------- Closing call to action ---------- */
.tp-cta {
    padding: 4.5rem 0 0;
    text-align: center;
    background: #fff;
}

.tp-cta h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.tp-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.tp-cta .store-badge {
    margin: 0 auto;
}

/* ---------- Motion ---------- */
.tp-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tp-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.tp-hero-copy {
    animation: tp-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tp-hero-media {
    animation: tp-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

@keyframes tp-rise {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .tp-hero-copy,
    .tp-hero-media,
    .tp-hop,
    .tp-sprite {
        animation: none;
    }

    /* Park the runners along the track instead of moving them */
    .tp-runner {
        animation: none;
        left: calc(var(--park, 0.2) * 100%);
    }
}

@media (max-width: 860px) {
    .tp-hero {
        padding-top: 3rem;
    }

    .tp-hero-grid,
    .tp-feature {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .tp-feature--reverse .tp-feature-media {
        order: 0;
    }

    .tp-section {
        padding: 3.5rem 0;
    }

    .tp-facts {
        grid-template-columns: 1fr;
    }

    .tp-track {
        margin-top: -20px;
    }
}
