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

/* Base responsive utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Flexible media */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Touch device support */
@media (hover: none) and (pointer: coarse) {
    .work-button:active,
    .project-card:active,
    .social-link:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .work-button:hover {
        transform: none;
        box-shadow: none;
    }

    .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    .social-link:hover {
        transform: none;
        box-shadow: none;
    }

    /* Disable complex animations on mobile for better performance */
    .geometric-shape {
        animation: float 3s ease-in-out infinite alternate;
    }

    .hero-text .highlight {
        animation: none;
        background: linear-gradient(45deg, #00d4aa, #00a0ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Better touch targets */
    .nav-menu a,
    .mobile-nav a,
    .work-button,
    .social-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Large Desktop Screens */
@media (min-width: 1440px) {
    .container {
        padding: 0 60px;
    }
    
    .hero-text h1 {
        font-size: 4rem;
    }
    
    .geometric-shape {
        width: 450px;
        height: 450px;
    }
}

/* Desktop Screens */
@media (max-width: 1280px) {
    .container {
        padding: 0 35px;
    }
    
    .hero-text h1 {
        font-size: 3.2rem;
    }
    
    .geometric-shape {
        width: 380px;
        height: 380px;
    }
}

/* Large Laptops (1200px-1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .container {
        padding: 0 50px;
    }
    
    .hero-text h1 {
        font-size: 3.8rem;
    }
    
    .hero-text .subtitle {
        font-size: 1.3rem;
    }
    
    .geometric-shape {
        width: 420px;
        height: 420px;
    }
    
    .about-content {
        gap: 60px;
    }
    
    .project-card {
        width: 320px;
        min-width: 320px;
    }
}

/* Medium Laptops (1025px-1199px) */
@media (min-width: 1025px) and (max-width: 1199px) {
    .container {
        padding: 0 40px;
    }
    
    .hero-text h1 {
        font-size: 3.4rem;
    }
    
    .hero-text .subtitle {
        font-size: 1.2rem;
    }
    
    .geometric-shape {
        width: 360px;
        height: 360px;
    }
    
    .about-content {
        gap: 50px;
    }
    
    .project-card {
        width: 300px;
        min-width: 300px;
    }
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .nav-container {
        padding: 0 30px;
    }

    .hero {
        padding-top: 90px;
    }

    .hero-content {
        gap: 50px;
        grid-template-columns: 1fr 1fr;
    }

    .hero-text h1 {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-text .subtitle {
        font-size: 1.1rem;
    }

    .geometric-shape {
        width: 350px;
        height: 350px;
    }

    .about {
        padding: 100px 0;
    }

    .about-content {
        gap: 50px;
    }

    .about-image {
        width: 280px;
        height: 350px;
    }

    .credentials {
        padding: 100px 0;
    }

    .credentials-grid {
        gap: 50px;
    }

    .projects {
        padding: 100px 0;
    }

    .projects-grid {
        gap: 25px;
        padding: 20px 10px;
    }

    .project-card {
        width: 320px;
    }

    .contact {
        padding: 100px 0;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-container {
        padding: 0 20px;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1002;
    }

    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        padding-top: 120px;
        text-align: center;
    }

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

    .hero-text {
        order: 1;
    }

    .hero-visual {
        order: 2;
        height: 350px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .hero-text .subtitle {
        font-size: 1.1rem;
        margin-bottom: 30px;
        line-height: 1.5;
    }

    .work-button {
        padding: 14px 28px;
        font-size: 0.95rem;
        margin-top: 10px;
    }

    .geometric-shape {
        width: 280px;
        height: 280px;
    }

    .about {
        padding: 80px 0;
    }

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

    .about h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }

    .about-text {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 30px;
    }

    .about-image {
        width: 250px;
        height: 300px;
        margin: 0 auto;
    }

    .credentials {
        padding: 80px 0;
    }

    .credentials h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }

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

    .credential-item {
        margin-bottom: 30px;
    }

    .skills-list {
        justify-content: center;
    }

    .projects {
        padding: 80px 0;
    }

    .projects h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .projects-grid {
        gap: 20px;
        padding: 20px 5px;
        justify-content: flex-start;
    }

    .project-card {
        width: 300px;
        min-width: 300px;
    }

    .project-info {
        padding: 25px;
    }

    .contact {
        padding: 80px 0;
    }

    .contact h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }

    .contact-info {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .contact-email {
        font-size: 1.1rem;
        word-break: break-all;
    }

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

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Large Mobile (600px-767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .container {
        padding: 0 25px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-text .subtitle {
        font-size: 1rem;
    }
    
    .geometric-shape {
        width: 220px;
        height: 220px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .project-card {
        width: 280px;
        min-width: 280px;
    }
}

/* Medium Mobile (481px-599px) */
@media (min-width: 481px) and (max-width: 599px) {
    .container {
        padding: 0 20px;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-text .subtitle {
        font-size: 0.95rem;
    }
    
    .geometric-shape {
        width: 180px;
        height: 180px;
    }
    
    .project-card {
        width: calc(100vw - 60px);
        min-width: calc(100vw - 60px);
    }
    
    .work-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .header {
        padding: 15px 0;
    }

    .hero {
        padding-top: 100px;
        min-height: 100vh;
    }

    .hero-content {
        gap: 30px;
    }

    .hero-visual {
        height: 280px;
    }

    .hero-text h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .hero-text .subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
        line-height: 1.6;
    }

    .work-button {
        padding: 12px 24px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .geometric-shape {
        width: 220px;
        height: 220px;
    }

    .about {
        padding: 60px 0;
    }

    .about h2,
    .credentials h2,
    .projects h2,
    .contact h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .about-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .about-image {
        width: 200px;
        height: 250px;
    }

    .credentials {
        padding: 60px 0;
    }

    .credential-item {
        margin-bottom: 25px;
    }

    .credential-label {
        font-size: 1.1rem;
    }

    .credential-value {
        font-size: 0.95rem;
    }

    .projects {
        padding: 60px 0;
    }

    .projects-grid {
        padding: 15px 0;
    }

    .project-card {
        width: 280px;
        min-width: 280px;
    }

    .project-info {
        padding: 20px;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .project-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .skills-list {
        justify-content: center;
        gap: 8px;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .contact {
        padding: 60px 0;
    }

    .contact-email {
        font-size: 1rem;
        word-break: break-all;
    }

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

    .social-link {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Mobile navigation improvements */
    .mobile-nav {
        width: 100%;
        right: -100%;
        padding: 80px 20px 30px;
    }

    .mobile-nav ul li {
        margin: 20px 0;
    }

    .mobile-nav ul li a {
        font-size: 1.1rem;
        padding: 15px 0;
        text-align: center;
    }
}

/* Extra Small Mobile Styles */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    .nav-container {
        padding: 0 12px;
    }

    .hero {
        padding-top: 90px;
    }

    .hero-content {
        gap: 25px;
    }

    .hero-text h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-text .subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .work-button {
        padding: 10px 20px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 200px;
    }

    .geometric-shape {
        width: 180px;
        height: 180px;
    }

    .about h2,
    .credentials h2,
    .projects h2,
    .contact h2 {
        font-size: 1.6rem;
    }

    .about-text {
        font-size: 0.9rem;
    }

    .about-image {
        width: 180px;
        height: 220px;
    }

    .project-card {
        width: 260px;
        min-width: 260px;
    }

    .project-info {
        padding: 18px;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-description {
        font-size: 0.8rem;
    }

    .skill-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .social-link {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .contact-email {
        font-size: 0.9rem;
    }

    .mobile-nav {
        width: 100%;
        padding: 70px 15px 20px;
    }

    .mobile-nav ul li a {
        font-size: 1rem;
        padding: 12px 0;
    }

    /* Improve scroll behavior on very small screens */
    .projects-grid {
        gap: 15px;
        padding: 10px 0;
    }

    .projects-grid::-webkit-scrollbar {
        height: 6px;
    }
}

/* Landscape orientation for mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 80px;
        min-height: 100vh;
    }

    .hero-content {
        gap: 30px;
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .hero-visual {
        height: 300px;
    }

    .geometric-shape {
        width: 200px;
        height: 200px;
    }

    .about,
    .credentials,
    .projects,
    .contact {
        padding: 50px 0;
    }
}

/* Enhanced mobile-specific styles */
.mobile-optimized {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mobile-optimized * {
    -webkit-tap-highlight-color: transparent;
}

.mobile-optimized .geometric-shape {
    animation-duration: 10s;
}

/* Fix about section responsiveness */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .about-image {
        order: -1;
        margin-bottom: 30px;
    }
}

/* Fix credentials section layout */
@media (max-width: 768px) {
    .credentials-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .credential-section {
        text-align: center;
    }
    
    .skills-list {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Fix contact section responsiveness */
@media (max-width: 768px) {
    .contact-info {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .contact-email {
        display: block;
        margin-top: 15px;
        word-break: break-word;
    }
    
    .social-links {
        justify-content: center;
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Fix project cards overflow and spacing */
@media (max-width: 768px) {
    .projects-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding: 20px 0;
        gap: 15px;
    }
    
    .project-card {
        scroll-snap-align: start;
        flex-shrink: 0;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* Breakpoint-specific styles */
.breakpoint-xs .hero-text h1 {
    font-size: 1.6rem;
}

.breakpoint-xs .project-card {
    width: 240px;
    min-width: 240px;
}

.breakpoint-sm .hero-text h1 {
    font-size: 1.9rem;
}

.breakpoint-sm .project-card {
    width: 270px;
    min-width: 270px;
}

/* Menu open state */
.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Enhanced mobile animations */
.mobile-animated {
    animation-duration: 0.5s;
}

/* Device-specific optimizations */
.is-mobile .reduce-motion {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
}

.is-touch .social-link:active,
.is-touch .work-button:active,
.is-touch .project-card:active {
    transform: scale(0.95);
}

/* Improved focus states for mobile */
.is-mobile a:focus,
.is-mobile button:focus {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* Fix text wrapping and overflow issues */
@media (max-width: 480px) {
    .project-title {
        font-size: 1rem;
        line-height: 1.3;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .credential-value {
        font-size: 0.9rem;
        line-height: 1.5;
        word-wrap: break-word;
    }
    
    .about-text p {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: left;
    }
}

/* Ultra Large Screens (4K - 2560px+) */
@media (min-width: 2560px) {
    .container {
        max-width: 1800px;
        padding: 0 120px;
    }
    
    .hero-text h1 {
        font-size: 5.5rem;
        line-height: 1.1;
    }
    
    .hero-text .subtitle {
        font-size: 1.8rem;
        margin-bottom: 50px;
    }
    
    .geometric-shape {
        width: 600px;
        height: 600px;
    }
    
    .about-image {
        width: 400px;
        height: 500px;
    }
    
    .project-card {
        width: 420px;
        min-width: 420px;
    }
    
    .work-button {
        padding: 20px 40px;
        font-size: 1.2rem;
    }
    
    .social-link {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Large 4K Screens (1920px-2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
    .container {
        max-width: 1600px;
        padding: 0 100px;
    }
    
    .hero-text h1 {
        font-size: 5rem;
        line-height: 1.1;
    }
    
    .hero-text .subtitle {
        font-size: 1.6rem;
        margin-bottom: 45px;
    }
    
    .geometric-shape {
        width: 550px;
        height: 550px;
    }
    
    .about-image {
        width: 360px;
        height: 450px;
    }
    
    .project-card {
        width: 380px;
        min-width: 380px;
    }
    
    .work-button {
        padding: 18px 36px;
        font-size: 1.1rem;
    }
}

/* Ultra-wide screen optimizations */
@media (min-width: 1600px) and (max-width: 1919px) {
    .container {
        max-width: 1400px;
        padding: 0 80px;
    }
    
    .hero-text h1 {
        font-size: 4.5rem;
    }
    
    .hero-text .subtitle {
        font-size: 1.4rem;
        margin-bottom: 40px;
    }
    
    .geometric-shape {
        width: 500px;
        height: 500px;
    }
    
    .about-image {
        width: 340px;
        height: 420px;
    }
    
    .project-card {
        width: 360px;
        min-width: 360px;
    }
}