/* ===== CSS VARIABLES ===== */
:root {
    --primary: #c084fc;
    --secondary: #a78bfa;
    --accent: #fbbf24;
    --cyan: #67e8f9;
    --purple: #a78bfa;
    --green: #86efac;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --gradient-1: linear-gradient(135deg, #c084fc 0%, #a78bfa 50%, #67e8f9 100%);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', 'Consolas', monospace;
    --header-height: 76px;
}

[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-darker: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f5;
    --border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-height); }

body {
    font-family: var(--font-primary);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition-fast), color var(--transition-fast);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LOADER - Optimized ===== */
.loader-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-darker);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.4s ease-out, visibility 0.4s;
}

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content { text-align: center; }

.loader-code-text {
    font-family: var(--font-code);
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: var(--primary);
    margin-bottom: 2rem;
}

.code-line {
    display: block;
    margin: 0.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.4s ease forwards;
}

.code-line:nth-child(1) { animation-delay: 0.1s; }
.code-line:nth-child(2) { animation-delay: 0.2s; }
.code-line:nth-child(3) { animation-delay: 0.3s; }
.code-line:nth-child(4) { animation-delay: 0.4s; }

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

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 1.5rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-progress-wrapper {
    width: 180px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 1.5rem auto;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
    animation: progress 1.5s ease forwards;
}

@keyframes progress { to { width: 100%; } }

.loader-percentage {
    font-family: var(--font-code);
    color: var(--primary);
    font-size: 1rem;
}

/* ===== HEADER ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    contain: layout style;
}

.main-header.scrolled { background: rgba(10, 14, 39, 0.95); }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    font-family: var(--font-code);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.logo-bracket { color: var(--purple); }

.logo-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    transition: color var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active { color: var(--primary); }

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 2px;
    background: var(--gradient-1);
}

.nav-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.lang-toggle, .theme-toggle, .menu-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.lang-toggle:hover, .theme-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.65rem;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition), opacity var(--transition);
}

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

.menu-toggle.active span:nth-child(2) { opacity: 0; }

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

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 8% 4rem;
}

.hero-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.code-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(192, 132, 252, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(192, 132, 252, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.floating-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-family: var(--font-code);
    color: var(--primary);
    opacity: 0.08;
    font-size: 1.5rem;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.08; }
    90% { opacity: 0.08; }
    100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

.hero-container {
    max-width: 1400px;
    width: 100%;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    max-width: 700px;
}

.hero-greeting {
    font-family: var(--font-code);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--cyan);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.greeting-cursor {
    animation: blink 1s infinite;
    color: var(--primary);
}

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

.hero-name {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.name-prefix {
    font-family: var(--font-code);
    color: var(--purple);
    font-size: 0.6em;
}

.name-operator {
    font-family: var(--font-code);
    color: var(--cyan);
    font-size: 0.6em;
}

.name-value {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.name-suffix {
    font-family: var(--font-code);
    color: var(--accent);
    font-size: 0.6em;
}

.hero-title {
    font-family: var(--font-code);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.hero-description {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 560px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 132, 252, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(192, 132, 252, 0.1);
}

.hero-social {
    display: flex;
    gap: 0.75rem;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.social-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== HERO IMAGE ===== */
.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.profile-image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

.profile-image-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: 
        0 0 30px rgba(192, 132, 252, 0.3),
        0 0 60px rgba(192, 132, 252, 0.1);
    overflow: hidden;
    background: var(--bg-card);
}

.profile-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    will-change: transform;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.profile-placeholder {
    font-size: 8rem;
    color: var(--primary);
    opacity: 0.3;
}

.floating-badge {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: floatBadge 3s ease-in-out infinite;
    min-width: 200px;
    transition: all var(--transition-smooth);
    z-index: 2;
}

.floating-badge:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(192, 132, 252, 0.25);
}

.floating-badge i {
    font-size: 2rem;
    color: var(--primary);
    flex-shrink: 0;
}

.badge-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.badge-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge-libs {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

.badge-1 {
    top: 10%;
    right: -10%;
    animation-delay: 0s;
}

.badge-2 {
    bottom: 20%;
    right: -15%;
    animation-delay: 1s;
}

.badge-3 {
    top: 50%;
    left: -15%;
    animation-delay: 2s;
}

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

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    z-index: 2;
}

.scroll-mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-wheel {
    width: 4px;
    height: 10px;
    background: var(--primary);
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* ===== SECTIONS ===== */
.section {
    padding: 5rem 0;
    position: relative;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-number {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--primary);
    opacity: 0.8;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.title-bracket {
    font-family: var(--font-code);
    color: var(--purple);
    font-weight: 400;
}

.title-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
    max-width: 300px;
}

/* ===== ABOUT SECTION ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-family: var(--font-code);
    font-size: clamp(1.8rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Code block */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    font-family: var(--font-code);
    font-size: 0.8rem;
    line-height: 1.7;
    overflow-x: auto;
}

.code-line.indent { padding-left: 1.5rem; }
.code-line.indent-2 { padding-left: 3rem; }

.code-keyword { color: var(--purple); }
.code-variable { color: var(--cyan); }
.code-operator { color: var(--primary); }
.code-brace, .code-bracket { color: var(--accent); }
.code-property { color: var(--cyan); }
.code-string { color: var(--accent); }
.code-comma, .code-semicolon { color: var(--text-muted); }

/* ===== SKILLS SECTION ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
}

.category-title {
    font-family: var(--font-code);
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.skill-name {
    font-family: var(--font-code);
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.85rem;
}

.skill-percent {
    font-family: var(--font-code);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.skill-bar {
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

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

/* ===== TIMELINE/EXPERIENCE ===== */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

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

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

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-dark);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.timeline-content:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-year {
    font-family: var(--font-code);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.timeline-badge {
    background: var(--gradient-1);
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
}

.timeline-title {
    font-family: var(--font-code);
    font-size: 1.1rem;
    color: var(--cyan);
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.timeline-company {
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.timeline-achievements {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: var(--bg-darker);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.achievement-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.achievement-item i {
    color: var(--green);
    font-size: 0.85rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: var(--bg-darker);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-family: var(--font-code);
    border: 1px solid var(--border);
}

/* ===== GAMES SECTION ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    contain: layout;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.15);
}

.game-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-darker);
    overflow: hidden;
}

.game-iframe-wrapper {
    position: absolute;
    inset: 0;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 200%;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
    background: var(--bg-darker);
}

.game-card:hover .game-iframe {
    pointer-events: auto;
}

.game-loader {
    position: absolute;
    inset: 0;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.game-loader-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.game-loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

.game-loader-text {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
    z-index: 5;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.game-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--gradient-1);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transform: translateY(10px);
    opacity: 0;
    transition: all var(--transition-fast);
}

.game-card:hover .game-play-btn {
    transform: translateY(0);
    opacity: 1;
}

.game-play-btn:hover {
    transform: scale(1.05);
}

.game-content {
    padding: 1.25rem;
}

.game-title {
    font-family: var(--font-code);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-title i {
    color: var(--accent);
    font-size: 0.9rem;
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.game-tag {
    background: var(--bg-darker);
    color: var(--cyan);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--font-code);
    border: 1px solid var(--border);
}

/* ===== PROJECTS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    contain: layout;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-darker);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.25;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

.project-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transform: scale(0.8);
    transition: transform var(--transition-fast);
    text-decoration: none;
}

.project-card:hover .project-link { transform: scale(1); }

.project-content {
    padding: 1.25rem;
}

.project-title {
    font-family: var(--font-code);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ===== CONTACT ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
}

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

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-label {
    font-family: var(--font-code);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.contact-value {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.contact-value:hover { color: var(--primary); }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.btn-submit {
    align-self: flex-start;
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 8%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.footer-divider {
    margin: 0 0.75rem;
    color: var(--border);
}

.footer-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.footer-author-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-author-link:hover { color: var(--cyan); }

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social-link {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.footer-social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-section { padding: 5rem 5% 3rem; }
    .section-container { padding: 0 5%; }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-image-wrapper {
        order: -1;
    }
    
    .hero-image-container {
        width: 300px;
        height: 300px;
    }
    
    .floating-badge {
        min-width: 160px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .badge-1 { right: -5%; }
    .badge-2 { right: -8%; }
    .badge-3 { left: -8%; }
}

/* Nav collapses to the hamburger menu here — before the 8 links + language/theme
   toggles run out of horizontal room. This closes the gap (roughly 769px-1050px)
   where the full nav used to overflow or get clipped on common laptop/tablet widths. */
@media (max-width: 1100px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-darker);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 0.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border);
        z-index: 999;
    }
    
    .nav-menu.active { right: 0; }
    
    .nav-link {
        width: 100%;
        padding: 1rem;
        border-radius: 8px;
        white-space: normal;
    }
    
    .nav-link:hover { background: var(--bg-card); }
    
    .menu-toggle { display: flex; }
}

@media (max-width: 768px) {
    .hero-section { min-height: auto; padding: 6rem 5% 3rem; }
    
    .hero-container {
        grid-template-columns: 1fr;
    }
    
    .hero-image-container {
        width: 250px;
        height: 250px;
    }
    
    .floating-badge {
        display: none;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .code-block {
        font-size: 0.7rem;
        padding: 1rem;
    }
    
    .projects-grid, .games-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .scroll-indicator { display: none; }
    
    /* Reduce animations on mobile for performance */
    .particle { display: none; }
    .code-grid-bg { display: none; }
    
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    :root { --header-height: 64px; }
    .nav-container { padding: 0.75rem 1rem; }
    .section-container { padding: 0 1rem; }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn { width: 100%; justify-content: center; }
    
    .hero-social { flex-wrap: wrap; justify-content: center; }
    
    .hero-image-container {
        width: 200px;
        height: 200px;
    }
    
    .skill-category { padding: 1.25rem; }
    
    .timeline { padding-left: 1rem; }
    .timeline-item { padding-left: 2rem; }
    .timeline-marker { left: -1.5rem; }
    .timeline-content { padding: 1.25rem; }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        max-width: 100%;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .skill-progress { transition: none; }
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .main-header, .loader-screen, .floating-badge, .scroll-indicator { display: none; }
    .main-content { margin-top: 0; }
    body { background: white; color: black; }
}
