:root {
    --bg-color: #FFF8F0; 
    --text-color: #333333;
    --accent-color: #CDBBA7;
    --accent-hover: #B5A492;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --muted-text: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
    --carousel-bg: rgba(250, 248, 242, 0.8);
    --carousel-hover: white;
    --carousel-arrow: var(--text-color);
}

html {
    scroll-behavior: smooth;
}

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

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px); /* Starts slightly lower */
    }
    100% {
        opacity: 1;
        transform: translateY(0);    /* Ends in its original position */
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.4s ease, color 0.4s ease;

}

body.dark-theme {
    --bg-color: #2b231d; 
    
    --text-color: #e6d5c3; 
    
    --accent-color: #8c735c; 
    --accent-hover: #735e4a;
    --muted-text: #a89f91; 
    --border-color: rgba(252, 237, 220, 0.526);

    --carousel-bg: rgba(230, 213, 195, 0.8); 
    --carousel-hover: #e6d5c3;              
    --carousel-arrow: #2b231d;

}

.back-to-top {
    display: flex;
    width: max-content;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-style: italic;
    font-family: var(--font-serif);
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
    margin: 3rem auto 0 auto; 
}

.back-to-top:hover {
    animation: bounceUp 1s infinite;
}

@keyframes bounceUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px); 
    }
}
header {
    width: 100%;
    max-width: 1100px;
    padding: 2rem;
}
 main, footer {
    width: 100%;
    max-width: 950px;
    padding: 0 2rem;

    opacity: 0; 
    animation: fadeUp 0.8s ease-out forwards;
    
    animation-delay: 0.5s;
 }

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.nav-links {
    display: flex;
    gap: 9rem;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 0.5rem;
    flex: 1;
}
.left-links {
    justify-content: flex-start; 
}

.right-links {
    justify-content: flex-end;  
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    display: inline-block; 
    
    transition: transform 0.3s ease; 
}

.nav-links a:hover {
    transform: rotate(-4deg); 
    scale: 1.1;
}

.logo-name {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
    padding: 0 2rem;
}
.logo-name a {
    text-decoration: none;     
    color: var(--text-color);  
}

.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-text {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--muted-text);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-style: italic;
    font-family: var(--font-serif);
    
    text-decoration: none; 
    color: var(--text-color); 
    cursor: pointer;
}

.scroll-indicator:hover {
    animation: bounce 1s infinite; 
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0); 
    }
    50% {
        transform: translateY(8px); 
    }
}

.section-title {
    font-family: var(--font-serif);
    text-align: center;
    font-style: italic;
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.about-content {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 300px;
    height: auto;
    object-fit: cover;
}

.about-text {
    flex: 1;
    font-size: 0.95rem;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.btn {
    display: block;
    width: max-content;
    margin: 0 auto;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--accent-hover);
}

footer {
    text-align: center;
    padding: 2rem 0 2rem 0;
    font-family: var(--font-serif);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

/* --- Projects Page Styling --- */

.page-title {
    font-family: var(--font-serif);
    text-align: center;
    font-style: italic;
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 1rem; /* Adds breathing room below the title */
}

.page-subtitle {
    text-align: center;
    font-size: 1rem;
    font-style: italic;
    font-family: var(--font-serif);
    color: var(--muted-text);
    margin-bottom: 4rem;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 5rem; /* The vertical space between each project */
}

.project-item {
    display: flex;
    gap: 3rem; 
    align-items: center; 
}

.project-image a {
    display: block;
}

.project-image img {
    width: 200px;
    height: 200px;
    border-radius: 50%; 
    object-fit: cover;  
    border: 1px solid rgba(0,0,0,0.05); 
    
    transition: transform 0.3s ease; 
    
    cursor: pointer; 
}

.project-image img:hover {
    transform: scale(1.1); 
}

.project-info {
    flex: 1; 
}

.project-info h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.project-date {
    font-size: 0.8rem;
    color: var(--muted-text);
    margin-bottom: 1rem;
}

.project-desc {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* The Links (Github/Dashboard) */
.project-link {
    font-size: 0.85rem;
    color: var(--text-color);
}

.project-link a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 3px; /* Pushes the underline slightly down for a cleaner look */
    transition: opacity 0.3s ease;
}

.project-link a:hover {
    opacity: 0.7;
}

/* --- Project Detail Page Styling --- */

.project-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-title {
    font-family: var(--font-serif);
    text-align: center;
    font-weight: 400;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* --- Image Gallery (Carousel) --- */
.carousel {
    position: relative;
    width: 100%;
    max-width: 800px; /* Limits how wide the gallery gets */
    height: 500px;    /* Fixed height to keep layout stable */
    margin-bottom: 3rem;
}

.carousel-track-container {
    height: 100%;
    width: 100%;
    overflow: hidden; /* Hides the images that are off-screen */
    border-radius: 8px; /* Optional: Slight curve to the image corners */
}

.carousel-track {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-in-out; /* The smooth sliding animation */
}

.carousel-slide {
    min-width: 100%; /* Forces each image to take up exactly 100% of the container */
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

/* Gallery Navigation Arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--carousel-bg);
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
color: var(--carousel-arrow);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--carousel-hover);
    transform: translateY(-50%) scale(1.1); /* Slight pop when hovered */
}

.carousel-btn.prev {
    left: -20px; /* Hangs slightly outside the image */
}

.carousel-btn.next {
    right: -20px;
}

/* --- Detail Text Styling --- */
.detail-content {
    max-width: 650px; /* Keeps line lengths comfortable for reading */
    width: 100%;
}

.detail-date {
    font-size: 0.9rem;
    color: var(--muted-text);
    margin-bottom: 2rem;
    font-style: italic;
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 0.5rem;
}

.detail-description {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.detail-description p {
    margin-bottom: 1.5rem;
}

/* --- Back to Projects Button --- */

.back-link-container {
    width: 100%;
    display: flex;
    justify-content: center;
    max-width: 1400px; /* Matches the width you set for your header earlier */
    margin: auto auto; /* Centers the container */
    padding-top: 4rem;
    padding-bottom: 0rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-style: italic;
    font-family: var(--font-serif);
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: max-content; /* Keeps the hover area tight around the text */
}

.back-link:hover {
    opacity: 0.7;
    transform: translateX(-5px); 
}

.carousel-caption {
    text-align: center;
    margin-top: 1rem;
    padding: 0 2rem;
    min-height: 2.5rem; /* Prevents the page from jumping if a caption spans two lines */
}

#caption-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--muted-text);
    transition: opacity 0.3s ease; /* Optional smooth fade */
}