body {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* -------------------------------------------------- */
/* Animations */
/* -------------------------------------------------- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.8), 0 0 60px rgba(59, 130, 246, 0.3); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes matrix {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -30px, 0); }
    70% { transform: translate3d(0, -15px, 0); }
    90% { transform: translate3d(0, -4px, 0); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 5px #3b82f6,
            0 0 10px #3b82f6,
            0 0 15px #3b82f6,
            0 0 20px #3b82f6;
    }
    50% {
        text-shadow:
            0 0 2px #3b82f6,
            0 0 5px #3b82f6,
            0 0 8px #3b82f6,
            0 0 12px #3b82f6;
    }
}

@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* -------------------------------------------------- */
/* Layout & Visual System */
/* -------------------------------------------------- */
.cyber-grid {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

.glass-effect {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(59, 130, 246, 0.26);
}

.neon-border {
    border: 2px solid transparent;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9)) padding-box,
        linear-gradient(145deg, #3b82f6, #06b6d4, #8b5cf6) border-box;
}

.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Reusable animation helpers */
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-glow { animation: glow 3s ease-in-out infinite; }
.animate-slide-in-left { animation: slideInLeft 0.8s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.8s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out; }
.animate-pulse-slow { animation: pulse 2s ease-in-out infinite; }
.animate-spin-slow { animation: rotate 20s linear infinite; }
.animate-bounce-slow { animation: bounce 3s ease-in-out infinite; }
.animate-neon-pulse { animation: neonPulse 2s ease-in-out infinite; }

/* Background matrix + particles */
.matrix-rain {
    position: absolute;
    color: rgba(59, 130, 246, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrix 10s linear infinite;
}

.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

/* Progress bar */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transition: width 2s ease-in-out;
}

/* Cards */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35);
}

/* Typing cursor */
.typing-cursor {
    border-right: 2px solid #3b82f6;
    padding-right: 3px;
    animation: pulse 1s infinite;
}

/* Section entrance animation */
.section-enter {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.section-enter.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Code block styling */
.code-block {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #3b82f6;
}

/* Terminal-like sections */
.terminal {
    background: #000;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
}

/* Interactive cards */
.interactive-card {
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.interactive-card:hover {
    transform: rotateY(10deg) rotateX(10deg);
}

/* Timeline styling */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid #3b82f6;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6;
}

/* Achievement badge */
.achievement-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Statistics counter */
.stats-counter {
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(45deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tech grid */
.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.tech-item {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: rgba(59, 130, 246, 0.22);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.22);
}

/* Project filters */
.project-filter {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid #3b82f6;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Testimonial slider (if added later) */
.testimonial-slider {
    overflow: hidden;
    position: relative;
}

.testimonial-track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonial-card {
    min-width: 100%;
    padding: 2rem;
}

/* Blog preview (if added later) */
.blog-preview {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
}

/* Interactive demo terminal */
.interactive-demo {
    background: #000;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    color: #00ff00;
    min-height: 200px;
}

/* Mobile menu slide-in */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Parallax background hook (if used later) */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* View transition (for modern browsers) */
@view-transition {
    navigation: auto;
}

/* -------------------------------------------------- */
/* New responsive & polish additions */
/* -------------------------------------------------- */

/* Ensure images scale correctly */
img {
    max-width: 100%;
    height: auto;
}

/* Hero profile image */
.profile-image {
    border-radius: 999px;
    object-fit: cover;
}

/* Premium shadows */
.shadow-soft {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.shadow-strong {
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

/* Project cards always stretch nicely */
.project-card {
    min-height: 100%;
}

/* Matrix + particles performance optimization on small devices */
@media (max-width: 640px) {
    .matrix-rain,
    .floating-particle {
        display: none !important;
    }
}

/* Section spacing (clamp for all screen sizes) */
section {
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

/* Lock body scroll when mobile menu open */
body.menu-open {
    overflow: hidden;
}

/* Respect prefers-reduced-motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
