/* CSS Variables & Reset */
:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-cyan: #00f3ff;
    --accent-purple: #bd00ff;
    --gradient-main: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

/* Background Effects */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIwLjA1Ii8+PC9zdmc+');
    pointer-events: none;
    z-index: 0;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    top: -100px;
    left: -100px;
    animation: floating 10s infinite ease-in-out;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    bottom: -50px;
    right: -50px;
    animation: floating 12s infinite ease-in-out reverse;
}

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

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

    100% {
        transform: translate(0, 0);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.highlight {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    transition: padding 0.3s ease, background 0.3s ease;
}

/* Scrolled state */
.glass-nav.scrolled {
    padding: 1rem 5%;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    cursor: pointer;
}

.nav-logo {
    height: 50px;
    transition: height 0.3s ease;
}

.glass-nav.scrolled .nav-logo {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-main);
    transition: width 0.3s;
}

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
    /* Increased side padding for mobile */
    padding-top: 80px;
    /* Offset for fixed nav */
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.glitch {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1rem;
    position: relative;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.section-padding {
    padding: 6rem 1rem;
}

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

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

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

.icon-large {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.about-card p {
    color: var(--text-secondary);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.project-card {
    padding: 0;
    /* Remove default padding for image flush */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-image {
    height: 200px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
}

.color-1 {
    background: linear-gradient(45deg, #2b0042, #520088);
}

.color-2 {
    background: linear-gradient(45deg, #002b28, #005f59);
}

.color-3 {
    background: linear-gradient(45deg, #421e00, #884b00);
}

.project-card:hover .placeholder-img {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-tech span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    color: var(--accent-cyan);
}

.project-info p:not(.project-tech) {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-link {
    color: var(--text-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    color: var(--accent-cyan);
}

/* Contact */
.contact-container {
    max-width: 800px;
    text-align: center;
}

.contact-box {
    padding: 4rem 2rem;
}

.contact-box p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

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

.social-links {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide for now, script will handle toggle if needed or simple stack */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #000;
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        text-align: center;
        border-bottom: 1px solid var(--card-border);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .glitch {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Animations classes controlled by JS */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    padding: 1.5rem 3rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3), inset 0 0 20px rgba(0, 243, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    pointer-events: none;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-main);
    z-index: 1001;
    box-shadow: 0 0 10px var(--accent-purple);
    transition: width 0.1s linear;
}

/* Typewriter Effect */
/* Typewriter Effect (Desktop Only) */
@media (min-width: 769px) {
    .typing-text {
        border-right: 2px solid var(--accent-cyan);
        white-space: nowrap;
        overflow: hidden;
        animation: typing 4s steps(60, end), blink-caret 0.75s step-end infinite;
        display: inline-block;
        max-width: 100%;
    }
}

/* Mobile Subtitle Fade In */
@media (max-width: 768px) {
    .typing-text {
        border: none;
        white-space: normal;
        overflow: visible;
        width: auto;
        opacity: 0;
        animation: fadeInUpText 1s ease-out forwards;
        animation-delay: 0.5s;
    }

    @keyframes fadeInUpText {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-cyan)
    }
}

/* 3D Tilt Prerequisite */
.glass-card {
    transition: transform 0.1s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}