/* 
 * Responsive Design Overrides 
 */

/* Large Tablets & Small Laptops (max-width: 1399px) */
@media (max-width: 1399px) {
    :root {
        --header-height: 90px;
    }

    .container {
        padding: 0 40px;
        max-width: 100%;
    }

    /* Reduce Header Padding slightly */
    header {
        padding: 1rem 40px;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger Button - Visible on Tablet & Mobile */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 101;
        padding: 0;
        margin-left: auto;
    }

    .hamburger span {
        width: 100%;
        height: 2px;
        background: var(--text-main);
        transition: 0.3s;
        border-radius: 2px;
    }

    /* Hamburger Animation when Active */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile/Tablet Navigation (Side Menu) */
    nav.primary {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default */
        width: 280px;
        height: 100vh;
        background: rgba(10, 14, 46, 0.95);
        backdrop-filter: blur(20px);
        padding: 100px 30px 40px;
        display: flex;
        flex-direction: column;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 100;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav.primary.active {
        right: 0;
        /* Slide in */
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    nav a {
        font-size: 1.15rem;
        display: block;
        width: 100%;
    }

    /* Overlay for closing menu */
    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: 0.4s;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Adjust Grid Gap */
    .grid-box {
        gap: 1.25rem;
    }

    /* Adjust Main Title Size */
    .hero-content h2 {
        font-size: 3.5rem;
    }

    /* Hero Section Responsive */
    .kinetic-title span {
        font-size: clamp(3.5rem, 7vw, 6rem);
    }

    .kinetic-title .row-2 {
        font-size: clamp(4.5rem, 8vw, 7rem);
    }

    /* Services Section gap adjustment */
    .hero-services {
        gap: 3rem;
    }

    /* Toast Notification (Tablet) */
    .toast {
        padding: 1.1rem 3.5rem;
        font-size: 1.1rem;
    }
}

/* Portrait Tablet & Mobile (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 80px;
    }

    /* Typography reduction for 768px and below */
    .hero-content h2 {
        font-size: 2.5rem;
    }

    .title {
        font-size: 2rem;
    }

    header {
        padding: 1rem 24px;
    }

    /* Navigation font size adjustment */
    nav a {
        font-size: 1.1rem;
    }

    /* Mobile touch feedback - only during tap */
    nav a:active {
        color: var(--text-main);
    }

    nav a:active::before {
        width: 100%;
    }

    /* Stack Grids to Single Column */
    .grid-box,
    .grid-box.single {
        grid-template-columns: 1fr;
    }

    /* Hero Section Responsive (Moved from index.css) */

    /* Kinetic Title font size drastically reduced (Mobile) */
    .kinetic-title span {
        font-size: clamp(2.8rem, 6vw, 4.5rem);
        /* Mobile optimization */
    }

    .kinetic-title .row-2 {
        font-size: clamp(3.5rem, 7vw, 5.5rem);
    }

    /* Kinetic Title Row positioning drastically reduced */
    .kinetic-title .row-1 {
        margin-left: -5%;
    }

    /* .kinetic-title .row-2 {
        margin-left: 0;
    } */

    /* .kinetic-title .row-3 {
        margin-left: 3%;
    } */

    /* Services Section responsive optimization */
    .hero-services {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        /* Drastically reduced from Desktop 4rem */
    }

    /* Services Section typography adjustment */
    .service-header h3 {
        text-align: center;
        font-size: 1.5rem;
    }

    .service-list a {
        font-size: 1rem;
        /* Reduced from Desktop 1rem */
    }

    /* Service list: Item wrapping (li itself moves to next line, not text) */
    .service-list ul {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
    }

    .service-list ul li {
        white-space: nowrap;
    }

    /* Section Spacing */
    section.container {
        gap: 80px;
        padding-bottom: 80px;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Card Adjustments */
    .box:hover {
        transform: translateY(-4px) scale(1.005);
        /* Tone down hover on touch */
    }

    .box {
        padding: 1.5rem;
        /* Adjusted padding for mobile */
    }

    /* Toast Notification (Mobile) */
    .toast {
        padding: 1rem 2.5rem;
        font-size: 1rem;
        width: 85%;
        max-width: 290px;
        text-align: center;
    }

}

/* Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {

    /* Header Compact */
    header h1 {
        font-size: 1.25rem;
    }

    nav a {
        font-size: 0.85rem;
    }

    /* Hero Typography */
    .hero-content h2 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .title {
        font-size: 2rem;
        /* Reduce Section Titles */
    }

    /* Footer */
    footer {
        padding: 2rem 1rem;
    }

    /* Mobile Interaction Improvements */
    .service-list a:active,
    .link:active {
        background: var(--primary);
        color: #fff;
        transform: scale(0.95);
    }

    /* Hero Section Responsive (Moved from index.css) */
    /* Kinetic Title font size further reduced (Small Mobile) */
    .kinetic-title span {
        font-size: clamp(2.2rem, 5.5vw, 3.5rem);
        /* Small screen optimization */
    }

    .kinetic-title .row-2 {
        font-size: clamp(2.8rem, 6.5vw, 4.5rem);
        /* Main Row small screen optimization */
    }

    /* Center alignment for very narrow screens */
    .kinetic-title .row-1,
    .kinetic-title .row-2,
    .kinetic-title .row-3 {
        margin-left: 0;
    }

    /* Services Section further reduction */
    .hero-services {
        gap: 1rem;
    }

    .service-header h3 {
        font-size: 1.3rem;
    }

    .service-list a {
        font-size: 0.85rem;
    }

    /* Toast Notification (Small Mobile 320px+) */
    .toast {
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
        max-width: 270px;
    }

}