:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #22d3ee;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="light"] {
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(99, 102, 241, 0.1);
}

[data-bs-theme="dark"] {
    --body-bg: #0b1120;
    --card-bg: #111827;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --nav-bg: rgba(11, 17, 32, 0.9);
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(99, 102, 241, 0.2);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    padding-top: 76px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, .display-1, .display-2, .display-3, .display-4, .display-5 {
    font-family: 'Space Grotesk', sans-serif;
}

.glass-nav {
    background: var(--nav-bg) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.navbar-brand .brand-accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: var(--gradient);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
}

.btn-theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

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

/* Hero */
.hero-section {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.profile-image-wrapper {
    position: relative;
    display: inline-block;
}

.profile-image {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border: 4px solid transparent;
    background: var(--gradient) border-box;
    box-shadow: var(--shadow);
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
}

.typing-text {
    color: var(--primary);
    font-weight: 700;
    border-right: 3px solid var(--primary);
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: rgba(99, 102, 241, 0.3);
}

.section-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.text-muted { color: var(--text-muted) !important; }

/* Skills */
.skill-bar {
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 50px;
    transition: width 1.5s ease;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.45rem;
    top: 0.5rem;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--body-bg);
    box-shadow: 0 0 0 3px var(--primary);
}

/* Project Cards */
.project-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

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

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-overlay {
    position: relative;
    overflow: hidden;
}

.tech-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.15rem;
}

/* Testimonials */
.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 0;
    left: 1rem;
    line-height: 1;
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Contact */
.contact-form .form-control,
.contact-form .form-select {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.contact-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* Footer */
.footer-section {
    background: var(--card-bg);
    border-top: 1px solid var(--glass-border);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: var(--transition);
}

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

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary);
    color: white;
}

.page-hero {
    background: var(--card-bg);
    border-bottom: 1px solid var(--glass-border);
}

.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 14px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.blog-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}


/* Site body & mesh background */
.site-body {
    background-color: var(--body-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(34, 211, 238, 0.06), transparent);
    background-attachment: fixed;
}

.bg-section {
    background: rgba(99, 102, 241, 0.03);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

[data-bs-theme="dark"] .bg-section {
    background: rgba(99, 102, 241, 0.05);
}

/* Brand */
.brand-logo {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
}

/* Hero improvements */
.hero-greeting {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.profile-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -12px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.25;
    filter: blur(24px);
    z-index: -1;
}

.profile-ring {
    padding: 4px;
    background: var(--gradient);
    border-radius: 50%;
    display: inline-block;
}

.profile-ring .profile-image {
    border: none;
    border-radius: 50%;
    animation: none;
}

/* Page hero */
.page-hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08), transparent 55%);
    pointer-events: none;
}

.page-hero {
    background: var(--card-bg);
    border-bottom: 1px solid var(--glass-border);
}

/* Contact page */
.contact-section {
    position: relative;
}

.contact-info-card,
.contact-form-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    height: 100%;
}

[data-bs-theme="dark"] .contact-info-card,
[data-bs-theme="dark"] .contact-form-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.contact-info-item:hover {
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateX(4px);
    color: inherit;
}

.contact-info-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border-radius: 12px;
    font-size: 1.25rem;
}

.contact-info-icon.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
}

.contact-form .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

/* Alerts */
main > .alert {
    max-width: 1140px;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 12px;
}

/* Section spacing */
section.py-5 {
    position: relative;
}

/* Project card polish */
.project-card .p-4 {
    padding: 1.5rem !important;
}

.project-card h5 {
    font-size: 1.1rem;
}

/* Testimonial polish */
.testimonial-card {
    transition: var(--transition);
}

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

/* Footer polish */
.footer-section h5, .footer-section h6 {
    font-family: 'Space Grotesk', sans-serif;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.25);
}

@media (max-width: 768px) {
    .profile-image { width: 240px; height: 240px; }
    .section-title { font-size: 2rem; }
    .hero-section { text-align: center; }
}
