/* ==== Base Styles ==== */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: #333;
}

body {
    background-color: #f5f5f5;
}

/* ==== Header & Footer Styles ==== */
header {
    position: relative;
    background-image: url('bgbb.jpg');
    background-size: cover;
    background-position: 440px center;
    background-attachment: fixed;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: fit-content;
}

header h1 {
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    margin: 0;
    white-space: nowrap;
    background-image: url('bgbb.jpg');
    background-size: cover;
    background-position: 440px center;
    background-attachment: fixed;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

header nav {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

header nav a {
    background-image: url('bgbb.jpg');
    background-size: cover;
    background-position: 440px center;
    background-attachment: fixed;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    flex-grow: 1;
}

header nav a.active {
    filter: brightness(1.5); 
}

header nav a:hover:not(.active) {
    filter: brightness(1.8);
    transform: scale(1.05);
}

main {
    padding: 0;
}

footer {
    background-color: #e9e9e9;
    padding: 1rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
    border-top: 1px solid #ddd;
}

/* ================================== */
/* ==== Home Page Specific Styles ==== */
/* ================================== */

html:has(body.home) {
    height: 100%;
}

body.home {
    height: 100%;
    background: url('bgbb.jpg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.content {
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
    opacity: 0;
    animation: fadeIn 2s ease-in-out forwards;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes top and bottom content to the edges */
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.home .title-main, .home .title-sub, .home .subtitle, .home .nav a {
    background: url('bgbb.jpg') no-repeat center center fixed;
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.title-main,
.title-sub {
    font-weight: 600;
}

.subtitle {
    font-weight: 400;
}

.home .nav a {
    text-decoration: none;
    transition: filter 0.3s, transform 0.3s;
    font-weight: 600;
    text-transform: uppercase;
}

.home .nav a:hover {
    filter: brightness(1.5);
    transform: scale(1.05);
}


/* ================================= */
/* ==== Gallery Page Styles ==== */
/* ================================= */

.project-gallery-container {
    position: relative;
    background-image: url('bgbb.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    padding: 5rem 2rem;
    width: 100%;
    box-sizing: border-box; 
}

.project-gallery-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    background: linear-gradient(to bottom, 
        rgba(255, 248, 245, 1) 0%,      
        rgba(255, 248, 245, 1) 40%,     
        rgba(255, 248, 245, 0) 80%      
    );
    z-index: 1; 
}

.gallery-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background-color: #ffffff;
    padding: 1rem;
    text-decoration: none;
    box-shadow: 6px 6px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0,0,0,0.1);
    position: relative;
    
    /* Initial state for animation */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.4s ease-in-out;
}

/* Final state for the animation */
.project-card.is-visible:nth-child(odd) {
    opacity: 1;
    transform: translateY(0) rotate(3deg);
}

.project-card.is-visible:nth-child(even) {
    opacity: 1;
    transform: translateY(0) rotate(-3deg);
}

.project-card:hover {
    box-shadow: 10px 10px 8px rgba(0, 0, 0, 0.4);
    transform: rotate(0deg) scale(1.05) translateY(-10px);
    z-index: 10; 
}

.card-image-wrapper {
    overflow: hidden; 
    background-color: #e0e0e0;
}

.card-thumbnail {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease-in-out;
}

.project-card:hover .card-thumbnail {
    transform: scale(1.05);
}

.card-body {
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
    text-align: center;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('bgbb.jpg');
    background-size: cover;
    background-position: center;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.card-description {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}


/* ================================== */
/* ==== Contact Page Styles ==== */
/* ================================== */


body.contact-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.contact-page main {
    flex-grow: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The main content card */
.contact-section {
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
    margin: 2rem;
    padding: 2rem 2.5rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 6px 6px 4px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.contact-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    /* ADDED: Cutout text effect */
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('bgbb.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.contact-section p {
    line-height: 1.6;
    color: #555;
}

.contact-links {
    margin-top: 2rem;
}


.contact-section a {
    color: #f4b8b8;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-section a:hover {
    color: #e49ca0;
    text-decoration: underline;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 500px) {
    .contact-section {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .contact-section h2 {
        font-size: 1.75rem;
    }
}

/* ==================================== */
/* ==== Biography Page Styles ==== */
/* ==================================== */

.bio-section {
    padding: 4rem 2rem;
}

.bio-content {
    display: flex;
    gap: 2rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

body.bio-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.bio-page main {
    flex-grow: 1; /* Pushes the footer to the bottom by filling available space */
}


/* --- Mobile Styles (default) --- */
.bio-content {
    flex-direction: column; 
}

.bio-text {
    text-align: center;
    order: 2; 
}

.bio-photo {
    order: 1; 
}

.bio-photo img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    /* On mobile, image fades from the bottom to blend with text */
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
}

.bio-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-top: 0;
    /* Darkened cutout text effect */
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('bgbb.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.bio-text p {
    line-height: 1.7;
    color: #555;
    text-align: justify;
}

/* --- Tablet & Desktop Styles --- */
@media (min-width: 768px) {
    .bio-content {
        flex-direction: row;
        gap: 4rem;
    }

    .bio-text {
        text-align: left;
        order: 1; 
        flex-basis: 60%;
        flex-shrink: 1;
    }

    .bio-photo {
        order: 2; 
        flex-basis: 35%;
        flex-shrink: 0;
    }

    .bio-photo img {
        width: 100%;
        height: auto;
        max-width: 350px;
        /* CORRECTED: Image is solid on the left and fades out on the right */
        -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
        mask-image: linear-gradient(to right, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
    }

    .bio-text h2 {
        font-size: 3rem;
    }
}

/* Styles for the fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================= */
/* ==== Project Page Template Styles ==== */
/* ======================================= */

.project-container {
    display: flex;
    flex-direction: column;
    background: #fff;
    padding-top: 3rem;
    padding-bottom: 5rem;
}

/* --- Sidebar Styles --- */
.project-sidebar {
    position: static;
    writing-mode: horizontal-tb;
    transform: none;
    width: 100%;
    box-sizing: border-box;
    padding: 2rem;
    text-align: center;
    order: 1;
}

.project-sidebar .title,
.project-sidebar .subtitle {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('bgbb.jpg') no-repeat center center fixed;
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    line-height: 1.2;
}

.project-sidebar .title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
}

.project-sidebar .subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
}

/* --- Main Content Styles --- */
.project-gallery-wrapper {
    order: 2;
    padding: 0 1.5rem;
}

.project-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.project-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.project-image-wrapper {
    position: relative;
    cursor: pointer;
    transform: rotate(calc(var(--tilt, 0deg)));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 6px 6px 4px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.project-image-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.4);
}

.project-image-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.project-description {
    width: 100%;
    box-sizing: border-box;
}

.project-description h3,
.project-description p {
    margin: 0 0 1rem;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('bgbb.jpg') no-repeat center center fixed;
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.project-description h3 {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
}

.project-description p {
    text-align: justify;
    font-family: 'Poppins', sans-serif;
}

/* --- Lightbox Styles --- */
.lightbox {
    position: fixed;
    display: none;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-radius: 4px;
    cursor: default;
}

.lightbox .close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lightbox .close:hover {
    transform: scale(1.1);
}

/* --- Navigation Bubble Styles --- */
.nav-bubble {
    position: fixed;
    bottom: 1.5rem;
    width: 80px;
    height: 80px;
    background-color: rgba(255, 248, 245, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    box-shadow: 6px 6px 4px rgba(0, 0, 0, 0.4);
    color: #333;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    z-index: 50;
    opacity: 0;
    transform: translateY(200%);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    line-height: 1.2;
}
.nav-bubble.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.nav-bubble:hover {
    transform: scale(1.05);
    box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.4);
}

.next-bubble {
    right: 1.5rem;
}
.back-bubble {
    right: calc(1.5rem + 80px + 0.5rem);
}


/* --- Scroll Animation --- */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Desktop & Tablet Styles --- */
@media (min-width: 768px) {
    .project-container {
        flex-direction: row;
    }
    
    .project-sidebar {
        position: fixed;
        top: 50%;
        left: 0;
        width: 100px;
        transform: translateY(-50%) rotate(180deg);
        writing-mode: vertical-rl;
        text-orientation: mixed;
        align-items: flex-start;
        justify-content: center;
        padding-left: 1rem;
        pointer-events: none;
    }

    .project-sidebar > div {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .project-sidebar .title { font-size: 3.5rem; }
    .project-sidebar .subtitle { font-size: 1.2rem; }
    
    .project-gallery-wrapper {
        margin-left: 240px; 
        padding: 3rem 4rem 3rem 2rem;
    }

    .project-entry {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }

    .project-image-wrapper, .project-description {
        flex: 1;
    }

    .project-description {
        padding-top: 2rem;
    }
}

@media (min-width: 1200px) {
    .project-content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
    }
}


/* --- DO NOT CHANGE YOUR FORMATTING FOR SCREEN DUMMY --- */

/* --- MOBILE STYLES (default) --- */
.content {
    padding: 3rem 1.5rem; 
}
.top-left {
    align-self: flex-start;
}
.bottom-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3rem; /* Space between text block and nav */
}
.bottom-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}
.title-main { font-size: 2.25rem; }
.title-sub { 
    font-size: 3.5rem;
    margin-bottom: 0.25rem;
}
.subtitle { 
    font-size: 1.25rem;
    margin-top: 0;
}
.home .nav a { font-size: 1rem; }


/* --- TABLET STYLES --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .content {
        padding: 1.5rem;
    }
    .title-main { font-size: 3.5rem; }
    .title-sub { font-size: 5rem; }
    .subtitle { font-size: 2.5rem; }
    .home .nav a { font-size: 1.1rem; }
}

/* --- DESKTOP STYLES --- */
@media (min-width: 1025px) {
    .content {
        padding: 1rem;
    }

    .bottom-row {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        align-items: flex-end;
    }

    .nav {
        align-items: flex-end;
        text-align: right;
        gap: 1.5rem;
    }
    .title-main { font-size: 4rem; }
    .title-sub { font-size: 6rem; margin: 0; }
    .subtitle { font-size: 3rem; margin: 0.5rem 0 1rem; }
    .home .nav a { font-size: 1.2rem; }
}


@media (max-width: 500px) {
    header { padding: 1rem; }
    header h1 { font-size: 1.75rem; }
    header nav a { font-size: 0.7rem; }
}