/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Greeting Animation */
.greeting-wrapper {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.greeting-container {
    display: inline-flex;
    position: relative;
    color: var(--accent-color);
    display: inline-block;
    min-width: 120px;
    height: 1.2em;
    position: relative;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    vertical-align: middle;
    perspective: 1000px;
}

.greeting-text {
    position: relative;
    display: inline-block;
    transition: opacity 0.5s ease;
    text-align: center;
    min-width: 120px;
}

.greeting-lang {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    font-size: 0.6rem;
    opacity: 0.7;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-align: center;
    width: max-content;
}

/* Dust Effect */
@keyframes dustOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(2px);
    }
}

@keyframes dustIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.dust-out {
    animation: dustOut 0.6s ease-out forwards;
    position: relative;
}

.dust-in {
    animation: dustIn 0.6s ease-out forwards;
}

/* Animated Background Elements */
.bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    z-index: -1;
    will-change: transform;
    transition: transform 0.5s ease-out;
}

.shape-1 {
    width: 350px;
    height: 350px;
    background: linear-gradient(45deg, #1a237e, #0d47a1);
    top: 10%;
    left: 5%;
    animation: float1 20s ease-in-out infinite;
    opacity: 0.6;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(45deg, #0d47a1, #1a237e);
    bottom: 10%;
    right: 5%;
    animation: float2 25s ease-in-out infinite;
    opacity: 0.5;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #1a237e, #0d47a1);
    top: 50%;
    left: 30%;
    animation: float3 22s ease-in-out infinite reverse;
    opacity: 0.4;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #0d47a1, #1a237e);
    top: 70%;
    left: 70%;
    animation: float4 28s ease-in-out infinite;
    opacity: 0.45;
}

.shape-5 {
    width: 400px;
    height: 400px;
    background: linear-gradient(45deg, #1a237e, #0d47a1);
    top: 20%;
    right: 20%;
    animation: float5 30s ease-in-out infinite reverse;
    opacity: 0.4;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, 30px) rotate(5deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-40px, -20px) rotate(-5deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(25px, -25px) rotate(7deg); }
}

@keyframes float4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 30px) rotate(-7deg); }
}

@keyframes float5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(40px, 20px) rotate(10deg); }
}

/* Particles.js container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Ensure content stays above background */
.hero, .scrolling-banner, section {
    position: relative;
    z-index: 1;
}

/* Grid Lines */
.grid-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(93, 156, 236, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 156, 236, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    opacity: 0.3;
    animation: gridMove 120s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(-50%) translateX(-50%);
    }
}

/* Floating Circles */
.floating-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.15;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #5d9cec, transparent 70%);
    top: -100px;
    left: -100px;
    animation: floatCircle1 25s ease-in-out infinite alternate;
}

.circle-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #a78bfa, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation: floatCircle2 30s ease-in-out infinite alternate-reverse;
}

.circle-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #66d9e8, transparent 70%);
    top: 50%;
    right: 10%;
    animation: floatCircle3 20s ease-in-out infinite alternate;
}

@keyframes floatCircle1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

@keyframes floatCircle2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

@keyframes floatCircle3 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -50px); }
    100% { transform: translate(0, 0); }
}

/* Animated Grid */
.animated-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 24%, rgba(93, 156, 236, 0.05) 25%, rgba(93, 156, 236, 0.05) 26%, transparent 27%, transparent 74%, rgba(93, 156, 236, 0.05) 75%, rgba(93, 156, 236, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(transparent 24%, rgba(93, 156, 236, 0.05) 25%, rgba(93, 156, 236, 0.05) 26%, transparent 27%, transparent 74%, rgba(93, 156, 236, 0.05) 75%, rgba(93, 156, 236, 0.05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    z-index: -2;
    opacity: 0.5;
    animation: gridPulse 10s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Hero Section Background */
.hero {
    position: relative;
    overflow: hidden;
    background: #000000;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(20, 20, 20, 0.8) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(10, 10, 10, 0.8) 0%, transparent 40%);
    z-index: 0;
    animation: gradientPulse 30s ease infinite;
}

@keyframes gradientPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.floating-element.circle {
    border-radius: 50%;
}

.floating-element.square {
    border-radius: 2px;
    transform-origin: center;
}

/* Interactive Particles */
.interactive-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 0.1s ease-out, opacity 0.3s ease-out;
}

/* Connection Points and Lines */
.connecting-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.connection-point {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform, opacity;
    transition: all 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.2; }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(10px, -15px) scale(1.05) rotate(2deg);
    }
    50% {
        transform: translate(-15px, 10px) scale(0.95) rotate(-2deg);
    }
    75% {
        transform: translate(15px, 15px) scale(1.02) rotate(1deg);
    }
}

/* Subtle Noise Texture */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
    z-index: -2;
    animation: noise 0.2s infinite;
}

@keyframes noise {
    0% { opacity: 0.09; }
    50% { opacity: 0.11; }
    100% { opacity: 0.09; }
}

/* Subtle Grid Overlay */
.hero .grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: -1;
    opacity: 0.15;
    animation: gridMove 300s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* Dust particles */
.dust-particles {
    pointer-events: none;
}

.dust-particles div {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.greeting-container:hover .greeting-lang {
    opacity: 1;
    transform: translateY(-5px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    min-height: 120px; /* Ensure consistent height during animation */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInFromLeft 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInFromRight 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

.slide-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInFromBottom 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromLeft {
    from { 
        opacity: 0;
        transform: translateX(-50px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from { 
        opacity: 0;
        transform: translateX(50px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromBottom {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Entry Animations */
.section-padding {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-padding.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Project Card Hover Effects */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(255, 111, 0, 0.2);
}

/* Skill Bar Animations */
.skill-progress {
    transform-origin: left;
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Text Highlight Effect */
.text-highlight {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.text-highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(255, 111, 0, 0.3);
    z-index: -1;
    transition: height 0.3s ease;
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::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: 0.5s;
    z-index: -1;
}

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

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-in-out forwards;
}

/* Slide In Animation */
@keyframes slideInFromLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
    animation: slideInFromLeft 0.8s ease-out forwards;
}

@keyframes slideInFromRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInFromRight 0.8s ease-out forwards;
}

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Rotate Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 10s linear infinite;
}

/* Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 111, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* Glow Effect */
.glow {
    text-shadow: 0 0 10px rgba(255, 111, 0, 0.5);
    transition: text-shadow 0.3s ease;
}

.glow:hover {
    text-shadow: 0 0 20px rgba(255, 111, 0, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-content {
        transform: translateY(20px);
    }
    
    .section-padding {
        transform: translateY(30px);
    }
}
