/* ========================================
   MOBILE RESPONSIVE DESIGN
   Maintains original design while adapting for mobile
======================================== */

/* Tablet and Below - 1024px */
@media (max-width: 1024px) {
    section {
        padding: 8vh 6%;
    }

    .nav-container {
        padding: 0.7rem 2rem;
        gap: 2.5rem;
    }

    .nav-links li a {
        font-size: 0.75rem;
        padding: 0.7rem 1.2rem;
    }
}

/* Mobile - 768px and below */
@media (max-width: 768px) {

    /* Hide custom cursor on mobile */
    #sukuna-cursor {
        display: none !important;
    }

    html,
    body,
    * {
        cursor: auto !important;
    }

    /* Responsive padding */
    section {
        padding: 6vh 5%;
        min-height: auto;
    }

    /* Navigation - Compact mobile nav */
    #main-nav {
        top: 1rem;
        width: 95%;
    }

    .nav-container {
        padding: 0.6rem 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.3rem;
        width: 100%;
    }

    .nav-links li a {
        font-size: 0.7rem;
        padding: 0.6rem 1rem;
        text-align: center;
    }

    .lang-switcher {
        width: 100%;
        justify-content: center;
    }

    .lang-dropdown {
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        right: auto;
    }

    /* Hero Section */
    .hero {
        text-align: center;
        align-items: center;
        padding-top: 15vh;
    }

    .hero-content h1 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .subtitle-word {
        font-size: 0.65em;
    }

    .hero-role {
        font-size: 0.4em;
    }

    .hero-btns {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .view-posts-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px 10px 20px;
    }

    /* About Section - Bento Grid */
    .bento-resume-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .bento-resume-grid>*:first-child {
        grid-column: 1;
    }

    .resume-card {
        margin-top: 1.5rem;
    }

    .bio-personas {
        flex-wrap: wrap;
        justify-content: center;
    }

    .bio-personas .p-item {
        width: 40px;
        height: 40px;
    }

    .bio-personas .p-item:hover {
        width: 160px;
    }

    .bio-languages {
        flex-wrap: wrap;
        justify-content: center;
    }

    .lang-tag {
        width: 100px;
        height: 48px;
    }

    .card-header h3 {
        font-size: 0.85rem;
    }

    .bio-text {
        font-size: 0.85rem;
    }

    /* Projects Section */
    .project-slider-wrapper {
        padding: 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        overflow-x: visible;
    }

    .scroll-btn {
        display: none;
    }

    /* Blogs Section */
    .blogs-grid-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .coming-soon-card {
        padding: 2rem;
    }

    /* Contact Section */
    .contact-grid-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-left-col {
        order: 2;
        /* Form after info */
        padding-bottom: 0;
    }

    .contact-right-col {
        order: 1;
        /* Info first */
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }

    .contact-form {
        padding: 1.5rem;
        gap: 1rem;
    }

    .form-group label {
        font-size: 0.7rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .contact-text h2 {
        font-size: 2.5rem;
    }

    .social-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* Back to Top Button */
    #back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    /* 3D Elements - Reduce complexity on mobile */
    #three-container {
        opacity: 0.3;
        left: -30%;
        width: 100%;
    }

    #matrix-canvas {
        opacity: 0.2;
        width: 300px;
        height: 300px;
    }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
    section {
        padding: 5vh 4%;
    }

    /* Navigation */
    #main-nav {
        width: 96%;
    }

    .nav-links li a {
        font-size: 0.65rem;
        padding: 0.5rem 0.8rem;
    }

    /* Hero */
    .hero-content h1 {
        font-size: clamp(1.3rem, 10vw, 2rem);
        line-height: 1;
    }

    .subtitle-word::before {
        content: '>';
    }

    .hero-btns {
        gap: 0.8rem;
    }

    /* About Cards */
    .card-header h3 {
        font-size: 0.8rem;
    }

    .bio-text {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .timeline-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .time {
        font-size: 0.7rem;
    }

    .detail h4 {
        font-size: 0.75rem;
    }

    .detail p {
        font-size: 0.65rem;
    }

    /* Bio Personas - Smaller on tiny screens */
    .bio-personas .p-item {
        width: 36px;
        height: 36px;
    }

    .bio-personas .p-item i {
        font-size: 1.2rem;
    }

    .bio-personas .p-item:hover {
        width: 140px;
    }

    .bio-personas .p-item span {
        font-size: 0.7rem;
    }

    /* Language Tags */
    .lang-tag {
        width: 90px;
        height: 45px;
    }

    .lang-name {
        font-size: 0.65rem;
    }

    /* Projects */
    .project-card-3d {
        max-width: 100%;
    }

    /* Contact */
    .contact-text h2 {
        font-size: 2rem;
    }

    .contact-text p {
        font-size: 0.9rem;
    }

    .social-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

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

    /* Section Headers */
    .section-header h2 {
        font-size: 2rem;
    }

    .section-header-inline h2 {
        font-size: 1.8rem;
    }
}

/* Certificate Page Mobile */
@media (max-width: 768px) {
    .cert-page {
        padding: 6vh 5%;
    }

    .cert-hero h1 {
        font-size: 2.5rem;
    }

    .cert-archive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cert-box {
        padding: 2rem;
    }

    /* Certificate Modal */
    .modal-content {
        max-width: 95%;
        max-height: 80vh;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }

    .modal-caption {
        font-size: 1rem;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        text-align: center;
    }

    .download-cert-btn {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
        padding: 0.7rem 1.2rem;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets on touch devices */
    .nav-links li a {
        padding: 1rem 1.5rem;
    }

    .view-posts-btn {
        padding: 12px 12px 12px 24px;
    }

    .cert-btn {
        padding: 1rem 2rem;
    }

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

    /* Remove hover effects, use active instead */
    .resume-card:hover {
        transform: none;
    }

    .resume-card:active {
        transform: scale(0.98);
    }

    .project-card-3d:hover .content {
        transform: none;
    }

    .project-card-3d:active .content {
        transform: scale(0.98);
    }
}

/* Landscape Mobile - Special handling */
@media (max-width: 896px) and (orientation: landscape) {
    section {
        min-height: auto;
        padding: 4vh 6%;
    }

    .hero {
        padding-top: 10vh;
    }

    #main-nav {
        top: 0.5rem;
    }

    .nav-container {
        padding: 0.4rem 1.5rem;
        flex-direction: row;
        gap: 1.5rem;
    }

    .nav-links {
        flex-direction: row;
    }
}