:root {
    --primary: #6366f1;
    --secondary: #a855f7;
    --accent: #ec4899;
    --bg-light: #f8fafc;
    --text-light: #0f172a;
    --card-light: rgba(255, 255, 255, 0.7);
    
    --bg-dark: #020617;
    --text-dark: #f8fafc;
    --card-dark: rgba(30, 41, 59, 0.7);
    
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --card-bg: var(--card-dark);
    --nav-bg: rgba(2, 6, 23, 0.8);
}

[data-theme='light'] {
    --bg: var(--bg-light);
    --text: var(--text-light);
    --card-bg: var(--card-light);
    --nav-bg: rgba(248, 250, 252, 0.8);
}

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

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

/* --- Animated Background --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.6;
}

.bg-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 50%;
    animation: move 20s infinite alternate;
}

@keyframes move {
    from { transform: translate(-10%, -10%) rotate(0deg); }
    to { transform: translate(110%, 110%) rotate(360deg); }
}

/* --- Navbar --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

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

.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero .typed-text {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    min-height: 1.6em;
}

.hero-btns {
    margin-top: 2.5rem;
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5);
}

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

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

.section-action {
    margin-top: 3rem;
    text-align: center;
}

/* --- Sections General --- */
section {
    padding: 100px 10%;
}

.projects-page {
    padding-top: 90px;
    min-height: 100vh;
}

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

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 10px auto;
    border-radius: 2px;
}

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

.skill-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.skill-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

/* --- Project Cards (Flexbox) --- */
.projects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.project-card {
    flex: 1 1 350px;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    transform-style: preserve-3d;
}

.project-img {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: var(--transition);
}

.project-img-contain {
    height: 260px;
    background-color: #05050a;
    background-size: contain;
    background-position: center;
}

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

.project-content {
    padding: 1.5rem;
}

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

.tag {
    font-size: 0.7rem;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-weight: 600;
}

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

.project-links a {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.cert-card {
    position: relative;
    text-align: left;
    padding: 1.5rem;
}

.cert-link-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text);
    opacity: 0.75;
    transition: var(--transition);
}

.cert-link-icon:hover {
    color: var(--primary);
    opacity: 1;
    transform: translateY(-2px);
}

/* --- Blogs & Certs --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Contact Form --- */
.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

input, textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    section { padding: 80px 5%; }
}
