/* X4Free Portfolio - Responsive Styles */

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
    :root {
        --vh: 1vh; /* Fallback for viewport height */
    }
    
    /* Use custom viewport height for mobile browsers */
    .hero {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    .nav-menu {
        height: calc(100vh - 70px);
        height: calc(var(--vh, 1vh) * 100 - 70px);
    }
    
    /* Disable animations for better performance on older mobile devices */
    .reduce-motion * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Hardware acceleration for smooth scrolling */
    body, .hero, .nav-menu {
        -webkit-overflow-scrolling: touch;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
    }
    
    /* Improve tap performance */
    .btn, .nav-link, .project-card, .filter-btn {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Prevent text selection on interactive elements */
    .hamburger, .social-link, .project-link {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Optimize images for mobile */
    img, picture, video {
        max-width: 100%;
        height: auto;
        display: block;
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .section-title {
        font-size: 5rem;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .hero-content {
        gap: 40px;
    }
    
    .hero-title {
        max-width: 350px;
    }
    
    .title-name {
        font-size: 2.5em;
    }
    
    .code-window {
        width: 350px;
    }
    
    .contact-content {
        gap: 60px;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px 0;
        --container-padding: 0 30px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
        min-height: 70vh;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 30px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .main-card {
        transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
        max-width: 400px;
        margin: 0 auto;
    }
    
    .floating-cards .mini-card {
        display: none;
    }
    
    .floating-card {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
    
    .code-window {
        width: 400px;
        max-width: 100%;
    }
    
    .about-highlights {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 30px;
    }
    
    /* New About Section Tablet Responsive */
    .about-stage {
        margin-bottom: 100px;
    }
    
    .stage-content {
        gap: 60px;
    }
    
    .stage-number {
        font-size: 60px;
    }
    
    .stage-title {
        font-size: 36px;
    }
    
    .stage-description {
        font-size: 17px;
    }
    
    .symbol-container {
        height: 350px;
    }
    
    /* New Skills Section Tablet Responsive */
    .skill-stage {
        margin-bottom: 100px;
    }
    
    .skill-stage .stage-content {
        gap: 60px;
    }
    
    .category-number {
        font-size: 60px;
    }
    
    .skill-category-title h3 {
        font-size: 30px;
    }
    
    .visual-container {
        height: 350px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 30px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .nav-menu {
        gap: 30px;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
        --container-padding: 0 20px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 12px 20px; /* Added more padding for rounded navbar */
    }
    
    .hamburger {
        display: flex;
        position: relative;
        left: -5px; /* Move hamburger slightly left */
    }
    
    .nav-brand {
        position: relative;
        right: -5px; /* Move logo slightly right */
    }
    
    .nav-menu {
        position: fixed;
        top: 85px; /* Adjusted for navbar with border radius */
        left: -120%;
        right: 20px; /* Add right margin */
        width: calc(100% - 40px); /* Account for margins */
        height: fit-content; /* Height fits content instead of full height */
        max-height: calc(100vh - 120px); /* Prevent overflow */
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px; /* Modern rounded corners */
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 30px 20px; /* Reduced padding for content-fit */
        gap: 25px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        margin-left: 20px; /* Left margin for positioning */
    }
    
    .nav-menu.active {
        left: 0;
        transform: translateY(0);
        animation: slideInTech 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes slideInTech {
        0% {
            opacity: 0;
            transform: translateY(-20px) scale(0.95);
        }
        50% {
            opacity: 0.8;
            transform: translateY(-5px) scale(0.98);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .nav-link {
        font-size: 16px;
        color: var(--text-white);
        padding: 12px 30px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 40px;
        text-decoration: none;
        position: relative;
        font-weight: 500;
        letter-spacing: 1px;
        text-transform: uppercase;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 50px;
        min-width: 160px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(255, 215, 0, 0.15) 25%, 
            rgba(255, 215, 0, 0.3) 50%, 
            rgba(255, 215, 0, 0.15) 75%, 
            transparent 100%
        );
        transition: left 0.8s ease;
        z-index: 1;
        animation: randomBeam 4s ease-in-out infinite;
        animation-delay: calc(var(--random-delay, 0) * 1s);
    }
    
    .nav-link::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 40px;
        padding: 1px;
        background: linear-gradient(45deg, 
            transparent, 
            rgba(255, 215, 0, 0.2), 
            transparent, 
            rgba(255, 215, 0, 0.1)
        );
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask-composite: subtract;
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: source-out;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 2;
    }
    
    .nav-link span {
        position: relative;
        z-index: 3;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        color: var(--accent-gold);
        background: rgba(255, 215, 0, 0.1);
        border-color: rgba(255, 215, 0, 0.3);
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    }
    
    .nav-link:hover::before {
        left: 100%;
    }
    
    .nav-link:hover::after {
        opacity: 1;
    }
    
    .nav-link:hover span {
        transform: scale(1.05);
        letter-spacing: 2px;
    }
    
    .nav-link:active {
        transform: translateY(-1px);
    }
    
    @keyframes randomBeam {
        0%, 70%, 100% {
            left: -100%;
        }
        15%, 55% {
            left: 100%;
        }
    }
    
    /* Active state indicator */
    .nav-link.active {
        background: rgba(255, 215, 0, 0.15);
        border-color: rgba(255, 215, 0, 0.4);
        color: var(--accent-gold);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    }
    
    .nav-link.active::before {
        left: 0;
        background: linear-gradient(90deg, 
            rgba(255, 215, 0, 0.2) 0%, 
            rgba(255, 215, 0, 0.4) 50%, 
            rgba(255, 215, 0, 0.2) 100%
        );
        animation: none;
    }
    
    .nav-link.active::after {
        opacity: 1;
        animation: pulseGlow 2s ease-in-out infinite;
    }
    
    .nav-link.active span {
        transform: scale(1.02);
        letter-spacing: 1.5px;
    }
    
    @keyframes pulseGlow {
        0%, 100% {
            opacity: 1;
        }
        50% {
            opacity: 0.7;
        }
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: var(--accent-gold);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: var(--accent-gold);
    }
    
    /* Hero Mobile Styles */
    .hero-content {
        text-align: center;
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
        margin: 0 auto 15px auto;
    }

    .hero-title {
        max-width: 100%;
        gap: 6px;
        text-align: center;
        align-items: center;
    }
    
    .title-name {
        font-size: 2.2em;
    }
    
    .title-slogan {
        font-size: 1em;
    }
    
    .title-subtitle {
        font-size: 0.7em;
        max-width: 280px;
    }
    
    .hero-description {
        font-size: 16px;
        max-width: 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .main-card {
        max-width: 300px;
        padding: 0;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .code-display {
        font-size: 12px;
    }
    
    .geometric-grid {
        background-size: 30px 30px;
    }
    
    /* Hero Section */
    .hero-subtitle {
        font-size: 18px;
        margin-bottom: 30px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 40px;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .code-window {
        width: 100%;
        max-width: 350px;
    }
    
    .window-header {
        padding: 12px 15px;
    }
    
    .code-content {
        padding: 15px;
        font-size: 12px;
    }
    
    /* About Section - New Artistic Design Responsive */
    .about-stage {
        margin-bottom: 80px;
    }
    
    .stage-content {
        flex-direction: column !important;
        gap: 40px;
        min-height: auto;
        text-align: center;
    }
    
    /* Force symbol first (top), then text for all stages on mobile */
    .about-stage .stage-content {
        display: flex;
        flex-direction: column;
    }
    
    .about-stage .stage-symbol {
        order: 1; /* Symbol first (top) */
    }
    
    .about-stage .stage-text {
        order: 2; /* Text second (bottom) */
    }
    
    .stage-text,
    .stage-symbol {
        flex: none;
        width: 100%;
    }
    
    .stage-text {
        padding: 20px;
    }
    
    .stage-number {
        font-size: 48px;
        margin-bottom: 15px;
    }
    
    .stage-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .stage-description {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .stage-skills {
        justify-content: center;
        gap: 8px;
    }
    
    .skill-tag {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Symbol Container Responsive */
    .symbol-container {
        height: 250px;
    }
    
    /* Code Symbol Mobile */
    .symbol-code .code-brackets {
        gap: 120px;
    }
    
    .bracket {
        font-size: 80px;
    }
    
    .code-line.line-1 { width: 50px; }
    .code-line.line-2 { width: 80px; }
    .code-line.line-3 { width: 40px; }
    
    /* Mobile Symbol Mobile */
    .symbol-mobile .mobile-frame {
        width: 160px;
        height: 260px;
        border-radius: 30px;
        border-width: 3px;
    }
    
    .mobile-screen {
        width: 130px;
        height: 210px;
        margin: 15px auto;
        border-radius: 18px;
    }
    
    .screen-content {
        padding: 18px;
        gap: 12px;
    }
    
    .app-icon {
        width: 30px;
        height: 30px;
    }
    
    .app-waves {
        height: 35px;
        bottom: 12px;
        left: 12px;
        right: 12px;
    }
    
    .mobile-button {
        width: 35px;
        height: 35px;
        bottom: 10px;
    }
    
    /* 3D Cube Mobile */
    .symbol-3d .cube-container {
        width: 150px;
        height: 150px;
    }
    
    .face {
        width: 150px;
        height: 150px;
    }
    
    .face.front  { transform: rotateY(0deg) translateZ(75px); }
    .face.back   { transform: rotateY(180deg) translateZ(75px); }
    .face.right  { transform: rotateY(90deg) translateZ(75px); }
    .face.left   { transform: rotateY(-90deg) translateZ(75px); }
    .face.top    { transform: rotateX(90deg) translateZ(75px); }
    .face.bottom { transform: rotateX(-90deg) translateZ(75px); }
    
    /* Symbol Glow Mobile */
    .symbol-glow {
        width: 200px;
        height: 200px;
    }

    /* Skills Section - New Artistic Design Responsive */
    .skill-stage {
        margin-bottom: 80px;
    }
    
    .skill-stage .stage-content {
        flex-direction: column !important;
        gap: 40px;
        min-height: auto;
        text-align: center;
    }
    
    .skill-text,
    .skill-visual {
        flex: none;
        width: 100%;
    }
    
    .skill-text {
        padding: 20px;
    }
    
    .skill-category-title {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .category-number {
        font-size: 48px;
    }
    
    .skill-category-title h3 {
        font-size: 24px;
    }
    
    .skill-item {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .skill-item:hover {
        transform: translateX(0);
    }
    
    .skill-name,
    .skill-level {
        font-size: 14px;
    }
    
    .skill-bar {
        height: 6px;
    }
    
    /* Visual Container Mobile */
    .visual-container {
        height: 250px;
    }
    
    /* Web Visual Mobile */
    .visual-web .symbol-orbit {
        width: 200px;
        height: 200px;
    }
    
    .center-symbol {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .orbit-item {
        width: 40px;
        height: 40px;
    }
    
    .tech-symbol {
        font-size: 10px;
    }
    
    /* Mobile Visual Mobile */
    .device {
        width: 70px;
        height: 130px;
    }
    
    .device-screen {
        width: 60px;
        height: 110px;
        margin: 10px auto;
        padding: 8px;
    }
    
    .app-dot {
        width: 15px;
        height: 15px;
    }
    
    .particle {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    /* 3D Visual Mobile */
    .visual-3d .design-workspace {
        width: 200px;
        height: 200px;
    }
    
    .rotating-shape {
        width: 100px;
        height: 100px;
    }
    
    .shape-face {
        width: 100px;
        height: 100px;
    }
    
    .shape-face.face-1 { transform: rotateY(0deg) translateZ(50px); }
    .shape-face.face-2 { transform: rotateY(90deg) translateZ(50px); }
    .shape-face.face-3 { transform: rotateY(180deg) translateZ(50px); }
    .shape-face.face-4 { transform: rotateY(270deg) translateZ(50px); }
    
    .tool-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    /* Visual Glow Mobile */
    .visual-glow {
        width: 250px;
        height: 250px;
    }
    
    /* Projects Section */
    .projects-filter {
        gap: 10px;
        margin-bottom: 40px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-content {
        padding: 25px;
    }
    
    .project-title {
        font-size: 18px;
    }
    
    /* Contact Section */
    .contact-info h3 {
        font-size: 28px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .contact-info p {
        font-size: 16px;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .contact-methods {
        margin-bottom: 30px;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .method-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .contact-form {
        padding: 30px 25px;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Mobile Landscape */
@media (max-width: 640px) {
    .hero {
        min-height: 100vh;
        padding-top: 70px;
    }
    
    .hero-content {
        min-height: auto;
        gap: 40px;
        text-align: center;
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
        margin: 0 auto 15px auto;
    }
    
    .floating-card {
        padding: 20px;
    }
    
    .code-window {
        max-width: 300px;
    }
    
    .window-header {
        padding: 10px 12px;
    }
    
    .window-title {
        font-size: 10px;
    }
    
    .code-content {
        padding: 12px;
        font-size: 11px;
        line-height: 1.6;
    }
    
    .control {
        width: 10px;
        height: 10px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    :root {
        --section-padding: 50px 0;
        --container-padding: 0 15px;
    }
    
    /* Loading Screen Mobile Optimization */
    .loader-wrapper {
        padding: 15px;
    }
    
    .loader {
        width: 80px;
        height: 80px;
    }
    
    .loader-inner {
        width: 60px;
        height: 60px;
    }
    
    .loader-line-wrap {
        width: 50px;
        height: 4px;
    }
    
    .loader-text {
        font-size: 14px;
        margin-top: 30px;
        text-align: center;
        max-width: 250px;
    }
    
    .loader-progress {
        width: 200px;
        height: 6px;
        margin-top: 20px;
    }
    
    .progress-percentage {
        font-size: 12px;
        margin-top: 8px;
    }
    
    /* Typography */
    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 10px 15px;
    }
    
    .hamburger {
        left: -8px; /* Move hamburger more left on small screens */
    }
    
    .nav-brand {
        right: -8px; /* Move logo more right on small screens */
    }
    
    .nav-menu {
        top: 75px;
        width: calc(100% - 30px);
        margin-left: 15px;
        right: 15px;
        border-radius: 16px;
        padding: 25px 15px;
        gap: 20px;
    }
    
    .nav-link {
        font-size: 15px;
        min-width: 140px;
        min-height: 45px;
        padding: 10px 25px;
    }
    
    .nav-link:hover span {
        letter-spacing: 1.5px;
    }
    
    .hamburger {
        width: 42px;
        height: 42px;
    }
    
    .hamburger .bar {
        width: 18px;
    }
    
    .brand-text {
        font-size: 20px;
    }
    
    .brand-subtitle {
        font-size: 10px;
    }
    
    /* Enhanced mobile hamburger menu */
    .hamburger {
        display: flex;
        /* Inherit all the modern design from main CSS */
    }

    .hamburger .bar {
        width: 20px;
        height: 2px;
        border-radius: 2px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        transform-origin: center;
    }
    
    .hamburger .bar:nth-child(1) {
        background: #ffd700; /* Gold - first color */
    }
    
    .hamburger .bar:nth-child(2) {
        background: linear-gradient(90deg, #ffd700, #00bfff); /* Gradient transition */
    }
    
    .hamburger .bar:nth-child(3) {
        background: #00bfff; /* Blue - last color */
    }
    
    .hamburger.active {
        background: rgba(255, 215, 0, 0.15);
        border-color: rgba(255, 215, 0, 0.4);
        transform: rotate(180deg);
    }
    
    .hamburger.active::before {
        opacity: 1;
        animation-duration: 1s;
    }
    
    @keyframes rotate {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding-top: 80px;
    }
    
    .hero-content {
        gap: 30px;
        padding: 20px 0;
        text-align: center;
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
        margin: 0 auto 20px auto;
        left: 0;
    }

    .hero-title {
        max-width: 100%;
        gap: 5px;
        text-align: center;
        align-items: center;
        margin-bottom: 30px;
    }    .title-name {
        font-size: 2em;
    }
    
    .title-slogan {
        font-size: 0.95em;
    }
    
    .title-subtitle {
        font-size: 0.65em;
        max-width: 260px;
    }

    .hero-subtitle {
        font-size: 16px;
        text-align: center;
    }    .hero-description {
        font-size: 16px;
        line-height: 1.6;
        margin: 20px 0;
        text-align: center;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        margin: 25px 0;
    }
    
    .stat-item {
        min-width: 120px;
        text-align: center;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 15px 25px;
        font-size: 16px;
        border-radius: 12px;
        margin: 0 auto;
        touch-action: manipulation;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Mobile Visual Elements */
    .hero-visual {
        padding: 20px;
        max-width: 100%;
    }
    
    .main-card {
        /*max-width: 280px;*/
        margin: 0 auto;
        transform: none !important;
    }
    
    .floating-cards .mini-card {
        display: none;
    }
    
    .floating-card {
        transform: none !important;
        padding: 20px;
        margin: 10px 0;
    }
    
    .code-window {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .window-header {
        padding: 8px 12px;
    }
    
    .window-controls {
        gap: 6px;
    }
    
    .control {
        width: 8px;
        height: 8px;
    }
    
    .window-title {
        font-size: 10px;
    }
    
    .code-content {
        padding: 12px;
        font-size: 11px;
        line-height: 1.5;
    }
    
    /* Scroll Indicators */
    .scroll-indicator {
        bottom: -30px;
        font-size: 14px;
    }
    
    .scroll-text {
        font-size: 12px;
    }
    
    .scroll-arrow {
        font-size: 16px;
    }
    
    /* Cards and Content */
    .highlight-card,
    .skill-category,
    .contact-form {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .project-title {
        font-size: 16px;
    }
    
    .project-description {
        font-size: 14px;
    }
    
    .tech-tag {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* Form */
    .form-group {
        margin-bottom: 25px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 15px 0;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
        touch-action: manipulation;
    }
    
    .form-group label {
        font-size: 14px;
        pointer-events: none;
    }
    
    .form-group input:focus + label,
    .form-group input:valid + label,
    .form-group textarea:focus + label,
    .form-group textarea:valid + label {
        font-size: 11px;
    }
    
    /* Mobile-specific form button */
    .contact-form .btn {
        width: 100%;
        padding: 18px 25px;
        font-size: 16px;
        border-radius: 12px;
        margin-top: 10px;
    }
    
    /* Touch-friendly elements */
    .project-card {
        border-radius: 12px;
        touch-action: manipulation;
    }
    
    .project-card:active {
        transform: scale(0.98);
    }
    
    .filter-btn {
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 20px;
        min-width: 80px;
        touch-action: manipulation;
    }
    
    .filter-btn:active {
        transform: scale(0.95);
    }
    
    /* Contact Methods */
    .method-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .method-info h4 {
        font-size: 16px;
    }
    
    .method-info p {
        font-size: 14px;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    :root {
        --container-padding: 0 10px;
    }
    
    /* Ultra-compact loader for small screens */
    .loader {
        width: 60px;
        height: 60px;
    }
    
    .loader-inner {
        width: 45px;
        height: 45px;
    }
    
    .loader-line-wrap {
        width: 40px;
        height: 3px;
    }
    
    .loader-text {
        font-size: 12px;
        margin-top: 25px;
        max-width: 200px;
    }
    
    .loader-progress {
        width: 150px;
        height: 5px;
    }
    
    .progress-percentage {
        font-size: 11px;
    }
    
    .hero-title {
        gap: 4px;
        text-align: center;
        align-items: center;
        margin-bottom: 25px;
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
        margin: 0 auto 12px auto;
        left: 0;
    }
    
    .title-name {
        font-size: 1.8em;
        letter-spacing: -0.5px;
    }
    
    .title-slogan {
        font-size: 0.9em;
    }
    
    .title-subtitle {
        font-size: 0.6em;
        max-width: 240px;
    }
    
    .section-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
    }
    
    .nav-container {
        padding: 8px 12px;
    }
    
    .hamburger {
        left: -10px; /* Move hamburger even more left on ultra-small screens */
    }
    
    .nav-brand {
        right: -10px; /* Move logo even more right on ultra-small screens */
    }
    
    .nav-menu {
        width: calc(100% - 20px);
        margin-left: 10px;
        right: 10px;
        border-radius: 14px;
        padding: 20px 12px;
        gap: 18px;
    }
    
    .nav-link {
        font-size: 14px;
        min-width: 130px;
        min-height: 42px;
        padding: 8px 22px;
    }
    
    .nav-link:hover span {
        letter-spacing: 1px;
    }
    
    .hamburger {
        width: 40px;
        height: 40px;
    }
    
    .hamburger .bar {
        width: 16px;
    }
    
    .brand-text {
        font-size: 18px;
    }
    
    .floating-card {
        padding: 15px;
    }
    
    .code-window {
        max-width: 250px;
    }
    
    .highlight-card,
    .skill-category,
    .contact-form,
    .project-content {
        padding: 20px 15px;
    }
    
    .about-intro {
        font-size: 16px;
    }
    
    /* About Section Mobile Portrait - Symbol on Top */
    .about-stage {
        margin-bottom: 60px;
    }
    
    .about-stage .stage-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px;
        text-align: center;
    }
    
    .about-stage .stage-symbol {
        order: 1 !important; /* Always symbol first (top) */
        align-self: center;
    }
    
    .about-stage .stage-text {
        order: 2 !important; /* Always text second (bottom) */
    }
    
    .stage-number {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .stage-title {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .stage-description {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .symbol-container {
        height: 250px;
        margin: 0 auto;
    }
    
    .contact-info h3 {
        font-size: 24px;
    }
    
    .contact-info p {
        font-size: 15px;
    }
    
    /* Ultra-compact buttons */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 60px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .loader-line,
    .section-line,
    .skill-bar,
    .nav-link::after {
        transform: translateZ(0);
        -webkit-font-smoothing: antialiased;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        min-height: auto;
        align-items: center;
    }
    
    .hero-visual {
        order: 1;
    }
    
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
        width: auto;
    }
    
    .floating-card {
        padding: 15px;
    }
    
    .code-window {
        max-width: 280px;
    }
    
    .scroll-indicator {
        bottom: 25px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hamburger,
    .scroll-indicator,
    .loader-wrapper,
    .particles,
    .contact-form {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero,
    .about,
    .skills,
    .projects,
    .contact {
        background: white !important;
        color: black !important;
        page-break-inside: avoid;
    }
    
    .section-title {
        color: black !important;
    }
    
    .btn,
    .social-link,
    .project-link {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}
