/* Main Styles */
:root {
    --primary-black: #00000066;
    --secondary-black: #0a0a0a94;
    --accent-white: #ffffff;
    --accent-gray: #1a1a1a;
    --text-light: #ffffff;
    --text-muted: #999999;
    --border-gray: #333333;
    --gradient-bw: linear-gradient(135deg, #000000 0%, #2d2d2d 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Bebas Neue', 'Oswald', 'Impact', 'Arial Black', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--primary-black);
    overflow-x: hidden;
    letter-spacing: 0.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -999;
    background: var(--primary-black);
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(50px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(50px) saturate(200%) brightness(1.1);
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
                0 1px 0 0 rgba(255, 255, 255, 0.05), 
                0 10px 30px rgba(0, 0, 0, 0.3);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-white);
    letter-spacing: 3px;
    font-family: 'Bebas Neue', sans-serif;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 50px;
    align-items: center;
}

/* Mobile Nav Toggle (hidden desktop) */
.nav-toggle {
    display: none;
    background: var(--primary-black);
    border: 2px solid var(--accent-white);
    color: var(--accent-white);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 0;
    position: relative;
    font: inherit;
    line-height: 1;
    transition: all .3s ease;
}
.nav-toggle:focus-visible { outline: 2px solid var(--accent-white); outline-offset: 4px; }
.nav-toggle .bar {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--accent-white);
    margin: 6px 0;
    transition: transform .4s ease, opacity .4s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Compact top-bar navigation (mobile) */
@media (max-width: 900px) {
    .nav-toggle { 
        display: block; 
        margin-left: auto; 
        order: 2; 
    }
    nav { 
        flex-wrap: wrap; 
    }
    /* Horizontal sliding bar under header */
    nav ul {
        flex: 1 0 100%;
        order: 3; /* force below logo + toggle */
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 18px;
        background: var(--secondary-black);
        border-top: 2px solid var(--accent-white);
        border-bottom: 2px solid var(--accent-white);
        padding: 0 14px;
        margin-top: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scroll-behavior: smooth;
        white-space: nowrap;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        max-height: 0; /* collapsed */
        opacity: 0;
        pointer-events: none;
        transition: max-height .35s ease, opacity .35s ease;
    }
    nav ul::-webkit-scrollbar { display: none; }
    nav ul.open { 
        max-height: 70px; 
        opacity: 1; 
        pointer-events: auto; 
        cursor: grab;
    }
    nav ul li a { 
        font-size: 0.95rem; 
        padding: 10px 16px; 
        display: inline-block; 
        letter-spacing: 1px; 
        border: none; 
        min-width: max-content;
        flex-shrink: 0;
        white-space: nowrap;
        cursor: pointer;
        user-select: none;
    }
    /* Hide extra nav items on mobile */
    nav ul li:not(.mobile-visible) { display: none; }
    .nav-indicator { display: none; }
}

nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    position: relative;
    transition: color 0.3s;
    text-transform: uppercase;
}

nav ul li a:hover {
    color: var(--text-muted);
}

/* Content Sections */
.content-section {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(60px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(60px) saturate(200%) brightness(1.1);
    padding: 60px;
    margin: 40px 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
                0 1px 0 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
    overflow: visible;
}

.content-section:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
                0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(70px) saturate(220%) brightness(1.15);
    -webkit-backdrop-filter: blur(70px) saturate(220%) brightness(1.15);
}

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

h1, h2, h3 {
    color: var(--text-light);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'Bebas Neue', sans-serif;
}

h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: var(--accent-white);
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.2), 0 0 30px rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-size: 1.1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeInScale 0.5s ease-out backwards;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 1px 0 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

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

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    filter: grayscale(100%) contrast(120%);
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: grayscale(0%) contrast(100%);
}

.gallery-item-info {
    padding: 20px;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    color: var(--text-light);
    letter-spacing: 2px;
}

.gallery-item-info p {
    margin: 0;
    color: var(--accent-white);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px;
}

/* Modal/Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(60px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(60px) saturate(180%) brightness(1.05);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: 3% auto;
    max-width: 90%;
    max-height: 90vh;
    text-align: center;
    animation: slideIn 0.4s ease;
}

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

.modal-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.modal-info {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(50px) saturate(180%) brightness(1.1);
    -webkit-backdrop-filter: blur(50px) saturate(180%) brightness(1.1);
    padding: 30px;
    margin-top: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-info.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.modal-info.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.modal-info h2 {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 2.5rem;
}

.modal-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--text-light);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.close:hover,
.close:focus {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-black);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2), 0 1px 0 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    margin: 0;
    user-select: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 400;
    z-index: 1002;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-black);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2), 0 1px 0 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

/* Modal Image Animation */
#modalImage {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#modalImage.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

#modalImage.fade-in {
    opacity: 1;
    transform: scale(1);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateX(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Filter Options */
.filter-controls {
    margin: 30px 0;
    text-align: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 28px;
    margin: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Bebas Neue', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    border-radius: 50%;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--primary-black);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2), 0 1px 0 0 rgba(255, 255, 255, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { 
        font-size: 2rem;
        text-align: center;
        word-wrap: break-word;
        padding: 0 10px;
        hyphens: none;
        overflow-wrap: normal;
        line-height: 1.1;
    }
    .content-section { 
        padding: 30px 20px;
        text-align: center;
    }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
    .gallery-item img { height: 200px; }
    
    /* Fix grid overflow on mobile */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 10px;
        overflow-x: hidden;
    }
    
    /* Professional works page grid - stack on mobile */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Ensure buttons don't overflow */
    .btn {
        font-size: 1rem;
        padding: 12px 24px;
        word-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    
    .modal-nav {
        font-size: 35px;
        padding: 15px;
        width: 50px;
        height: 50px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }

    .close {
        right: 20px;
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
}

/* Skills/Tags - Static Grid Layout (NO SCROLLING) */
.skills-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px;
    margin: 30px 0;
    overflow: visible !important;
    white-space: normal !important;
    width: 100% !important;
    position: relative !important;
}

/* Remove any wrapper conflicts */
.skills-wrapper {
    display: none !important;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--accent-white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.skill-tag:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-black);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2), 0 1px 0 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-white);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-white);
    transition: left 0.5s;
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover {
    color: var(--primary-black) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.25), 0 1px 0 0 rgba(255, 255, 255, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

/* Portfolio Card Hover Effects */
.portfolio-card {
    will-change: transform;
}

.portfolio-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 60px rgba(0, 255, 204, 0.3) !important;
}

.portfolio-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg) !important;
}

/* Portfolio Image Animations */
.portfolio-image {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease !important;
    will-change: transform;
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.1) !important;
    filter: brightness(1.1) !important;
}

/* Button hover only when directly hovering the button */
.portfolio-btn {
    pointer-events: auto !important;
}

.portfolio-btn:hover {
    color: var(--primary-black) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.25), 0 1px 0 0 rgba(255, 255, 255, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-btn:hover::before {
    left: 0 !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* ======================
   NAVIGATION STYLES WITH FLOWING INDICATOR
   ====================== */
.nav-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 3px;
    background: var(--accent-white);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

nav ul {
    position: relative;
}

nav ul li a {
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ======================
   SCROLL REVEAL ANIMATIONS
   ====================== */
.reveal-item {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for multiple items */
.reveal-item:nth-child(1) { transition-delay: 0s; }
.reveal-item:nth-child(2) { transition-delay: 0.1s; }
.reveal-item:nth-child(3) { transition-delay: 0.2s; }
.reveal-item:nth-child(4) { transition-delay: 0.3s; }
.reveal-item:nth-child(5) { transition-delay: 0.4s; }
.reveal-item:nth-child(6) { transition-delay: 0.5s; }

/* ======================
   PARTICLES CANVAS
   ====================== */
#particles-canvas {
    opacity: 0.4;
}

/* ======================
   ENHANCED BACKGROUNDS
   ====================== */
.animated-bg {
    background: radial-gradient(ellipse at top, #0a0a0a 0%, #000000 100%);
}

/* ======================
   CAROUSEL STYLES - Professional Slide Transition
   ====================== */

/* Carousel Wrapper - Main Container */
.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 100px auto;
    padding: 250px 0 250px 0;
    overflow: visible;
    z-index: 10;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
    transform-style: preserve-3d;
    overflow: visible;
    z-index: 10;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    max-width: 700px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}

/* Active card - front and center with 3D hover effect */
.carousel-slide.position-0 {
    transform: translate(-50%, -50%) translateY(0) translateZ(50px) scale(1);
    opacity: 1;
    z-index: 30;
    filter: blur(0px) brightness(1);
    visibility: visible;
}

/* Next card - in deck below, ready to slide on top */
.carousel-slide.position-1 {
    transform: translate(-50%, -50%) translateY(20px) translateZ(0px) scale(0.95);
    opacity: 0;
    z-index: 20;
    pointer-events: none;
    filter: blur(0px) brightness(0.7);
    visibility: hidden;
}

/* Third card - further back in deck */
.carousel-slide.position-2 {
    transform: translate(-50%, -50%) translateY(35px) translateZ(-30px) scale(0.92);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    filter: blur(0px) brightness(0.5);
    visibility: hidden;
}

/* Previous card - sliding off to the side and down */
.carousel-slide.position-exit {
    transform: translate(-50%, -50%) translateX(-80%) translateY(40%) translateZ(-100px) scale(0.8) rotateZ(-10deg);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    filter: blur(3px) brightness(0.3);
    visibility: visible;
}

/* Cards entering - coming from bottom of deck */
.carousel-slide.position-enter {
    transform: translate(-50%, -50%) translateY(50px) translateZ(-50px) scale(0.9);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    filter: blur(1px) brightness(0.4);
    visibility: visible;
}

/* Ensure inner cards stay centered without any additional transforms */
.carousel-slide.position-1 .carousel-card,
.carousel-slide.position-2 .carousel-card {
    margin-left: auto;
    margin-right: auto;
}

.carousel-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: box-shadow 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0px) scale3d(1, 1, 1);
    transform-style: preserve-3d;
    position: relative;
}

/* Only allow 3D transforms on the active card */
.carousel-slide.position-0 .carousel-card {
    transition: transform 0.2s ease-out, box-shadow 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Lock other cards in place */
.carousel-slide.position-1 .carousel-card,
.carousel-slide.position-2 .carousel-card,
.carousel-slide.position-exit .carousel-card,
.carousel-slide.position-enter .carousel-card {
    transform: none !important;
}

.carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.carousel-slide.position-0 .carousel-card {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.carousel-slide.position-0 .carousel-card::before {
    opacity: 1;
}

/* Hide content of cards below the top card */
.carousel-slide.position-1 .carousel-card::after,
.carousel-slide.position-2 .carousel-card::after,
.carousel-slide.position-enter .carousel-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 100;
    pointer-events: none;
}

.carousel-card-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.95;
}

.carousel-slide.position-0 .carousel-card img {
    transform: scale(1.03);
    opacity: 1;
}

.carousel-info {
    padding: 35px 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-info h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    text-transform: uppercase;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.carousel-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
}

/* Navigation Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 20px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 0.9);
    width: 24px;
    border-radius: 4px;
}

.carousel-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Responsive Carousel Adjustments */
@media (max-width: 1024px) {
    .carousel-wrapper {
        max-width: 700px;
    }

    .carousel-slide {
        max-width: 600px;
    }
    
    .carousel-track {
        height: 500px;
    }
    
    .carousel-card-image {
        height: 300px;
    }
    
    .carousel-info {
        padding: 25px 30px;
    }
    
    .carousel-info h3 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .carousel-wrapper {
        max-width: 100%;
        height: 420px;
        padding: 0 20px;
    }

    .carousel-slide {
        max-width: 100%;
        height: 380px;
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                    opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .carousel-card {
        padding: 25px;
    }

    .carousel-card img {
        height: 220px;
        max-width: 320px;
    }

    .carousel-info h3 {
        font-size: 1.6rem;
    }

    .carousel-info p {
        font-size: 1rem;
    }

    .carousel-slide.position-1 {
        transform: translate(-50%, -50%) translate3d(20px, 10px, -30px) scale(0.94) rotateY(-3deg);
    }

    .carousel-slide.position-2 {
        transform: translate(-50%, -50%) translate3d(40px, 20px, -60px) scale(0.88) rotateY(-6deg);
    }

    .carousel-slide.position-exit {
        transform: translate(-50%, -50%) translate3d(-100%, -15px, -90px) scale(0.85) rotateY(10deg);
    }

    .carousel-slide.position-enter {
        transform: translate(-50%, -50%) translate3d(100%, 30px, -90px) scale(0.82) rotateY(-10deg);
    }
}

/* ======================
   CONTACT FORM STYLES
   ====================== */

/* Contact Form Input Styles */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--primary-black);
    border: 2px solid var(--border-gray);
    color: var(--text-light);
    font-size: 1rem;
    border-radius: 0px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-white);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.contact-form input:hover,
.contact-form textarea:hover {
    border-color: var(--text-muted);
}

.contact-form label {
    display: block;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

.form-message {
    padding: 15px;
    border-radius: 0px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 15px;
    display: none;
}

.form-message.success {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00;
}

.form-message.error {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    color: #ff0000;
}

/* Contact Links Hover Effects */
#contact a {
    transition: all 0.3s ease;
    text-decoration: none;
    border-bottom: 2px solid var(--accent-white);
}

#contact a:hover {
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border-bottom-color: var(--text-light);
}

/* ======================
   HERO SECTION ANIMATIONS
   ====================== */

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* ======================
   UTILITY CLASSES
   ====================== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }
.p-4 { padding: 40px; }
.p-5 { padding: 50px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Responsive grid */
@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ======================
   MOBILE TOUCH INTERACTIONS
   ====================== */

/* Use :active for mobile touch feedback instead of :hover */
@media (hover: none) and (pointer: coarse) {
    /* Buttons - tap feedback */
    .btn:active {
        transform: translateY(-5px) scale(0.98);
        box-shadow: 0 15px 50px rgba(255, 255, 255, 0.2);
    }
    
    /* Portfolio cards - tap to activate */
    .portfolio-card:active {
        transform: translateY(-15px);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    }
    
    .portfolio-card:active .portfolio-image {
        transform: scale(1.1);
    }
    
    /* Content sections - tap feedback */
    .content-section:active {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    }
    
    /* Carousel dots - larger touch target */
    .carousel-dot {
        width: 12px;
        height: 12px;
        margin: 0 6px;
    }
    
    .carousel-dot:active {
        background: rgba(255, 255, 255, 0.6);
        transform: scale(1.3);
    }
    
    /* Skill tags - tap feedback */
    .skill-tag:active {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
    }
    
    /* Gallery items - tap to activate */
    .gallery-item:active {
        transform: scale(1.05);
    }
    
    /* Navigation links - tap feedback */
    nav ul li a:active {
        color: var(--accent-white);
        transform: translateY(-2px);
    }
    
    /* Filter buttons - tap feedback */
    .filter-btn:active {
        background: var(--accent-white);
        color: var(--primary-black);
        transform: scale(0.95);
    }
    
    /* Portfolio button - tap feedback */
    .portfolio-btn:active {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Keep carousel 3D effect but reduce speed */
    .carousel-card {
        transition: transform 0.1s ease-out !important;
    }
}

/* Optimize for touch devices */
@media (hover: none) {
    /* Remove hover-only pseudo-elements on touch devices */
    .btn::before,
    .portfolio-btn::before,
    .filter-btn::before {
        display: none;
    }
    
    /* Simplify animations for better performance */
    .carousel-card {
        transition: transform 0.3s ease-out;
    }
}

/* ======================
   THREE.JS ENHANCEMENTS
   ====================== */

/* 3D Canvas Container */
#three-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -998;
    pointer-events: none;
}

/* 3D Logo Enhancement */
.nav-logo {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 50px;
}

/* Skills Globe Container */
#skills-globe-container {
    width: 100%;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    position: relative;
}

#skills-globe-container canvas {
    cursor: grab;
}

#skills-globe-container canvas:active {
    cursor: grabbing;
}

/* 3D Card Effects */
.carousel-card,
.portfolio-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

/* Model Viewer Container */
.model-viewer-container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    border: 3px solid var(--border-gray);
    border-radius: 8px;
    overflow: hidden;
    background: var(--secondary-black);
}

.model-viewer-container canvas {
    display: block;
    width: 100%;
    height: 400px;
}

/* Loading indicator for 3D content */
.three-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-white);
    font-size: 1.2rem;
    z-index: 10;
}

/* Enhance carousel cards with 3D depth */
.carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.carousel-card:hover::before {
    opacity: 1;
}

/* Responsive 3D Effects */
@media (max-width: 768px) {
    #skills-globe-container {
        min-height: 400px;
    }
    
    .model-viewer-container canvas {
        height: 300px;
    }
    
    /* Reduce 3D card effects on mobile for performance */
    .carousel-card,
    .portfolio-card {
        transform-style: flat;
    }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    #three-bg-canvas {
        display: none;
    }
    
    .carousel-card,
    .portfolio-card {
        transform-style: flat !important;
    }
}

