/* ============================================
   LogicMesh - Responsive Styles
   Mobile-First Approach
   ============================================ */

/* ============================================
   Mobile Base (< 768px)
   ============================================ */

/* Typography */
h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

/* Hero */
.hero-title {
    font-size: var(--text-4xl);
}

.hero-subtitle {
    font-size: var(--text-base);
}

/* Section Headers */
.section-title {
    font-size: var(--text-3xl);
}

.page-title {
    font-size: var(--text-4xl);
}

/* Navigation */
.navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 80px var(--space-6) var(--space-6);
    gap: var(--space-4);
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
}

.navbar-menu.active {
    right: 0;
}

.navbar-toggle {
    display: flex;
    z-index: var(--z-modal);
}

.navbar-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: var(--z-fixed);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Grid Systems */
.grid-2,
.grid-3,
.grid-4 {
    grid-template-columns: 1fr;
}

.stats {
    grid-template-columns: repeat(2, 1fr);
}

/* Footer */
.footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

.footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
}

/* Cards */
.card {
    padding: var(--space-5);
}

/* Buttons */
.hero-buttons {
    flex-direction: column;
    width: 100%;
}

.hero-buttons .btn {
    width: 100%;
}

/* Section Spacing */
.section {
    padding: var(--space-16) 0;
}

.section-lg {
    padding: var(--space-20) 0;
}

/* Page Header */
.page-header {
    padding: 120px 0 60px;
}

/* Hide on Mobile */
.hide-mobile {
    display: none;
}

/* ============================================
   Tablet (768px - 1024px)
   ============================================ */

@media (min-width: 768px) {

    /* Typography */
    h1 {
        font-size: var(--text-5xl);
    }

    h2 {
        font-size: var(--text-4xl);
    }

    .hero-title {
        font-size: var(--text-5xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .section-title {
        font-size: var(--text-4xl);
    }

    .page-title {
        font-size: var(--text-5xl);
    }

    /* Grid */
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stats */
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: row;
        text-align: left;
    }

    /* Buttons */
    .hero-buttons {
        flex-direction: row;
        width: auto;
    }

    .hero-buttons .btn {
        width: auto;
    }

    /* Page Header */
    .page-header {
        padding: 140px 0 80px;
    }

    /* Show on Tablet */
    .hide-mobile {
        display: block;
    }

    .hide-tablet {
        display: none;
    }
}

/* ============================================
   Desktop (1024px+)
   ============================================ */

@media (min-width: 1024px) {

    /* Typography */
    h1 {
        font-size: var(--text-6xl);
    }

    h2 {
        font-size: var(--text-5xl);
    }

    .hero-title {
        font-size: var(--text-7xl);
    }

    .hero-subtitle {
        font-size: var(--text-xl);
    }

    .section-title {
        font-size: var(--text-5xl);
    }

    .page-title {
        font-size: var(--text-6xl);
    }

    /* Navigation */
    .navbar-menu {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        flex-direction: row;
        padding: 0;
        border: none;
        backdrop-filter: none;
        gap: var(--space-6);
    }

    .navbar-toggle {
        display: none;
    }

    .menu-overlay {
        display: none;
    }

    /* Grid */
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    /* Section Spacing */
    .section {
        padding: var(--space-24) 0;
    }

    .section-lg {
        padding: var(--space-32) 0;
    }

    /* Page Header */
    .page-header {
        padding: 160px 0 80px;
    }

    /* Show on Desktop */
    .hide-tablet {
        display: block;
    }

    .hide-desktop {
        display: none;
    }
}

/* ============================================
   Large Desktop (1440px+)
   ============================================ */

@media (min-width: 1440px) {
    :root {
        --container-max: 1400px;
    }

    .hero-title {
        font-size: var(--text-8xl);
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {

    .navbar,
    .footer,
    .particles-container,
    .mesh-background {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ============================================
   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;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --text-secondary: #c0c0c0;
        --border-light: rgba(255, 255, 255, 0.3);
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */

@media (hover: none) {

    .hover-lift:hover,
    .hover-glow:hover,
    .hover-scale:hover {
        transform: none;
        box-shadow: inherit;
    }

    .card:hover {
        transform: none;
    }
}

/* ============================================
   Landscape Phone
   ============================================ */

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
}