/* =========================================
   1. CSS Variables & Reset
   ========================================= */
:root {
    /* DARK MODE (Default) */
    --bg-color: #020617;
    /* Deep Slate */
    --text-main: #f8fafc;
    /* White/Off-white */
    --text-muted: #94a3b8;
    /* Light Gray */
    --primary: #06b6d4;
    /* Cyan */
    --primary-glow: rgba(6, 182, 212, 0.6);

    /* Glassmorphism Tokens (Dark) */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --nav-glass: rgba(2, 6, 23, 0.8);

    /* Fonts */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout */
    --container-width: 1200px;
    --section-spacing: 120px;
}

[data-theme="light"] {
    /* LIGHT MODE Overrides */
    --bg-color: #f0f9ff;
    /* Very light blue/white */
    --text-main: #0f172a;
    /* Dark Slate */
    --text-muted: #475569;
    /* Slate 600 */
    --primary: #0284c7;
    /* Darker Blue for contrast */
    --primary-glow: rgba(2, 132, 199, 0.4);

    /* Glassmorphism Tokens (Light) */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --nav-glass: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
}

/* Particle Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease-in-out;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. Utility Classes
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 1rem auto 0;
    border-radius: 2px;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    /* Faster */
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.glass-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px -10px var(--primary-glow);
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* =========================================
   3. Header & Navigation
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
}

.glass-nav {
    background: var(--nav-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--glass-border);
    border-radius: 50px;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
    /* Specific Gap Request */
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--primary-glow);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: transform 0.3s;
    /* Margin removed in favor of wrapper gap */
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    color: var(--primary);
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background: var(--text-main);
    transition: 0.3s;
}

/* =========================================
   4. Hero Section
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.greeting-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.08);
    color: var(--primary);
    border-radius: 30px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.name {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    /* Pop against particles */
}

.title {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.typing-text {
    color: var(--primary);
    font-weight: 600;
    margin-left: 0.5rem;
    border-right: 2px solid var(--primary);
    padding-right: 5px;
    text-shadow: 0 0 10px var(--primary-glow);
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.bio {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

/* Premium Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 30px;
    /* Pill shape for magnetic effect */
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 35px var(--primary-glow);
}

.btn-glass {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Hero Image with "Wow" Animation */
.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image {
    padding: 8px;
    border-radius: 50%;
    animation: floatImage 4s ease-in-out infinite, pulseGlow 3s infinite alternate;
}

.hero-image img {
    width: 360px;
    height: 360px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 20px -5px var(--primary-glow);
        border-color: rgba(6, 182, 212, 0.3);
    }

    100% {
        box-shadow: 0 0 50px 10px var(--primary-glow), 0 0 20px var(--primary);
        border-color: var(--primary);
    }
}

@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* =========================================
   5. Card Styles & Tilt
   ========================================= */
.service-card {
    text-align: center;
    padding: 2.5rem;
    /* Tilt is handled by JS but we add base transition */
    transform: perspective(1000px) translateZ(0);
}

.icon-box {
    width: 70px;
    height: 70px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    font-size: 1.8rem;
    transition: 0.15s ease-in-out;
}

.service-card:hover .icon-box {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 25px var(--primary-glow);
    transform: scale(1.1);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Projects */
.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    overflow: hidden;
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.tech-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0 5px 1rem 0;
}

.project-actions {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.05);
}

.btn-link {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    gap: 0.5rem;
    transition: 0.15s ease-in-out;
}

.btn-link:hover {
    padding-left: 5px;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.about-text h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.skill-category {
    margin-bottom: 2rem;
}

.skill-category h5 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags span {
    display: inline-block;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 8px;
    /* Slightly more rounded */
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.15s ease-in-out;
    backdrop-filter: blur(5px);
}

.skill-tags span:hover {
    color: #fff;
    /* White text on hover for better contrast */
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-3px) scale(1.05);
}

/* =========================================
   6. Contact Section
   ========================================= */
.contact-wrapper {
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
}

.contact-box {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    transition: 0.15s ease-in-out;
}

.contact-box:hover {
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px -5px var(--primary-glow);
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    /* Ensure wrapping on small screens */
    justify-content: center;
    gap: 15px;
    /* Specific request */
    margin-bottom: 3rem;
}

.social-icons a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.15s ease-in-out;
}

.social-icons a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 0 25px var(--primary-glow);
}

.cv-download-area {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* =========================================
   7. Responsiveness
   ========================================= */
@media screen and (max-width: 968px) {
    .container {
        width: 100%;
        padding: 0 1.5rem;
    }

    .name {
        font-size: 3rem;
    }

    .social-icons {
        gap: 15px;
    }
}

@media screen and (max-width: 768px) {
    .glass-nav {
        margin-top: 0;
        border-radius: 0;
        padding: 1rem 1.5rem;
        background: var(--bg-color);
        justify-content: space-between;
        gap: 1rem;
        /* Ensure gap between logo and nav-wrapper */
    }

    .nav-wrapper {
        gap: 1rem;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .theme-toggle {
        position: relative;
        z-index: 1001;
    }

    .nav-list {
        position: fixed;
        right: -100%;
        top: 75px;
        background: rgba(2, 6, 23, 0.98);
        border-left: 1px solid var(--glass-border);
        width: 75%;
        height: 100vh;
        flex-direction: column;
        padding: 3rem 2rem;
        transition: 0.3s;
    }

    .nav-list.active {
        right: 0;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}