
/*========================================================
  NeonMatrix Pro - Complete Responsive System
  Version: 2.0.0
  Devices: Mobile / Tablet / Laptop / Desktop / 4K
========================================================*/


/*========================================================
  01. GLOBAL RESPONSIVE FIXES
========================================================*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 320px;
    overflow-x: clip;
    margin: 0;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

img,
video {
    height: auto;
}

input,
textarea,
select,
button {
    max-width: 100%;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: min(100% - 48px, 1200px);
    margin-inline: auto;
}

section {
    position: relative;
    width: 100%;
    padding: 90px 0;
}

.row,
.flex,
.hero-buttons,
.cta-buttons {
    min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    overflow-wrap: anywhere;
}


/*========================================================
  02. LARGE DESKTOP (1440px+)
========================================================*/

@media (min-width: 1440px) {

    .container {
        width: min(100% - 100px, 1320px);
    }

    .hero-title {
        font-size: clamp(3.2rem, 4vw, 5rem);
    }

    .section-title {
        font-size: clamp(2.5rem, 3vw, 3.5rem);
    }

    .hero .container {
        gap: 70px;
    }

    .features-grid,
    .services-grid {
        gap: 30px;
    }

    .portfolio-grid {
        gap: 28px;
    }
}


/*========================================================
  03. TABLET AND SMALL LAPTOP (1024px)
========================================================*/

@media (max-width: 1024px) {

    .container {
        width: min(100% - 40px, 900px);
    }

    section {
        padding: 75px 0;
    }

    /* Hero */

    .hero .container {
        grid-template-columns: 1fr;
        gap: 45px;
        text-align: center;
    }

    .hero-content {
        width: 100%;
        max-width: 750px;
        margin-inline: auto;
    }

    .hero-visual {
        order: 2;
        width: 100%;
        max-width: 650px;
        margin-inline: auto;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* General grids */

    .features-grid,
    .services-grid,
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* About */

    .about-grid,
    .about-content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        max-width: 550px;
        margin-inline: auto;
    }

    /* Contact */

    .contact-grid,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .contact-info,
    .form-container {
        width: 100%;
    }

    /* Skills */

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Blog */

    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Dashboard */

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/*========================================================
  04. MOBILE NAVIGATION (768px)
========================================================*/

@media (max-width: 768px) {

    /* Typography */

    body {
        font-size: 15px;
        line-height: 1.7;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 3rem);
        line-height: 1.35;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.9;
    }

    .section-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        line-height: 1.4;
    }

    .section-description {
        font-size: 0.95rem;
    }

    /* Container */

    .container {
        width: calc(100% - 36px);
        padding-inline: 0;
    }

    section {
        padding: 65px 0;
    }

    /* Navbar */

    .navbar {
        min-height: 65px;
    }

    .navbar .container,
    .nav-container {
        gap: 10px;
    }

    .nav-menu {
        position: fixed;
        top: 65px;
        right: 0;
        width: min(310px, 85vw);
        height: calc(100dvh - 65px);
        height: calc(100vh - 65px);
        padding: 25px 22px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;

        background: var(--bg-primary, #10101c);
        border-left: 1px solid var(--border, rgba(255,255,255,.1));
        border-radius: 0 0 0 20px;

        transform: translateX(110%);
        visibility: hidden;
        opacity: 0;

        overflow-y: auto;
        overscroll-behavior: contain;

        transition:
            transform .3s ease,
            opacity .3s ease,
            visibility .3s ease;

        z-index: 9999;
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        right: 0;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 12px 10px;
        font-size: 1rem;
    }

    .nav-toggle,
    .menu-toggle,
    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-actions .btn {
        display: none;
    }

    /* Hero */

    .hero {
        min-height: auto;
        padding: 105px 0 65px;
    }

    .hero .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 35px;
    }

    .hero-content,
    .hero-visual {
        width: 100%;
        min-width: 0;
    }

    .hero-visual img {
        max-width: 100%;
        object-fit: contain;
    }

    .hero-buttons,
    .cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .hero-buttons .btn,
    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .scroll-indicator {
        display: none;
    }

    /* Features */

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .feature-card {
        min-width: 0;
        padding: 22px 16px;
    }

    /* Services */

    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .service-card {
        min-width: 0;
        padding: 22px 16px;
    }

    /* Portfolio */

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .portfolio-item {
        min-width: 0;
    }

    .portfolio-image img {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

    .portfolio-overlay {
        padding: 15px;
    }

    /* About */

    .about-grid,
    .about-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-image img {
        width: 100%;
        height: auto;
    }

    /* Skills */

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    /* Contact */

    .contact-grid,
    .contact-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }

    .contact-info,
    .form-container {
        width: 100%;
        min-width: 0;
    }

    .form-container {
        padding: 24px 20px;
    }

    .form-group {
        width: 100%;
        margin-bottom: 18px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 16px;
    }

    .form-group textarea {
        min-height: 130px;
        resize: vertical;
    }

    .form-container button[type="submit"] {
        width: 100%;
        justify-content: center;
    }

    /* Testimonials */

    .testimonials-slider {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Blog */

    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    /* CTA */

    .cta-section {
        padding: 55px 0;
    }

    /* Footer */

    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 20px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Back to top */

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 18px;
        right: 18px;
    }

    /* Tables */

    .table-responsive,
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 550px;
    }

    /* Modals */

    .modal-content {
        width: calc(100% - 30px);
        max-width: 550px;
        max-height: 85dvh;
        overflow-y: auto;
    }

    /* Code blocks */

    pre,
    .code-block {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre;
    }

    /* Matrix background */

    canvas,
    .matrix-background {
        max-width: 100%;
    }
}


/*========================================================
  05. SMALL MOBILE (480px)
========================================================*/

@media (max-width: 480px) {

    .container {
        width: calc(100% - 28px);
    }

    section {
        padding: 52px 0;
    }

    body {
        font-size: 14px;
    }

    /* Typography */

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.3rem);
    }

    .hero-subtitle {
        font-size: .92rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-description {
        font-size: .9rem;
    }

    /* Hero */

    .hero {
        padding: 90px 0 50px;
    }

    .hero-badge {
        font-size: .72rem;
        padding: 6px 11px;
    }

    .hero-buttons {
        gap: 10px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-number {
        font-size: 1.7rem;
    }

    /* Buttons */

    .btn {
        padding: 10px 17px;
        font-size: .88rem;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: .92rem;
    }

    /* Cards */

    .features-grid,
    .services-grid,
    .portfolio-grid,
    .skills-grid,
    .blog-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .feature-card,
    .service-card {
        padding: 22px 18px;
    }

    .feature-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .feature-title {
        font-size: 1.05rem;
    }

    .service-icon {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }

    /* Portfolio */

    .portfolio-image img {
        height: 240px;
    }

    .portfolio-overlay {
        padding: 15px;
    }

    /* Forms */

    .form-container {
        padding: 20px 15px;
    }

    .form-group label {
        font-size: .9rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px;
    }

    /* Footer */

    .footer {
        padding: 35px 0 20px;
    }

    .footer-top {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }

    .footer-logo {
        font-size: 1.3rem;
    }

    .footer-social a {
        width: 38px;
        height: 38px;
    }

    /* Navigation */

    .nav-menu {
        width: min(290px, 88vw);
    }

    .nav-logo {
        font-size: 1.15rem;
    }

    /* Messages */

    .form-success-message,
    .form-error-message {
        padding: 14px;
        gap: 10px;
        font-size: .85rem;
    }
}


/*========================================================
  06. EXTRA SMALL MOBILE (360px)
========================================================*/

@media (max-width: 360px) {

    .container {
        width: calc(100% - 22px);
    }

    section {
        padding: 45px 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.55rem;
    }

    .hero-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .btn {
        padding: 9px 14px;
        font-size: .82rem;
    }

    .feature-card,
    .service-card {
        padding: 18px 14px;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    .service-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .form-container {
        padding: 17px 12px;
    }

    .nav-menu {
        width: 90vw;
    }
}


/*========================================================
  07. LANDSCAPE MOBILE
========================================================*/

@media (max-height: 500px) and (orientation: landscape) {

    .hero {
        min-height: auto;
        padding: 80px 0 35px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scroll-indicator {
        display: none;
    }

    section {
        padding: 40px 0;
    }

    .nav-menu {
        height: calc(100dvh - 60px);
        overflow-y: auto;
    }
}


/*========================================================
  08. ACCESSIBILITY & REDUCED MOTION
========================================================*/

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/*========================================================
  09. PRINT
========================================================*/

@media print {

    .navbar,
    .nav-toggle,
    .back-to-top,
    .progress-bar,
    .scroll-indicator,
    .matrix-background,
    .matrix-overlay,
    .floating-card,
    .hero-buttons,
    .footer-social {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        overflow: visible !important;
    }

    section {
        padding: 20px 0;
        break-inside: avoid;
    }

    .hero-title,
    .section-title {
        color: #000 !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }
}

/*==============================================
  MOBILE NAVIGATION FIX
==============================================*/

.nav-toggle,
.menu-toggle,
.hamburger,
#menuToggle,
#navToggle {
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-toggle i,
.menu-toggle i,
.hamburger i {
    font-size: 22px;
}

@media (max-width: 768px) {

    .nav-toggle,
    .menu-toggle,
    .hamburger,
    #menuToggle,
    #navToggle {
        display: flex;
    }

    .nav-menu,
    .navbar-nav,
    #navMenu,
    #navbarMenu {
        position: fixed;
        top: 65px;
        right: 0;
        width: min(310px, 85vw);
        height: calc(100vh - 65px);
        height: calc(100dvh - 65px);
        padding: 25px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        overflow-y: auto;

        background: var(--bg-primary);
        border-left: 1px solid var(--border);

        transform: translateX(110%);
        visibility: hidden;
        opacity: 0;

        transition:
            transform .3s ease,
            opacity .3s ease,
            visibility .3s ease;

        z-index: 10000;
    }

    .nav-menu.active,
    .navbar-nav.active,
    #navMenu.active,
    #navbarMenu.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }

    body.menu-open {
        overflow: hidden;
    }
}
