

/* A more generic, system-ui font stack is used for broad compatibility */
/* Define custom properties for cursors */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 2rem;
    cursor: none;

}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    max-width: 200px;
    height: auto;
    /* No transition needed */
}

.contact-email {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    font-size: 0.9rem;
}

h1 {
    display: inline-block;
    border: 2px solid white;
    padding: 0.5rem 1.5rem;
    font-size: 2rem;
    font-weight: normal;
    background-color: #000;
}

.portfolio-column {
    max-width: 700px;
    margin: 0 auto;
    transition: max-width 0.4s ease-in-out; /* Animate width change */
    will-change: max-width;
}

.portfolio-column.is-detail-mode {
    max-width: 1000px; /* The expanded width */
}

.portfolio-entry {
    text-decoration: none;
    color: inherit;
    display: block;
    /*border: 1px solid white;*/
    background-color: rgba(255, 255, 255, 0);
    /* Set a base max-width and center the entry within its container. */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
    overflow: hidden; /* Crucial for a clean height animation */
    /* Animate properties and hint browser for performance */
    will-change: height, max-width;
    transition: height 0.4s ease-in-out, max-width 0.4s ease-in-out;
}

/* When an entry is active, it expands to the full detail width. */
.portfolio-entry.is-active-detail {
    max-width: 1000px;
}

/* When the LAST entry is active, add a large bottom margin. */
/* This ensures there is enough scrollable space for the scrollTo behavior to work correctly. */
.portfolio-entry.is-active-detail:last-of-type {
    margin-bottom: 50vh; /* 50% of the viewport height */
}

/* Remove the bottom margin from the last portfolio entry to prevent excessive spacing at the end of the list. */
/* The body's padding will provide the final spacing. */
.portfolio-entry:last-of-type {
    margin-bottom: 0;
}

.portfolio-entry.is-minimized .entry-content {
    /* Hide the content area when the parent window is minimized */
    display: none;
}

.title-bar {
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*border-bottom: 1px solid white;*/
}

.title-text {
    font-weight: bold;
}
.window-buttons {
    display: flex;
    gap: 4px;
}

.window-button {
    position: relative; /* Add positioning context for icons */
    width: 20px;
    height: 20px;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.window-button:hover {
    background-color: #fff;
    color: #000;
}

/* Ensure link-based window buttons don't have an underline */
a.window-button {
    color: #fff; /* Override the default purple color for visited links */
    text-decoration: none; 
}

/* Apply pointer cursor to all interactive elements */
a[href],
button,
.window-button,
.portfolio-entry {
    cursor: var(--cursor-pointer);
}
/* Using pseudo-elements for the button icons */
.toggle-expand-button::before,
.toggle-expand-button::after {
    position: absolute;
    /* Use flexbox to perfectly center the icon content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Maximize Icon State (Default) */
.toggle-expand-button::before {
    content: '☐'; /* A hollow square character */
    opacity: 1;
    transform: scale(1);
}

/* Minimize Icon State (Hidden by default) */
.toggle-expand-button::after {
    content: '_';
    opacity: 0;
    transform: scale(0.8);
    /* The 'top: -2px' is no longer needed due to flexbox centering */
}

/* When the entry is active, flip the icon visibility */
.is-active-detail .toggle-expand-button::before {
    opacity: 0;
    transform: scale(0.8);
}
.is-active-detail .toggle-expand-button::after {
    opacity: 1;
    transform: scale(1);
}
.entry-content {
    padding: 10px; /* Restore padding for consistency */
}
.portfolio-image {
    width: 100%;
    display: block;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}



.detail-view-image {
    width: 100%;
    display: block;
    /* Use aspect-ratio and object-fit to ensure all images are the same size */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin-bottom: 1rem;
}

.detail-text {
    /* This content will be faded in by JS */
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.2s; /* Delay the fade-in */
}

.detail-description {
    line-height: 1.6;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Add space between the image grid and the description that follows it */
.detail-image-grid + .detail-text-container {
    margin-top: 1.5rem;
}

.detail-text-container {
    display: grid;
    /* Create a two-column layout, with the description taking more space. */
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: start; /* Align items to the top of their grid cell. */
    /* Add horizontal padding to give the text some breathing room from the edges. */
    padding: 0 0.5rem;
}

.detail-metadata {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
   
    padding-left: 2rem;
}

.detail-metadata p {
    margin: 0 0 0.5rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.metadata-key {
    color: rgba(255, 255, 255, 0.7);
}

.metadata-value {
    text-align: right;
}

.detail-text.is-visible {
    opacity: 1;
}

@media (min-width: 768px) {
    .detail-image-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .detail-view-image {
        margin-bottom: 0; /* Let the grid gap handle spacing */
    }
}

@media (max-width: 767px) {
    .detail-text-container {
        grid-template-columns: 1fr; /* Stack to a single column on smaller screens */
        gap: 1.5rem;
    }
    .detail-metadata {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.4);
        padding-left: 0;
        padding-top: 1.5rem;
    }
}

/* --- p5.js Background Sketch --- */
#background-sketch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Place it behind all other content */
    overflow: hidden; /* Prevent scrollbars from the canvas */
}

footer {
    text-align: center;
    margin-top: 4rem;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

footer p {
    margin: 0;
}