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

:root {
    --primary-color: #1e4e9e;
    --primary-dark: #4ca673;
    --secondary-color: #f08008; 
    --gray-color: #6b7280;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --header-height: 72px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8fafc;
    scroll-padding-top: var(--header-height);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(1.8rem, 4vw + 1rem, 3rem);
}

h2 {
    font-size: clamp(1.4rem, 2.8vw + 0.8rem, 2.2rem);
    color: var(--dark-color);
    position: relative;
    padding-bottom: 0.5rem;
}

h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

h3 {
    font-size: clamp(1.2rem, 1.5vw + 0.8rem, 1.5rem);
}

p {
    margin-bottom: 1rem;
    color: var(--gray-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: clamp(3rem, 5vw, 5rem) 0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

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

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.nav-tagline {
    font-size: 0.85rem;
    color: var(--gray-color);
    font-style: italic;
    font-weight: 400;
}

.btn-cv {
    background-color: var(--secondary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-cv:hover {
    background-color: #059669;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.hero-role {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 1.25rem;
    margin-top: 0.25rem;
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: underline;
}

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

/* Header & Navigation */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    min-height: var(--header-height);
}

.logo {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.8rem);
    font-weight: 700;
    color: var(--primary-color);
}

.logo span {
    color: var(--secondary-color);
}

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

.nav-links li {
    margin-left: clamp(1rem, 2vw, 2rem);
}

.nav-links a {
    font-weight: 500;
    color: var(--dark-color);
    position: relative;
    font-size: clamp(0.9rem, 1vw, 1rem);
}

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

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

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

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--dark-color);
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1001;
    transition: color var(--transition);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding-top: clamp(6rem, 8vw, 8rem);
    padding-bottom: clamp(3rem, 5vw, 5rem);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.5rem, 3vw, 3rem);
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-text h1 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.hero-text p {
    font-size: clamp(0.98rem, 1.1vw, 1.1rem);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-height: min(400px, 50vh);
    border-radius: var(--border-radius);
    display: block;
    object-fit: cover;
    box-shadow: var(--box-shadow);
}

.hero-btns {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* About Section */
.about {
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}

.portfolio-categories {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

.portfolio-categories li {
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-section {
    background-color: #f8fafc;
}

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

.skill-category {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

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

.skill-category h3 i {
    color: var(--secondary-color);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.skill-tag {
    background-color: #e0f2fe;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.section-intro {
    max-width: 700px;
    margin-bottom: 3rem;
}

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

.category-btn {
    padding: 0.6rem 1.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
}

.category-btn.active, .category-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.project-img {
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
    min-height: 140px;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.1rem, 1.2vw + 0.5rem, 1.3rem);
    color: var(--dark-color);
}

.project-description {
    margin: 1rem 0;
    color: var(--gray-color);
    line-height: 1.6;
}

.project-description ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.project-description li {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

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

.project-tag {
    background-color: #f3f4f6;
    color: var(--gray-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
}

/* Contact Section */
.contact {
    background-color: #f8fafc;
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
}

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

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

.contact-icon {
    background-color: #e0f2fe;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-btns {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    background-color: #708090;
    color: white;
    padding: 3rem 0;
    text-align: center;
}

footer .logo {
    color: white;
    font-size: 1.8rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: #d1d5db;
    font-size: 0.9rem;
}

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

.copyright {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-text {
        order: 1;
        max-width: 100%;
        width: 100%;
    }

    .hero-image {
        order: 2;
        max-width: 500px;
        width: 100%;
        margin: 0 auto;
    }

    .hero-image img {
        max-height: min(350px, 40vh);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-tagline {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 0;
        box-shadow: var(--box-shadow);
        transform: translateY(-100%);
        opacity: 0;
        transition: var(--transition);
        z-index: 999;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links:not(.active) {
        pointer-events: none;
    }

    .nav-links li {
        margin: 0.75rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    }

    .hero {
        padding-top: calc(var(--header-height) + 2rem);
        margin-top: 0;
    }

    body.menu-open {
        overflow: hidden;
    }

    .project-img {
        min-height: 150px;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: 64px;
    }
    
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .hero-btns {
        flex-direction: column;
        align-items: stretch;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .btn {
        width: 100%;
        max-width: none;
    }
    
    .project-categories {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .category-btn {
        width: 100%;
        max-width: 250px;
    }

    .hero-image img {
        max-height: 250px;
    }

    .project-img {
        min-height: 130px;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .section-intro {
        padding: 0;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .project-links .btn {
        width: 100%;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-btns {
        flex-direction: column;
    }
    
    .contact-btns .btn {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .hero-image img {
        max-height: 220px;
    }
    
    .project-img {
        min-height: 120px;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .skill-tag {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    h2:after {
        width: 40px;
        height: 3px;
    }
    
    .hero {
        padding-top: calc(var(--header-height) + 1.5rem);
    }
    
    .skills-container {
        gap: 1.5rem;
    }
    
    .skill-category {
        padding: 1.2rem;
    }
}

/* Prevent horizontal scrolling on very small screens */
@media (max-width: 320px) {
    html, body {
        overflow-x: hidden;
        position: relative;
    }
    
    .container {
        padding: 0 8px;
    }
    
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .category-btn:hover {
        background-color: white;
        color: inherit;
        border-color: #e5e7eb;
    }
    
    .category-btn.active:hover {
        background-color: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .project-card:hover {
        transform: none;
    }
    
    .nav-links a:hover:after {
        width: 0;
    }
}