@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary: #6c63ff;
    --primary-dark: #5a52d5;
    --primary-light: #8b85ff;
    --bg: #0f0f1a;
    --bg-alt: #16162a;
    --bg-card: #1e1e35;
    --text: #e2e2f0;
    --text-muted: #8888aa;
    --border: rgba(108, 99, 255, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --transition: 0.3s ease;
    --nav-height: 70px;
}

[data-theme="light"] {
    --bg: #f5f5ff;
    --bg-alt: #eeeeff;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #555577;
    --border: rgba(108, 99, 255, 0.25);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* ===== Utility ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-title span {
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.nav-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1100px;
    margin: 0 auto;
    gap: 3rem;
    position: relative;
    padding-top: var(--nav-height);
}

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

.hero-greeting {
    color: var(--primary);
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.hero-name {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    min-height: 2rem;
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.hero-socials {
    display: flex;
    gap: 1rem;
}

.hero-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all var(--transition);
}

.hero-socials a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 380px;
}

.avatar-ring {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    padding: 6px;
    position: relative;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7rem;
    color: var(--primary-light);
}

.blob {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    background: rgba(108, 99, 255, 0.12);
    z-index: 0;
    animation: morph 8s ease-in-out infinite alternate;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

@keyframes morph {
    0% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
    100% { border-radius: 40% 60% 45% 55% / 60% 40% 60% 40%; }
}

.scroll-down {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    margin-top: 3rem;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-text strong {
    color: var(--text);
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.info-card i {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    display: block;
}

.info-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

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

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.skill-category h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(108, 99, 255, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: 50px;
    padding: 0.3rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}

.skill-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.project-icon {
    width: 52px;
    height: 52px;
    background: rgba(108, 99, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
}

.project-body {
    flex: 1;
}

.project-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

.project-tags span {
    font-size: 0.75rem;
    color: var(--primary-light);
    background: rgba(108, 99, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.project-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color var(--transition);
}

.project-links a:hover {
    color: var(--primary);
}

.project-links a.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.projects-cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    width: 44px;
    height: 44px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.contact-item a,
.contact-item p {
    font-size: 0.95rem;
    color: var(--text);
    transition: color var(--transition);
}

.contact-item a:hover {
    color: var(--primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-status {
    font-size: 0.88rem;
    text-align: center;
    min-height: 1.2rem;
    color: var(--primary);
}

.form-status.error {
    color: #ff6b6b;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer strong {
    color: var(--primary);
}

.footer-copy {
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: calc(var(--nav-height) + 2rem);
    }

    .hero-image {
        max-width: 240px;
    }

    .avatar-ring {
        width: 200px;
        height: 200px;
    }

    .blob {
        width: 240px;
        height: 240px;
    }

    .hero-desc {
        margin: 0 auto 2rem;
    }

    .hero-buttons,
    .hero-socials {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 680px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        transform: translateY(-120%);
        transition: transform var(--transition);
        box-shadow: var(--shadow);
        border-top: 1px solid var(--border);
    }

    .nav-links.open {
        transform: translateY(0);
    }

    .hamburger {
        display: flex;
    }

    .section {
        padding: 70px 0;
    }

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

    .about-cards {
        grid-template-columns: 1fr;
    }

    .about-stats {
        justify-content: space-around;
    }
}
