/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rethink Sans', sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.5rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-link {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #1a1a1a;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #333;
}

.nav-link:hover::after {
    width: 100%;
}

/* Landing Section */
.landing {
    min-height: 110vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 2rem 4rem;
    text-align: center;
    position: relative;
    background-image: url('images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Fade to white at the bottom */
.landing::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10%; /* Adjust this to control how much of the bottom fades */
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none; /* Allows clicks to pass through */
    z-index: 1;
}

.landing-content {
    animation: fadeInUp 1s ease-out;
    position: relative;
    z-index: 2; /* Ensures content stays above the fade overlay */
}

.landing-name {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.landing-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    color: #666;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    z-index: 2; /* Ensures scroll indicator stays above the fade overlay */
}

/* Portfolio Section */
.portfolio {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 6rem;
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.section-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

/*this means that the portfolio items are initially hidden and then fade in as they are scrolled into view*/
.portfolio-item {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    max-width: 100%;      /* Full width of the portfolio container */
    align-self: stretch;  /* Ensure each item spans the full width */
}

.portfolio-image-wrapper {
    position: relative;
    overflow: visible;
    transition: transform 0.4s ease;
    display: flex;              /* Place image and title side by side */
    align-items: center;        /* Vertically center title relative to image */
    width: 100%;
}

.portfolio-item[data-side="left"] .portfolio-image-wrapper {
    flex-direction: row;        /* Image on the left, title on the right */
}

.portfolio-item[data-side="right"] .portfolio-image-wrapper {
    flex-direction: row-reverse; /* Image on the right, title on the left */
}

.portfolio-image-wrapper:hover {
    transform: translateY(-5px);
}

/* Only the image gets the hover shadow, not the title area */
.portfolio-image-wrapper:hover .portfolio-image-container {
    /*this is the shadow made when you hover over the image*/
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.051);
}

.portfolio-image-container {
    overflow: hidden;           /* Clip the image */
    flex: 0 0 65%;              /* default image size at 65% */
    max-width: 65%;             /* default image size at 65% */
}

/* add more lines to edit portfolio image size independently */
.portfolio-image-container--measure {
    flex: 0 0 45%;
    max-width: 45%;
}

.portfolio-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.portfolio-image-wrapper:hover .portfolio-image {
    transform: scale(1.06);
}

.portfolio-overlay {
    position: relative;         /* Sit in normal flow next to the image */
    background: transparent;
    padding: 0 2rem;            /* Horizontal breathing room in white space */
    pointer-events: none;       /* Clicks pass through so item still toggles dropdown */
    flex: 1;                    /* Take up remaining white space */
    display: flex;
    align-items: center;        /* Vertically center the title text */
    justify-content: center;    /* Horizontally center inside the white space */
    text-align: center;
}

.portfolio-title {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a; /* Black text */
    letter-spacing: 1px;
    margin: 0;
    white-space: nowrap;
}

/* Portfolio Details (Expandable Dropdown) */
.portfolio-details {
    width: 100vw; /* Full viewport width */
    margin: 2.5rem 0 0;
    margin-left: calc(50% - 50vw); /* Extend to left and right edges of the screen */
    max-height: 0;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 -16px 32px rgba(0, 0, 0, 0.04), /* subtle top shadow */
        0 16px 32px rgba(0, 0, 0, 0.04);  /* subtle bottom shadow */
    transition: max-height 1s ease;
    position: relative;
}

.portfolio-details-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 4rem 8rem;
    position: relative;
}

.portfolio-details-tagline {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.portfolio-details-intro {
    font-size: 0.98rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 720px;
}

.portfolio-details-intro-with-collab {
    position: static;
}

.portfolio-details-intro-text {
    padding-right: 260px;
}

.portfolio-details-collab {
    position: absolute;
    top: 2.5rem;
    right: 4rem;
    width: 200px;
    text-align: left;
}

.portfolio-details-collab-label {
    font-size: 0.98rem;
    font-weight: 400;
    color: #8a8a8a;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-family: 'Rethink Sans', sans-serif;
}

.portfolio-details-collab-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: center;
}

.portfolio-details-collab-logo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
}
/*this is for the dezeen hyperlink*/
.portfolio-details-intro a {
    color: #1a1a1a;
    text-decoration: underline;
    transition: color 0.3s ease;
}
.portfolio-details-intro a:hover {
    color: #7f7f7f;
}

.portfolio-details-video {
    margin: 2rem 0;
    max-width: 100%;
}

.portfolio-details-video video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    margin: 3rem 0;
}

.portfolio-details-image-full-width {
    margin: 3rem 0;
    max-width: 100%;
}

.portfolio-full-image {
    width: 100%;
    height: auto;
    display: block;
}

.portfolio-details-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem; /* Gap between the 2 images */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem; /* Gap at the bottom of images */
}

.portfolio-details-media-item {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.portfolio-media-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Expanded state, the height of the expanded dropdown */
/* Max-height is set dynamically via JavaScript based on content */
.portfolio-item.is-open .portfolio-details {
    max-height: 50000px; /* Very large default, will be overridden by JS for each item */
}

/* Close Arrow Icon */
.portfolio-close-arrow {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 1.5rem 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item.is-open .portfolio-close-arrow {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.portfolio-close-arrow:hover {
    color: #666;
}

.portfolio-close-arrow svg {
    width: 40px;
    height: 40px;
}

/* About Section */
.about {
    padding: 8rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.about-content {
    animation: fadeInUp 0.8s ease-out;
}

.about-text {
    max-width: 700px;
    margin: 3rem auto 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

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

/* Contact Section */
.contact {
    padding: 8rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.contact-content {
    animation: fadeInUp 0.8s ease-out;
}

.contact-text {
    font-size: 1.1rem;
    color: #666;
    margin: 2rem 0 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.contact-link {
    font-size: 1.2rem;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #666;
}

.social-links {
    display: flex;
    gap: 2rem;
}

.social-link {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #1a1a1a;
}

/* Footer */
.footer {
    padding: 3rem 4rem;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Smooth scroll offset for fixed navbar */
section {
    scroll-margin-top: 80px;
}


/* Responsive layout tweaks */

/* Medium screens (tablets, small laptops) */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }

    .portfolio {
        padding: 6rem 2rem;
    }

    .portfolio-details-inner {
        padding: 2rem 2rem 6rem;
    }

    .portfolio-details-collab {
        right: 2rem;
    }
}

/* Small screens (phones) */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1.5rem;
    }

    .nav-menu {
        gap: 1.5rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .landing {
        padding: 2rem 1.5rem 3rem;
        min-height: 90vh;
    }

    .landing-name {
        font-size: 2.8rem;
        letter-spacing: 1px;
    }

    .landing-subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .portfolio {
        padding: 5rem 1.5rem;
    }

    .portfolio-image-wrapper {
        flex-direction: column !important;
        align-items: flex-start;
    }

    .portfolio-image-container {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .portfolio-overlay {
        padding: 1rem 0 0;
        justify-content: flex-start;
        text-align: left;
    }

    .portfolio-title {
        font-size: 1.5rem;
        white-space: normal;
    }

    .portfolio-details {
        margin-top: 2rem;
    }

    .portfolio-details-inner {
        padding: 2rem 1.5rem 5rem;
    }

    .portfolio-details-media {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-details-media-item {
        min-height: auto;
    }

    .portfolio-details-collab {
        position: static;
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .portfolio-details-intro-text {
        padding-right: 0;
    }

    .about,
    .contact {
        padding: 6rem 1.5rem;
    }

    .footer {
        padding: 2rem 1.5rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .nav-menu {
        gap: 1rem;
        justify-content: center;
    }

    .landing-name {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2.4rem;
    }

    .portfolio-details-inner {
        padding: 1.75rem 1.25rem 4.5rem;
    }
}

