/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    /* Cosmic Color Palette */
    --color-space-dark: #000000;
    --color-space-deep: #0a0a1a;
    --color-space-medium: #0f0f2a;
    --color-blue-primary: #3366ff;
    --color-blue-light: #4477ff;
    --color-blue-bright: #5588ff;
    --color-purple-primary: #6b3aff;
    --color-purple-light: #8855ff;
    --color-cyan-glow: #00d4ff;
    --color-white: #ffffff;
    --color-gray-light: #e0e0e0;
    --color-gray-medium: #a0a0a0;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Effects */
    --blur-glass: 10px;
    --transition-smooth: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-space-dark);
    color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Prevent Material Icons text flash before font loads */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
}

/* ========================================
   Static Gradient Background
   ======================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(180deg,
            #000000 0%,
            #0a0a1a 50%,
            #0f0f2a 100%);
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 94%;
    max-width: 1400px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar.hidden {
    transform: translateX(-50%) translateY(-150%);
    opacity: 0;
    pointer-events: none;
}

.navbar.scrolled {
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(51, 102, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 15, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(51, 102, 255, 0.3);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    gap: 3rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-white);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.logo:hover {
    color: var(--color-blue-bright);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--color-gray-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    font-size: 0.95rem;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-blue-bright);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: var(--color-white);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(51, 102, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 102, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(51, 102, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 102, 255, 0.15) 1px, transparent 1px);
    background-size: 100px 100px;
    background-position: center center;
    opacity: 0.5;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.hero-content {
    text-align: center;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
            rgba(51, 102, 255, 0.3) 0%,
            rgba(107, 58, 255, 0.2) 30%,
            transparent 70%);
    filter: blur(60px);
    animation: pulseGlow 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

.hero-title {
    color: var(--color-white);
    /* Fallback color */
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.gradient-text {
    color: var(--color-blue-bright);
    background: linear-gradient(135deg,
            var(--color-blue-bright),
            var(--color-purple-light),
            var(--color-cyan-glow));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}


.hero-subtitle {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-gray-light);
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700;
}

.hero-subtitle .highlight-word {
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg,
            var(--color-white) 0%,
            var(--color-blue-bright) 25%,
            var(--color-cyan-glow) 50%,
            var(--color-blue-bright) 75%,
            var(--color-white) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 1.5s linear infinite;
}

.hero-subtitle .highlight-word:hover {
    animation: shimmer 0.5s linear infinite;
    transform: scale(1.05);
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.hero-subtitle-secondary {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--color-gray-medium);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary,
.btn-secondary {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
    display: inline-block;
    position: relative;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: rgba(24, 24, 118, 0.27);
    border: 2px solid rgba(0, 0, 255, 0.344);
    color: var(--color-white);
    box-shadow: 0 0 30px rgba(0, 7, 27, 0.09);
}

.btn-primary:hover {
    background: rgba(0, 0, 112, 0.27);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.362);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-blue-primary);
}

.btn-secondary:hover {
    background: rgba(1, 8, 32, 0.145);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.362);
    transform: translateY(-2px);
}

.btn-primary.large {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
}



/* ========================================
   Scroll Indicator
   ======================================== */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-arrow {
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-blue-primary);
    border-radius: 6px;
    position: relative;
}

.scroll-arrow::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--color-blue-primary);
    border-radius: 50%;
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        top: 10px;
        opacity: 1;
    }

    100% {
        top: 30px;
        opacity: 0;
    }
}

/* ========================================
   Common Section Styles
   ======================================== */
.section {
    padding: var(--spacing-xl) 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    scroll-margin-top: 80px;
    /* Offset for fixed navbar */
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    color: var(--color-white);
    /* Fallback color */
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg,
            var(--color-white),
            var(--color-blue-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--color-gray-medium);
    margin-bottom: 3rem;
}

/* ========================================
   Glass Card Effect
   ======================================== */
.glass-card {
    background: rgba(15, 15, 42, 0.4);
    backdrop-filter: blur(var(--blur-glass));
    border: 1px solid rgba(51, 102, 255, 0.2);
    border-radius: 6px;
    padding: 2rem;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(0, 64, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.348);
    transform: translateY(-5px);
}

/* ========================================
   Services Section
   ======================================== */
.services-scroll-container {
    width: 100%;
    overflow: hidden;
    margin-top: 3rem;
    position: relative;
    padding: 15px 0;
}

.services-scroll-track {
    display: flex;
    gap: 2rem;
    animation: scroll-left 40s linear infinite;
    width: fit-content;
}

.services-scroll-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.service-card {
    text-align: center;
    padding: 2.5rem 2rem;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    color: var(--color-blue-bright);
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 48;
}

.service-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-white);
}

.service-desc {
    color: var(--color-gray-medium);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   Skills Section
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    text-align: center;
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-blue-bright), var(--color-cyan-glow), var(--color-purple-light), var(--color-blue-bright));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    background-size: 300% 300%;
    animation: gradientRotate 4s ease infinite;
}

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

.skill-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 10px 10px 10px rgba(51, 102, 255, 0.075);
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    color: var(--color-blue-bright);
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 48;
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 10px rgba(51, 102, 255, 0.3));
}

.skill-card:hover .skill-icon {
    transform: rotateY(360deg) scale(1.1);
    color: var(--color-cyan-glow);
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.6));
}

.skill-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-white);
    transition: color 0.3s ease;
}

.skill-card:hover .skill-title {
    color: var(--color-cyan-glow);
}

.skill-desc {
    color: var(--color-gray-medium);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   Projects Section
   ======================================== */
#projects {
    position: relative;
    padding-bottom: 6rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    padding: 0;
    overflow: hidden;
}

.project-image {
    height: 260px;
    background: linear-gradient(135deg,
            rgba(51, 102, 255, 0.2),
            rgba(107, 58, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(51, 102, 255, 0.2);
}

.project-placeholder {
    font-size: 5rem;
    color: var(--color-blue-bright);
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 48;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.project-content {
    padding: 1.25rem 1.5rem 1.1rem;
}

.project-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-white);
    line-height: 1.3;
}

.project-desc {
    color: var(--color-gray-medium);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    font-size: 0.825rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.tag {
    background: rgba(30, 35, 50, 0.6);
    color: rgba(186, 197, 254, 0.9);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(51, 102, 255, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: rgba(186, 197, 254, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
    position: relative;
}

.project-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: var(--transition-smooth);
}

.project-link:hover {
    color: var(--color-cyan-glow);
}

.project-link:hover::after {
    margin-left: 0.75rem;
}

/* ========================================
   Contact Section
   ======================================== */
.wave-divider {
    position: absolute;
    bottom: -100px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
    transform: rotate(180deg);
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(200% + 1.3px);
    height: 100px;
}

.wave-divider svg path:nth-child(1) {
    animation: wave-flow-1 15s linear infinite;
}

.wave-divider svg path:nth-child(2) {
    animation: wave-flow-2 20s linear infinite reverse;
}

@keyframes wave-flow-1 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes wave-flow-2 {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}



#contact {
    position: relative;
    overflow: hidden;
    padding-bottom: 2rem;
    background: rgba(0, 0, 0, 0);
}

#contact::before,
#contact::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 200%;
    height: 200%;
    background: transparent;
    transform: translateX(-50%);
}

#contact::before {
    bottom: -80%;
    border-radius: 45%;
    background: radial-gradient(circle, rgba(51, 102, 255, 0.15) 0%, transparent 60%);
    z-index: 0;
}

#contact::after {
    bottom: -80%;
    border-radius: 40%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 50%);
    z-index: 0;
}

#contact .container {
    position: relative;
    z-index: 10;
}

#contact .section-title {
    margin-top: 3rem;
}

.contact-intro {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--color-white);
    margin-bottom: 2rem;
    max-width: 800px;

    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

.contact-details {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--color-gray-light);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.highlight-text {
    color: var(--color-blue-bright);
    font-weight: 600;
    position: relative;
}

.contact-content {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.contact-icons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.contact-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    backdrop-filter: none;
    border: none;
    transition: all 0.4s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.contact-icon-link:hover {
    background: rgba(15, 15, 42, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(51, 102, 255, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.167);
}

.contact-icon-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-blue-bright), var(--color-cyan-glow), var(--color-purple-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
}



.contact-icon-link:hover::before {
    opacity: 1;
    animation: rotate-gradient 2s linear infinite;
}

@keyframes rotate-gradient {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.contact-icon-link i {
    font-size: 1.8rem;
    color: rgb(186, 197, 254);
    transition: all 0.3s ease;
}

.contact-icon-link:hover i {
    color: var(--color-white);
}

/* ========================================
   Footer
   ======================================== */
.copyright {
    width: 100%;
    text-align: center;
    padding: 2rem 0;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(51, 102, 255, 0.2);
    font-weight: 300;
    margin-top: 0;
}

.copyright p {
    font-size: 0.95rem;
    color: rgba(186, 197, 254, 0.8);
    font-family: var(--font-primary);
}

.copyright i {
    color: var(--color-blue-bright);
    margin-right: 8px;
    font-size: 18px;
}

.copyright i:hover {
    color: #4477ff;
    font-weight: 500;
}

.copyright span {
    font-family: Menlo, Monaco, 'Courier New', monospace;
}

.copyright span:hover {
    color: #5588ff;
    font-weight: 600;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 6rem 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        display: none;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-space-deep);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
            var(--color-blue-primary),
            var(--color-purple-primary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
            var(--color-blue-light),
            var(--color-purple-light));
}

/* ========================================
   Selection Styling
   ======================================== */
::selection {
    background: rgba(51, 102, 255, 0.3);
    color: var(--color-white);
}

::-moz-selection {
    background: rgba(51, 102, 255, 0.3);
    color: var(--color-white);
}