/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;

    /* Spacing */
    --container-max: 1200px;
    --section-padding: 5rem 0;

    /* Animations */
    --transition-fast: 0.2s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.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: left 0.5s;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.25rem;
}

.bar {
    width: 1.5rem;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-normal);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

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

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.highlight {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    animation: fadeInDown 1s ease-out;
    perspective: 1000px;
}

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

.code-window {
    background: var(--bg-dark);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition-slow);
}

.code-window:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.window-header {
    background: #1f2937;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #374151;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.control.red { background: #ef4444; }
.control.yellow { background: #f59e0b; }
.control.green { background: #10b981; }

.window-title {
    color: #9ca3af;
    font-size: 0.875rem;
}

.code-content {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: left;
    min-height: 380px;
    height: 380px;
    overflow: hidden;
}

.code-content pre {
    margin: 0;
    white-space: pre;
    word-wrap: break-word;
    overflow-wrap: break-word;
    tab-size: 4;
}

.code-content code {
    color: #e5e7eb;
    white-space: pre;
    word-wrap: break-word;
    display: block;
    tab-size: 4;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-normal);
}

.scroll-indicator:hover {
    color: white;
}

.scroll-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Code Display */
.code-display {
    font-family: var(--font-mono);
    color: #e5e7eb;
    position: relative;
    text-align: left !important;
}

.code-line {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 0.875rem;
    white-space: pre;
    font-family: var(--font-mono);
    tab-size: 4;
    text-align: left !important;
}

.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #10b981;
    animation: blink 1s step-end infinite;
    vertical-align: text-top;
    margin-left: 2px;
}

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

/* Section Styles */
section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-intro {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.highlight-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.highlight-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.highlight-item p {
    color: var(--text-secondary);
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

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

.about-image {
    display: flex;
    justify-content: center;
}

.image-frame {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.image-frame::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.profile-placeholder {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.profile-placeholder i {
    font-size: 4rem;
    color: var(--text-light);
}

.profile-photo {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    border: 4px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-normal);
}

.profile-photo:hover {
    transform: scale(1.05);
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.timeline-item:nth-child(even) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(odd) {
    animation-delay: 0.1s;
}

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

.timeline-marker {
    position: absolute;
    left: 1.25rem;
    top: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--primary-color);
    z-index: 1;
}

.timeline-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.timeline-content:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.company-header {
    margin-bottom: 1rem;
}

.company-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.company {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.period {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 1rem;
}

.role-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.timeline-extended {
    display: none;
}

.timeline-extended.show {
    display: block;
}

.timeline-show-more {
    text-align: center;
    margin: 2rem 0;
}

/* Skills Section */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.category-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.skill-name {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
}

.skill-level {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Skill level indicators */
.skill-item.expert .skill-progress {
    background: linear-gradient(90deg, #10b981, #059669);
}

.skill-item.advanced .skill-progress {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.skill-item.intermediate .skill-progress {
    background: linear-gradient(90deg, var(--secondary-color), #f59e0b);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: left var(--transition-slow);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card:hover::before {
    left: 0;
}

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

.project-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.project-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.project-link:hover {
    color: var(--primary-dark);
}

/* Contact Section */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

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

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

.contact-icon {
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-details h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-details a,
.contact-details span {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.contact-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
}

.footer-left h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-left p {
    color: #9ca3af;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        gap: 2.5rem;
        padding: 2rem 0;
        min-height: calc(100vh - 4rem);
    }

    .hero-visual {
        max-width: 450px;
        margin: 0 auto;
    }

    .code-window {
        transform: none;
        transition: transform var(--transition-normal);
        max-width: 100%;
    }

    .code-window:hover {
        transform: scale(1.02);
    }

    .hero-content {
        animation-delay: 0.3s;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 4rem;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        padding-top: 4rem;
        min-height: 100vh;
    }

    .hero-container {
        gap: 2rem;
        padding: 1rem 0;
    }

    .hero-visual {
        max-width: 350px;
    }

    .code-window {
        font-size: 0.75rem;
        border-radius: 0.5rem;
    }

    .window-header {
        padding: 0.75rem;
    }

    .code-content {
        padding: 1rem;
        font-size: 0.75rem;
        height: 350px;
        min-height: 350px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .hero-cta {
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-badge {
        margin-bottom: 1rem;
    }

    .badge-text {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .timeline::before {
        left: 1rem;
    }

    .timeline-item {
        padding-left: 3rem;
    }

    .timeline-marker {
        left: 0.25rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 430px) {
    .hero {
        padding-top: 4rem;
    }

    .hero-container {
        padding: 0.5rem 0;
        gap: 1.5rem;
    }

    .hero-visual {
        max-width: 280px;
    }

    .code-window {
        font-size: 0.7rem;
        transform: none !important;
    }

    .code-content {
        padding: 0.75rem;
        font-size: 0.7rem;
        line-height: 1.4;
        height: 290px;
        min-height: 290px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .window-header {
        padding: 0.5rem;
    }

    .window-title {
        font-size: 0.7rem;
    }

    .control {
        width: 0.6rem;
        height: 0.6rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    .hero-badge {
        margin-bottom: 0.75rem;
    }

    .badge-text {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }

    /* Reduce motion for better mobile performance */
    .typing-animation {
        animation: none;
        border-right: none;
        white-space: normal;
        overflow: visible;
    }

    /* Optimize animations for mobile */
    .hero-content {
        animation-duration: 0.8s;
    }

    .hero-visual {
        animation-duration: 0.8s;
    }

    /* Simplified hover effects for mobile */
    .code-window:hover {
        transform: none;
    }

    .image-frame::before {
        animation: none;
    }
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

/* Loading animation for skill bars */
.skill-progress[data-level] {
    width: 0;
}

.skill-progress.animated[data-level="95"] { width: 95%; }
.skill-progress.animated[data-level="90"] { width: 90%; }
.skill-progress.animated[data-level="85"] { width: 85%; }
.skill-progress.animated[data-level="80"] { width: 80%; }
.skill-progress.animated[data-level="75"] { width: 75%; }
.skill-progress.animated[data-level="70"] { width: 70%; }

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
    /* Reduce GPU load on mobile */
    .hero::before {
        display: none;
    }

    /* Disable complex animations on mobile */
    .skill-progress::after {
        display: none;
    }

    /* Simplify parallax on mobile */
    .hero {
        transform: none !important;
    }
}

/* Accessibility - Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .typing-animation {
        animation: none;
        border-right: none;
    }

    .hero-content,
    .hero-visual {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .timeline-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .code-window:hover,
    .timeline-content:hover,
    .project-card:hover,
    .skill-category:hover {
        transform: none;
    }

    .nav-link:hover {
        color: var(--text-secondary);
    }

    .nav-link:hover::after {
        width: 0;
    }
}