/* Mobile Responsive Styles */

/* Tablet and below */
@media (max-width: 968px) {
    /* Navigation */
    nav {
        padding: 15px 5%;
    }

    nav .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        font-size: 24px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    /* Hero Section */
    .hero {
        padding: 80px 5% 50px;
        min-height: auto;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-content .subtitle {
        font-size: 1.2rem;
    }

    .hero-content .tagline {
        font-size: 1rem;
    }

    .hero-content p {
        font-size: 1rem !important;
    }

    .cta-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Profile Images */
    .hero-image {
        order: -1;
        margin-bottom: 20px;
    }

    .profile-frame.main {
        width: 300px;
        height: 300px;
    }

    .profile-frame.badge {
        width: 120px;
        height: 120px;
        right: -25px;
        bottom: -10px;
    }

    /* About Section */
    .about-section {
        padding: 60px 5%;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-text h2 {
        font-size: 2rem;
        text-align: center;
    }

    .about-text p {
        font-size: 1rem;
        text-align: center;
    }

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

    .stat-card {
        padding: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Skills Section */
    .skills-section {
        padding: 60px 5%;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skill-card {
        padding: 30px 20px;
    }

    .skill-icon {
        font-size: 2.5rem;
    }

    .skill-card h3 {
        font-size: 1.3rem;
    }

    /* Philosophy Section */
    .philosophy-section {
        padding: 60px 5%;
    }

    .philosophy-section .section-title {
        font-size: 2rem;
    }

    .philosophy-section p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Contact Section */
    .contact-section {
        padding: 60px 5%;
    }

    .contact-container h2 {
        font-size: 2rem;
    }

    .contact-container p {
        font-size: 1rem;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 15px;
    }

    .social-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Footer */
    footer {
        padding: 30px 5%;
        font-size: 0.9rem;
    }
}

/* Mobile phones */
@media (max-width: 640px) {
    /* Navigation */
    .logo {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .nav-links {
        gap: 10px;
        font-size: 0.85rem;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    /* Hero Section */
    .hero {
        padding: 70px 4% 40px;
    }

    .hero-container {
        gap: 30px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .hero-content .subtitle {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .hero-content .tagline {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .hero-content p {
        font-size: 0.9rem !important;
        margin-bottom: 25px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .btn {
        width: 100%;
        padding: 12px 25px;
        font-size: 0.95rem;
    }

    /* Profile Images */
    .profile-frame.main {
        width: 250px;
        height: 250px;
        border-width: 4px;
    }

    .profile-frame.badge {
        width: 100px;
        height: 100px;
        border-width: 3px;
        right: -20px;
        bottom: -5px;
    }

    /* About Section */
    .about-section {
        padding: 50px 4%;
    }

    .about-text h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .about-text p {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px 15px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    /* Skills Section */
    .skills-section {
        padding: 50px 4%;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .skills-grid {
        gap: 15px;
    }

    .skill-card {
        padding: 25px 15px;
    }

    .skill-icon {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .skill-card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .skill-card p {
        font-size: 0.9rem;
    }

    /* Philosophy Section */
    .philosophy-section {
        padding: 50px 4%;
    }

    .philosophy-section .section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .philosophy-section > p {
        font-size: 0.9rem;
        margin-bottom: 40px;
        padding: 0 5px;
    }

    .philosophy-grid {
        gap: 15px;
    }

    .philosophy-card .overlay {
        padding: 15px;
        font-size: 0.9rem;
    }

    /* Contact Section */
    .contact-section {
        padding: 50px 4%;
    }

    .contact-container h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .contact-container p {
        font-size: 0.9rem;
        margin-bottom: 30px;
    }

    .contact-container .btn {
        width: 100%;
    }

    .social-links {
        gap: 12px;
        margin-top: 30px;
    }

    .social-icon {
        width: 45px;
        height: 45px;
    }

    .social-icon img {
        width: 20px;
        height: 20px;
    }

    /* Footer */
    footer {
        padding: 25px 4%;
        font-size: 0.85rem;
    }

    /* Background Animation - Reduce for performance */
    .pixel-grid {
        background-size: 30px 30px;
    }

    .circuit-line {
        display: none; /* Hide on mobile for better performance */
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .profile-frame.main {
        width: 220px;
        height: 220px;
    }

    .profile-frame.badge {
        width: 85px;
        height: 85px;
        right: -15px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .about-text h2 {
        font-size: 1.4rem;
    }

    .contact-container h2 {
        font-size: 1.4rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 60px 5% 30px;
    }

    .profile-frame.main {
        width: 200px;
        height: 200px;
    }

    .profile-frame.badge {
        width: 80px;
        height: 80px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .cta-buttons {
        margin-top: 20px;
    }
}

/* Ensure touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .social-icon,
    .nav-links a {
        min-height: 44px;
        min-width: 44px;
    }

    .skill-card {
        cursor: default;
    }
}

/* Fix for notched devices (iPhone X and similar) */
@supports (padding: max(0px)) {
    nav,
    .hero,
    .about-section,
    .skills-section,
    .philosophy-section,
    .contact-section,
    footer {
        padding-left: max(5%, env(safe-area-inset-left));
        padding-right: max(5%, env(safe-area-inset-right));
    }
}