/* --- Color & Font Variables --- */
:root { /* Light Theme */
    --bg-color: #f8f9fa; --bg-alt-color: #ffffff; --text-color: #212529; --text-muted-color: #6c757d; --accent-color: #0d6efd; --accent-hover-color: #0b5ed7; --card-shadow: 0 4px 10px rgba(0,0,0,0.1); --border-color: #dee2e6;
    --font-primary: 'Montserrat', sans-serif; --font-secondary: 'Lato', sans-serif;
}
body.dark-mode { /* Dark Theme */
    --bg-color: #121212; --bg-alt-color: #1e1e1e; --text-color: #f8f9fa; --text-muted-color: #adb5bd; --accent-color: #4dabf7; --accent-hover-color: #74c0fc; --card-shadow: 0 4px 15px rgba(0,0,0,0.3); --border-color: #495057;
}

/* --- Global & Initial Layout --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-secondary); 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    /* REMOVED: transition for background-color and color */
}
.portfolio-wrapper { min-height: 100vh; position: relative; }

/* --- Theme Toggle --- */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted-color);
    z-index: 1000;
}
.theme-toggle .fa-sun { display: none; }
body.dark-mode .theme-toggle .fa-sun { display: block; }
body.dark-mode .theme-toggle .fa-moon { display: none; }


/* --- Left Panel (Sidebar) --- */
.left-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* UPDATED: 'all' is replaced with specific properties to prevent color transition */
    transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), width 0.9s cubic-bezier(0.65, 0, 0.35, 1), top 0.9s cubic-bezier(0.65, 0, 0.35, 1), left 0.9s cubic-bezier(0.65, 0, 0.35, 1), padding 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
.profile-photo {
    width: 150px; height: auto; border-radius: 8px; margin-bottom: 1.5rem; border: 4px solid var(--accent-color); box-shadow: var(--card-shadow);
    transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
h1 { font-family: var(--font-primary); font-size: 3rem; margin-bottom: 0.5rem; }
.headline { font-size: 1.5rem; color: var(--text-muted-color); margin-bottom: 2rem; }
.view-work-btn { margin-bottom: 2rem; }
.social-links { margin-bottom: 2rem; }
.social-links a { font-size: 1.5rem; color: var(--text-color); margin: 0 0.75rem; transition: color 0.3s ease; }
.social-links a:hover { color: var(--accent-color); }

/* --- Right Panel (Content) --- */
.right-panel {
    opacity: 0; visibility: hidden; position: absolute;
    transition: opacity 0.8s ease-in-out 0.5s, visibility 0.8s ease-in-out 0.5s;
}

/* --- FINAL LAYOUT STATE (after button click) --- */
body.content-view { overflow: hidden; }
body.content-view .portfolio-wrapper {
    display: grid;
    grid-template-columns: 350px 1px auto;
}
body.content-view::before {
    content: ''; grid-column: 2; width: 1px; height: 100vh; background-color: var(--border-color); position: fixed;
    animation: fadeIn 0.8s ease-in-out 0.5s forwards; opacity: 0;
}
@keyframes fadeIn { to { opacity: 1; } }

body.content-view .left-panel {
    top: 0;
    left: 0;
    transform: translate(0, 0);
    width: 350px;
    height: 100vh;
    padding: 3rem 2rem;
    text-align: left;
    align-items: flex-start;
    background-color: var(--bg-alt-color);
    justify-content: flex-start;
}
body.content-view .profile-photo { width: 100px; }
body.content-view .view-work-btn { opacity: 0; visibility: hidden; height: 0; margin: 0; padding: 0; border: none; transition: all 0.5s ease; }

body.content-view .right-panel {
    opacity: 1;
    visibility: visible;
    position: static;
    grid-column: 3;
    height: 100vh;
    overflow-y: auto;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
}
body.content-view .right-panel main {
    flex-grow: 1;
}

/* --- Contact Section in Sidebar --- */
.contact-sidebar {
    opacity: 0;
    visibility: hidden;
    margin-top: auto;
    padding-bottom: 1rem;
    transition: opacity 0.8s ease-in-out 0.5s, visibility 0.8s ease-in-out 0.5s;
}
.contact-sidebar h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.contact-sidebar .cta-button { width: 100%; text-align: center; }
body.content-view .contact-sidebar { opacity: 1; visibility: visible; }

/* --- General Section Styling --- */
section { padding: 2rem 0; text-align: center; }
h2 { font-size: 2rem; margin-bottom: 2rem; text-align: center; }
.cta-button { display: inline-block; padding: 0.8rem 2rem; background: var(--accent-color); color: #fff; border-radius: 5px; font-size: 1.1rem; text-decoration: none; cursor: pointer; }

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted-color);
    /* REMOVED: transition for background-color and color */
}

/* --- Project Cards & About Me --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.project-card {
    background: var(--bg-alt-color);
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    text-align: left;
    /* UPDATED: Removed background-color and color from transition */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
body.dark-mode .project-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.project-card img { width: 100%; height: 200px; object-fit: cover; border-top-left-radius: 8px; border-top-right-radius: 8px; }
.project-card-content { padding: 1.5rem; }
.about-content { max-width: 800px; margin: 2rem auto; text-align: left; }
.about-content p { margin-bottom: 1.5rem; }


/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .left-panel { position: static; transform: none; max-width: 100%; padding: 4rem 2rem; }
    body.content-view .portfolio-wrapper { display: block; }
    body.content-view::before { display: none; }
    body.content-view .left-panel { position: static; width: 100%; height: auto; text-align: center; align-items: center; }
    body.content-view .right-panel { height: auto; overflow-y: visible; padding: 2rem; grid-column: auto; }
    .contact-sidebar { margin-top: 2rem; text-align: center; }
}

/* --- Animated Underline for Links --- */
.project-links a {
    position: relative;
    padding-bottom: 5px;
}
.project-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}
.project-links a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- Scroll Animations --- */
.project-card, #about, footer {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, filter 0.6s ease-out, transform 0.6s ease-out;
}
.project-card:nth-child(2) {
    transition-delay: 200ms;
}
.project-card:nth-child(3) {
    transition-delay: 400ms;
}
.project-card.show, #about.show, footer.show {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}
