:root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #121214;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent-glow: rgba(99, 102, 241, 0.15);
}

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

body {
    font-family: 'Inter', 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(217, 70, 239, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    animation: meshFloat 30s ease-in-out infinite alternate;
}

@keyframes meshFloat {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(2deg); }
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-hover {
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.glass-hover:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

.nav-glass {
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.5s ease;
}

.nav-link, .nav-link-static {
    position: relative;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    padding: 0.25rem 0;
    cursor: pointer;
}
.nav-link:hover, .nav-link-static:hover {
    color: rgba(255, 255, 255, 0.8);
}
.nav-link.active {
    color: #ffffff;
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
}
.hero-glow.pink { background: #d946ef; top: -20%; right: -10%; }
.hero-glow.blue { background: #3b82f6; bottom: -20%; left: -10%; }

.title-premium {
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.15));
    letter-spacing: -0.04em;
}

.hero-rose {
    position: absolute;
    width: 1300px;
    height: 1300px;
    opacity: 0.08;
    pointer-events: none;
    bottom: -500px;
    left: 50%;
    transform: translateX(-50%);
    filter: grayscale(1) brightness(2.5) contrast(1.1);
    mix-blend-mode: color-dodge;
    transition: all 1s ease;
    z-index: 0;
}

#hero-section:hover .hero-rose {
    opacity: 0.12;
    bottom: -450px;
}

.mati-card-glow {
    box-shadow:
        0 -15px 40px -10px rgba(255, 255, 255, 0.15),
        0 20px 40px -10px rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mati-card-glow:hover {
    box-shadow:
        0 -25px 60px -5px rgba(255, 255, 255, 0.2),
        0 30px 60px -15px rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-5px);
}

.hero-rose img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes heroFloat {
    0% { transform: translate(-50%, -52%) rotate(0deg); }
    50% { transform: translate(-48%, -48%) rotate(3deg); }
    100% { transform: translate(-50%, -52%) rotate(0deg); }
}

.floating { animation: heroFloat 12s ease-in-out infinite; }

.badge-glow {
    box-shadow: 0 0 25px rgba(217, 70, 239, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    padding: 0.875rem 2.5rem;
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}
.btn-primary:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.15);
}
.btn-primary:active {
    transform: scale(0.97);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    padding: 0.875rem 2.5rem;
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}
.btn-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 2.5rem;
    padding: 2rem;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.glass-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.glass-input {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 1.25rem !important;
    padding: 1rem 1.5rem !important;
    color: #ffffff !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    outline: none !important;
}
.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.03) !important;
}

.glass-input select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1.5rem center !important;
    background-size: 1.2rem !important;
}
.glass-input option {
    background: #1a1a1e;
    color: #ffffff;
}

.glass-input textarea {
    resize: vertical;
    min-height: 120px;
}

.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(0px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    position: fixed;
    inset: 0;
}

.modal-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible;
    backdrop-filter: blur(15px);
}

.modal-box {
    background: rgba(18, 18, 20, 0.9);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

.glass-card-premium {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(100px);
    opacity: 0;
}

.modal-overlay.active .glass-card-premium {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.modal-overlay button.glass {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 1100;
    transition: all 0.3s ease;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
}

.modal-overlay button.glass:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portfolio-swiper-full {
    width: 100%;
    height: 100%;
}

.portfolio-swiper-full .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 640px) {
    .glass-card-premium {
        border-radius: 2rem 2rem 0 0;
        margin-bottom: 0 !important;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 2rem;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.portfolio-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.portfolio-item .img-secure {
    transition: transform 0.6s ease;
}
.portfolio-item:hover .img-secure {
    transform: scale(1.05);
}
.filter-btn {
    padding: 0.75rem 2rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
}
.filter-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}
.filter-btn.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.img-secure {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-nw {
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}
.btn-primary:hover .icon-nw {
    transform: rotate(-45deg) translate(-2px, -2px);
}

@media (max-width: 768px) {
    .max-w-7xl { padding: 0 1rem; }

    .nav-glass {
        position: sticky !important;
        top: 1rem !important;
        z-index: 1000 !important;
        width: calc(100% - 2rem) !important;
        margin: 1rem auto 0 !important;
    }

    #hero-section {
        margin-top: 1rem;
        padding: 3rem 1rem;
        min-height: auto;
        border-radius: 1.5rem;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(18, 18, 20, 0.98) !important;
    }
    .hero-rose {
        display: block !important;
        width: 100%;
        height: auto;
        bottom: -150px;
        opacity: 0.12;
        filter: grayscale(1) brightness(2) contrast(1.1);
    }
    .title-premium { font-size: 3.2rem !important; }

    .glass, .glass-card, .nav-glass, .modal-box {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(20, 20, 22, 0.98) !important;
    }

    * { transition-duration: 0.15s !important; }

    .btn-primary, .btn-glass {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        justify-content: center;
        width: 100%;
        display: flex;
        align-items: center;
    }

    body, html {
        overflow-x: visible !important;
        height: auto;
        position: relative;
        -webkit-overflow-scrolling: touch;
    }
}

/* Ensure immediate visibility on all devices so items never stay hidden waiting for JS */
@media (max-width: 1024px) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
