/* ============================================
   SCALEFORGE DIGITAL — RESPONSIVE STYLESHEET
   Breakpoints:
   - Desktop: 1200px+
   - Laptop: 1024px - 1199px
   - Tablet: 768px - 1023px
   - Mobile Large: 576px - 767px
   - Mobile Small: < 576px
   ============================================ */

/* ==========================================
   1. LARGE DESKTOP (1400px+)
   ========================================== */
@media screen and (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }

    .hero__title {
        font-size: var(--fs-6xl);
    }

    .hero__dashboard {
        max-width: 520px;
    }
}

/* ==========================================
   2. LAPTOP (1024px - 1199px)
   ========================================== */
@media screen and (max-width: 1199px) {
    :root {
        --container-padding: 2rem;
    }

    .hero__title {
        font-size: var(--fs-4xl);
    }

    .hero__container {
        gap: var(--space-10);
    }

    .hero__dashboard {
        max-width: 420px;
    }

    .results__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-4);
    }

    .result-card {
        padding: var(--space-6) var(--space-3);
    }

    .result-card__value {
        font-size: var(--fs-4xl);
    }

    .case-studies__grid {
        gap: var(--space-5);
    }

    .footer__top {
        gap: var(--space-10);
    }
}

/* ==========================================
   3. TABLET (768px - 1023px)
   ========================================== */
@media screen and (max-width: 1023px) {

    /* ---- Section Defaults ---- */
    .section {
        padding: var(--space-20) 0;
    }

    .section__title {
        font-size: var(--fs-3xl);
    }

    .section__header {
        margin-bottom: var(--space-12);
    }

    /* ---- Navigation ---- */
    .nav__toggle {
        display: flex;
    }

    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        height: 100vh;
        background: var(--bg-primary);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        padding: calc(var(--header-height) + var(--space-8)) var(--space-8) var(--space-8);
        transition: right var(--transition-base);
        z-index: var(--z-overlay);
        overflow-y: auto;
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
    }

    .nav__link {
        padding: var(--space-3) var(--space-4);
        font-size: var(--fs-base);
        border-radius: var(--radius-lg);
        display: block;
    }

    .nav__link:hover,
    .nav__link.active {
        background: var(--primary-50);
    }

    .nav__link--cta {
        text-align: center;
        margin-top: var(--space-4);
        padding: var(--space-3) var(--space-5) !important;
    }

    .nav__close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: var(--space-6);
        right: var(--space-6);
        width: 40px;
        height: 40px;
        border-radius: var(--radius-lg);
        color: var(--text-primary);
        cursor: pointer;
        transition: background var(--transition-base);
    }

    .nav__close:hover {
        background: var(--gray-100);
    }

    /* Mobile menu overlay */
    .nav__menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        z-index: -1;
    }

    .nav__menu.show-menu::before {
        opacity: 1;
        visibility: visible;
    }

    /* ---- Hero ---- */
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + var(--space-12));
        padding-bottom: var(--space-16);
    }

    .hero__container {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }

    .hero__content {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero__badge {
        justify-content: center;
    }

    .hero__title {
        font-size: var(--fs-4xl);
    }

    .hero__description {
        margin: 0 auto var(--space-8);
    }

    .hero__cta-group {
        justify-content: center;
    }

    .hero__trust {
        justify-content: center;
    }

    .hero__visual {
        order: -1;
    }

    .hero__dashboard {
        max-width: 450px;
        margin: 0 auto;
    }

    .hero__scroll-indicator {
        display: none;
    }

    /* ---- Trust Bar ---- */
    .trust-bar {
        padding: var(--space-8) 0;
    }

    /* ---- Services ---- */
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .service-card {
        padding: var(--space-6);
    }

    .service-card__number {
        font-size: var(--fs-3xl);
    }

    /* ---- Results ---- */
    .results__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .result-card__value {
        font-size: var(--fs-4xl);
    }

    /* ---- Case Studies ---- */
    .case-studies__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .case-studies__grid .case-card:last-child {
        grid-column: 1 / -1;
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }

    /* ---- Why Us ---- */
    .why-us__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    .why-card {
        padding: var(--space-6);
    }

    /* ---- Process ---- */
    .process__timeline {
        max-width: 100%;
        padding-left: var(--space-12);
    }

    .process__line {
        left: 32px;
    }

    .process__step {
        flex-direction: row !important;
        text-align: left !important;
    }

    .process__step-number {
        width: 56px;
        height: 56px;
        font-size: var(--fs-base);
        position: relative;
        left: -28px;
        margin-left: 0;
    }

    .process__step-content {
        flex: 1;
    }

    /* ---- Testimonials ---- */
    .testimonial-card {
        padding: var(--space-8) var(--space-6);
    }

    /* ---- CTA ---- */
    .cta-section__title {
        font-size: var(--fs-3xl);
    }

    /* ---- Footer ---- */
    .footer__top {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .footer__brand {
        text-align: center;
    }

    .footer__tagline {
        max-width: 100%;
    }

    .footer__social {
        justify-content: center;
    }

    .footer__links {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer__badges {
        justify-content: center;
    }
}

/* ==========================================
   4. MOBILE LARGE (576px - 767px)
   ========================================== */
@media screen and (max-width: 767px) {
    :root {
        --container-padding: 1.25rem;
        --header-height: 70px;
    }

    /* ---- Section Defaults ---- */
    .section {
        padding: var(--space-16) 0;
    }

    .section__title {
        font-size: var(--fs-2xl);
    }

    .section__subtitle {
        font-size: var(--fs-base);
    }

    .section__header {
        margin-bottom: var(--space-10);
    }

    /* ---- Buttons ---- */
    .btn--lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-sm);
    }

    /* ---- Navigation ---- */
    .nav__menu {
        width: 100%;
        right: -100%;
    }

    .nav__logo {
        font-size: var(--fs-lg);
    }

    /* ---- Hero ---- */
    .hero {
        padding-top: calc(var(--header-height) + var(--space-8));
        padding-bottom: var(--space-12);
    }

    .hero__title {
        font-size: var(--fs-3xl);
    }

    .hero__description {
        font-size: var(--fs-base);
    }

    .hero__cta-group {
        flex-direction: column;
        align-items: stretch;
    }

    .hero__cta-group .btn {
        justify-content: center;
        width: 100%;
    }

    .hero__trust {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }

    .hero__dashboard {
        max-width: 100%;
    }

    .dashboard__metric-value {
        font-size: var(--fs-2xl);
    }

    /* ---- Trust Bar ---- */
    .trust-bar__logo {
        font-size: var(--fs-base);
    }

    .trust-bar__logo-track {
        gap: var(--space-8);
    }

    /* ---- Services ---- */
    .services__grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .service-card {
        padding: var(--space-6);
    }

    .service-card__number {
        font-size: var(--fs-2xl);
        top: var(--space-4);
        right: var(--space-4);
    }

    /* ---- Results ---- */
    .results__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .result-card {
        padding: var(--space-6) var(--space-3);
    }

    .result-card__value {
        font-size: var(--fs-3xl);
    }

    .result-card__suffix {
        font-size: var(--fs-xl);
    }

    .result-card__label {
        font-size: var(--fs-sm);
    }

    .result-card__sublabel {
        font-size: var(--fs-xs);
    }

    /* ---- Case Studies ---- */
    .case-studies__grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .case-studies__grid .case-card:last-child {
        max-width: 100%;
    }

    .case-card__image {
        height: 180px;
    }

    .case-card__results {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .case-card__metric-value {
        font-size: var(--fs-xs);
    }

    /* ---- Why Us ---- */
    .why-us__grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .why-card {
        padding: var(--space-6);
    }

    /* ---- Process ---- */
    .process__timeline {
        padding-left: var(--space-10);
    }

    .process__line {
        left: 24px;
    }

    .process__step {
        gap: var(--space-4);
        margin-bottom: var(--space-8);
    }

    .process__step-number {
        width: 48px;
        height: 48px;
        font-size: var(--fs-sm);
        left: -24px;
    }

    .process__step-content h3 {
        font-size: var(--fs-base);
    }

    .process__step-content p {
        font-size: var(--fs-sm);
    }

    /* ---- Testimonials ---- */
    .testimonial-card {
        padding: var(--space-6) var(--space-4);
    }

    .testimonial-card__text {
        font-size: var(--fs-base);
    }

    .testimonial-card__text::before {
        font-size: 40px;
        top: -15px;
    }

    .testimonials__controls {
        margin-top: var(--space-6);
    }

    /* ---- CTA ---- */
    .cta-section__title {
        font-size: var(--fs-2xl);
    }

    .cta-section__text {
        font-size: var(--fs-base);
    }

    .cta-section__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-section__actions .btn {
        justify-content: center;
        width: 100%;
    }

    /* ---- Footer ---- */
    .footer {
        padding: var(--space-12) 0 var(--space-6);
    }

    .footer__links {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .footer__col:last-child {
        grid-column: 1 / -1;
    }

    .footer__badges {
        flex-direction: column;
        align-items: center;
    }

    /* ---- WhatsApp Float ---- */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: var(--space-4);
        right: var(--space-4);
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================
   5. MOBILE SMALL (< 576px)
   ========================================== */
@media screen and (max-width: 575px) {
    :root {
        --container-padding: 1rem;
    }

    /* ---- Typography ---- */
    .section__title {
        font-size: var(--fs-xl);
    }

    .section__tag {
        font-size: var(--fs-xs);
    }

    /* ---- Hero ---- */
    .hero__title {
        font-size: var(--fs-2xl);
    }

    .hero__badge {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }

    .hero__description {
        font-size: var(--fs-sm);
    }

    .hero__gradient-orb--1 {
        width: 300px;
        height: 300px;
    }

    .hero__gradient-orb--2 {
        width: 250px;
        height: 250px;
    }

    .hero__gradient-orb--3 {
        width: 200px;
        height: 200px;
    }

    .dashboard__body {
        padding: var(--space-4);
    }

    .dashboard__metric-value {
        font-size: var(--fs-xl);
    }

    /* ---- Services ---- */
    .service-card__icon {
        width: 48px;
        height: 48px;
    }

    .service-card__icon svg {
        width: 24px;
        height: 24px;
    }

    .service-card__title {
        font-size: var(--fs-lg);
    }

    .service-card__description {
        font-size: var(--fs-sm);
    }

    .service-card__features li {
        font-size: var(--fs-xs);
    }

    /* ---- Results ---- */
    .results__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .result-card {
        padding: var(--space-4) var(--space-2);
    }

    .result-card__value {
        font-size: var(--fs-2xl);
    }

    .result-card__suffix {
        font-size: var(--fs-lg);
    }

    .result-card__label {
        font-size: var(--fs-xs);
    }

    .result-card__sublabel {
        display: none;
    }

    /* ---- Case Studies ---- */
    .case-card__content {
        padding: var(--space-4);
    }

    .case-card__title {
        font-size: var(--fs-base);
    }

    .case-card__challenge {
        font-size: var(--fs-xs);
    }

    .case-card__results {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .case-card__metric {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: var(--space-1) 0;
    }

    .case-card__metric-value {
        order: 2;
    }

    .case-card__metric-label {
        order: 1;
    }

    .case-card__image {
        height: 150px;
    }

    /* ---- Process ---- */
    .process__timeline {
        padding-left: var(--space-8);
    }

    .process__line {
        left: 20px;
    }

    .process__step-number {
        width: 40px;
        height: 40px;
        font-size: var(--fs-xs);
        left: -20px;
    }

    .process__step-content {
        padding: var(--space-3);
    }

    .process__step-content h3 {
        font-size: var(--fs-sm);
    }

    .process__step-content p {
        font-size: var(--fs-xs);
        line-height: 1.6;
    }

    /* ---- Testimonials ---- */
    .testimonial-card {
        padding: var(--space-5) var(--space-3);
    }

    .testimonial-card__text {
        font-size: var(--fs-sm);
        line-height: 1.7;
    }

    .testimonial-card__stars {
        font-size: var(--fs-base);
    }

    .testimonial-card__author {
        flex-direction: column;
        gap: var(--space-2);
    }

    .testimonial-card__info {
        text-align: center;
    }

    .testimonial-card__name {
        font-size: var(--fs-sm);
    }

    .testimonial-card__role {
        font-size: var(--fs-xs);
    }

    /* ---- CTA ---- */
    .cta-section__title {
        font-size: var(--fs-xl);
    }

    .cta-section__text {
        font-size: var(--fs-sm);
    }

    /* ---- Footer ---- */
    .footer__links {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer__col:last-child {
        grid-column: auto;
    }

    .footer__badge {
        font-size: 10px;
    }

    .footer__copyright {
        font-size: var(--fs-xs);
    }
}

/* ==========================================
   6. HEIGHT-BASED ADJUSTMENTS
   ========================================== */
@media screen and (max-height: 700px) and (min-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + var(--space-8));
        padding-bottom: var(--space-8);
    }

    .hero__title {
        font-size: var(--fs-3xl);
    }

    .hero__scroll-indicator {
        display: none;
    }
}

/* ==========================================
   7. LANDSCAPE MOBILE
   ========================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-6)) 0 var(--space-6);
    }

    .hero__container {
        grid-template-columns: 1fr 1fr;
    }

    .hero__visual {
        order: 0;
    }

    .hero__title {
        font-size: var(--fs-2xl);
    }

    .hero__description {
        font-size: var(--fs-sm);
        margin-bottom: var(--space-4);
    }

    .hero__trust {
        display: none;
    }

    .hero__scroll-indicator {
        display: none;
    }
}

/* ==========================================
   8. PRINT STYLES
   ========================================== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .header,
    .nav__toggle,
    .whatsapp-float,
    .hero__bg-elements,
    .hero__scroll-indicator,
    .custom-cursor,
    .custom-cursor-follower,
    #preloader {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .section {
        padding: 2rem 0;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .btn {
        border: 1px solid #000;
        padding: 0.5rem 1rem;
    }
}

/* ==========================================
   9. REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero__gradient-orb {
        animation: none;
    }

    .trust-bar__logo-track {
        animation: none;
    }

    .chart-line {
        stroke-dashoffset: 0;
        animation: none;
    }

    .chart-area {
        opacity: 1;
        animation: none;
    }

    .scroll-dot {
        animation: none;
    }

    .hero__badge-dot {
        animation: none;
    }

    .whatsapp-float {
        animation: none;
    }
}

/* ==========================================
   10. HIGH CONTRAST / DARK MODE PREFERENCE
   ========================================== */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #333333;
        --text-tertiary: #555555;
        --border-light: #999999;
    }

    .service-card,
    .case-card,
    .why-card,
    .testimonial-card {
        border-width: 2px;
    }

    .btn--outline {
        border-width: 2px;
    }
}

/* ==========================================
   11. HOVER CAPABILITY DETECTION
   ========================================== */
@media (hover: none) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .case-card:hover,
    .why-card:hover,
    .result-card:hover {
        transform: none;
    }

    .service-card:hover::before {
        transform: scaleX(0);
    }

    /* Use active state instead */
    .service-card:active {
        transform: scale(0.98);
    }

    .case-card:active {
        transform: scale(0.98);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.95);
    }
}