/* ---
   Global Styles & Variables
   --- */
:root {
    --color-purple: #6e06f2;
    --color-dark: #24262f;
    --color-text: #4e525a;
    --color-text-light: #777e90;
    --color-light: #fcfcfd;
    --color-border: rgba(110, 6, 242, 0.4);

    --font-primary: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-light);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
    padding-top: 160px; /* Add padding to prevent content from hiding behind the fixed header */
}

/* Hide content initially to prevent FOUC when CSS is loaded asynchronously via JS */
body.fouc-hidden {
    opacity: 0;
    transition: opacity 0.3s ease-in-out; /* Smooth fade-in */
}

.container {
    width: 100%;
    max-width: 1400px;
    padding: 0 40px;
    display: flex;
    flex-direction: column; /* This gap controls the space between header, main, and footer */
    gap: 70px;
    padding-bottom: 50px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ---
   Typography
   --- */
.section-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 25px;
}

.section-title .highlight {
    color: var(--color-purple);
}

.section-subtitle {
    font-size: 18px;
    color: var(--color-text-light);
    max-width: 600px;
}

h1.section-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 25px;
}
/* ---
   Buttons
   --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-purple);
    color: white;
    border: 1px solid var(--color-purple);
}

.btn-primary:hover {
    background-color: #5805c1;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-dark);
    border: 1px solid var(--color-dark);
}

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

/* ---
   Header / Navigation
   --- */
.main-header {
    display: grid;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-light);
    z-index: 1000;
    padding: 20px 0; /* Remove horizontal padding */
}

.header-content {
    padding: 0 40px; /* Add padding here to match .container */
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.nav-container {
    display: contents;
}

.logo {
    font-weight: 700;
    font-size: 22px;
    color: var(--color-dark);
}


.logo .highlight {
    color: var(--color-purple);
}

.main-nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    font-weight: 600;
    font-size: 18px;
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-purple);
}

/* Hide mobile contact link on desktop */
.contact-mobile-link {
    display: none;
}

.header-right {
    justify-self: end;
}

.theme-toggle {
    background-color: var(--color-dark);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.theme-toggle i {
    font-size: 20px;
    color: var(--color-light);
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    justify-self: end;
}

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

main {
    display: flex;
    flex-direction: column;
    gap: 120px;
}



/* ---
   Hero Section
   --- */
.hero {
    display: flex;
    align-items: center;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding: 50px 0;
    scroll-margin-top: 100px;
}

.hero-text {
    flex: 2;
    display: flex;
    flex-direction: column;
    min-height: 400px; /* Set a fixed height for the text block to contain internal movement */
    gap: 25px;
}

.hero-text .greeting {
    font-size: 24px;
    color: var(--color-text);
}

.hero-text .title {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--color-dark);
    height: 145px; /* Set a fixed height to prevent any layout shift. */
}

.hero-text .title .highlight {
    color: var(--color-purple);
}

.cursor {
    display: inline-block;
    width: 4px;
    background-color: var(--color-dark);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-text .subtitle {
    font-size: 24px;
    line-height: 1.3;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

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

.profile-picture-container {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-picture {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    object-fit: contain;
    filter: grayscale(100%); /* Make the image black and white */
    transition: filter 0.3s ease;
}

.profile-picture:hover {
    filter: grayscale(0%); /* Return to color on hover */
}

/* ---
   Scroll Animation
   --- */
#skills {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#skills.visible {
    opacity: 1;
    transform: translateY(0);
}
/* ---
   Experience Section
   --- */
.experience-section {
    display: flex;
    gap: 50px;
}

.experience-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.experience-tab {
    padding: 15px 20px;
    cursor: pointer;
    font-size: 22px;
    font-weight: 500;
    color: var(--color-text-light);
    border-right: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.experience-tab.active {
    color: var(--color-purple);
}

.experience-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--color-purple);
}

.experience-content {
    flex: 3;
    padding-left: 50px;
}

.job {
    display: none; /* Hidden by default, shown with JS */
}

.job.active {
    display: block;
}

.job-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--color-dark);
    margin-bottom: 5px;
}

.job-title .company {
    color: var(--color-purple);
}

.job-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 30px;
}
.job-meta .job-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-duties {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.job-duties li {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    font-size: 18px;
    color: var(--color-text-light);
    line-height: 1.4;
}

.job-duties li .list-item-content {
    flex: 1;
}

.job-duties .tick-icon {
    color: var(--color-purple);
    font-size: 25px;
    flex-shrink: 0;
    margin-top: 1px;
}

.job-duties .role-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start; /* Override parent li alignment */
}

.job-duties .role-group .role-title {
    font-weight: 600;
    color: var(--color-dark);
    font-size: 18px;
}

.job-duties .role-group ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 5px;
    width: 100%;
}

.job-duties .role-group .role-date {
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
    color: var(--color-text-light);
}

/* Styles for nested sub-points */
.job-duties ul ul {
    margin-top: 15px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.job-duties ul ul li {
    font-size: 16px;
}

/* ---
   Skills Section
   --- */
section[id] {
    /* This ensures that when navigating to a section via an anchor link, it doesn't hide behind the fixed header. */
    scroll-margin-top: 100px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.skill-category h4 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 20px;
}

.skill-category ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-category li {
    font-size: 18px;
    color: var(--color-text-light);
}

/* ---
   My Story Section
   --- */
.my-story p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 1em;
}

.my-story p:last-child {
    margin-bottom: 0;
}

.my-story .highlight {
    color: var(--color-purple);
    font-weight: 500;
}

/* ---
   Contact Page
   --- */
#contact-page {
    display: flex;
    flex-direction: column;
    gap: 60px;
    text-align: center;
    align-items: center;
    top: 0;
}

.contact-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-header .section-title{
    margin-bottom: 0;
}

.contact-header .section-subtitle{
    max-width: 650px;
    text-align: center;
    margin-bottom: 50px;
}

.contact-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 500;
}

.info-item i {
    color: var(--color-purple);
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / 3;
}

.form-group label {
    font-weight: 600;
    color: var(--color-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #f7f7f7;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-purple);
    box-shadow: 0 0 0 3px rgba(110, 6, 242, 0.1);
}

.form-status {
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
}

.form-status.success {
    color: #28a745; /* Green for success */
}

.form-status.error {
    color: #dc3545; /* Red for error */
}

/* ---
   Blog Page
   --- */
.blog-page{
    padding-top: 100px;
}

.blog-posts-list {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 0 auto; /* Center the list */
}

.blog-post-item {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 40px;
}

.blog-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.post-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--color-dark);
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--color-purple);
}

.post-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.post-tags {
    display: flex;
    gap: 10px;
}

.tag {
    background-color: #f0f0f0;
    color: var(--color-text-light);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* ---
   Blog Post Detail Page
   --- */
.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.blog-post-content .post-title-detail {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.2;
    margin-bottom: 15px;
}

.blog-post-content .post-meta-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.blog-post-content .post-body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text);
}

.blog-post-content .post-body h2,
.blog-post-content .post-body h3 {
    color: var(--color-dark);
    margin-top: 2em;
    margin-bottom: 1em;
}

.blog-post-content .post-body p {
    margin-bottom: 1.5em;
}

.blog-post-content .post-body a {
    color: var(--color-purple);
    text-decoration: underline;
}

.blog-post-content .post-body ul, .blog-post-content .post-body ol {
    padding-left: 20px;
    margin-bottom: 1.5em;
}
/* ---
   Footer
   --- */
.main-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0 30px;
    padding-top: 50px;
    border-top: 1px solid #e0e0e0;
}

.footer-nav {
    grid-column: 1 / 2;
}

.footer-nav ul {
    display: flex;
    gap: 25px;
}

.footer-nav a {
    font-weight: 600;
    font-size: 18px;
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--color-purple);
}

.footer-socials {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    justify-content: flex-end;
    gap: 25px;
}

.footer-socials a i {
    font-size: 24px;
    transition: color 0.3s ease;
}

.footer-cta {
    grid-column: 1 / 2;
    text-align: left;
    padding-top: 40px;
}

.footer-cta h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.footer-cta h3 .highlight {
    color: var(--color-purple);
}

.footer-cta .buttons {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
}

.footer-copyright {
    grid-column: 2 / 3;
    text-align: right;
    align-self: center;
    color: var(--color-text-light);
    font-size: 16px; /* padding-top is inherited from footer-cta */
}

.footer-copyright-contact {
    grid-column: 2 / 3;
    text-align: right;
    align-self: center;
    color: var(--color-text-light);
    font-size: 16px; /* padding-top is inherited from footer-cta */
    padding-top: 40px;
}

.footer-copyright .highlight {
    color: var(--color-purple);
}

/* ---
   Responsive Styles
   --- */
@media (max-width: 810px) {
    .container {
        padding: 0 20px;
        gap: 50px;
    }

    body {
        padding-top: 77px; /* Adjust padding for mobile header height */
    }

    .main-header {
        padding: 20px 0; /* Reset padding to be vertical only */
    }

    /* Show mobile contact link and hide desktop icon */
    .contact-mobile-link {
        display: list-item;
    }

    .hamburger-menu {
        display: block;
        grid-column: 2 / 3; /* Position hamburger in the second column */
        grid-row: 1 / 2;    /* on the first row */
    }

    .nav-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen */
        width: 100%;
        height: 100vh;
        background-color: var(--color-light);
        transition: right 0.3s ease-in-out;
        overflow: hidden; /* Prevent scrollbar from appearing */
        z-index: 1000;
        padding: 20px;
    }

    .nav-container.active {
        right: 0; /* Slide in */
    }
    
    .header-content {
        grid-template-columns: 1fr auto; /* Logo on left, hamburger on right */
        padding: 0 20px; /* Match mobile container padding */
    }

    .main-nav ul {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .main-nav a {
        font-size: 28px;
    }

    .header-right {
        justify-self: center;
        display: none; /* Hide desktop icon on mobile */
    }

    /* Hamburger animation to 'X' */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        align-items: center;
    }

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

    .hero-text .title {
        font-size: 42px;
        min-height: 100px; /* Allow title to be 1 or 2 lines on mobile */
    }

    .hero-text .subtitle {
        font-size: 18px;
    }

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

    .footer-cta .buttons {
        flex-direction: column;
        align-items: center;
    }

    .profile-picture-container {
        width: 280px;
        height: 280px;
    }

    .profile-picture {
        width: 75%;
        height: 75%;
    }

    .section-title {
        font-size: 46px;
        text-align: center;
    }

    .experience-section {
        flex-direction: column;
    }

    .experience-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .experience-tab {
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
    }

    .experience-tab.active::before {
        width: 100%;
        height: 3px;
        left: 0;
        top: auto;
        bottom: -2px;
    }

    .experience-content {
        padding-left: 0;
    }

    .main-footer {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: center;
    }

    .footer-nav,
    .footer-socials,
    .footer-cta,
    .footer-copyright {
        grid-column: 1 / 2; /* Ensure all items take full width */
        padding-top: 20px;  /* Add consistent spacing */
        text-align: center;
    }

    .footer-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        padding-bottom: 20px;
    }

    .footer-socials {
        grid-row: auto;
        justify-content: center;
        padding-bottom: 20px;
    }

    .footer-copyright,
    .footer-copyright-contact {
        grid-column: 1 / 2; /* Take up full width */
        padding-top: 20px;
        text-align: center; /* Explicitly center the text */
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: 1 / 2;
    }

    .skill-category {
        text-align: center;
    }

}