/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* ===========================
   MOBILE STYLES (768px and below)
   =========================== */

@media (max-width: 768px) {
    /* Mobile optimization for Conway's Game of Life cells */
    .cell {
        width: 12px;
        height: 12px;
        transition: opacity 0.4s ease;
    }

    /* Navigation */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--secondary-bg);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    /* Layout adjustments */
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* CTA Buttons */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cta-buttons .hero-social-links {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    /* Hero Section */
    .hero-content {
        padding: 0 1rem;
        max-width: 95vw;
    }

    .hero {
        min-height: 100vh;
        padding-bottom: 3rem;
        align-items: flex-start;
        padding-top: 120px;
    }

    .scramble-text {
        font-size: clamp(2rem, 8vw, 3.5rem);
        white-space: normal;
        line-height: 1.1;
        letter-spacing: 1px;
    }

    .typewriter {
        font-size: 1.2rem;
        max-width: 90%;
    }

    .hero-description {
        font-size: 1rem;
        max-width: 95%;
        padding: 0 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: normal;
    }

    /* Projects */
    .project-card {
        margin-bottom: 2rem;
    }

    .project-description {
        font-size: 0.95rem;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: normal;
    }

    /* Sections */
    .section {
        padding: 3rem 0;
    }

    /* Modals */
    .project-modal {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 2rem;
    }
    
    .modal-title {
        font-size: 2rem;
    }
}

/* ===========================
   TABLET STYLES (769px to 1024px)
   =========================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-content {
        max-width: 85vw;
    }

    .scramble-text {
        font-size: clamp(3rem, 7vw, 4.5rem);
    }
}

/* ===========================
   LARGE SCREEN STYLES (1400px and above)
   =========================== */

@media (min-width: 1400px) {
    .hero-content {
        max-width: 1200px;
    }

    .scramble-text {
        font-size: clamp(4rem, 5vw, 6rem);
    }
}

/* ===========================
   HIGH DPI DISPLAYS
   =========================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .navbar,
    .bg-animation,
    .simple-loader,
    .hero-social-links,
    .project-modal {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .section {
        page-break-inside: avoid;
    }
}
