/* Basic Reset & Dark Theme Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #1e1e1e;
    /* Very dark background (Cursor-like) */
    --text-color: #cccccc;
    /* Light grey text */
    --primary-color: #ffffff;
    /* White for key elements */
    --card-bg: #252526;
    /* Dark gray for cards/sidebar */
    --border-color: #3e3e42;
    /* Dark gray borders */
    --hover-bg: #2a2d2e;
    --sidebar-width: 180px;
    /* Sidebar width variable */
    --active-color: #5dade2;
    /* Lighter blue accent */
    --accent-blue: #5dade2;
    /* Consistent lighter blue accent */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-y: scroll;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--bg-color);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

#logo-img {
    height: 36px;
    width: auto;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    text-transform: lowercase;
    transition: color 0.2s ease;
    position: relative;
}

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

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


/* Main Content Area */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

/* About Section */
#about {
    padding-top: 1rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    border-top: none;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

#about .about-content {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.about-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    position: relative;
}

.about-text {
    flex: 1;
    min-width: 0;
    max-width: 60%;
}

.about-image {
    flex: 0 0 auto;
    width: 40%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#name-heading {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    white-space: normal;
    overflow: visible;
    height: auto;
    min-height: 2.2em;
    max-width: 100%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#name-heading br {
    content: "";
    display: block;
    margin: 0;
    line-height: 0.1em;
}

.subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-color);
    font-weight: 400;
    margin-bottom: 1.5rem;
}


.about-description {
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.8;
    margin-top: 1.5rem;
    max-width: 600px;
}

#portrait-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Section Styling */
section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Projects Section */
#projects {
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    padding-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

#projects h2 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.projects-list {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.view-all {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

#projects-page {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

#projects-page h1 {
    margin-bottom: 3rem;
}

h1,
h2 {
    /* Section headings */
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    font-weight: 400;
    text-transform: lowercase;
}

/* Project Categories */
.project-category {
    margin-bottom: 4rem;
}

.project-category:last-child {
    margin-bottom: 0;
}

.project-category h3 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* Projects List - Minimal Style */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 1.5rem;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s ease;
    color: var(--text-color);
}

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

.project-item:hover {
    color: var(--active-color);
}

.project-item:hover .project-title {
    color: var(--active-color);
}

.project-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 0;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.project-desc {
    display: block;
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

.view-all {
    margin-top: 1.5rem;
    margin-left: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.view-all a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.view-all a:hover {
    color: var(--active-color);
    transition: color 0.2s ease;
    display: inline-block;
}

/* Contact Section */
#contact {
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    padding-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
    text-align: left;
}

#contact h2 {
    margin-bottom: 2rem;
    text-align: left;
    padding-left: 8rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
}

.contact-links {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    padding-left: 8rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
}

.contact-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

/* Style the icons directly */
.contact-links a i {
    font-size: 2rem;
    transition: color 0.2s ease;
    vertical-align: middle;
}

.contact-links a:hover {
    color: var(--active-color);
}

.contact-links a:hover i {
    color: var(--active-color);
}


/* Footer */
footer {
    text-align: left;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.1s forwards;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* When modal is visible or fading out */
.modal.visible,
.modal.fading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.visible {
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 0;
    padding: 40px;
    border: none;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 0;
}

.modal.visible .modal-content {
    opacity: 1;
    transform: translateY(0);
}

#modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 20px;
    /* Space for scrollbar */
}

#modal-body h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 2.5rem;
}

#modal-body img {
    max-width: 100%;
    height: auto;
    margin-bottom: 2rem;
    border-radius: 6px;
}

#modal-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

#modal-body ul {
    margin-bottom: 1.5rem;
    padding-left: 25px;
}

#modal-body li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

#modal-body a {
    color: var(--active-color);
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

#modal-body a:hover {
    color: var(--primary-color);
}

.close-btn {
    color: var(--text-color);
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 32px;
    font-weight: normal;
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: color 0.3s ease;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    line-height: 1;
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
    text-align: center;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--active-color);
}

/* Update mobile styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95vh;
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 20px;
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .main-content {
        padding: 5rem 1.5rem 2rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

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

    .about-image {
        width: 70%;
        margin: 2rem auto 0;
        max-width: 450px;
    }

    .about-text {
        flex-basis: auto;
        order: 2;
        width: 100%;
    }

    .about-image {
        flex-basis: auto;
        order: 1;
    }

    #portrait-img {
        width: 100%;
        max-width: 450px;
    }

    #name-heading {
        font-size: clamp(2rem, 10vw, 4rem);
        min-height: 2em;
        padding: 0.5em 0;
    }

    .subtitle {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
}


@media (max-width: 768px) {
    .main-content {
        padding: 5rem 1rem 2rem;
    }

    .top-nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    h2 {
        font-size: 2rem;
    }

    .contact-links a i {
        font-size: 1.3rem;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .about-image {
        width: 85%;
        max-width: 380px;
    }

    #portrait-img {
        width: 100%;
        max-width: 380px;
    }

    #name-heading {
        font-size: clamp(1.8rem, 12vw, 3rem);
        min-height: 1.8em;
        padding: 0.4em 0;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 4.5rem 1rem 2rem;
    }

    .top-nav {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    #logo-img {
        height: 28px;
    }

    .contact-links {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .contact-links a {
        margin: 0;
    }

    .contact-links a i {
        font-size: 2.8rem;
    }

    .modal-content {
        margin: 10% auto;
    }

    .about-image {
        width: 90%;
        max-width: 320px;
    }

    #portrait-img {
        width: 100%;
        max-width: 320px;
    }

    #name-heading {
        font-size: clamp(1.6rem, 14vw, 2.5rem);
        min-height: 1.6em;
        padding: 0.3em 0;
        line-height: 1.2;
    }

    .subtitle {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }

    .about-description {
        font-size: 0.95rem;
    }
}

/* Add fade-in animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add initial state and animation to main content */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

/* Add staggered animations for sections */
#about {
    padding-top: 3rem;
    padding-bottom: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    border-top: none;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

#projects {
    border-top: 2px solid var(--border-color);
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.4s forwards;
}

#contact {
    text-align: center;
    min-height: auto;
    padding: 4rem 0;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.6s forwards;
}

/* Add fade-in for top nav */
.top-nav {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.1s forwards;
}

/* Add fade-in for project cards */

/* Back Navigation */
.back-nav {
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--active-color);
    transform: translateX(-3px);
}

.back-btn i {
    font-size: 0.9rem;
}

/* Project Detail Page */
#project-detail {
    padding-top: 6rem;
}

.project-detail-content {
    max-width: 800px;
}

.project-detail-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 2rem 0;
}

.project-links {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.project-links a {
    color: var(--active-color);
    text-decoration: underline;
    font-weight: 600;
    margin-right: 2rem;
    transition: color 0.2s ease;
}

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

#project-detail h1 {
    margin-bottom: 1rem;
}

#project-detail p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

#project-detail ul {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

#project-detail li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}