/* --- Global Styles & Variables --- */
:root {
    --primary-color: #2c3e50; /* Dark Blue/Gray */
    --secondary-color: #34495e; /* Slightly Lighter Blue/Gray */
    --accent-color: #1abc9c;   /* Calm Teal/Green */
    --light-gray: #f8f9fa;
    --text-color: #333;
    --text-light: #ecf0f1;
    --border-color: #e0e0e0;
    --header-height: 70px;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-primary);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}


a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.content-section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray);
}

/* --- Header --- */
#header {
    background-color: #fff;
    color: var(--text-color);
    padding: 0 20px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: var(--header-height);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

#header .logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-primary);
}

#navbar ul {
    list-style: none;
    display: flex;
}

#navbar ul li {
    margin-left: 25px;
}

#navbar ul li a {
    color: var(--secondary-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    font-family: var(--font-primary);
    transition: color 0.3s ease;
}

#navbar ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

#navbar ul li a:hover,
#navbar ul li a.active {
    color: var(--accent-color);
}

#navbar ul li a:hover::after,
#navbar ul li a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
#mobile-menu-toggle {
    display: none; /* Hidden by default, shown in media query */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Above navbar items for clickability */
}

#mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}


/* --- Hero Section (Home) --- */
.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.8)), url('../assets/images/hero-bg-placeholder.jpg') no-repeat center center/cover; /* Add a hero-bg-placeholder.jpg */
    color: var(--text-light);
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}
/* Add a hero-bg-placeholder.jpg to assets/images (e.g., an abstract tech background) */

.hero-section h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #fff;
    animation: fadeInDown 1s ease-out;
}
.hero-section h2::after { display: none; } /* No underline for hero h2 */

.hero-section .tagline {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.5s;
    animation-fill-mode: backwards; /* Start animation state before it begins */
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: zoomIn 1s ease-out 1s;
    animation-fill-mode: backwards;
}

.cta-button:hover {
    background-color: #16a085; /* Darker accent */
    transform: translateY(-3px);
}

/* Animations for hero */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}


/* --- About Section --- */
#about .about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

#about .about-image {
    flex-basis: 35%;
    max-width: 300px; /* Control image size */
    margin: 0 auto; /* Center on smaller screens if it stacks */
}

#about .about-image img {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#about .about-text {
    flex-basis: 65%;
}

#about .about-text p {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* --- New interactive about styles --- */
/* Interactive About Section */
.about-interactive-layout {
    display: flex;
    gap: 30px; /* Space between text and sidebar */
    margin-top: 20px;
}

.about-text-interactive {
    flex: 2; /* Takes more space */
    line-height: 1.8;
}

.about-text-interactive p {
    margin-bottom: 1.5em;
    font-size: 1.05rem; /* Retained from original */
    line-height: 1.7; /* Retained from original, plan has 1.8 for .about-text-interactive itself */
}

.about-text-interactive .keyword {
    font-weight: bold; /* دائما بخط bold */
    color: inherit; /* نفس لون النص العادي */
    position: relative; /* ضروري لتحديد موضع الخط السفلي */
    padding-bottom: 3px; /* مسافة صغيرة للخط السفلي */
    display: inline-block; /* ليأخذ padding-bottom التأثير الصحيح */
    /* لا يوجد خط سفلي أو تغيير في الشفافية بشكل افتراضي */
}

.about-text-interactive .keyword::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0; /* يبدأ بدون عرض (مخفي) */
    height: 1px; /* سمك الخط النقطي */
    border-bottom: 1px dotted var(--accent-color); /* خط نقطي رفيع باللون الرئيسي */
    transition: width 0.4s ease-out; /* حركة ناعمة لعرض الخط */
}

.about-text-interactive .keyword.keyword-active::after {
    width: 100%; /* عند التفعيل، يمتد الخط لكامل عرض الكلمة */
}

/* .about-text-interactive .keyword.highlight { */ /* تمت إزالة هذا الكلاس، نعتمد على .keyword-active */
    /* opacity: 1; */
/* } */

/* .about-text-interactive .keyword:not(.highlight) { */ /* تمت إزالة هذا الكلاس */
    /* opacity: 1; */ /* الكلمات دائما ظاهرة بالكامل */
/* } */

.about-sidebar {
    flex: 0 0 300px; /* عرض ثابت للشريط الجانبي */
    padding: 20px;
    background-color: var(--light-gray); /* أو #fff إذا كنت تفضل */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.about-sidebar h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 10px 15px;
    background-color: #fff;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.interactive-visual-placeholder {
    padding: 15px;
    border: 1px dashed var(--border-color);
    border-radius: 5px;
    min-height: 150px; /* ارتفاع مبدئي */
    text-align: center;
}
.interactive-visual-placeholder h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}
.interactive-visual-placeholder p {
    font-size: 0.9rem;
    color: #666;
}

/* استجابة التصميم للشاشات الصغيرة */
@media (max-width: 992px) { /* نقطة تغيير للشاشات المتوسطة */
    .about-interactive-layout {
        flex-direction: column;
    }
    .about-sidebar {
        flex: 0 0 auto; /* يعود إلى الحجم الطبيعي */
        width: 100%;
        margin-bottom: 30px;
    }
    .filter-buttons {
        flex-direction: row; /* الأزرار تصبح أفقية */
        flex-wrap: wrap; /* تسمح بالالتفاف إذا لم يكن هناك مساحة كافية */
    }
    .filter-btn {
        flex-grow: 1; /* الأزرار تأخذ مساحة متساوية */
        text-align: center;
    }
}

@media (max-width: 768px) { /* نقطة تغيير للشاشات الصغيرة */
    /* تنسيقات قسم الـ Hero Section وأزرار cta-button */
    .hero-section .container { /* تحديد حاوية الأزرار داخل قسم الـ Hero */
        display: flex;
        flex-direction: column; /* ترتيب العناصر عموديًا */
        align-items: center; /* توسيط العناصر أفقيًا */
    }

    .hero-section .cta-button {
        margin: 10px 0; /* إضافة هوامش رأسية بين الأزرار */
        width: auto; /* جعل الأزرار تأخذ العرض الطبيعي لها */
        display: block; /* تحويل العناصر إلى عناصر Block */
    }
    
    /* تنسيقات filter-buttons وأزرار filter-btn (احتفظ بها كما هي أو عدلها حسب الحاجة) */
    .filter-buttons {
        flex-direction: column; /* الأزرار تعود عمودية لتوفير مساحة */
    }
    .filter-btn {
        text-align: left;
    }
}
/* --- END New interactive about styles --- */
.about-content-alt {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.about-text-full {
    width: 100%;
}

.about-text-full p {
    margin-bottom: 15px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-text-full p:last-child {
    margin-bottom: 0;
}



/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.service-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.service-item .service-icon {
    font-size: 2.5rem; /* Adjust if using actual icons */
    color: var(--accent-color);
    margin-bottom: 15px;
    display: block;
}

.service-item h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}
/* --- Experience Section (Timeline) --- */


.timeline {
    position: relative;
    max-width: 900px; /* Adjust as needed */
    margin: 0 auto;
    padding: 30px 0;
}

/* The TImeline Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background-color: var(--border-color); /* Or var(--accent-color) for more emphasis */
    z-index: 0; /* Changed from 1 to 0 to ensure the line stays in the background */
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    opacity: 0; /* For scroll animation */
    transform: translateY(20px); /* For scroll animation */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* Animate on scroll if visible (JS will handle adding 'visible' class or direct style) */
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}


/* Odd items on the left */
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 25px; /* Space from center line */
    text-align: right;
}

/* Even items on the right */
.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 25px; /* Space from center line */
    text-align: left;
}

/* Icons */
.timeline-icon {
    position: absolute;
    top: 15px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--border-color);
    color: var(--accent-color);
    /* position: relative; قم بإزالة هذا السطر */
}

.timeline-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--accent-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.timeline-icon::before { /* استهداف العنصر الزائف */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: -20px; /* Half of icon width to center it on the line */
    transform: translateX(0); /* Reset if any transform was inherited */
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -20px; /* Half of icon width to center it on the line */
    transform: translateX(0);
}

.timeline-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item:hover .timeline-content {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}


/* Arrow Pointers */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 20px; /* Align with icon or content */
    width: 0;
    height: 0;
    border-style: solid;
}

/* Arrow for items on the left, pointing right */
.timeline-item:nth-child(odd) .timeline-content::before {
    right: -15px; /* Width of the arrow */
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent #fff; /* Arrow color matches content bg */
}

/* Arrow for items on the right, pointing left */
.timeline-item:nth-child(even) .timeline-content::before {
    left: -15px; /* Width of the arrow */
    border-width: 10px 15px 10px 0;
    border-color: transparent #fff transparent transparent; /* Arrow color matches content bg */
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    display: block;
    margin-bottom: 8px;
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.timeline-content .company-name {
    font-size: 1rem;
    font-style: italic;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.timeline-content .description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

/* Responsive Timeline */
@media screen and (max-width: 768px) {
    .timeline::before {
        left: 20px; /* Move line to the left */
        transform: translateX(0);
    }

    .timeline-item {
        width: 100%;
        padding-left: 60px; /* Space for icon and line */
        padding-right: 15px;
        left: 0 !important; /* Override inline style from even items */
        text-align: left !important; /* All items align left */
    }

    .timeline-item:nth-child(odd) {
        padding-right: 15px; /* Reset */
    }
     .timeline-item:nth-child(even) {
        padding-left: 60px; /* Consistent padding */
    }


    .timeline-icon {
        left: 0px !important; /* Position icon relative to the new line position */
        /* width: 30px;
        height: 30px; */
    }
    /* .timeline-icon svg {
        width: 16px;
        height: 16px;
    } */

    .timeline-item:nth-child(odd) .timeline-icon,
    .timeline-item:nth-child(even) .timeline-icon {
        /* transform: translateX(-50%); */
        /* Override previous L/R positioning, now all icons are on left of content */
        right: auto;
        left: 0px;
    }

    /* All arrows point left */
    .timeline-content::before {
        left: -15px !important;
        right: auto !important;
        border-width: 10px 15px 10px 0 !important;
        border-color: transparent #fff transparent transparent !important;
    }
}
/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 250px; /* Or desired fixed height */
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(44, 62, 80, 0.9); /* primary-color with opacity */
    color: var(--text-light);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    text-align: center;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    margin-bottom: 5px;
    font-size: 1.3rem;
    color: #fff;
}

.portfolio-overlay p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.view-project-btn {
    background-color: var(--accent-color);
    color: #fff;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.view-project-btn:hover {
    background-color: #16a085; /* Darker accent */
}

/* --- Portfolio Modal --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideInModal 0.4s ease-out;
}

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


.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 1000; /* أو أي قيمة أعلى من قيم z-index للعناصر الأخرى */

    /* إضافة التنسيقات المطلوبة */
    background-color: rgba(0, 0, 0, 0.5); /* خلفية سوداء شفافة */
    border-radius: 50%; /* شكل دائري */
    width: 40px; /* تحديد عرض الخلفية الدائرية */
    height: 40px; /* تحديد ارتفاع الخلفية الدائرية */
    display: flex; /* استخدام Flexbox للتوسيط */
    justify-content: center; /* توسيط أفقي */
    align-items: center; /* توسيط رأسي */
}

.close-button:hover,
.close-button:focus {
    color: #333;
    background-color: rgba(0, 0, 0, 0.7); /* خلفية سوداء أغمق عند الت hover */
}

#modal-project-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
}
#modal-project-content img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 20px;
}
#modal-project-content p {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.7;
}
#modal-project-content .tech-stack {
    margin-top: 15px;
    font-size: 0.9rem;
}
#modal-project-content .tech-stack strong {
    color: var(--secondary-color);
}

/* --- Contact Section --- */
#contact-form {
    max-width: 700px;
    margin: 20px auto 0;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-secondary);
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.2);
}

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

.submit-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #16a085; /* Darker accent */
}

.error-message {
    display: block;
    color: #e74c3c; /* Red for errors */
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.form-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form Success Message */
.form-success {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.form-success h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.form-success p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Form Success Message */
.form-success {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.form-success h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.form-success p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}


/* --- Footer --- */
#footer {
    background-color: var(--secondary-color);
    color: var(--text-light);
    text-align: center;
    padding: 25px 0;
    margin-top: 40px; /* If sections are full width with different BGs */
}

#footer p {
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    h2 {
        font-size: 2rem;
    }

    /* Header & Nav for Mobile */
    #header .container {
        position: relative; /* For mobile menu positioning */
    }

    #navbar {
        display: none; /* Hide desktop nav */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 10px 0; /* Padding for menu items */
    }
    #navbar.active {
        display: block; /* Show when active */
    }

    #navbar ul {
        flex-direction: column;
        align-items: center; /* Center items */
    }

    #navbar ul li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }
    #navbar ul li a {
        display: block; /* Make links full width for easier tapping */
        padding: 10px 20px;
    }
    #navbar ul li a::after {
      display: none; /* Remove underline for mobile nav links */
    }


    #mobile-menu-toggle {
        display: block; /* Show burger icon */
    }
    #mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    #mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    #mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }


    /* Hero Section */
    .hero-section {
        height: auto; /* Adjust height */
        min-height: 80vh;
        padding-top: 80px; /* Ensure content below sticky header */
        padding-bottom: 60px;
    }
    .hero-section h2 {
        font-size: 2.2rem;
    }
    .hero-section .tagline {
        font-size: 1.2rem;
    }

    /* About Section */
    #about .about-content {
        flex-direction: column;
        text-align: center;
    }
    #about .about-image {
        margin-bottom: 30px;
        max-width: 250px;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr; /* Stack service items */
    }

    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr; /* Stack portfolio items */
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
    #modal-project-content h3 { font-size: 1.5rem; }
}

/* Scroll Margin Top for sections to account for sticky header */
section[id] {
  scroll-margin-top: var(--header-height);
}