/* ============================================================
   ADVENNO - COMPREHENSIVE RESPONSIVE FRAMEWORK
   Mobile-First Design System for All Breakpoints
   ============================================================ */

/* === GLOBAL FOUNDATION === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Responsive Images & Media */
img,
video,
iframe,
embed,
object,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Text Overflow Protection */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
li {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === MOBILE FIRST (320px - 479px) === */
@media (max-width: 479px) {
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    h1,
    .hero-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }

    h2,
    .section-title {
        font-size: clamp(1.5rem, 4vw, 2rem) !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    body,
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Stack ALL grids on mobile */
    .grid,
    .features-grid,
    .benefits-grid,
    .tech-grid,
    .usecase-grid,
    .related-grid,
    .stats-grid,
    .selector-grid,
    [class*="-grid"],
    [class*="grid-"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Full-width buttons */
    .btn,
    .button,
    [class*="btn-"] {
        width: 100%;
        display: block;
        text-align: center;
        padding: 14px 24px;
        font-size: 1rem;
    }

    .hero-cta,
    .hero-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-cta .btn,
    .hero-actions .btn {
        width: 100%;
    }

    /* Reduce section padding */
    section,
    .section,
    [class*="-section"] {
        padding: 50px 0 !important;
    }

    .hero-section,
    .service-hero {
        padding: 100px 0 50px !important;
        min-height: auto !important;
    }

    .hero {
        min-height: max(500px, 60vh) !important;
        padding-top: 80px !important;
    }

    /* Touch-friendly interactions */
    .faq-question,
    .nav-link,
    button {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }

    /* Process timeline mobile */
    .process-timeline {
        padding-left: 0;
        flex-direction: column;
    }

    .process-step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        font-size: 2rem;
        margin-bottom: 16px;
    }

    /* Cards spacing */
    .card,
    .feature-card,
    .benefit-item,
    .usecase-card,
    .related-card,
    .val-card {
        padding: 24px !important;
    }

    .card-icon,
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    /* Stats */
    .stat-number {
        font-size: 2.5rem !important;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Page header */
    .page-header {
        padding: 120px 0 60px !important;
    }

    /* Hero orbs: smaller on mobile */
    .hero-orb,
    .hero-orb-1 {
        width: 200px;
        height: 200px;
    }

    .hero-orb-2 {
        width: 150px;
        height: 150px;
    }

    .hero-orb-3 {
        width: 120px;
        height: 120px;
    }

    /* Testimonials */
    .testimonial-card,
    .testimonial-card-enhanced {
        padding: 24px !important;
    }

    .testimonial-quote {
        font-size: 1rem;
    }

    .testimonial-quote::before {
        font-size: 2rem;
    }

    /* CTA section */
    .cta-section {
        padding: 50px 0 !important;
    }

    .cta-section .cta-content p {
        font-size: 1rem;
    }

    /* Footer bottom */
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-bottom .footer-links {
        flex-direction: column;
        gap: 12px !important;
    }

    /* FAQ */
    .faq-question {
        font-size: 0.95rem;
        padding: 16px !important;
    }

    .faq-answer {
        padding: 0 16px 16px !important;
    }

    /* Selector grid */
    .selector-grid {
        grid-template-columns: 1fr !important;
    }

    .selector-card {
        padding: 24px !important;
    }

    /* Hero breadcrumb */
    .hero-breadcrumb {
        font-size: 0.8rem;
    }

    /* Hero subtitle */
    .hero-subtitle {
        font-size: 1rem;
    }

    /* Process animation section */
    .process-animation-section {
        min-height: 400px;
        padding: 60px 0;
    }

    /* Trust bar */
    .trust-bar {
        margin-top: 2rem;
    }

    .trust-logos {
        gap: 1.5rem;
    }

    .logo-placeholder {
        width: 80px;
        height: 30px;
    }

    /* Portfolio filters - scrollable */
    .portfolio-filters {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px !important;
        padding-bottom: 8px;
    }

    .portfolio-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    /* Portfolio cards */
    .portfolio-card {
        aspect-ratio: 16 / 12;
    }

    /* Contact form */
    .contact-form-area {
        padding: 20px !important;
    }

    /* Chat UI */
    .conversation-ui {
        min-height: 300px;
    }

    .chat-bubble {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    /* Beam cards */
    .card-wrapper,
    .beam-card,
    .beam-card-ascii {
        width: 200px !important;
        height: 130px !important;
    }

    .beam-card-title {
        font-size: 1.1rem;
    }

    .beam-card-details {
        font-size: 0.8rem;
    }

    /* About hero */
    .about-hero {
        padding: 120px 0 60px !important;
    }

    /* Final CTA card */
    .final-cta-card {
        padding: 30px 16px !important;
    }

    .cta-benefits {
        flex-direction: column;
        gap: 12px !important;
        align-items: center;
    }

    /* Overview section */
    .overview-content {
        padding: 0 !important;
    }

    .overview-content p {
        font-size: 0.95rem;
    }
}

/* === SMALL MOBILE (480px - 575px) === */
@media (min-width: 480px) and (max-width: 575px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    h1,
    .hero-title {
        font-size: 2rem !important;
    }

    h2,
    .section-title {
        font-size: 1.75rem !important;
    }

    .grid {
        grid-template-columns: 1fr !important;
    }

    .features-grid,
    .benefits-grid,
    .usecase-grid,
    .related-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-cta,
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn,
    .hero-actions .btn {
        width: 100%;
    }

    .service-hero {
        padding: 110px 0 50px !important;
    }

    .stat-number {
        font-size: 2.8rem !important;
    }

    .portfolio-card {
        aspect-ratio: 16 / 11;
    }

    /* About hero */
    .about-hero {
        padding: 130px 0 60px !important;
    }
}

/* === TABLET (576px - 767px) === */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }

    h1,
    .hero-title {
        font-size: 2.25rem !important;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-6,
    .features-grid,
    .benefits-grid,
    .usecase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .selector-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-cta {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .service-hero {
        padding: 130px 0 60px !important;
    }

    .page-header {
        padding: 140px 0 80px !important;
    }

    .portfolio-filters {
        justify-content: center;
        flex-wrap: wrap;
    }

    .about-hero {
        padding: 140px 0 70px !important;
    }
}

/* === LARGE TABLET (768px - 991px) === */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
        padding-left: 32px;
        padding-right: 32px;
    }

    h1,
    .hero-title {
        font-size: 2.5rem !important;
    }

    .grid-3,
    .grid-6,
    .features-grid,
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid-4,
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .usecase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .selector-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    section,
    .section {
        padding: 80px 0 !important;
    }

    .service-hero {
        padding: 140px 0 70px !important;
    }

    .page-header {
        padding: 150px 0 80px !important;
    }

    .hero-orb,
    .hero-orb-1 {
        width: 300px;
        height: 300px;
    }

    .hero-orb-2 {
        width: 220px;
        height: 220px;
    }

    .hero-content {
        max-width: 85%;
    }

    .process-timeline {
        flex-direction: column;
        gap: 24px;
    }


}

/* === DESKTOP (992px - 1199px) === */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .grid-3,
    .features-grid,
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .grid-6,
    .tech-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .usecase-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .service-hero {
        padding: 150px 0 80px;
    }
}

/* === LARGE DESKTOP (1200px+) === */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* === XL DESKTOP (1400px+) === */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* === MOBILE NAVIGATION === */
@media (max-width: 991px) {

    /* Fully-screen mobile menu overrides removed to allow accordion style */
    .mega-menu {
        display: block;
    }

    /* Stack mega menu columns */
    .mega-menu-inner,
    .mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* Show hamburger */
    .mobile-menu-toggle,
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
    }

    /* Hide desktop nav */
    .desktop-nav {
        display: none !important;
    }

    /* Touch-friendly nav links */
    .nav-link,
    .menu-item a,
    .mega-link {
        display: block;
        padding: 16px;
        font-size: 1.1rem;
        min-height: 52px;
    }

    .header-cta {
        width: 100%;
        margin-top: 16px;
    }
}

/* Desktop: show nav, hide hamburger */
@media (min-width: 992px) {

    .mobile-menu-toggle,
    .mobile-toggle {
        display: none !important;
    }
}

/* === ANIMATION PERFORMANCE === */
@media (max-width: 768px) {

    /* Simplified animations on mobile */
    [data-animation],
    .reveal {
        animation-duration: 0.3s !important;
    }

    /* Disable parallax */
    [data-parallax],
    .parallax {
        background-attachment: scroll !important;
        transform: none !important;
    }

    /* Hide decorative elements */
    .floating-element,
    .decoration,
    .floating-shape {
        display: none !important;
    }

    /* Reduce hover effects on touch */
    .hover-lift-card:hover {
        transform: translateY(-5px);
    }

    .card:hover {
        transform: translateY(-3px);
    }

    .magnetic-levitate:hover {
        transform: translateY(-8px) scale(1.01);
    }

    /* Hide cursor effects on touch */
    .cursor-glow,
    .cursor-dot,
    .cursor-circle {
        display: none !important;
    }

    /* Simpler animations */
    .anti-gravity {
        animation-duration: 12s;
    }

    .zero-g-drift {
        animation-duration: 16s;
    }
}

/* === LANDSCAPE MOBILE === */
@media (max-width: 991px) and (orientation: landscape) {

    .hero,
    .service-hero,
    .about-hero {
        min-height: auto !important;
        padding-top: 100px !important;
        padding-bottom: 40px !important;
    }

    .hero-orb {
        opacity: 0.15;
    }

    .process-animation-section {
        min-height: 400px;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (pointer: coarse) {

    /* Larger touch targets */
    .filter-btn {
        min-height: 44px;
        padding: 10px 20px;
    }

    .faq-question {
        min-height: 52px;
    }

    .dropdown-item,
    .mega-links li a {
        min-height: 48px;
        padding: 14px 16px;
    }

    /* Disable hover-only effects */
    .selector-hover-content {
        max-height: none;
        opacity: 1;
    }
}

/* === REDUCED MOTION SUPPORT === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === PRINT STYLES === */
@media print {

    header,
    footer,
    nav,
    .cta-section,
    .mobile-menu-toggle,
    .floating-element,
    .back-to-top,
    .fab,
    .sticky-cta-bar,
    .hero-bg,
    .hero-orb,
    .neural-bg,
    .grid-overlay {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
}

/* === UTILITY CLASSES === */
.gap-10 {
    gap: 10px !important;
}

.gap-15 {
    gap: 15px !important;
}

.gap-20 {
    gap: 20px !important;
}

.gap-30 {
    gap: 30px !important;
}

.gap-40 {
    gap: 40px !important;
}

.p-20 {
    padding: 20px !important;
}

.p-30 {
    padding: 30px !important;
}

.p-40 {
    padding: 40px !important;
}

.p-50 {
    padding: 50px !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

@media (max-width: 767px) {
    .p-50 {
        padding: 30px !important;
    }

    .p-40 {
        padding: 24px !important;
    }
}