/* ==========================================================================
   Home page only. Shared components live in style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-section {
    /* Slides under the sticky header (its height plus 1px border) */
    margin-top: calc(-1 * var(--header-height) - 1px);
    padding: calc(var(--header-height) + clamp(2.5rem, 6vw, 5.5rem)) 0 clamp(3.5rem, 7vw, 6.5rem);
    isolation: isolate;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(52rem 34rem at 78% 18%, rgba(37, 99, 235, 0.2), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 72px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 72px 100%;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
}

.hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
}

.hero-content {
    max-width: 660px;
}

.hero-content > *,
.hero-stage {
    animation: heroRise 0.9s var(--ease-out) both;
}
.hero-content > :nth-child(2) { animation-delay: 80ms; }
.hero-content > :nth-child(3) { animation-delay: 160ms; }
.hero-content > :nth-child(4) { animation-delay: 240ms; }
.hero-content > :nth-child(5) { animation-delay: 320ms; }
.hero-stage { animation-delay: 240ms; }

@keyframes heroRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

.hero-title {
    font-size: clamp(2.5rem, 1.35rem + 4.2vw, 4.3rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.hero-subtitle {
    font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.16rem);
    max-width: 34rem;
}

.hero-buttons {
    gap: 0.85rem;
    margin-bottom: 2.75rem;
}

.hero-features {
    list-style: none;
    gap: 0.7rem 1.75rem;
}

.hero-feature-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.hero-feature-icon svg {
    width: 12px;
    height: 12px;
}

/* Hero visual: the stage keeps the chips inside its own box at every width,
   and z-index keeps them in front of the phone or image. */
.hero-showcase {
    min-width: 0;
}

.hero-stage {
    position: relative;
    width: min(100%, 480px);
    margin-inline: auto;
    padding-block: 1.5rem;
}

.device-phone,
.hero-media,
.floating-chip {
    translate: calc(var(--px, 0) * var(--depth, 1) * 26px) calc(var(--py, 0) * var(--depth, 1) * 20px);
    transition: translate 0.6s var(--ease-out);
}

.device-phone {
    position: relative;
    z-index: 1;
    width: clamp(226px, 60%, 288px);
    margin-inline: auto;
    background: #0a1124;
    border: 7px solid #1c2740;
    border-radius: 38px;
    overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-notch {
    width: 84px;
    height: 16px;
    margin: 0 auto;
    background: #1c2740;
    border-radius: 0 0 11px 11px;
}

.phone-screen {
    padding: 1.1rem 0.95rem 1.5rem;
}

.screen-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
}

.screen-card + .screen-card {
    margin-top: 0.75rem;
}

.screen-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.screen-card-desc {
    margin-top: 0.35rem;
    font-size: 0.71rem;
    line-height: 1.45;
    color: var(--dark-text-body);
}

.screen-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 78px;
    margin-top: 0.9rem;
    padding-top: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.chart-bar {
    flex: 1;
    background: var(--accent-blue);
    border-radius: 3px 3px 0 0;
    transform-origin: bottom;
    animation:
        barGrow 1s var(--ease-out) both,
        barBreathe 3.6s ease-in-out 1.6s infinite alternate;
    animation-delay: calc(500ms + var(--bar) * 90ms), calc(1600ms + var(--bar) * 240ms);
}

.chart-bar:last-child {
    background: #93c5fd;
}

@keyframes barGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes barBreathe {
    from { transform: scaleY(1); }
    to { transform: scaleY(0.84); }
}

.screen-steps {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin-top: 0.7rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #cbd5e1;
}

.screen-steps li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.screen-steps svg {
    width: 12px;
    height: 12px;
    color: #60a5fa;
}

.screen-steps .is-next {
    color: var(--dark-text-body);
}

.screen-steps .is-next span {
    width: 12px;
    height: 12px;
    border: 2px solid #60a5fa;
    border-radius: 50%;
}

.hero-media {
    position: relative;
    z-index: 1;
    width: 88%;
    margin-inline: auto;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--dark-card);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-chip {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    background: rgba(17, 26, 49, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    animation: chipFloat 5s ease-in-out infinite alternate;
}

.floating-chip svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #93c5fd;
}

.floating-chip-1 { top: 40%; left: 0; }
.floating-chip-2 { top: 7%; right: 0; animation-delay: -1.6s; }
.floating-chip-3 { bottom: 17%; right: 0; animation-delay: -3.1s; }

@keyframes chipFloat {
    from { transform: translateY(5px); }
    to { transform: translateY(-5px); }
}

/* --------------------------------------------------------------------------
   Capabilities marquee
   -------------------------------------------------------------------------- */
.marquee-strip {
    background: var(--dark-bg);
    border-block: 1px solid rgba(255, 255, 255, 0.08);
    padding-block: 1.15rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeSlide 48s linear infinite;
}

.marquee-strip:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    list-style: none;
    flex-shrink: 0;
}

.marquee-group li {
    display: flex;
    align-items: center;
    font-size: 0.92rem;
    font-weight: 500;
    color: #a8b5c9;
    white-space: nowrap;
}

.marquee-group li::after {
    content: '';
    width: 4px;
    height: 4px;
    margin-inline: 1.9rem;
    border-radius: 50%;
    background: var(--accent-blue);
}

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

/* --------------------------------------------------------------------------
   Shared section rhythm
   -------------------------------------------------------------------------- */
.services-section,
.about-section,
.process-section,
.projects-section,
.testimonials-section {
    padding-block: var(--section-gap);
}

.section-header-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.5rem 4rem;
    align-items: end;
    max-width: none;
    text-align: left;
}

.section-header-split .section-title {
    margin-bottom: 0;
}

.section-header-aside .section-subtitle {
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */
.services-grid {
    gap: 1.25rem;
}

.service-card {
    padding: 2rem;
}

.service-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(2.5rem, 6vw, 5.5rem);
}

.about-content {
    max-width: none;
}

.about-title {
    font-size: clamp(1.95rem, 1.5rem + 1.9vw, 2.9rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
}

.about-desc {
    margin-bottom: 2rem;
}

.about-image-card {
    aspect-ratio: 1 / 1.08;
    background: var(--border-subtle);
    box-shadow: none;
}

.about-image-card img {
    height: 100%;
}

.about-flow-badge {
    position: static;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--light-text-head);
}

.about-flow-sep {
    color: var(--primary);
}

.about-points {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2rem;
    margin-bottom: 2.25rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.about-point {
    display: flex;
    gap: 0.85rem;
}

.about-point-icon {
    flex-shrink: 0;
    width: 22px;
    margin-top: 2px;
    color: var(--primary);
}

.about-point-icon svg {
    width: 20px;
    height: 20px;
}

.about-point-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--light-text-head);
    margin-bottom: 0.25rem;
}

.about-point-text {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--light-text-body);
}

.stats-row {
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.25rem;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Process: dark band with a rail that fills on scroll
   -------------------------------------------------------------------------- */
.process-section {
    background: var(--dark-bg);
}

.process-section .section-title {
    color: #ffffff;
}

.process-section .section-subtitle {
    color: var(--dark-text-body);
}

.process-track {
    position: relative;
    padding-top: 3.25rem;
}

.process-rail {
    position: absolute;
    top: 1rem;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

.process-rail-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    border-radius: inherit;
    transform-origin: left;
    transform: scaleX(var(--progress, 1));
}

.process-grid {
    list-style: none;
    gap: 2.25rem;
}

.process-card {
    display: block;
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) {
    .process-card:hover {
        box-shadow: none;
        border-color: rgba(147, 197, 253, 0.4);
    }
}

.process-node {
    position: absolute;
    top: calc(-3.25rem + 1rem + 1px);
    left: 1.5rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    transition: background-color var(--dur-base) ease, border-color var(--dur-base) ease, color var(--dur-base) ease;
}

.is-tracking .process-node:not(.is-lit) {
    background: #111a31;
    border-color: rgba(255, 255, 255, 0.2);
    color: #a8b5c9;
}

.process-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
}

.process-icon-wrap svg {
    width: 21px;
    height: 21px;
}

.process-title {
    color: #ffffff;
}

.process-desc {
    color: var(--dark-text-body);
}

/* Sits wholly inside the gap between two cards */
.process-arrow {
    position: absolute;
    top: 50%;
    right: calc(-2.25rem - 1px);
    width: 2.25rem;
    height: 1.5rem;
    margin-top: -0.75rem;
    display: grid;
    place-items: center;
    color: #6f8bb5;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.projects-section {
    background: var(--light-bg);
    border-top: 0;
}

.projects-header-wrap {
    gap: 1.5rem 3rem;
    flex-wrap: wrap;
}

.projects-header-wrap .section-title,
.testimonials-header-wrap .section-title {
    margin-bottom: 0.5rem;
}

.projects-header-wrap .section-subtitle {
    max-width: 38rem;
}

/* Compact cards: four across on desktop, centred when there are fewer */
.projects-grid,
.apps-grid {
    --card-gap: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem var(--card-gap);
}

.project-card {
    flex: 0 1 calc((100% - 3 * var(--card-gap)) / 4);
    min-width: 0;
}

.project-thumb {
    height: auto;
    aspect-ratio: 4 / 3;
}

.project-info {
    padding: 0.9rem 1rem 1rem;
    gap: 0.75rem;
}

.project-title {
    font-size: 0.98rem;
}

.project-category {
    font-size: 0.7rem;
}

.project-btn {
    width: 30px;
    height: 30px;
}

/* --------------------------------------------------------------------------
   Our Apps: store-style cards (managed in Admin > Apps)
   -------------------------------------------------------------------------- */
.apps-section {
    padding-block: var(--section-gap);
    background: var(--light-bg);
}

/* Directly after the portfolio, the two read as one continuous band */
.projects-section + .apps-section {
    padding-top: 0;
}

.store-badge svg {
    width: 18px;
    height: 18px;
}

.apps-section .section-header {
    text-align: center;
    margin-inline: auto;
    margin-bottom: 3rem;
}

.app-card {
    display: flex;
    flex-direction: column;
    flex: 0 1 calc((100% - 3 * var(--card-gap)) / 4);
    min-width: 0;
}

.app-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #eef2ff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.app-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.app-card:hover .app-cover-img {
    transform: scale(1.03);
}

/* No cover uploaded: brand gradient with a soft, oversized copy of the icon */
.app-cover-plain {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
}

.app-cover-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46%;
    height: auto;
    aspect-ratio: 1;
    transform: translate(-50%, -58%) rotate(-8deg);
    border-radius: 22%;
    opacity: 0.22;
    filter: blur(1px);
    object-fit: cover;
}

.app-icon {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    margin: -32px auto 0;
    border-radius: 16px;
    background: #ffffff;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    object-fit: cover;
}

.app-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 0.6rem;
}

.app-title {
    font-size: 1.05rem;
    text-align: center;
    color: var(--light-text-head);
}

.app-tagline {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    text-align: center;
    color: var(--light-text-muted);
}

.app-desc {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--light-text-muted);
}

.app-more {
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
    text-decoration: none;
}

.app-more:hover,
.app-more:focus-visible {
    text-decoration: underline;
}

.app-stores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem 0.35rem 0.65rem;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    transition: transform var(--dur-base) ease, box-shadow var(--dur-base) ease;
}

.store-badge small {
    display: block;
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.store-badge:hover,
.store-badge:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

@media (max-width: 1024px) {
    .project-card,
    .app-card {
        flex-basis: calc((100% - var(--card-gap)) / 2);
        max-width: 320px;
    }
}

@media (max-width: 720px) {
    .projects-grid,
    .apps-grid {
        --card-gap: 0.75rem;
        row-gap: 1.25rem;
    }

    .project-info {
        padding: 0.7rem 0.75rem 0.8rem;
    }

    .project-title {
        font-size: 0.88rem;
    }

    .project-btn {
        display: none;
    }

    .project-card {
        max-width: none;
    }

    .app-card {
        flex-basis: min(100%, 340px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-cover-img,
    .store-badge {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Testimonials: scroll-snap carousel
   -------------------------------------------------------------------------- */
.testimonials-section {
    background: var(--light-bg-alt);
    border-top: 1px solid var(--border-subtle);
}

.testimonials-header-wrap {
    gap: 1.5rem 3rem;
}

.slider-controls {
    flex-shrink: 0;
}

.slider-controls[hidden] {
    display: none;
}

html:not(.js) .slider-controls {
    display: none;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 1.5rem) / 3);
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    border-radius: var(--radius-md);
}

.testimonials-grid::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    scroll-snap-align: start;
    min-width: 0;
}

@media (hover: hover) {
    .testimonial-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--border-hover);
    }
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */
.cta-section {
    padding: 0 0 var(--section-gap);
}

.testimonials-section + .cta-section {
    padding-top: var(--section-gap);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.02rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .process-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .process-card {
        padding: 1.5rem 1.25rem;
    }
    .process-node {
        left: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .testimonials-grid {
        grid-auto-columns: calc((100% - 1.5rem) / 2);
    }
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .hero-grid,
    .about-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero-content {
        max-width: 680px;
    }
    .section-header-split {
        grid-template-columns: minmax(0, 1fr);
    }
    .about-image-card {
        aspect-ratio: 16 / 10;
    }

    /* Process turns into a vertical timeline */
    .process-track {
        padding: 0 0 0 3.25rem;
    }
    .process-rail {
        top: 0;
        bottom: 0;
        left: 1.05rem;
        right: auto;
        width: 2px;
        height: auto;
    }
    .process-rail-fill {
        transform-origin: top;
        transform: scaleY(var(--progress, 1));
    }
    .process-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.25rem;
    }
    .process-node,
    .process-card .process-node {
        top: 1.5rem;
        left: calc(-3.25rem + 1.1rem - 1px);
        transform: translateX(-50%);
    }
    .process-arrow {
        top: auto;
        right: auto;
        bottom: calc(-2.25rem - 1px);
        left: 50%;
        margin: 0 0 0 -1.125rem;
        height: 2.25rem;
    }
    .process-arrow svg {
        transform: rotate(90deg);
    }
}

@media (max-width: 720px) {
    .services-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .testimonials-grid {
        grid-auto-columns: 100%;
    }
    .about-points {
        grid-template-columns: minmax(0, 1fr);
    }
    .testimonials-header-wrap {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero-buttons .btn {
        flex: 1 1 100%;
    }
    .floating-chip {
        padding: 0.45rem 0.75rem;
        font-size: 0.74rem;
    }
    .floating-chip svg {
        width: 13px;
        height: 13px;
    }
    .service-card {
        padding: 1.6rem;
    }
    .cta-action,
    .cta-action .btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion: the global rule in style.css shortens animations, but these
   must not run or loop at all. Everything rests in its final position.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero-content > *,
    .hero-stage,
    .chart-bar,
    .floating-chip,
    .marquee-track {
        animation: none;
    }
    .marquee-strip {
        -webkit-mask-image: none;
        mask-image: none;
    }
    .marquee-track {
        width: auto;
        justify-content: center;
    }
    .marquee-group {
        flex-wrap: wrap;
        flex-shrink: 1;
        justify-content: center;
        row-gap: 0.4rem;
        padding-inline: 1.5rem;
    }
    .marquee-group[aria-hidden="true"] {
        display: none;
    }
    .testimonials-grid {
        scroll-behavior: auto;
    }
}
