/* ========================================
   STUDIOKODU.PL — Premium Portfolio
   ======================================== */

/* Reset and base styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background-color: #0a0f1e;
    overflow-x: hidden;
}

#logoClick:hover {
    cursor: pointer;
}

/* ========== Scroll Progress Bar ========== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #14b8a6, #a855f7);
    z-index: 1100;
    transition: width 0.1s linear;
}

/* ========== Container ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== Header ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    background: rgba(10, 15, 30, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(99, 102, 241, 0.15);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 600;
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.03);
}

.logo-text {
    font-family: 'Fira Code', monospace;
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-link:hover {
    color: #f8fafc;
}

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

/* ========== Hero Section ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #0a0f1e 0%, #131b2e 40%, #0a0f1e 100%);
    position: relative;
    overflow: hidden;
}

/* Animated mesh gradient background */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    animation: meshFloat 20s ease-in-out infinite;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.03'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

@keyframes meshFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -2%) rotate(1deg); }
    50% { transform: translate(-1%, 3%) rotate(-1deg); }
    75% { transform: translate(-3%, -1%) rotate(0.5deg); }
}

/* Particles canvas */
#particles-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 2rem;
    font-size: 0.85rem;
    color: #a5b4fc;
    margin-bottom: 1.5rem;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.08;
    letter-spacing: -0.02em;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.highlight {
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 50%, #a855f7 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* Typing cursor effect */
.typed-cursor {
    display: inline-block;
    width: 3px;
    height: 1.3em;
    background: #6366f1;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.7;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

/* ========== Buttons ========== */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #14b8a6 100%);
    background-size: 200% auto;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(99, 102, 241, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.15);
    background-position: right center;
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.5);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* ========== Hero Visual ========== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
    perspective: 1000px;
}

.code-block {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(20px);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: floatCode 6s ease-in-out infinite;
}

.code-block:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 
        0 30px 70px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(99, 102, 241, 0.1);
}

@keyframes floatCode {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.code-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.dot:hover {
    transform: scale(1.3);
}

.dot.red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.dot.yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dot.green { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.code-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: #64748b;
}

.code-content {
    padding: 1.5rem;
    position: relative;
}

/* Code line numbers */
.code-content::before {
    content: '1\A2\A3\A4\A5\A6\A7';
    white-space: pre;
    position: absolute;
    left: 0;
    top: 1.5rem;
    padding: 0 0.75rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #334155;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    text-align: right;
    width: 2.5rem;
}

.code-content pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
    padding-left: 2rem;
}

.code-keyword { color: #c792ea; }
.code-variable { color: #82aaff; }
.code-property { color: #ffcb6b; }
.code-string { color: #c3e88d; }
.code-boolean { color: #ff5370; }

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 1.2s both;
}

.scroll-indicator span {
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    position: relative;
}

.scroll-mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: #6366f1;
    border-radius: 2px;
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ========== Section Styles ========== */
section {
    padding: 7rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 3.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== About Section ========== */
.about {
    background: linear-gradient(180deg, #0f172a 0%, #131b2e 50%, #0f172a 100%);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.about-text p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.skills {
    margin-top: 3rem;
}

.skills h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #f8fafc;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: rgba(99, 102, 241, 0.08);
    color: #a5b4fc;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(20, 184, 166, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.skill-tag:hover::before {
    opacity: 1;
}

/* ========== Projects Section ========== */
.projects {
    background: linear-gradient(180deg, #0a0f1e 0%, #101827 50%, #0a0f1e 100%);
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
}

/* Animated gradient border on hover */
.project-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, #6366f1, #14b8a6, #a855f7, #6366f1);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderRotate 4s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.project-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.08);
}

.project-card:hover::before {
    opacity: 1;
}

/* Shine effect on hover */
.project-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.project-card:hover::after {
    transform: rotate(45deg) translateY(100%);
}

.project-image {
    height: 220px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(20, 184, 166, 0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.project-image img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.project-placeholder {
    opacity: 0.5;
}

.project-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f8fafc;
}

.project-description {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(20, 184, 166, 0.08);
    color: #5eead4;
    padding: 0.3rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(20, 184, 166, 0.15);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.3);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.4rem 0;
}

.project-link:hover {
    color: #14b8a6;
    transform: translateX(3px);
}

/* ========== Contact Section ========== */
.contact {
    background: linear-gradient(180deg, #0f172a 0%, #131b2e 50%, #0f172a 100%);
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(20, 184, 166, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.contact-description {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 3rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(20, 184, 166, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-link:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.1);
}

.contact-link:hover::before {
    opacity: 1;
}

.contact-link svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.contact-link:hover svg {
    transform: scale(1.1);
}

/* ========== Footer ========== */
.footer {
    background: #0a0f1e;
    padding: 3rem 0;
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}

.footer-content {
    text-align: center;
    color: #475569;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

/* ========== Back to Top Button ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ========== Language Switcher ========== */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(148, 163, 184, 0.12);
}

.lang-link {
    display: flex;
    align-items: center;
    padding: 0.375rem;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
}

.lang-link:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.lang-link.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.lang-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #6366f1;
}

.flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ========== Animations ========== */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Stagger animation for cards */
.project-card:nth-child(1) { transition-delay: 0.1s; }
.project-card:nth-child(2) { transition-delay: 0.2s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }
.project-card:nth-child(4) { transition-delay: 0.4s; }

/* Stagger for skill tags */
.skill-tag:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s both; }
.skill-tag:nth-child(2) { animation: fadeInUp 0.5s ease 0.15s both; }
.skill-tag:nth-child(3) { animation: fadeInUp 0.5s ease 0.2s both; }
.skill-tag:nth-child(4) { animation: fadeInUp 0.5s ease 0.25s both; }
.skill-tag:nth-child(5) { animation: fadeInUp 0.5s ease 0.3s both; }
.skill-tag:nth-child(6) { animation: fadeInUp 0.5s ease 0.35s both; }
.skill-tag:nth-child(7) { animation: fadeInUp 0.5s ease 0.4s both; }
.skill-tag:nth-child(8) { animation: fadeInUp 0.5s ease 0.45s both; }
.skill-tag:nth-child(9) { animation: fadeInUp 0.5s ease 0.5s both; }
.skill-tag:nth-child(10) { animation: fadeInUp 0.5s ease 0.55s both; }

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .header .container {
        padding: 0.75rem 1.25rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 15, 30, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid rgba(99, 102, 241, 0.1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
    
    .lang-switcher {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 1rem;
        border-top: 1px solid rgba(148, 163, 184, 0.1);
    }
    
    .flag-icon {
        width: 18px;
        height: 12px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }

    .hero-badge {
        margin-left: auto;
        margin-right: auto;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 6rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .project-content {
        padding: 1.5rem;
    }

    .code-block {
        max-width: 300px;
    }

    .code-content::before {
        display: none;
    }

    .code-content pre {
        padding-left: 0;
        font-size: 0.8rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #0a0f1e;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #334155, #475569);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #475569, #6366f1);
}

/* ========== Focus states for accessibility ========== */
.nav-link:focus-visible,
.btn:focus-visible,
.contact-link:focus-visible,
.project-link:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ========== Selection ========== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #f8fafc;
}

/* ========== Print styles ========== */
@media print {
    .header,
    .scroll-progress,
    .back-to-top,
    .scroll-indicator,
    #particles-canvas {
        display: none !important;
    }
    
    .hero {
        background: white;
        color: black;
    }
    
    section {
        opacity: 1;
        transform: none;
    }
    
    .section-title {
        color: black;
        -webkit-text-fill-color: black;
    }
}
