/* =========================================
   VARIABLES & SETUP (Dark and Light Modes)
   ========================================= */
:root {
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.dark-mode {
    --bg-primary: #04020a;
    --bg-secondary: #0a0618;
    --bg-card: #0d0920;
    --bg-input: #110c28;

    --text-primary: #ffffff;
    --text-secondary: #a19db3;

    --accent-color: #8b5cf6;
    --accent-hover: #a855f7;
    --accent-light: rgba(139, 92, 246, 0.2);

    --glow-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    --border-color: rgba(255, 255, 255, 0.05);

    --canvas-opacity: 1;
}

body.light-mode {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f3f4f6;

    --text-primary: #1f2937;
    --text-secondary: #4b5563;

    --accent-color: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: rgba(124, 58, 237, 0.1);

    --glow-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
    --border-color: rgba(0, 0, 0, 0.18);

    --canvas-opacity: 0.15;
    /* Fade out stars in light mode */
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.no-scroll {
    overflow: hidden;
}

/* Background Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: var(--canvas-opacity);
    transition: opacity 0.4s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    position: relative;
    z-index: 10;
}

.section-padding {
    padding: 100px 0;
}

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

.highlight {
    color: var(--accent-color);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

/* =========================================
   BUTTONS & LINKS
   ========================================= */
a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--glow-shadow);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* =========================================
   NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition);
}

.nav-backdrop.active {
    display: block;
    opacity: 1;
}

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

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.logo-name {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-links li a {
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--accent-color);
    font-weight: 600;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.theme-toggle:hover {
    color: var(--accent-color);
    transform: rotate(30deg);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 500;
    min-height: 2.2rem;
    /* Fix jumpiness of typing text */
}

.typing-text {
    font-style: italic;
    color: var(--accent-color);
}

.cursor {
    animation: blink 1s infinite;
    color: var(--accent-color);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.image-wrapper {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(to right, var(--bg-primary), var(--bg-card));
    border: 2px solid var(--accent-light);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 50px rgba(139, 92, 246, 0.1), 0 0 30px rgba(139, 92, 246, 0.15);
    position: relative;
    animation: float 6s ease-in-out infinite;
    z-index: 1;
}

.image-wrapper::before,
.image-wrapper::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 40% 60% 65% 35% / 40% 45% 55% 60%;
    background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-light));
    z-index: -1;
    animation: spin-oval 5s linear infinite;
    box-shadow: 0 0 25px var(--accent-color);
}

.image-wrapper::after {
    inset: -5px;
    border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
    animation: spin-oval 7s linear infinite reverse;
    opacity: 0.7;
}

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

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    filter: brightness(0.95);
    border: 4px solid var(--bg-primary);
    z-index: 2;
    position: relative;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* =========================================
   ABOUT SECTION
   ========================================= */
.about-container {
    display: flex;
    gap: 60px;
    margin-top: 50px;
}

.about-text {
    flex: 1;
}

.about-subtitle {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.about-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.about-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
    border-color: var(--accent-light);
}

.service-card {
    display: flex;
    gap: 20px;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-light);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.card-content h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   PROJECTS SECTION (Reusing Grid layout)
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--glow-shadow);
    border-color: var(--accent-color);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.project-info {
    padding: 25px;
    flex: 1;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tags span {
    font-size: 0.8rem;
    padding: 5px 12px;
    background-color: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* =========================================
   SKILLS SECTION
   ========================================= */
.filter-chips {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.chip {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-family: inherit;
}

.chip:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.chip.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.skill-card {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: block;
    /* Visible initially */
}

.skill-card:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.skill-name {
    font-weight: 600;
}

.skill-percentage {
    color: var(--accent-color);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-color);
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 50px;
}

.contact-container {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.info-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-card);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.info-text {
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.contact-form-wrapper {
    flex: 1.2;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.form-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.submit-btn {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
}

/* =========================================
   ANIMATIONS & REVEALS
   ========================================= */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s ease-out;
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s ease-out;
}

.reveal-fade {
    opacity: 0;
    transition: all 0.8s ease-out;
}

.reveal-active {
    opacity: 1;
    transform: translate(0);
}

/* =========================================
   MEDIA QUERIES
   ========================================= */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }

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

    .image-wrapper {
        width: 300px;
        height: 300px;
    }

    .about-container {
        flex-direction: column;
    }

    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        transition: right 0.4s ease;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: block;
        z-index: 101;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        justify-content: center;
    }

    .about-buttons {
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .image-wrapper {
        width: 250px;
        height: 250px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .contact-form-wrapper {
        padding: 25px 20px;
    }

    .project-info h3 {
        font-size: 1.1rem;
    }
}

@media (max-height: 600px) {
    .scroll-indicator {
        display: none;
    }
}