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

html {
    scroll-behavior: smooth;
    /* Prevent zoom on iOS */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    /* Scroll padding will be set dynamically by JavaScript */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    /* Improve touch scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    /* Ensure container never exceeds viewport */
    width: 100%;
    box-sizing: border-box;
}

/* Prevent any element from causing horizontal overflow */
* {
    max-width: 100%;
}

/* Touch-friendly interactive elements */
a, button, .btn, .nav-link, .project-card, .filter-btn {
    /* Ensure minimum touch target size of 44px */
    min-height: 44px;
    /* Improve touch response */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(216, 67, 21, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #d84315;
    border: 2px solid #d84315;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #d84315;
    text-decoration: none;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    transition: width 0.3s ease;
}

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

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

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Floating Navigation Indicator */
.nav-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001; /* Above navbar */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.nav-indicator.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-indicator-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(216, 67, 21, 0.9);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-indicator-btn:hover {
    background: rgba(216, 67, 21, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.nav-indicator-btn:active {
    transform: scale(0.95);
}

/* Hide indicator on desktop */
@media (min-width: 769px) {
    .nav-indicator {
        display: none;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, #fefefe 0%, #fff8f0 100%);
    padding: 100px 0 50px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.highlight {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
}

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

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-photo {
    width: 400px;
    height: 400px;
    object-fit: cover;
    object-position: 70% 30%;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(216, 67, 21, 0.3);
    border: 5px solid white;
}

.about-photo {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(216, 67, 21, 0.3);
    margin: 0 auto;
    display: block;
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 0 0 auto;
    margin-left: 2rem;
}

.engine-photo {
    width: 600px;
    height: 500px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Personal Showcase Section */
.personal-showcase {
    background: linear-gradient(135deg, #fff8f0 0%, #fef5e7 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.personal-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.showcase-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

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

.showcase-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 700;
}

.showcase-header p {
    font-size: 1.3rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.showcase-item {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    aspect-ratio: 1;
    height: 400px;
    width: 300px;
}

.showcase-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive design for smaller screens */
@media (max-width: 1024px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .personal-showcase {
        padding: 60px 0;
    }
    
    .showcase-header h2 {
        font-size: 2.5rem;
    }
    
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.hero-placeholder {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    box-shadow: 0 20px 40px rgba(216, 67, 21, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    color: #d84315;
    font-size: 1.5rem;
    text-decoration: none;
}

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

/* Section Styles */
section {
    padding: 80px 0;
}

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

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: #f8f9fa;
}

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

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #333;
}

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

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

.stat {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat h4 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat p {
    color: #666;
    font-weight: 500;
    margin: 0;
}

.about-placeholder {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(46, 125, 50, 0.3);
}

/* Projects Section */
.projects {
    background: white;
}

.project-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    border-color: transparent;
    color: white;
}

.projects-grid {
    display: block;
}

.projects-grid .project-card {
    display: inline-block;
    vertical-align: top;
    width: 350px;
    max-width: 400px;
    margin: 1rem;
}

/* Center align the inline blocks */
.projects-grid {
    text-align: center;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.project-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

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

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

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

.project-link {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-link:hover {
    transform: scale(1.1);
    background: #667eea;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.project-link i {
    font-size: 1.2rem;
}

.project-link span {
    display: none;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.project-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.tech-tag {
    background: #fbe9e7;
    color: #d84315;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-actions {
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.see-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #d84315;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid #d84315;
}

.see-more-btn:hover {
    background: #d84315;
    color: white;
    transform: translateX(5px);
}

.see-more-btn i {
    transition: transform 0.3s ease;
}

.see-more-btn:hover i {
    transform: translateX(3px);
}

/* Project Section Breaks */
.project-section-break {
    display: block;
    width: 100%;
    margin: 3rem 0 2rem 0;
    padding: 1rem 0;
    position: relative;
    text-align: center;
}

.project-section-break .project-section-title {
    display: inline-flex;
    align-items: center;
}

.project-section-break::before {
    content: '';
    position: absolute;
    left: 0;
    right: calc(50% + 160px);
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(216, 67, 21, 0.3), transparent);
}

.project-section-break::after {
    content: '';
    position: absolute;
    left: calc(50% + 160px);
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(216, 67, 21, 0.3), transparent);
}

.project-section-title {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(216, 67, 21, 0.7);
    text-align: center;
    white-space: nowrap;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(216, 67, 21, 0.2);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(216, 67, 21, 0.05);
}

.project-section-title i {
    margin-right: 0.5rem;
}

.project-section-break.machine-shop .project-section-title {
    background: rgba(216, 67, 21, 0.05);
    color: rgba(216, 67, 21, 0.8);
}

.project-section-break.personal .project-section-title {
    background: rgba(191, 54, 12, 0.05);
    color: rgba(191, 54, 12, 0.8);
}

.project-section-break.class .project-section-title {
    background: rgba(216, 67, 21, 0.08);
    color: rgba(216, 67, 21, 0.9);
}

/* Experience Section */
.experience {
    padding: 80px 0;
    background: #ffffff;
}

.experience-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #d84315, #bf360c);
}

.experience-item {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.experience-item:last-child {
    margin-bottom: 0;
}

.experience-icon {
    width: 90px;
    height: 90px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 4px solid #d84315;
    box-shadow: 0 4px 12px rgba(216, 67, 21, 0.2);
    flex-shrink: 0;
}

.experience-icon i {
    color: #d84315;
    font-size: 28px;
}

.timeline-company-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    padding: 6px;
    background: #ffffff;
    border: 2px solid #fbe9e7;
}

.experience-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex: 1;
    transition: all 0.3s ease;
}

.experience-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.experience-header {
    margin-bottom: 16px;
}

.job-header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.company-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #fbe9e7;
}

.job-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.company {
    display: inline-block;
    color: #d84315;
    font-weight: 500;
    font-size: 16px;
    margin-right: 12px;
}

.duration {
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.job-description p {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.achievements {
    list-style: none;
    padding: 0;
}

.achievements li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.achievements li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #d84315;
    font-weight: bold;
}

.achievements li:last-child {
    margin-bottom: 0;
}

.job-photos {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.work-photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.work-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #d84315;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-width: 1200px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #ffffff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

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

/* Modal for Image Gallery (copied from project-detail.css) */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    opacity: 0.7;
}

/* Skills Section */
.skills {
    background: #f8f9fa;
}

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

.skills-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.skill-item {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    height: 70px;
    width: 100%;
}

.skill-item:hover {
    transform: translateY(-3px);
}

.skill-item i {
    font-size: 1.5rem;
    color: #d84315;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.skill-item span {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Contact Section */
.contact {
    background: white;
}

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

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.contact-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

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

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.contact-method i {
    font-size: 1.5rem;
    color: #d84315;
    width: 30px;
}

.contact-method h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.contact-method p {
    color: #666;
    margin: 0;
}

.contact-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-left p {
    color: #bdc3c7;
    margin: 0;
}

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

.social-link {
    width: 40px;
    height: 40px;
    background: #34495e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #d84315;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Prevent horizontal overflow on mobile */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ensure all sections fit within viewport */
    section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        background-color: transparent;
        width: auto;
        padding: 0;
        position: static;
        box-shadow: none;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

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

    .nav-toggle {
        display: none;
    }

    .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 section mobile fixes */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        width: 100%;
        max-width: 100vw;
    }

    .hero-title {
        font-size: 2.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    /* About section mobile fixes */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        width: 100%;
    }

    .about-stats {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .engine-photo {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    /* Contact section mobile fixes */
    .contact-content {
        grid-template-columns: 1fr;
        width: 100%;
    }

    /* Skills section mobile fixes */
    .skills-list {
        grid-template-columns: 1fr;
        width: 100%;
    }

    /* Projects section mobile fixes */
    .project-filter {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .projects-grid .project-card {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 1rem 0;
    }

    /* Project section breaks mobile fixes */
    .project-section-break::before {
        right: calc(50% + 100px);
    }

    .project-section-break::after {
        left: calc(50% + 100px);
    }

    .project-section-title {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }

    /* Footer mobile fixes */
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        text-align: center;
    }

    /* Experience Section Mobile */
    .experience {
        padding: 60px 0;
        width: 100%;
    }

    .experience-timeline::before {
        left: 20px;
    }

    .experience-item {
        gap: 15px;
        width: 100%;
        max-width: 100vw;
    }

    .experience-icon {
        width: 70px;
        height: 70px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .timeline-company-logo {
        width: 56px;
        height: 56px;
        padding: 4px;
    }

    .job-photos {
        margin-top: 16px;
        padding-top: 12px;
        width: 100%;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .work-photo {
        height: 280px;
        width: 100%;
        object-fit: cover;
    }

    .experience-icon i {
        font-size: 16px;
    }

    .experience-content {
        padding: 20px;
        width: 100%;
        overflow-wrap: break-word;
    }

    .job-title {
        font-size: 18px;
        word-wrap: break-word;
    }

    .company {
        font-size: 15px;
        display: block;
        margin-bottom: 4px;
        word-wrap: break-word;
    }

    .company-info {
        gap: 8px;
        align-items: flex-start;
        width: 100%;
    }

    .company-logo {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .duration {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    /* Strict mobile overflow prevention */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ultra-compact navigation for narrow screens */
    .navbar {
        padding: 6px 0; /* Reduce navbar height */
    }
    
    .nav-container {
        padding: 0 8px; /* Reduce side padding */
        gap: 6px; /* Reduce gap between logo and menu */
    }
    
    .nav-logo a {
        font-size: 14px; /* Smaller logo text */
    }
    
    .nav-menu {
        gap: 0.1rem; /* Minimal gap between nav items */
    }
    
    .nav-link {
        padding: 6px 8px; /* More compact padding */
        font-size: 12px; /* Smaller text */
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: calc(100vw - 30px);
    }
    
    /* Ensure all content fits */
    * {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        word-wrap: break-word;
    }

    .section-title {
        font-size: 2rem;
        word-wrap: break-word;
    }

    .hero-placeholder {
        width: 200px;
        height: 200px;
        font-size: 3rem;
        margin: 0 auto;
    }

    .about-placeholder {
        width: 200px;
        height: 200px;
        font-size: 3rem;
        margin: 0 auto;
    }

    .project-filter {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
        margin: 5px 0;
        width: 100%;
        max-width: 200px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 250px;
        box-sizing: border-box;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }

    .experience-content {
        padding: 15px;
        width: 100%;
    }

    .job-title {
        font-size: 16px;
        word-wrap: break-word;
    }

    .company {
        font-size: 14px;
        word-wrap: break-word;
    }

    .duration {
        font-size: 12px;
    }

    .skill-item {
        padding: 8px 12px;
        font-size: 14px;
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    .about-text {
        font-size: 16px;
        line-height: 1.6;
        word-wrap: break-word;
    }

    .section-subtitle {
        font-size: 16px;
        word-wrap: break-word;
    }

    .project-card {
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
    }

    .project-title {
        font-size: 18px;
        word-wrap: break-word;
    }

    .project-description {
        font-size: 14px;
        word-wrap: break-word;
    }

    .contact-info {
        text-align: center;
        width: 100%;
    }

    .contact-item {
        justify-content: center;
        text-align: center;
        padding: 15px;
        width: 100%;
        word-wrap: break-word;
    }

    .navbar {
        padding: 8px 0;
        width: 100%;
    }

    .nav-container {
        padding: 0 10px;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .nav-logo a {
        font-size: 16px;
        word-wrap: break-word;
        flex-shrink: 0;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 0.3rem;
        background-color: transparent;
        width: auto;
        padding: 0;
        position: static;
        box-shadow: none;
        flex-wrap: wrap; /* Allow wrapping to second line when needed */
        justify-content: flex-end;
        align-items: center;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 14px;
        border-radius: 4px;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .nav-link:hover {
        background-color: rgba(216, 67, 21, 0.1);
    }
    
    /* Ensure images don't cause overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix any potential grid overflow */
    .projects-grid,
    .about-stats,
    .skills-list,
    .photo-gallery {
        width: 100%;
        max-width: 100%;
    }
}

/* Additional Mobile Enhancements */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }

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

    .hero-placeholder,
    .about-placeholder {
        width: 150px;
        height: 150px;
        font-size: 2.5rem;
    }

    .experience-icon {
        width: 60px;
        height: 60px;
    }

    .timeline-company-logo {
        width: 46px;
        height: 46px;
    }

    .work-photo {
        height: 250px;
    }
}

/* Extra small mobile devices (max-width: 320px) */
@media (max-width: 320px) {
    .nav-container {
        padding: 0 5px;
        gap: 4px; /* Minimal gap */
    }
    
    .nav-logo a {
        font-size: 12px; /* Very small logo */
    }
    
    .nav-menu {
        gap: 0.1rem; /* Minimal gap between items */
        flex-shrink: 1; /* Allow menu to shrink if needed */
    }
    
    .nav-link {
        padding: 4px 6px; /* Very compact padding */
        font-size: 10px; /* Very small text */
        white-space: nowrap; /* Prevent wrapping */
        flex-shrink: 1; /* Allow links to shrink if needed */
    }
}

/* Ultra small screens (max-width: 280px) */
@media (max-width: 280px) {
    .navbar {
        padding: 4px 0; /* Minimal navbar height */
    }
    
    .nav-container {
        padding: 0 3px;
        gap: 2px;
    }
    
    .nav-logo a {
        font-size: 11px;
    }
    
    .nav-menu {
        gap: 0.05rem; /* Almost no gap */
    }
    
    .nav-link {
        padding: 3px 4px; /* Extremely compact */
        font-size: 9px; /* Very small text */
        border-radius: 2px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease; /* Reduced from 0.6s to 0.4s for faster animation */
}

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