/* A more generic, system-ui font stack is used for broad compatibility */
/* --- CUSTOM FONT DEFINITIONS --- */
@font-face {
    font-family: 'Xolonium';
    src: url('../assets/Xolonium-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'DINish';
    src: url('../assets/DINish-SemiBold.ttf') format('truetype');
    font-weight: normal; /* Using SemiBold as the normal weight */
    font-style: normal;
}
@font-face {
    font-family: 'DINish';
    src: url('../assets/DINish-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
body {
    font-family: 'DINish', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold; /* Use the bold version of DINish for all body text */
    background-color: #ffffff;
    color: #2f2f2f;
    margin: 0;
    cursor: none;
    padding-top: 6rem; /* Add padding to push main content below the fixed header */
}

/* --- CUSTOM CURSOR STYLES --- */
.custom-cursor {
    position: fixed; /* Positions the dot relative to the viewport */
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%; /* Makes it a circle */
    z-index: 9999; /* Ensures it's on top of all other content */
    pointer-events: none; /* Allows clicks to "pass through" the dot */

    /* This centers the dot on the actual cursor position */
    transform: translate(-50%, -50%);

    /* Adds a smooth transition for movement and size changes */
    transition: transform 0.1s ease-out;
}

/* This class will be added by JavaScript on hover */
.custom-cursor.grow {
    transform: translate(-50%, -50%) scale(2.5);
    background-color: rgba(255, 0, 0, 0.5); /* Optional: make it semi-transparent on grow */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: vec3(0.98);
    z-index: 100;
    padding: 1rem 2rem; /* Add padding to match body's horizontal padding */
    box-sizing: border-box; /* Ensures padding is included in the width */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    max-width: 1400px; /* Match portfolio column width */
    margin: 0 auto; /* Center the top bar content */
}

.header-socials {
    margin-top: 0; /* Reset margin */
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.75rem; /* Made the font smaller */
    align-items: left;
}

.header-socials a {
    margin: 0 0.25rem; /* Add a little space between links */
}

.logo {
    max-width: 150px; /* This rule was duplicated, keeping one */
    height: auto; 
}

.headertext {
    font-family: 'Xolonium', "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #2f2f2f;
    margin: 0; /* Reset margin */
    font-size: 1.5rem;
}

/* --- ABOUT SECTION (STATIC) --- */
#about-section {
    display: flex; /* Use flexbox for layout */
    flex-direction: column-reverse; /* Stack logo above text */
    align-items: center; /* Center items horizontally */
    gap: 1.5rem; /* Adjust gap for vertical layout */
    margin: 0rem 0rem 0rem; /* Removed top margin as body padding handles it */
    max-width:70%;
}

.about-text-wrapper {
    /* flex: 3; */ /* No longer needed for stacked layout */
}

.about-description {
    line-height: 1.2;
    margin: 0;
    font-size: 1.0rem;
}



/* Styling for all clickable metadata links */
.metadata-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.metadata-link:hover {
    color: rgb(255, 0, 0);
}

h1 {
    display: inline-block;
    border: 2px solid rgb(255, 255, 255);
    padding: 0.5rem 1.5rem;
    font-size: 2rem;
    font-weight: normal;
    background-color: #fff;
}

.portfolio-column {
    max-width: 1400px;
    margin: 0 auto; /* Centering the column */
    padding: 0 2rem; /* Add horizontal padding to match header */
    transition: max-width 0.4s ease-in-out;
    will-change: max-width;
}

.portfolio-column.is-detail-mode {
    max-width: 1400px;
}

.portfolio-entry {
    text-decoration: none;
    color: inherit;
    display: block;
    background-color: rgba(0, 0, 0, 0);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
    overflow: hidden;
    will-change: height, max-width;
    transition: height 0.4s ease-in-out, max-width 0.4s ease-in-out;
}

.portfolio-entry.is-active-detail {
    max-width: 1400px;
}

.portfolio-entry.is-active-detail:last-of-type {
    margin-bottom: 50vh;
}

.portfolio-entry:last-of-type {
    margin-bottom: 0;
}

.portfolio-entry.is-minimized .entry-content {
    display: none;
}

.title-bar {
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-text {
    font-family: 'DINish', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1.3rem; /* Make portfolio titles larger than body text */
}
.window-buttons {
    display: flex;
    gap: 4px;
}

.window-button {
    position: relative;
    width: 20px;
    height: 20px;
    border: 1px solid black;
    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: #000;
    color: #ffffff;
}

a.window-button {
    color: #000;
    text-decoration: none;
}

a[href],
button,
.window-button,
.portfolio-entry {
    cursor: var(--cursor-pointer);
}

/* --- UPDATED STYLES FOR COLLAPSE CONTROL --- */

/* This is the main container for the text and the round button. It's hidden by default. */
.collapse-control {
    display: none;
    align-items: center;
    gap: 0.5rem; /* Adds space between the text and the button */
    cursor: var(--cursor-pointer);
}

/* We only show the collapse control on an active (expanded) entry */
.portfolio-entry.is-active-detail .collapse-control {
    display: flex;
}

/* This styles the "collapse entry" text */
.collapse-text {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.8rem;
    transition: color 0.2s ease; /* Smooth color transition on hover */
}

/* This styles the round button graphic */
.collapse-graphic {
    /* Make it bigger */
    width: 24px;
    height: 24px;
    /* Make it round */
    border-radius: 50%;
    /* Adjust font size for the "-" sign */
    font-size: 16px;
}

/* --- Optional: Add a nice hover effect for the whole control --- */
.collapse-control:hover .collapse-text {
    color: rgb(255, 0, 0);
}

/* The hover for the graphic itself is already handled by the .window-button:hover rule */

.entry-content {
    padding: 10px;
}

/* --- START: NEW STYLES FOR OVERLAY EFFECT --- */
.portfolio-image-container {
    position: relative; /* Establishes a positioning context for the overlay */
    line-height: 0; /* Removes any extra space below the image */
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* STYLES FOR RESPONSIVE YOUTUBE EMBED */
.video-embed-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (9 / 16 = 0.5625) */
    break-inside: avoid; /* Prevents splitting across columns in grid view */
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.portfolio-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(59, 62, 103, 0.6); /* Semi-transparent grey */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1; /* Ensures overlay is on top of the image */
}

.portfolio-entry:not(.is-active-detail):hover .portfolio-image-container::before {
    opacity: 1; /* Show the overlay on hover */
}
/* --- END: NEW STYLES FOR OVERLAY EFFECT --- */


.portfolio-image {
    width: 100%;
    height: auto; /* This lets the height adjust automatically */
    display: block;
}

.detail-image-caption {
    text-align: right;
    margin-top: 0.1rem;
    margin-bottom: 1rem;
    font-size: 0.8em;
    color: #555;
    white-space: pre-line;
}


.detail-view-image {
    width: 100%;
    height: auto; /* This lets the height adjust automatically */
    display: block;
}

.detail-text {
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.2s;
}

.detail-description-header {
    font-weight: bold;
    margin-bottom: 0.5rem;
}


.detail-description {
    line-height: 1.2;
    flex: 3; /* Assign flex-grow factor */
    font-family: 'DINish', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.is-active-detail .detail-description,
.is-active-detail .detail-metadata {
    cursor: var(--cursor-pointer);
}

.detail-text-container + .detail-image-grid {
    margin-top: 1.5rem;
}

.detail-text-container {
    margin-top: 2rem; /* Changed from negative to positive to add space */
    margin-bottom: 4rem;
    display: flex; /* Use flexbox for better alignment control */
    align-items: baseline; /* Align children based on their text baseline */
    gap: 2rem;
    padding: 0 0.5rem;
}

.detail-metadata {
    flex: 2; /* Assign flex-grow factor */
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.2;
    padding-left: 2rem;
}

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

.metadata-key {
    color: #000;
}

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

footer {
    text-align: center;
    margin-top: 4rem;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    color: #000000;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    /* Added styles for positioning and layout */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
}

footer p {
    margin: 0;
}

.footer-logo {
    max-width: 100px; /* Adjust size as desired */
    width: 100%;      /* Ensures it scales down on mobile */
    height: auto;
    margin-top: 2.0rem;
    margin-bottom: 2.0rem; /* Adds space between logo and the copyright text */
    display: block;
}

/* NEW STYLES FOR FOOTER CREDENTIALS */
.footer-credentials {
    max-width: 400px; /* Constrain width similar to about-metadata */
    width: 100%; /* Ensure it takes full width of its container up to max-width */
    margin-top: 1rem; /* Space above the credentials */
    margin-bottom: 2rem;
    text-align: center; /* Align text within the container */
}

.footer-credentials p {
    display: flex;
    justify-content: space-between; /* Distribute key and value */
    margin-bottom: 0.2rem; /* Reduce line spacing */
    font-size: 0.75rem; /* Slightly smaller font for footer */
    gap: 1rem;
}

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

@media (min-width: 768px) {
    .detail-image-grid {
        /* Remove the 'display: grid' properties */
        column-count: 2;
        column-gap: 1rem;
    }

    /* Add this rule for the containers inside the grid */
    .detail-image-container {
        break-inside: avoid; /* Prevents an image from splitting across columns */
        margin-bottom: -1rem; /* Re-introduce vertical spacing */
    }

    .detail-view-image {
        margin-bottom: 1;
    }
}


@media (max-width: 767px) {
    .custom-cursor {
        display: none;
    }

    #about-section {
        max-width:94%;    
    }
    /* --- RESPONSIVE HEADER TEXT --- */
    .headertext {
        font-size: 0.65rem; /* Further reduce font size for the main studio name */
    }
    .header-socials {
        font-size: 0.35rem; /* Further reduce font size for social links */
    }
    /* --- END RESPONSIVE HEADER TEXT --- */

    /* --- RESPONSIVE ABOUT SECTION --- */
    /* About section styles are now global */
    /* --- END RESPONSIVE ABOUT SECTION --- */

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

    .detail-description {
        font-size: 0.65rem;
    }

    .detail-image-caption {
        font-size: 0.5rem;
    }

    .detail-text-container {
        grid-template-columns: 1fr;
        gap: 1.0rem;
    }
    .detail-metadata {
        border-left: none;
        border-top: 1px solid rgb(255, 255, 255);
        padding-left: 0;
        padding-top: 1.5rem;
        font-size: 0.5rem;
    }

/* --- ADD THESE NEW LINES TO FIX THE FOOTER --- */
    
    /* 1. Shrink the general footer text */
    footer {
        font-size: 0.6rem; /* Reduced from 0.8rem */
        margin-top: 2rem;  /* Reduce top spacing */
    }

    /* 2. Shrink the footer logo */
    .footer-logo {
        max-width: 60px; /* Reduced from 100px */
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    /* 3. Ensure the JS-generated credentials match the new small size */
    .footer-credentials p {
        font-size: 0.6rem; 
        max-width: 100%;
    }

        .footer-credentials {
        font-size: 0.6rem; 
        max-width: 70%;
    }
}

#background-sketch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}
