:root {
    --color-primary: #0066cc;
    --color-primary-hover: #0052a3;
    --color-primary-active: #003d7a;
    --color-bg-light: #ffffff;
    --color-bg-subtle: #f8f9fa;
    --color-text-dark: #1a1a1a;
    --color-text-medium: #2d2d2d;
    --color-text-muted: #6c757d;
    --color-border: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --transition-fast: 150ms;
    --transition-normal: 250ms;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text-medium);
    background-color: var(--color-bg-light);
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: box-shadow var(--transition-normal);
}

.nav.scrolled {
    box-shadow: var(--shadow-sm);
}

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

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-decoration: none;
    letter-spacing: -0.02em;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--color-text-medium);
    font-weight: 500;
    transition: color var(--transition-fast);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--color-text-dark);
    margin: 5px 0;
    transition: all var(--transition-normal);
}

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

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 6rem 2rem 4rem;
    text-align: center;
}

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

.hero-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--color-text-muted);
    box-shadow: var(--shadow-sm);
}

.hero-image img {
    width: 125%;
    height: 125%;
    object-fit: contain;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.hero-title {
    font-size: 1.5rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    font-size: 1rem;
    font-family: inherit;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

/* Section Styles */
section {
    padding: 4rem 2rem;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: -0.02em;
}

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

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

.about-text h3 {
    font-size: 1.5rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--color-text-medium);
    font-size: 1.05rem;
}

.about-image {
    width: 100%;
    max-width: 300px;
    height: 300px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 4rem;
    color: var(--color-text-muted);
    box-shadow: var(--shadow-sm);
    margin-left: auto;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


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

.skill-category {
    background-color: var(--color-bg-light);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.skill-category h3 {
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.skill-tag {
    background-color: var(--color-bg-subtle);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text-medium);
    border: 1px solid var(--color-border);
}

/* Projects Section */
.projects {
    background-color: var(--color-bg-subtle);
}

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

.project-card {
    background-color: var(--color-bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
}

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

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.project-image img {
    width: 100%;
    height: 100%; /* adjust as needed */
    object-fit: cover;
    display: block;
}

.project-content {
    padding: 1.5rem;
}

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

.project-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.25rem;
}

.project-subtitle {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
}

.project-description {
    color: var(--color-text-medium);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

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

.tech-badge {
    background-color: var(--color-bg-subtle);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--color-text-medium);
    border: 1px solid var(--color-border);
}

.project-cta {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

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

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

.modal-header {
    padding-left: 2rem;
    padding-right: 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background-color: var(--color-bg-light);
    z-index: 10;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text-muted);
    line-height: 1;
    padding: 0.5rem;
    transition: color var(--transition-fast);
}

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

.modal-body {
    padding: 2rem;
}

.modal-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.modal-section {
    margin-bottom: 1.25rem;
}

.modal-section h3 {
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.modal-section li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

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

.modal-link {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
}

.modal-gallery {
    width: 100%;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gallery-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-normal);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 10;
    color: var(--color-text-dark);
    box-shadow: var(--shadow-md);
}

.gallery-nav:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav:disabled:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-text-dark);
    transform: translateY(-50%) scale(1);
}

.gallery-prev {
    left: 1rem;
}

.gallery-next {
    right: 1rem;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-bg-subtle);
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--color-bg-subtle);
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.gallery-thumbnail {
    min-width: 80px;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail:hover {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.gallery-counter {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Hide gallery section if no images */
#gallerySection.hidden {
    display: none;
}

/* Contact Section */
.contact-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.contact-intro {
    margin-bottom: 3rem;
}

.contact-intro p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--color-text-dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

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

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

.form-error {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group.error .form-error {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #dc3545;
}

.contact-direct {
    margin-bottom: 2rem;
}

.contact-email {
    font-size: 1.125rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-email:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-medium);
    text-decoration: none;
    transition: all var(--transition-normal);
    border: 1px solid var(--color-border);
}

.social-link:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-4px);
}

/* Footer */
footer {
    background-color: var(--color-text-dark);
    color: white;
    text-align: center;
    padding: 2rem;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    z-index: 999;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-4px);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-md);
        height: 100vh;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    section {
        padding: 3rem 1.5rem;
    }

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

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

    .about-image {
        max-width: 200px;
        height: 200px;
        margin: 0 auto;
    }

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

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

    .modal {
        padding: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    .gallery-main {
        height: 300px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-prev {
        left: 0.5rem;
    }
    
    .gallery-next {
        right: 0.5rem;
    }
    
    .gallery-thumbnail {
        min-width: 60px;
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}