/* ==========================================================================
   MEDIA QUERIES - RESPONSIVE LAYOUT
   ========================================================================== */

/* ----------------------------------
   SAFARI / iOS SPECIFIC FIXES
   Safari's 100vh includes the URL bar, causing constant layout recalculation
   which triggers page reloads on mobile. Using -webkit-fill-available fixes this.
   Also, backdrop-filter without -webkit prefix doesn't work in Safari.
   ---------------------------------- */

/* Fix for iOS Safari 100vh bug */
@supports (-webkit-touch-callout: none) {

    .hero,
    .modal-overlay,
    .preloader {
        min-height: -webkit-fill-available;
    }
}

/* iOS smooth momentum scrolling */
@media (max-width: 1024px) {

    .testimonial-cards,
    #partner-list,
    .ai-slick-slider,
    .portfolio-horizontal-scroll {
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce GPU memory pressure from backdrop-filter on touch devices */
    .sub-services-list li,
    .content-stats,
    .fancy-arrow {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ----------------------------------
   LAPTOP RESPONSIVENESS
   ---------------------------------- */
@media (max-height: 950px) and (min-width: 901px) {

    /* Prevent Journey section from getting cut off at the bottom on 13"-15" laptops */
    .journey-pin {
        padding-top: 5.5rem;
        padding-bottom: 2rem;
    }

    .journey-workspace {
        min-height: 380px;
        margin-top: clamp(20px, 3vh, 40px);
    }

    .journey-header {
        gap: 1.5rem;
    }

    .story-copy {
        padding: 24px 32px;
    }

    .content-stats {
        margin-bottom: 16px;
    }

    /* Prevent Industries section from getting cut off at the bottom */
    .industries-pin-wrapper {
        padding-top: 60px !important;
    }

    .ind-header {
        padding: 30px clamp(20px, 6vw, 96px) 15px !important;
    }

    .ind-accordion {
        height: clamp(400px, 58vh, 720px) !important;
    }

    .partners-header-wrapper {
        width: 100%;
    }
}

@media (max-width: 1600px) {

    /* Navbar */
    .nav-links {
        gap: 1.2rem;
        font-size: 1rem;
    }

    /* Hero Typography Fix for Laptops */
    .headline {
        max-width: min(1300px, 90vw);
        /* Allow more width to prevent wrapping */
    }

    .hl,
    .word {
        font-size: clamp(1.6rem, 6vw, 4.8rem);
    }

    .word-slot {
        height: clamp(2.5rem, 6.2vw, 5.5rem);
    }

    /* Typography scale down for laptop */
    .services-title h2 {
        font-size: 3rem;
    }

    .partners h2 {
        font-size: 4.5rem;
    }

    .test-title {
        font-size: 4.5rem;
    }

    .video-section h2 {
        font-size: 4.5rem;
    }

    .partner-image {
        width: 260px;
        height: 360px;
        right: 2%;
    }
}

/* ----------------------------------
   TABLET RESPONSIVENESS (max-width: 1024px)
   ---------------------------------- */
@media (max-width: 1024px) {

    /* General Layout */
    section {
        padding: 4rem 4%;
    }

    /* Hero Section */
    .hero-title {
        font-size: 7rem;
    }

    /* Portfolio Section */
    .portfolio h2 {
        font-size: 8rem;
        line-height: 1.2;
    }

    /* Video Section */
    .video-section h2 {
        font-size: 3.5rem;
    }

    .video-stats {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    /* Services Section */
    .services-cards-container {
        gap: 80px;
        padding: 80vh 5% 100px 5%;
    }

    /* Industries Accordion */
    .industries-under {
        align-items: flex-start !important;
        padding: 15vh 4% 4rem 4% !important;
    }

    .ind-heading {
        font-size: 4rem;
    }

    .ind-accordion {
        flex-direction: column;
        height: auto;
        min-height: 600px;
    }

    .ind-strip {
        width: 100% !important;
        height: 80px;
        flex: none !important;
        transition: height 0.6s cubic-bezier(0.25, 1, 0.5, 1) !important;
    }

    .ind-strip.active {
        height: 450px !important;
        flex: none !important;
    }

    /* Fix labels for vertical stacking */
    .strip-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0 20px;
    }

    .strip-name {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 16px;
        text-align: left;
    }

    .ind-strip.hov .strip-name {
        font-size: 16px;
        /* disable hover shrink */
    }

    .strip-num {
        position: relative;
        top: 0;
        opacity: 1;
        font-size: 16px;
    }

    .ind-strip.hov .strip-num {
        font-size: 16px;
        transform: none;
    }

    .strip-divider {
        height: 2px;
        width: 24px;
        margin: 0 10px;
    }

    .ind-strip.hov .strip-divider {
        height: 2px;
        width: 30px;
    }

    /* Fix content width */
    .strip-content {
        width: 100% !important;
        padding: 24px 20px;
        box-sizing: border-box;
    }

    /* Testimonials */
    .test-title {
        font-size: 4rem;
    }

    /* Global Partners */
    .partners h2 {
        font-size: 4rem;
    }

    .partner-image {
        width: 250px;
        height: 350px;
        opacity: 0.5;
        /* fade slightly to not block text */
    }

    /* Section Heading Responsiveness for Tablet */
    .exp-header h2,
    .brands-header h2,
    .ind-heading,
    .ai-header h2,
    .services-title h2,
    .services-sticky-content h2,
    .section-heading h2,
    .cta-heading,
    .logo-text-stack h2,
    .partners h2,
    .test-title {
        font-size: 3.5rem;
    }
}

/* ----------------------------------
   MOBILE RESPONSIVENESS (max-width: 768px)
   ---------------------------------- */
@media (max-width: 768px) {

    /* Section Heading Responsiveness for Mobile */
    .exp-header h2,
    .brands-header h2,
    .ind-heading,
    .ai-header h2,
    .services-title h2,
    .services-sticky-content h2,
    .section-heading h2,
    .cta-heading,
    .logo-text-stack h2,
    .partners h2,
    .test-title {
        font-size: 2.2rem;
    }

    .journey-pin {
        padding-left: 0;
        padding-right: 0;
    }

    /* Stack CTA heading text and image on mobile to prevent clipping */
    .cta-text-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .cta-inline-slot {
        display: block;
        margin: 0.5rem 0;
    }

    .cta-images {
        margin: 0;
    }


    /* Header Logo */
    .logo-desktop {
        display: none !important;
    }

    .logo-mobile {
        display: block !important;
    }

    /* AI Capabilities */
    .ai-capabilities {
        padding: 3rem 5%;
    }

    .ai-capabilities .section-heading p {
        margin-bottom: 1.5rem;
    }

    .ai-card {
        min-width: unset !important;
        margin: 0 10px !important;
    }

    .ai-card-content {
        padding: 1.5rem !important;
    }

    /* General Layout */
    section {
        padding: 3rem 4%;
    }

    /* Hero Section */
    .hero-title {
        font-size: 4.5rem;
        line-height: 1;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-brands {
        flex-direction: column;
        gap: 1rem;
    }

    /* Features Section */
    .features-list {
        flex-direction: column;
        gap: 2rem;
    }

    /* Tape Marquee */
    .marquee-content span {
        font-size: 4rem;
    }

    /* Services Section (Sticky with reduced mobile spacing) */
    .services-sticky-content {
        height: 50vh !important;
        top: 50px !important;
        align-items: center !important;
    }

    .services-cards-container {
        gap: 30px !important;
        padding: 50vh 5% 50px 5% !important;
    }

    .services-heading-wrapper h2 span {
        font-size: 2.8rem;
    }

    /* Industries Accordion */
    .industries-pin-wrapper {
        padding-top: 40px !important;
    }

    .industries-under {
        padding: 5vh 4% 2rem 4% !important;
    }

    .ind-heading {
        font-size: 3rem;
    }

    .ind-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ind-progress {
        align-items: flex-start;
    }

    .ind-dots {
        justify-content: flex-start;
    }

    .ind-strip .content-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
        white-space: normal !important;
        word-wrap: break-word;
        hyphens: auto;
    }

    /* Portfolio Section */
    .portfolio-marquee-content h2 {
        font-size: 4rem;
    }

    /* Testimonials */
    .test-title {
        font-size: 3rem;
    }

    .test-card {
        min-width: 300px;
        width: 300px;
        height: 420px;
        padding: 1.5rem;
    }

    .test-quote {
        font-size: 0.95rem;
    }

    /* Global Partners */
    .partners {
        padding: 4rem 5%;
    }

    .partners-header-wrapper {
        position: relative;
        width: 100%;
        top: 0;
        padding: 0;
        background: transparent;
    }

    .partners h2 {
        font-size: 3rem;
    }

    .partners-content {
        display: flex;
        flex-direction: column;
    }

    .partner-image {
        display: none !important;
    }

    .partners-content {
        margin-top: 2rem;
    }

    #partner-list {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1.5rem;
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
        width: 100%;
        margin: 0;
        padding-left: 0;
    }

    #partner-list::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari and Opera */
    }

    .partners-list li {
        scroll-snap-align: start;
        min-width: 240px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 16px;
        padding: 1.5rem 1rem !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        cursor: default;
        opacity: 1 !important;
    }

    .partners-list li strong {
        font-size: 1rem;
    }

    .partners-list li::before,
    .partners-list li.active::before {
        display: none !important;
    }

    .partners-list li.active,
    .partners-list li:hover {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    .partners-list li.active strong,
    .partners-list li:hover strong {
        color: #ffffff !important;
    }

    .mob-partner-img {
        display: block;
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }

    .mob-partner-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mob-partner-info {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        font-size: 1.4rem;
    }

    /* Contact Footer */
    .footer-huge-text {
        font-size: 10vw;
    }

    .footer-top {
        flex-direction: column;
        gap: 3rem;
    }

    .footer-bottom-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

}

/* ----------------------------------
   SMALL MOBILE RESPONSIVENESS (max-width: 480px)
   ---------------------------------- */
@media (max-width: 480px) {

    /* Force no horizontal scroll on tiny screens */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    /* Fix huge mobile logo pushing layout */
    .logo-mobile {
        height: 50px !important;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    /* Marquee */
    .marquee-content span {
        font-size: 2rem;
    }

    /* Services */
    .services-heading-wrapper h2 span {
        font-size: 2.2rem;
    }

    .service-card {
        padding: 1.2rem;
    }

    /* Partner Cards */
    .partners-list li {
        min-width: 300px;
        padding: 1.2rem 0.8rem !important;
    }

    /* Testimonials */
    .test-title {
        font-size: 2.2rem;
    }

    .test-card {
        min-width: 260px;
        width: 260px;
        padding: 1rem;
    }
}

/* Extra small devices (320px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 2rem;
    }

    .logo-mobile {
        height: 40px !important;
    }

    .partners h2,
    .portfolio-marquee-content h2,
    .video-section h2 {
        font-size: 2rem !important;
    }

    .test-card {
        min-width: 240px;
        width: 240px;
    }

    .partners-list li {
        min-width: 200px;
    }
}

/* --- GLOBAL SECTION HEADING STANDARDIZATION --- */
.journey-header h1,
.ind-heading,
.ai-header h2,
.services-heading-wrapper h2,
.portfolio-marquee-content h2,
.portfolio h2,
.partners h2,
.test-title,
.brands-header h2,
.section-heading h2,
.cta-heading,
.hero-title,
.video-section h2,
.exp-header h2,
.logo-text-stack h2 {
    font-size: clamp(2.5rem, 6vw, 5rem) !important;
    line-height: 1.1 !important;
}

/* GLOBAL SUBHEADINGS */
.journey-intro,
.ai-header p,
.services-heading-wrapper p,
.partners-subtitle,
.section-heading p,
.hero-subtitle,
.logo-text-stack p {
    font-size: clamp(1rem, 2vw, 1.25rem) !important;
    line-height: 1.5 !important;
}