:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #14b8a6;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --border-color: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-location {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.3s backwards;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.5s backwards;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

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

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

/* Hero Animation */
.hero-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    top: -200px;
    right: -200px;
    animation: float 20s infinite ease-in-out;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    bottom: -150px;
    left: -150px;
    animation: float 25s infinite ease-in-out reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 30s infinite ease-in-out;
}

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

section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -2rem;
    margin-bottom: 3rem;
}

/* Professional Experience */
.professional {
    padding: 5rem 0;
}

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

.experience-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

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

.experience-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.experience-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Experience Timeline */
.experience {
    background-color: var(--bg-secondary);
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding: 2rem;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 4rem;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 4rem;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 2rem;
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.timeline-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.timeline-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

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

.skill-category {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Education Grid */
.education {
    background-color: var(--bg-secondary);
}

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

.education-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.education-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.education-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.education-focus {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.education-school {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.education-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.project-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-secondary);
}

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

.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: transparent;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.contact-item i {
    font-size: 1.75rem;
}

/* Games Section */
.games-section {
    background-color: var(--bg-secondary);
}

.game-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card-select {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card-select:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.game-card-select i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.game-card-select h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.game-card-select p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.game-area {
    position: relative;
}

.game-area.hidden {
    display: none;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background-color: var(--bg-primary);
}

.game-content {
    display: none;
}

.game-content.active {
    display: block;
}

.game-title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

#flappyCanvas {
    border: 3px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 70%, #98D98E 70%, #98D98E 100%);
    max-width: 100%;
    height: auto;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.game-score {
    display: flex;
    gap: 2rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.game-score p {
    margin: 0;
    color: var(--text-primary);
}

.game-score span {
    color: var(--primary-color);
}

.game-instructions {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1rem;
}

.mobile-controls {
    display: none;
}

@media (max-width: 768px) {
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: inline;
    }
}

/* Soccer game specific styles */
#soccerCanvas {
    border: 3px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    cursor: crosshair;
}

/* Tetris game specific styles */
.tetris-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#tetrisCanvas {
    border: 3px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.tetris-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tetris-next {
    background-color: var(--bg-card);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.tetris-next h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

#tetrisNext {
    border: 2px solid var(--border-color);
    border-radius: 0.25rem;
}

/* Masters Projects Section */
.masters-projects {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

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

.masters-project-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.masters-project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.masters-project-card:hover::before {
    transform: translateX(0);
}

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

.masters-project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-course {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tech-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag-small {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-view-details {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-view-details:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.project-modal-content {
    background-color: var(--bg-card);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.project-detail h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.project-section {
    margin-bottom: 30px;
}

.project-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.project-section ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.project-section ul li {
    margin-bottom: 8px;
    padding-left: 20px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-section pre {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-section code {
    color: var(--text-primary);
}

/* Footer */
.footer {
    background-color: var(--bg-primary);
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    position: relative;
}

/* Hidden Study Access Icon */
.study-secret-icon {
    position: absolute;
    bottom: 10px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0.3;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.study-secret-icon:hover {
    opacity: 0.6;
    transform: translateY(-2px);
}

/* Dark mode specific styling for study icon */
[data-theme="dark"] .study-secret-icon {
    opacity: 0.2;
}

[data-theme="dark"] .study-secret-icon:hover {
    opacity: 0.5;
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .experience-grid,
    .skills-grid,
    .education-grid,
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        display: none;
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
        right: 0;
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
    }
    
    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    /* Hero Section */
    .hero {
        padding: 5rem 1.5rem 2rem;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Floating shapes */
    .shape-1 {
        width: 200px;
        height: 200px;
        top: -100px;
        right: -100px;
    }
    
    .shape-2 {
        width: 150px;
        height: 150px;
        bottom: -75px;
        left: -75px;
    }
    
    .shape-3 {
        width: 100px;
        height: 100px;
    }
    
    /* Section adjustments */
    section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Professional Experience */
    .experience-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .experience-card {
        padding: 1.5rem;
    }
    
    /* Timeline */
    .timeline::before {
        left: 1.5rem;
    }
    
    .timeline-item {
        width: 100%;
        padding: 1rem 0 1rem 3rem;
        left: 0;
        margin-bottom: 1.5rem;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        padding-left: 3rem;
        padding-right: 0;
    }
    
    .timeline-item::after {
        left: 12px;
        width: 15px;
        height: 15px;
        top: 1.5rem;
    }
    
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 12px;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .timeline-content h3 {
        font-size: 1.125rem;
    }
    
    .timeline-content h4 {
        font-size: 1rem;
    }
    
    /* Skills */
    .skill-category {
        padding: 1.5rem;
    }
    
    .skill-category h3 {
        font-size: 1.125rem;
    }
    
    .skill-tags {
        gap: 0.375rem;
    }
    
    .skill-tag {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Education */
    .education-card {
        padding: 1.5rem;
    }
    
    .education-card h3 {
        font-size: 1.125rem;
    }
    
    .education-icon {
        font-size: 2.5rem;
    }
    
    /* Projects */
    .project-card {
        padding: 1.5rem;
    }
    
    .project-card h3 {
        font-size: 1.125rem;
    }
    
    /* Games Section */
    .game-selector {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-card-select {
        padding: 1.5rem;
    }
    
    .game-card-select i {
        font-size: 2.5rem;
    }
    
    /* Game canvases */
    #flappyCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 400/600;
    }
    
    #soccerCanvas {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 600/400;
    }
    
    .tetris-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    #tetrisCanvas {
        width: 280px;
        height: 560px;
    }
    
    .tetris-sidebar {
        width: 100%;
        max-width: 280px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .tetris-next {
        flex: 0 0 auto;
    }
    
    #tetrisNext {
        width: 100px;
        height: 100px;
    }
    
    .game-score {
        font-size: 1rem;
        gap: 1rem;
    }
    
    .game-controls {
        width: 100%;
        justify-content: space-around;
    }
    
    .game-instructions {
        font-size: 0.875rem;
        padding: 0 1rem;
    }
    
    /* Contact */
    .contact-info {
        padding: 1rem;
    }
    
    .contact-item {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Masters Projects responsive */
    .masters-projects-grid {
        grid-template-columns: 1fr;
    }
    
    .masters-project-card {
        padding: 20px;
    }
    
    .project-modal {
        padding: 10px;
    }
    
    .project-modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 95vh;
    }
    
    .project-detail h3 {
        font-size: 1.5rem;
    }
    
    .project-section pre {
        font-size: 0.8rem;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    /* Even smaller timeline */
    .timeline-item {
        padding-left: 2.5rem;
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-item::after {
        left: 7px;
        width: 12px;
        height: 12px;
    }
    
    /* Smaller game canvases */
    #flappyCanvas {
        max-width: 300px;
    }
    
    #tetrisCanvas {
        width: 240px;
        height: 480px;
    }
    
    #tetrisNext {
        width: 80px;
        height: 80px;
    }
    
    .game-score {
        font-size: 0.875rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    .nav-link,
    .btn,
    .contact-item,
    .game-card-select {
        padding: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .timeline-content:hover,
    .experience-card:hover,
    .skill-category:hover,
    .education-card:hover,
    .project-card:hover {
        transform: none;
    }
    
    /* Improve button appearance */
    .btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 4rem 1.5rem 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
    }
}