:root {
    --primary-light: #0f172a;
    --secondary-light: #f8fafc;
    --accent-light: #3b82f6;
    --text-light: #1e293b;
    --text-muted-light: #64748b;
    --surface-light: #ffffff;
    --surface-dark-light: #f1f5f9;
    --success-light: #10b981;
    --warning-light: #f59e0b;
    --error-light: #ef4444;
    --purple-light: #8b5cf6;
    --pink-light: #ec4899;

    --primary-dark: #f8fafc;
    --secondary-dark: #0f172a;
    --accent-dark: #60a5fa;
    --text-dark: #e2e8f0;
    --text-muted-dark: #94a3b8;
    --surface-dark: #0f172a;
    --surface-dark-dark: #1e293b;
    --success-dark: #34d399;
    --warning-dark: #fbbf24;
    --error-dark: #f87171;
    --purple-dark: #a78bfa;
    --pink-dark: #f472b6;
}

body {
    font-family: 'Calibre', 'Inter', sans-serif;
    background-color: var(--surface-light);
    color: var(--text-light);
    scroll-behavior: smooth;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark {
    --primary-light: var(--primary-dark);
    --secondary-light: var(--secondary-dark);
    --accent-light: var(--accent-dark);
    --text-light: var(--text-dark);
    --text-muted-light: var(--text-muted-dark);
    --surface-light: var(--surface-dark);
    --surface-dark-light: var(--surface-dark-dark);
    --success-light: var(--success-dark);
    --warning-light: var(--warning-dark);
    --error-light: var(--error-dark);
    --purple-light: var(--purple-dark);
    --pink-light: var(--pink-dark);
}

/* Component styles using CSS variables */
.bg-surface {
    background-color: var(--surface-light);
}

.bg-surface-dark {
    background-color: var(--surface-dark-light);
}

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

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

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

.border-surface {
    border-color: var(--surface-dark-light);
}

.bg-accent {
    background-color: var(--accent-light);
}

.text-accent {
    color: var(--accent-light);
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Floating animation */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-12px) rotate(2deg);
    }

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

.floating {
    animation: float 8s ease-in-out infinite;
}

/* Offcanvas menu */
.offcanvas-menu {
    position: fixed;
    top: 0;
    right: -100vw;
    width: 100vw;
    height: 100vh;
    background-color: var(--surface-light);
    z-index: 50;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 2rem 5%;
    overflow-y: auto;
}

.offcanvas-menu.open {
    transform: translateX(-100vw);
}

.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.offcanvas-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Search modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.search-modal.open {
    opacity: 1;
    pointer-events: all;
}

.search-container {
    background-color: var(--surface-light);
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    padding: 3rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-dark-light);
}

.search-modal.open .search-container {
    transform: translateY(0);
}

/* Project cards */
.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    color: var(--secondary-light);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(20px);
}

.project-card:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered animations */
.fade-in:nth-child(1) {
    animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
    animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
    animation-delay: 0.3s;
}

.fade-in:nth-child(4) {
    animation-delay: 0.4s;
}

.fade-in:nth-child(5) {
    animation-delay: 0.5s;
}

.fade-in:nth-child(6) {
    animation-delay: 0.6s;
}

/* Theme toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--surface-dark-light);
    color: var(--text-light);
}

.theme-toggle:hover {
    background-color: var(--accent-light);
    color: var(--secondary-light);
    transform: rotate(15deg) scale(1.1);
}

/* Navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-light);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Buttons */
.btn-primary {
    background-color: var(--accent-light);
    color: var(--secondary-light);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn-primary:hover:before {
    left: 100%;
}

/* Section styling */
.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-light), var(--purple-light));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.section-title:hover:after {
    width: 60px;
}

/* Hero text */
.hero-text {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Text gradients */
.text-gradient {
    background: linear-gradient(90deg, var(--accent-light), var(--purple-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.text-gradient:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-light), var(--purple-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.text-gradient:hover:after {
    transform: scaleX(1);
}

/* Skill pills */
.skill-pill {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    background-color: var(--surface-dark-light);
    color: var(--text-muted-light);
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.skill-pill:hover {
    background-color: var(--accent-light);
    color: var(--secondary-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.skill-pill:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.skill-pill:hover:before {
    left: 100%;
}

/* Avatar styling */
.avatar {
    width: 180px;
    height: 180px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid var(--surface-light);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar:hover {
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Contact form */
.contact-input {
    background-color: var(--surface-light);
    border: 1px solid var(--surface-dark-light);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
}

.contact-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Floating elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
    z-index: 0;
    animation: float 15s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-dark-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-light);
}

/* Cursor effects */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent-light);
    mix-blend-mode: multiply;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    opacity: 0.3;
    transition: transform 0.1s ease;
}

@media (max-width: 768px) {
    .cursor-follower {
        display: none !important;
    }
}

/* Dark mode specific adjustments */
body.dark .neu-light {
    box-shadow: 8px 8px 16px #0d121f,
        -8px -8px 16px #1a2237;
}

body.dark .project-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
}

/* Particle background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background-color: var(--accent-light);
    opacity: 0.2;
    animation: float 15s linear infinite;
}

/* Animated gradient border */
.gradient-border {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.gradient-border:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-light), var(--purple-light), var(--pink-light));
    z-index: -1;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gradient-border:hover:before {
    opacity: 1;
    animation: gradientRotate 3s linear infinite;
}

@keyframes gradientRotate {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-text {
        font-size: 2.75rem;
    }

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

    .avatar {
        width: 140px;
        height: 140px;
    }
}

body.loading {
    cursor: none;
}

.cursor-loader {
    position: fixed;
    width: 24px;
    height: 24px;
    border: 3px solid var(--accent-light);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.7;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.social-icon {
    @apply w-10 h-10 flex items-center justify-center rounded-full bg-gray-100 dark:bg-gray-700 text-muted hover:bg-blue-100 dark:hover:bg-blue-900/50 hover:text-blue-500 dark:hover:text-blue-400 transition-all duration-300;
}

@keyframes pulseScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

@keyframes waveFlag {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    75% {
        transform: rotate(-5deg);
    }
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.4s ease-out;
    transition: all 0.3s ease-in-out;
}

/* Grid pattern background */
.bg-grid-pattern {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.2) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Gradient radial */
.bg-gradient-radial {
    background-image: radial-gradient(circle, var(--tw-gradient-from), var(--tw-gradient-to));
}

/* Prose styling */
.prose {
    line-height: 1.75;
}

.prose h3 {
    margin-top: 2em;
}

.prose ul {
    margin-top: 1em;
    margin-bottom: 1em;
}