/* Responsive Design    */

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: all var(--transition-base);
    border-radius: 2px;
}

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-lg);
    }
    
    /* Hero Banner Tablet */
    .hero-banner {
        height: auto;
        min-height: 800px;
    }
    
    .hero-logo-img {
        height: 280px;
    }
    
    .hero-roles-list {
        font-size: 2rem;
    }
    
    /* Main Column Tablet */
    .main-column {
        width: 100%;
    }
    
    .content-section {
        padding: var(--space-2xl) var(--space-xl);
    }
    
    /* Profile Tablet */
    .profile-avatar-wrapper {
        width: 160px;
        height: 160px;
    }
    
    /* Grids Tablet */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--space-lg);
    }
    
    .plugins-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-lg);
    }
    
    /* Resume Tablet */
    .resume-grid {
        grid-template-columns: 1fr;
    }
    
    /* Section Tablet */
    .section {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .section-header {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
        /* Increase tap target sizes for mobile */
        --mobile-tap-target: 48px;
    }
    
    h1 { 
        font-size: 2rem; 
        letter-spacing: -0.5px; 
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Mobile Menu */
    .mobile-menu-btn { 
        display: block; 
        z-index: 1002;
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .navbar {
        padding: var(--space-sm) var(--space-md);
    }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background: rgba(15, 15, 15, 0.98);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        padding-top: 100px;
        backdrop-filter: blur(20px);
        border-right: 1px solid var(--border-subtle);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-links.active { 
        left: 0; 
    }
    
    .nav-link { 
        font-size: 1.5rem; 
        display: block; 
        margin: var(--space-lg) 0;
        padding: var(--space-md) var(--space-lg);
        min-height: var(--mobile-tap-target);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link::before {
        display: none;
    }
    
    /* Hero Banner Mobile */
    .hero-banner {
        height: auto;
        min-height: 600px;
        padding: 120px var(--space-md) 60px;
    }
    
    .hero-bg-parallax {
        background-attachment: scroll;
        height: 100%;
        background-position: center center;
    }
    
    .banner-content {
        flex-direction: column;
        padding: 0 var(--space-md);
        gap: var(--space-lg);
    }
    
    .banner-left {
        margin-bottom: 0;
        order: 2;
        align-items: center;
        text-align: center;
        align-self: center;
    }
    
    .banner-center {
        order: 1;
        align-self: center;
    }
    
    .banner-right {
        margin-bottom: 0;
        order: 3;
        align-items: center;
        text-align: center;
        align-self: center;
    }
    
    .hero-logo-img {
        height: 200px;
    }
    
    .hero-roles-list {
        font-size: 1.5rem;
        align-items: center;
        margin-left: 0;
        width: 100%;
    }
    
    .hero-roles-list li::before {
        display: none;
    }
    
    /* Main Column Mobile */
    .main-column {
        width: 100%;
        margin-top: -40px;
    }
    
    /* Content Sections Mobile */
    .content-section {
        padding: var(--space-xl) var(--space-md);
    }
    
    #section-profile {
        padding: var(--space-xl) var(--space-md);
        border-radius: var(--radius-md);
    }
    
    #plugins {
        border-radius: var(--radius-md);
    }
    
    /* Profile Section Mobile */
    .hero-profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
        align-items: center;
    }
    
    .profile-avatar-wrapper {
        width: 140px;
        height: 140px;
    }
    
    .profile-avatar-wrapper::before {
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
    
    .hero-header-text {
        align-items: center;
    }
    
    .hero-header-text h1 {
        text-align: center;
        white-space: normal;
        word-break: break-word;
    }
    
    .nickname-wrapper {
        display: inline-block;
        margin-left: 0;
        margin-right: 0;
    }
    
    .header-meta-row {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
        text-align: center;
    }
    
    .info-item {
        justify-content: center;
    }
    
    .social-links-unified {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-xs);
        width: 100%;
    }
    
    .social-display-item {
        font-size: 0.85rem;
        padding: 0 var(--space-sm);
        height: 40px;
        min-height: 40px;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .icon-btn img {
        width: 20px;
        height: 20px;
    }
    
    /* Tech Stack Mobile */
    .tech-stack-section {
        flex-direction: column;
        gap: var(--space-md);
        column-gap: 0;
    }
    
    .tech-category {
        width: 100%;
        text-align: center;
    }
    
    .tech-category h4 {
        text-align: center;
    }
    
    .tech-icons {
        gap: var(--space-sm);
        justify-content: center;
    }
    
    .tech-icons img {
        height: 28px;
    }
    
    .hero-separator {
        margin: var(--space-lg) 0;
    }
    
    .description {
        font-size: 1rem;
        text-align: center;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        min-height: var(--mobile-tap-target);
    }
    
    .social-links-hero {
        justify-content: center;
    }
    
    /* Section Headers Mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        margin-bottom: var(--space-xl);
        margin-left: 0;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header h2::after {
        width: 40px;
    }
    
    .section-header .line {
        width: 100%;
    }
    
    /* Grids Mobile */
    .projects-grid,
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    /* Cards Mobile */
    .card {
        margin: 0;
    }
    
    .card-content {
        padding: var(--space-md);
    }
    
    .card h3 {
        font-size: 1.2rem;
    }
    
    .card-image-wrapper {
        height: 220px;
    }
    
    /* Plugin Cards Mobile */
    .plugin-card {
        padding: 0;
    }
    
    .plugin-header {
        flex-direction: row;
        align-items: flex-start;
        padding: var(--space-md);
    }
    
    .plugin-image-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .plugin-info h3 {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }
    
    .plugin-info p {
        font-size: 0.9rem;
    }
    
    .plugin-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        padding: 0 var(--space-md) var(--space-md);
    }
    
    .plugin-tech {
        width: 100%;
    }
    
    /* Resume Mobile */
    .resume-grid {
        gap: var(--space-xl);
    }
    
    .resume-item {
        flex-direction: row;
        padding: var(--space-md);
    }
    
    .resume-logo {
        width: 48px;
        height: 48px;
    }
    
    .resume-role-title {
        font-size: 1.05rem;
    }
    
    .resume-institution-name {
        font-size: 0.75rem;
    }
    
    .resume-category-title {
        font-size: 1.5rem;
    }
    
    /* Footer Mobile */
    .about-container {
        padding: var(--space-xl) var(--space-md);
    }
    
    .footer {
        padding: var(--space-lg) var(--space-md);
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-links a {
        min-width: 44px;
        min-height: 44px;
    }
    
    .background-glob {
        width: 400px;
        height: 400px;
        top: -10%;
        right: -30%;
    }
    
    /* Scroll to Top Mobile */
    .scroll-to-top {
        width: 48px;
        height: 48px;
        bottom: 24px;
        right: 24px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        font-size: 13px;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
    
    /* Hero Banner Small Mobile */
    .hero-banner {
        min-height: 500px;
        padding: 100px var(--space-sm) 40px;
    }
    
    .hero-logo-img {
        height: 160px;
    }
    
    .hero-roles-list {
        font-size: 1.25rem;
        gap: 6px;
    }
    
    .banner-right p {
        font-size: 0.85rem;
    }
    
    /* Profile Small Mobile */
    .profile-avatar-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .hero-header-text h1 {
        font-size: 1.75rem;
    }
    
    .header-meta-row {
        font-size: 0.8rem;
        gap: var(--space-xs);
    }
    
    .info-item {
        width: 100%;
        justify-content: center;
    }
    
    .social-links-unified {
        width: 100%;
    }
    
    .social-display-item {
        flex: 1;
        min-width: 0;
        font-size: 0.75rem;
        padding: 0 var(--space-xs);
    }
    
    .social-display-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Tech Stack Small Mobile */
    .tech-icons img {
        height: 24px;
    }
    
    /* Content Sections Small Mobile */
    .content-section {
        padding: var(--space-lg) var(--space-sm);
    }
    
    #section-profile {
        padding: var(--space-lg) var(--space-sm);
    }
    
    /* Cards Small Mobile */
    .card-content {
        padding: var(--space-sm);
    }
    
    .card h3 {
        font-size: 1.1rem;
        margin-bottom: var(--space-md);
    }
    
    .card p {
        font-size: 0.9rem;
    }
    
    .card-image-wrapper {
        height: 180px;
    }
    
    .card-image-wrapper.perfect-fit,
    .card-image-wrapper.with-blur-bg {
        padding-bottom: 50%;
    }
    
    /* Plugin Cards Small Mobile */
    .plugin-card {
        padding: 0;
    }
    
    .plugin-header {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .plugin-image-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .plugin-info h3 {
        font-size: 0.95rem;
    }
    
    .plugin-info p {
        font-size: 0.85rem;
    }
    
    .plugin-meta {
        padding: 0 var(--space-sm) var(--space-sm);
    }
    
    .plugin-tech span {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    /* Resume Small Mobile */
    .resume-item {
        padding: var(--space-sm);
        flex-direction: column;
        align-items: flex-start;
    }
    
    .resume-logo {
        width: 56px;
        height: 56px;
        margin-bottom: var(--space-xs);
        align-self: center;
    }
    
    .resume-content {
        width: 100%;
        align-items: center;
        text-align: center;
    }
    
    .resume-institution-name {
        font-size: 0.7rem;
    }
    
    .resume-role-title {
        font-size: 0.95rem;
        justify-content: center;
    }
    
    .resume-date {
        font-size: 0.75rem;
    }
    
    .resume-content .resume-role-group:not(:last-child)::before {
        display: none;
    }
    
    .resume-category-title {
        font-size: 1.4rem;
    }
    
    /* Buttons Small Mobile */
    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
        min-height: 44px;
    }
    
    /* Section Headers Small Mobile */
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    /* Footer Small Mobile */
    .footer-content {
        padding: var(--space-md) var(--space-sm);
    }
    
    .footer-left .logo-text {
        font-size: 1.1rem;
    }
    
    .footer-links a {
        width: 40px;
        height: 40px;
    }
    
    .footer-links a img {
        width: 20px;
        height: 20px;
    }
    
    /* Scroll to Top Button */
    .scroll-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    .tech-stack span {
        font-size: 0.85rem;
    }
}

/* Extra Small Mobile - 360px and below */
@media (max-width: 360px) {
    :root {
        font-size: 12px;
    }
    
    .hero-logo-img {
        height: 140px;
    }
    
    .hero-roles-list {
        font-size: 1.1rem;
    }
    
    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .hero-header-text h1 {
        font-size: 1.5rem;
    }
    
    .content-section {
        padding: var(--space-md) var(--space-xs);
    }
    
    #section-profile {
        padding: var(--space-md) var(--space-xs);
    }
    
    .social-links-unified {
        flex-direction: column;
        width: 100%;
    }
    
    .social-display-item {
        width: 100%;
    }
    
    .tech-icons {
        gap: var(--space-xs);
    }
    
    .tech-icons img {
        height: 20px;
    }
    
    .card-image-wrapper {
        height: 160px;
    }
    
    .resume-logo {
        width: 48px;
        height: 48px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-banner {
        min-height: 500px;
        padding: 100px var(--space-md) 40px;
    }
    
    .hero-logo-img {
        height: 160px;
    }
    
    .hero-roles-list {
        font-size: 1.2rem;
    }
    
    .banner-content {
        gap: var(--space-md);
    }
    
    .profile-avatar-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .nav-links {
        padding-top: 80px;
    }
    
    .content-section {
        padding: var(--space-lg) var(--space-md);
    }
}

/* High Resolution Displays */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .projects-grid,
    .plugins-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn,
    .nav-link,
    .icon-btn,
    .social-display-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Disable hover animations on touch devices */
    .card:hover {
        transform: none;
    }
    
    .plugin-card:hover {
        transform: none;
    }
    
    /* Make interactive elements more obvious */
    .btn,
    .icon-btn {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-bg-parallax {
        transform: none !important;
    }
    
    .scroll-to-top svg {
        animation: none !important;
    }
}

/* Dark Mode (default) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .mobile-menu-btn,
    .background-glob {
        display: none;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
    }
}
