/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --color-bg: #000000;
    --color-surface: #0a0a0a;
    --color-border: #1a1a1a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #d0d0d0;
    --color-text-tertiary: #a0a0a0;
    --color-accent: #ffffff;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    /* Better mobile scrolling */
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 120px;
    /* Prevent zoom on mobile */
    touch-action: manipulation;
    /* Ensure proper sizing on all devices */
    width: 100%;
    height: 100%;
}

body {
    font-family: var(--font-mono);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    overflow-x: hidden;
    line-height: 1.8;
    font-weight: 400;
    /* Prevent pull-to-refresh bounce on mobile */
    overscroll-behavior-y: contain;
    /* Better text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure proper sizing on mobile */
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Code-Based Scanline Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9998;
}

/* Terminal Cursor Blink */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 2px solid #1a1a1a;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-screen p {
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

#loading-screen p::after {
    content: '_';
    animation: blink 1s infinite;
}

/* Navigation - Refined Minimal Style */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    transition: var(--transition-fast);
}

#main-nav.scrolled {
    padding: 20px 60px;
    background: rgba(0, 0, 0, 0.95);
}

.logo {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
    letter-spacing: 3px;
}

.logo-image {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transition: var(--transition-fast);
}

.logo-image:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
}

.logo-primary {
    color: var(--color-text-primary);
    font-size: 14px;
}

.logo-secondary {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 400;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 50px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition-fast);
    position: relative;
    padding: 8px 0;
    font-weight: 500;
}

.nav-link::before {
    content: attr(data-level) ' // ';
    color: var(--color-text-tertiary);
    margin-right: 5px;
    opacity: 0;
    transition: var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-text-primary);
    transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Navigation Divider */
.nav-divider {
    color: rgba(255, 255, 255, 1);
    margin: 0 15px;
    align-self: center;
    font-size: 18px;
    user-select: none;
    pointer-events: none;
}

.nav-social {
    display: flex;
    gap: 25px;
}

.social-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition-fast);
    font-weight: 500;
}

.social-link:hover {
    color: var(--color-text-primary);
}

/* Three.js Canvas */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: transform 0.1s ease-out;
}

#canvas-container canvas {
    display: block;
}

/* Audio reactive pulsing effect */
#canvas-container.pulse {
    animation: bassPulse 0.15s ease-out;
}

@keyframes bassPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* Content Overlay */
#content-overlay {
    position: relative;
    z-index: 1;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 120px 80px;
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Allow about section to expand beyond viewport */
#about {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 120px;
}

/* Keep home section centered */
#home {
    min-height: 100vh;
    justify-content: center;
}

.section.active {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--color-text-tertiary);
    margin-bottom: 60px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
}

.section-description {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 60px;
    margin-top: -30px;
    max-width: 600px;
    text-align: center;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

/* Home Section - Luxury Minimal Style */
#home {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

/* Wide screen centering */
@media (min-width: 1600px) {
    #home {
        max-width: 1200px;
    }
}

.title-main {
    font-size: 72px;
    font-weight: 300;
    margin-bottom: 40px;
    color: var(--color-text-primary);
    letter-spacing: -2px;
    line-height: 1.2;
    font-family: var(--font-sans);
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.word-rotate-wrapper {
    display: inline-block;
    position: relative;
    vertical-align: top;
    min-width: 400px;
    text-align: left;
}

.word-rotate {
    display: inline-block;
    color: var(--color-text-primary);
    position: relative;
    animation: wordFadeIn 0.6s ease forwards;
    background: linear-gradient(90deg, #ffffff 0%, #808080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes wordFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wordFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.word-rotate.fade-out {
    animation: wordFadeOut 0.6s ease forwards;
}

.subtitle {
    font-size: 30px;
    color: var(--color-text-secondary);
    margin-bottom: 60px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

/* Home Logo Centered */
.home-logo {
    width: 300px;
    height: auto;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
    filter: drop-shadow(0 0 20px rgba(0, 206, 209, 0.3));
}

@media (max-width: 768px) {
    .home-logo {
        width: 200px;
    }
}

.cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

.cta-button {
    padding: 16px 40px;
    font-size: 11px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    font-family: var(--font-mono);
    position: relative;
    overflow: visible;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--color-text-primary);
    z-index: -1;
    transition: var(--transition-smooth);
    opacity: 0;
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--color-text-primary);
    filter: blur(20px);
    opacity: 0;
    z-index: -2;
    transition: var(--transition-smooth);
}

.cta-button:hover::after {
    opacity: 0.5;
}

.cta-button.primary {
    background: var(--color-text-primary);
    color: var(--color-bg);
    border-color: var(--color-text-primary);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.cta-button.primary::before {
    opacity: 1;
}

.cta-button.primary:hover {
    background: transparent;
    color: var(--color-text-primary);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}

.cta-button.primary:hover::before {
    opacity: 0;
}

.cta-button.secondary {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
}

.cta-button.secondary:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.cta-button.secondary:hover::before {
    opacity: 1;
}

.cta-button.secondary:hover {
    color: var(--color-bg);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Section - Code Grid */
#gallery {
    align-items: center;
    text-align: center;
}

.gallery-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 60px;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

/* Aceternity Glow Buttons */
.filter-btn {
    padding: 12px 30px;
    font-size: 11px;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    font-family: var(--font-mono);
    position: relative;
    overflow: visible;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--color-text-primary);
    z-index: -1;
    transition: var(--transition-smooth);
    opacity: 0;
}

.filter-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--color-text-primary);
    filter: blur(15px);
    opacity: 0;
    z-index: -2;
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.filter-btn:hover::after {
    opacity: 0.4;
}

.filter-btn.active {
    background: var(--color-text-primary);
    color: var(--color-bg);
    border-color: var(--color-text-primary);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4), 0 0 60px rgba(255, 255, 255, 0.2);
}

.filter-btn.active::before {
    opacity: 1;
}

.filter-btn.active::after {
    opacity: 0.6;
}

#gallery h2,
#about h2,
#contact h2 {
    font-size: 48px;
    margin-bottom: 80px;
    color: var(--color-text-primary);
    text-align: center;
    width: 100%;
    max-width: 1400px;
    font-weight: 300;
    letter-spacing: -1px;
    font-family: var(--font-sans);
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

/* Monochrome Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 300px;
    gap: 15px;
    width: 100%;
    max-width: 1400px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    transform-style: preserve-3d;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:nth-child(1) { animation-delay: 0.6s; }
.gallery-item:nth-child(2) { animation-delay: 0.7s; }
.gallery-item:nth-child(3) { animation-delay: 0.8s; }
.gallery-item:nth-child(4) { animation-delay: 0.9s; }
.gallery-item:nth-child(5) { animation-delay: 1.0s; }
.gallery-item:nth-child(6) { animation-delay: 1.1s; }
.gallery-item:nth-child(7) { animation-delay: 1.2s; }
.gallery-item:nth-child(8) { animation-delay: 1.3s; }
.gallery-item:nth-child(n+9) { animation-delay: 1.4s; }

/* Bento Grid - Asymmetric Layout */
.bento-grid .gallery-item:nth-child(1),
.bento-grid .gallery-item:nth-child(5),
.bento-grid .gallery-item:nth-child(8) {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-grid .gallery-item:nth-child(3),
.bento-grid .gallery-item:nth-child(7) {
    grid-row: span 2;
}

.gallery-item:hover {
    transform: translateY(-8px);
    border-color: var(--color-text-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px var(--color-text-primary);
}

.gallery-item-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img,
.gallery-item video.gallery-video-thumbnail {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0.7;
    transition: var(--transition-smooth);
    filter: grayscale(0.3);
}

.gallery-item:hover img,
.gallery-item:hover video.gallery-video-thumbnail {
    opacity: 1;
    transform: scale(1.05);
    filter: grayscale(0);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 30px;
    opacity: 0;
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay p {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--color-text-primary);
    position: relative;
    padding-left: 15px;
}

.gallery-overlay p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 1px;
    background: var(--color-text-primary);
}

/* About Section */
#about {
    text-align: center;
}

.about-intro {
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.skills-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.skills-category {
    text-align: left;
    padding: 30px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0;
    transition: var(--transition-fast);
}

.skills-category:hover {
    border-color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.skills-category h3 {
    font-size: 18px;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 600;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: var(--transition-fast);
    font-weight: 500;
}

.skill-tag:hover {
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Contact Section - Refined Form */
#contact {
    text-align: center;
}

.contact-content {
    max-width: 700px;
    width: 100%;
}

.contact-intro {
    font-size: 16px;
    margin-bottom: 60px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    margin-bottom: 60px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 0;
    color: var(--color-text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    transition: var(--transition-fast);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-text-primary);
    background: var(--color-surface);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 2px;
}

.contact-form textarea {
    resize: vertical;
    min-height: 160px;
}

.submit-button {
    padding: 18px 50px;
    background: var(--color-text-primary);
    color: var(--color-bg);
    border: 1px solid var(--color-text-primary);
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
    align-self: center;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: visible;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.submit-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--color-text-primary);
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
    transition: var(--transition-smooth);
}

.submit-button .button-arrow {
    transition: var(--transition-fast);
}

.submit-button:hover {
    background: transparent;
    color: var(--color-text-primary);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}

.submit-button:hover::after {
    opacity: 0.7;
}

.submit-button:hover .button-arrow {
    transform: translateX(5px);
}

.contact-info {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.contact-email {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.contact-email:hover {
    color: var(--color-text-primary);
}

/* Modal - Terminal Style */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 50px;
    font-size: 30px;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
}

#modal-media-container {
    max-width: 100%;
    max-height: 70vh;
}

#modal-media-container video,
#modal-media-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    font-size: 20px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
}

.modal-nav:hover {
    background: #ffffff;
    color: #000;
}

.modal-nav.prev {
    left: -80px;
}

.modal-nav.next {
    right: -80px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

@media (max-width: 1024px) {
    #main-nav {
        padding: 25px 40px;
    }

    .nav-links {
        gap: 35px;
    }

    .title-main {
        font-size: 56px;
    }

    .word-rotate-wrapper {
        min-width: 320px;
    }

    .section {
        padding: 100px 50px;
    }

    .bento-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }

    .modal-nav.prev {
        left: -60px;
    }

    .modal-nav.next {
        right: -60px;
    }
}

@media (max-width: 768px) {
    /* Navigation - Better mobile layout */
    #main-nav {
        padding: 15px 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
    }

    .logo-image {
        height: 40px;
    }

    .nav-links {
        position: static;
        transform: none;
        gap: 15px;
        width: 100%;
        justify-content: center;
        margin: 0;
    }

    .nav-link {
        font-size: 10px;
        padding: 6px 0;
    }

    .nav-social {
        display: none;
    }

    /* Home Section - Better spacing */
    .home-logo {
        width: 180px;
        margin-bottom: 30px;
    }

    .title-main {
        font-size: 38px;
        letter-spacing: -1px;
        margin-bottom: 30px;
    }

    .word-rotate-wrapper {
        min-width: 200px;
    }

    .subtitle {
        font-size: 16px;
        margin-bottom: 50px;
        padding: 0 20px;
    }

    /* Sections - Better padding and spacing */
    .section {
        padding: 100px 25px;
        min-height: auto;
    }

    #home {
        min-height: 100vh;
        padding: 120px 25px;
    }

    .section-label {
        margin-bottom: 40px;
        font-size: 9px;
    }

    /* CTAs - Full width on mobile */
    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 18px 40px;
        font-size: 12px;
    }

    /* Gallery - Single column, better spacing */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        grid-auto-rows: 280px;
    }

    .bento-grid .gallery-item:nth-child(1),
    .bento-grid .gallery-item:nth-child(5),
    .bento-grid .gallery-item:nth-child(8) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bento-grid .gallery-item:nth-child(3),
    .bento-grid .gallery-item:nth-child(7) {
        grid-row: span 1;
    }

    .gallery-overlay {
        padding: 20px;
    }

    /* About Section - Better text sizing */
    .about-intro {
        font-size: 15px;
        line-height: 1.8;
        padding: 0 10px;
    }

    .skills-container {
        gap: 25px;
    }

    .skills-category {
        padding: 25px;
    }

    .skills-category h3 {
        font-size: 16px;
    }

    /* Contact Form - Stack inputs */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal - Better mobile UX */
    .modal {
        padding: 15px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 32px;
        background: rgba(0, 0, 0, 0.8);
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 80vh;
    }

    .modal-nav {
        font-size: 18px;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.8);
    }

    .modal-nav.prev,
    .modal-nav.next {
        position: fixed;
        bottom: 30px;
        top: auto;
    }

    .modal-nav.prev {
        left: 15px;
    }

    .modal-nav.next {
        right: 15px;
    }

    /* Headings - Better mobile sizing */
    #gallery h2,
    #about h2,
    #contact h2 {
        font-size: 32px;
        margin-bottom: 40px;
        padding: 0 10px;
    }

    .section-description {
        margin-bottom: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Navigation - Compact for small screens */
    #main-nav {
        padding: 12px 15px;
    }

    .logo-image {
        height: 35px;
    }

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

    .nav-link {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    /* Home Section - Compact spacing */
    .home-logo {
        width: 150px;
        margin-bottom: 25px;
    }

    .title-main {
        font-size: 30px;
        letter-spacing: -1px;
    }

    .word-rotate-wrapper {
        min-width: 160px;
    }

    .subtitle {
        font-size: 14px;
        padding: 0 15px;
    }

    /* Sections - Tighter spacing */
    .section {
        padding: 80px 20px;
    }

    #home {
        padding: 100px 20px;
    }

    /* Gallery - Better touch targets */
    .gallery-filters {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        padding: 14px 30px;
    }

    .bento-grid {
        gap: 15px;
        grid-auto-rows: 250px;
    }

    /* Headings - Smaller on tiny screens */
    #gallery h2,
    #about h2,
    #contact h2 {
        font-size: 26px;
        margin-bottom: 35px;
    }

    /* About - Readable text */
    .about-intro {
        font-size: 14px;
        line-height: 1.7;
    }

    .skills-category {
        padding: 20px;
    }

    .skills-category h3 {
        font-size: 14px;
    }

    .skill-tag {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* Contact - Full width button */
    .submit-button {
        padding: 16px 32px;
        width: 100%;
        font-size: 12px;
    }

    /* Modal - Safe area spacing */
    .modal-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 28px;
    }

    .modal-nav.prev,
    .modal-nav.next {
        bottom: 20px;
        padding: 12px 16px;
    }
}

/* Custom Scrollbar - Terminal Style */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #cccccc;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Hide scrollbar on mobile for cleaner look */
    ::-webkit-scrollbar {
        width: 4px;
    }

    /* Better touch targets */
    button, a, .gallery-item, .achievement-card {
        -webkit-tap-highlight-color: rgba(0, 206, 209, 0.2);
        touch-action: manipulation;
    }

    /* Prevent text selection on interactive elements */
    .nav-link, .filter-btn, .cta-button, .submit-button {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Smooth scroll snap for sections */
    #content-overlay {
        scroll-snap-type: y proximity;
    }

    .section {
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }
}

/* Extra improvements for very small screens */
@media (max-width: 480px) {
    /* Hide scrollbar completely on small phones */
    ::-webkit-scrollbar {
        display: none;
    }

    html {
        scrollbar-width: none; /* Firefox */
        scroll-padding-top: 100px;
    }
}
