:root {
    --primary-color: #2c3e50;
    --accent-color: #1abc9c;
    --text-color: #444;
    --bg-color: #ebf7f5;
    --section-padding: 3rem 1.5rem;
    --max-width: 900px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset and base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1rem;
}

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

a:hover,
a:focus {
    color: #159d87;
    outline: none;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

header p.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 0;
    text-align: center;
    margin: 0 auto 0.5rem auto;
    max-width: 300px;
    /* optional */
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-content {
    text-align: center;
    flex: 1 1 auto;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    font-weight: 600;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

nav a:hover,
nav a:focus {
    border-color: var(--accent-color);
}

/* Sections */
section {
    padding: var(--section-padding);
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

/* Add this part for the side highlight effect */
section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(135deg, #3498db, #1abc9c);
    transition: height 0.4s ease;
}

/* Hover effect to extend the side bar */
section:hover::before {
    height: 100%;
}


section:last-of-type {
    border-bottom: none;
}

section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
}

/* Underline for headings */
section h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 0.3rem;
    border-radius: 2px;
}

p {
    max-width: 600px;
    margin: 0 0 1rem 0;
}

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

.skill-card {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    user-select: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Projects preview */
.projects-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.preview-text {
    flex: 1 1 60%;
    min-width: 250px;
}

.btn {
    background-color: var(--accent-color);
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 25px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    user-select: none;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn:hover,
.btn:focus {
    background-color: whitesmoke;
    outline: none;
}

.resume-btn {
    display: inline-block;
    margin-top: 1rem;
}

/* Contact list */
#contact {
    padding: var(--section-padding);
}

#contact h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

/* One item per line */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    margin: 12px 0;
    font-size: 18px;
}

.contact-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.contact-list a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-list a:hover,
.contact-list a:focus {
    color: #159d87;
    outline: none;
}

/*Footer part*/
footer {
    width: 100%;
    text-align: center;
    margin-top: 4rem;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    border-top: 1px solid #eee;
}



/* Highlight effect on hover/focus for sections and skill cards */
section:hover,
section:focus-within,
.skill-card:hover,
.skill-card:focus {
    background-color: #e0f7f4;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
    border-radius: 8px;
    cursor: pointer;
}

.skill-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.edu-exp-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.org-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 1. Small screen layout changes (including text-align) */
@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    nav {
        gap: 1rem;
    }

    .projects-preview {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-text {
        flex: 1 1 100%;
    }

    .contact-list li {
        flex: 1 1 100%;
    }

    .header-wrapper {
        flex-direction: column-reverse;
        align-items: center;
        gap: 1rem;
    }

    .profile-pic {
        margin-top: 1rem;
    }

    section,
    section * {
        text-align: left !important;
    }

    .contact-list a,
    .contact-list li {
        font-size: 14px;
    }

    .edu-exp-box {
        flex-direction: row;
        align-items: center;
    }

    .org-logo {
        width: 40px;
        height: 40px;
    }

    .skill-name {
        text-align: center !important;
        justify-content: center;
        align-items: center;
    }
}

/* 2. Touch device behavior overrides */
@media (hover: none),
(pointer: coarse) {

    section:hover,
    section:focus-within,
    .skill-card:hover,
    .skill-card:focus {
        background-color: unset;
        outline: none;
    }

    section {
        background-color: var(--bg-color);
        box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
        border-radius: 8px;
        margin-bottom: 2rem;

        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    section:focus {
        outline: none;
    }

    section::before {
        height: 100%;
    }
}