/* --- GLOBAL VARIABLES & RESET --- */

@import url('https://fonts.googleapis.com/css2?family=Handjet:wght,ELSH@100..900,2&family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=Reddit+Sans:ital,wght@0,200..900;1,200..900&display=swap');

/* .instrument-sans-<uniquifier> {
  font-family: "Instrument Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
} */

/* .handjet-<uniquifier> {
  font-family: "Handjet", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
  font-variation-settings:
    "ELGR" 1,
    "ELSH" 2;
} */


:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --hover-orange: #FF5A00;
    --grid-gap: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Instrument Sans", sans-serif;
    overflow-x: hidden;
    padding: 24px;
}


/* --- NAVIGATION --- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-color);

    /* Main container still handles overall left/right positioning */
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* Image shows standard spacing/padding. Adjusting previously solid padding for clean bar visual */
    padding: 20px 24px;
    margin-bottom: 20px;
    font-family: "Handjet", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Base styles for standard navigation buttons/text elements */
.nav-btn {
    /* Standard clean sans visual from reference image */
    font-weight: 400;
    font-size: 1rem;
    /* image has slightly smaller font than hero */
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s ease;
    font-weight: 700;

}

.nav-btn:hover {
    color: var(--hover-orange);
    /* Removing transform translate as it clashes with reference visual simplicity */
}

/* Specific minimal look for Name element */
.nav-name {
    font-weight: 700;
}


/* --- NEW LAYOUT MECHANICS --- */

/* Clustering logic: Use gaps for narrow spacing within groups */
.nav-group {
    display: flex;
    align-items: center;
}

.nav-left {
    /* Critical grouping space between Name and Marquee Role (implied cluster left) */
    gap: 15px;
    /* specific narrow spacing like image 1 visual logic */
}

.nav-right {
    /* Critical grouping space between About and Archives (implied cluster right) */
    gap: 30px;
    /* specific wider spacing within the cluster logic */
}


/* --- THE SLOW MARQUEE MECHANICS --- */

.marquee-container {
    margin-left: 80px;
    overflow: hidden;
    /* Hide excess text content */
    position: relative;
    /* Create a fixed "slot" where the marquee can loop */
    width: 250px;
    /* Adjust based on desired marquee window width */
    height: 1.5em;
    /* Ensure single line, matching text height */
    line-height: 1.5em;
    cursor: default;
    /* Avoid making role text look clickable */
}

.marquee-content {
    display: flex;
    /* NEW: Forces the container to be exactly as wide as both texts combined */
    width: max-content;

    /* Hardware acceleration to prevent stutter */
    will-change: transform;

    animation: marquee 15s linear infinite;
    white-space: nowrap;
}

.nav-role {
    font-family: inherit;
    /* standard system visual stack */
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Essential padding-right: acts as the "gap" before the duplicate loop appears */
    padding-right: 30px;
}

/* The CSS Animation for flawless looping */
@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }

    /* CHANGED: Move exactly half the width (one text instance) */
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* --- HERO SECTION (VIDEO & TEXT) --- */
.hero {
    position: sticky;
    /* CHANGED: This pins the video in place */
    top: 24px;
    /* NEW: Matches your body padding so it sticks perfectly */
    z-index: 1;
    /* NEW: Keeps the hero in the background */
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    margin-bottom: 80px;
    /* background-color: #1A85CB; */
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    font-weight: bold;
    will-change: transform, opacity;
}

.text-left {
    text-shadow: 3px 3px 7px rgba(0, 0, 0, 0.4);
    font-family: "Handjet", sans-serif;
    font-size: 1.5rem;
    max-width: 450px;
}

.text-right {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    font-family: "Handjet", sans-serif;
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
}

/* --- WORKS SECTION & GRID --- */
.works-section {
    position: relative;
    /* NEW: Required for z-index to work */
    z-index: 10;
    /* NEW: Pulls this section above the hero */
    background-color: var(--bg-color);
    /* NEW: Makes the background solid black */
    margin-top: 200px;
    padding-top: 40px;
    /* NEW: Gives a nice buffer before the title covers the video */
    padding-bottom: 40px;
    /* NEW: Gives breathing room at the bottom of the page */
}

.section-title {
    font-family: "Handjet", sans-serif;
    letter-spacing: 2px;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--grid-gap);
}

.span-3 {
    grid-column: span 3;
}

.span-2 {
    grid-column: span 2;
}

.project-card {
    position: relative;
    /* background-color: #FF5A5F; */
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:nth-child(2) {
    transition-delay: 0.1s;
}

.project-card:nth-child(3) {
    transition-delay: 0.1s;
}

.project-card:nth-child(4) {
    transition-delay: 0.2s;
}

.project-card:nth-child(5) {
    transition-delay: 0.3s;
}

.project-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-footer {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-footer .line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--text-color);
    margin: 0 15px;
    opacity: 1;
}

/* Ensure the card behaves correctly as a link */
a.project-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    /* Maintains the footer alignment */
    cursor: pointer;
}

/* Build the black overlay */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* 70% Black */
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Instrument Sans", sans-serif;
    /* Matches your footer font */
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    z-index: 3;
    /* Sits above the image and footer */
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Trigger the overlay when hovering over the card */
.project-card:hover .hover-overlay {
    opacity: 1;
}

/* PRO-TIP: Add a subtle image zoom on hover for a high-end feel */
.project-img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-img {
    transform: scale(1.05);
    /* Zooms the image slightly under the black overlay */
}


/* =========================================
   PROJECT DETAIL PAGE SPECIFIC STYLES 
   ========================================= */

.project-container {
    max-width: 1400px;
    /* Constrains max width on giant monitors */
    margin: 0 auto;
    /* Centers the content */
    padding-bottom: 80px;
}

/* --- 1. Header Intro --- */
.project-header {
    margin-bottom: 40px;
}

.project-title {
    font-family: "Handjet", sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    line-height: 1;
}

.project-tags {
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.project-desc {
    font-family: "Instrument Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 900px;
    /* Keeps line lengths readable */
    color: #e0e0e0;
}

/* --- 2. YouTube Video Box --- */
.project-media {
    margin-bottom: 80px;
}

.video-wrapper {
    position: relative;
    /* Crucial for the shield to attach properly */
    width: 100%;
    aspect-ratio: 16 / 6;
    /* background-color: #63FF5A; */
    /* The green from your mockup as a fallback */
}

.video-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
    /* Keeps scrolling intact until they click to interact with the video */
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 1. The Solid Curtains */
.content-layer {
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
    /* The solid black that hides the text */

    /* This padding ensures the margins from your inner sections don't create transparent holes */
    padding-top: 1px;
    padding-bottom: 60px;
}

/* Forces the first layer to cover the screen so the text below it cannot peek */
.content-layer:first-of-type {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* This also beautifully centers your title and video vertically! */
}

/* 2. The Transparent Window */
.parallax-window {
    position: relative;
    z-index: 1;
    /* Sits underneath the content layers */

    /* This height determines how long the user scrolls while looking at the text */
    height: 100vh;
}

/* --- 3. Giant Statement Text --- */
.statement-text {
    position: sticky;
    top: 50%;
    /* Locks the top of the text to the middle of the screen */
    transform: translateY(-100%);
    /* Pulls it up perfectly into the center */

    text-align: center;
    font-family: "Handjet", sans-serif;
    text-transform: uppercase;

    margin: 0;
    /* Removes the old margins so it doesn't break the window container */
}

.statement-text h3 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.statement-text h2 {
    font-size: 5.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 0.9;
    margin-top: 5px;
}





/* --- 4. Image Grids --- */
.project-section {
    margin-bottom: 150px;
}

.img-grid {
    display: grid;
    gap: var(--grid-gap);
    margin-bottom: 10px;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.grid-1 {
    grid-template-columns: 1fr;
}

.grid-img {
    width: 100%;
    height: auto;
    /* CHANGED: Let the aspect ratio dictate the height */
    /* Forces exactly 4:3 math */
    object-fit: cover;
    /* Ensures the image doesn't stretch or squish inside the box */
    /* background-color: #FF5A5F;  */
}

.offset-grid {
    /* Pushes everything to the left and shrinks the content */
    padding-right: 10%;
}

.single-img {
    aspect-ratio: 21 / 9;
    /* Cinematic wide ratio for the single image */
}

.img-caption {
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.7rem;
    color: #f6f6f6;
    margin-top: 8px;
    /* Adds a little breathing room between the photo and the text */
    text-transform: uppercase;
    /* Optional: gives it a nice technical/blueprint feel */
    letter-spacing: 1px;
}

.grid-figure {
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* --- Split Hero Layout --- */
.project-hero-split {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    /* Makes the video side slightly wider than the text side */
    gap: 60px;
    /* Adds breathing room between the text and the videos */
    align-items: start;
    /* Keeps the text pinned to the top of the row */
    margin-bottom: 80px;
}

/* Removes the old bottom margins so the wrapper handles the spacing */
.project-hero-split .project-header,
.project-hero-split .project-media {
    margin-bottom: 0;
}

/* --- 5. Split Text Sections --- */
.split-text {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Left col is 1/3, Right col is 2/3 */
    gap: 40px;
    margin-top: 30px;
}

.split-left h3 {
    font-family: "Handjet", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.split-right p {
    font-family: "Instrument Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* --- Vertical Text Column --- */
.text-column h3 {
    font-family: "Handjet", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    /* Adds a nice gap between the title and the paragraph */
}

.text-column p {
    font-family: "Instrument Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0e0;
}


/* --- FOOTER --- */
footer {
    position: relative;
    z-index: 10;
    /* Keeps it above the hero video just like the works section */
    background-color: var(--bg-color);

    display: flex;
    justify-content: space-between;
    align-items: center;

    /* Padding to match the grid and a subtle top border for separation */
    padding: 40px 24px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);

    font-family: "Handjet", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--hover-orange);
}

/* --- EMAIL COPY INTERACTION --- */
#copy-email-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Prevents the text from jumping when clicked */
    min-width: 180px;
}

.email-text,
.copy-feedback {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* The hidden "COPIED!" text */
.copy-feedback {
    position: absolute;
    opacity: 0;
    transform: translateY(10px);
    color: var(--hover-orange);
    font-weight: 600;
}

.margin__bottom-m {
    margin-bottom: 90px;
}

.margin__bottom-l {
    margin-bottom: 140px;
}

/* --- THE ACTIVE STATE (Triggered by JS) --- */
#copy-email-btn.is-copied .email-text {
    opacity: 0;
    transform: translateY(-10px);
}

#copy-email-btn.is-copied .copy-feedback {
    opacity: 1;
    transform: translateY(0);
}

.highlight-text {
    font-family: "Handjet", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

/* --- Inline Body Links --- */
.text-link {
    color: var(--text-color);
    text-decoration: underline;
    /* Keeps it obvious that it's clickable */
    text-underline-offset: 4px;
    /* Pushes the underline down slightly for a modern, high-end look */
    text-decoration-thickness: 1px;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.text-link:hover {
    color: var(--hover-orange);
    text-decoration-color: var(--hover-orange);
}

/* --- Custom Modifier Classes --- */
.custom-gap {
    gap: 100px;
    /* Change this number to whatever looks best (e.g., 20px, 80px) */
}

/* --- Custom Column Ratios --- */
.custom-ratio {
    /* Example: Makes the right side (video) twice as wide as the left side (text) */
    grid-template-columns: 1.5fr 1fr;
}

/* --- Floating Back to Top Button --- */
.back-to-top-btn {
    position: fixed;
    bottom: 40px;
    left: 50%;
    z-index: 99;
    /* Keeps it above everything else */

    /* Sleek Pill Shape */
    padding: 10px 20px;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    /* Gives it a premium frosted glass look over images */
    border: 1px solid rgba(255, 255, 255, 0.2);

    /* Typography matching your nav */
    color: black;
    font-family: "Handjet", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    /* Starts slightly lower */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top-btn:hover {
    background-color: var(--hover-orange);
    color: var(--bg-color);
    /* Turns text black when hovering over orange */
    border-color: var(--hover-orange);
    transform: translateY(-5px);
    /* Jumps up slightly on hover */
}

/* The class JS will add when we scroll down */
.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0); 
}





/* =========================================
   MOBILE RESPONSIVENESS FIXES
   ========================================= */

@media (max-width: 800px) {

    /* --- 1. Header Fixes --- */
    nav {
        padding: 20px 15px;
        /* Tighter padding to give us more horizontal room */
    }

    .nav-right {
        gap: 12px;
        /* Pulls About and Archives closer together */
    }

    /* Keep the left side as a row */
    .nav-left {
        flex-direction: row;
        /* Forces them side-by-side */
        align-items: center;
        gap: 100px;
        /* Small gap between Name and Role */
    }

    /* Stop the animation and let it sit naturally */
    .marquee-container {
        margin-left: 0;
        width: auto;
        height: auto;
    }

    .marquee-content {
        animation: none;
        /* Stops the scroll */
    }

    /* Hide the duplicate text */
    .nav-role:nth-child(2) {
        display: none;
    }

    /* The Magic Trick: Shrink and wrap the text so it fits on one row */
    .nav-role {
        padding-right: 0;
        white-space: normal;
        /* Overrides the nowrap from desktop so it can stack */
        line-height: 1.2;
    }

    /* --- 2. Hero & Content Reveal Fixes --- */
    /* Completely hide the hero video and text */
    .hero {
        display: none;
    }

    /* Pull the works section up so there isn't a massive gap where the video was */
    .works-section {
        margin-top: 60px;
        padding-top: 0;
    }

    /* --- 3. Works Grid Mobile Layout --- */
    .portfolio-grid {
        display: flex;
        flex-direction: column;
    }

    /* --- 4. Footer Fixes --- */
    /* Force the footer to stay horizontal (row) instead of stacking */
    footer {
        flex-direction: row;
        justify-content: space-between;
        padding: 40px 20px;
        font-size: 0.8rem;
        /* Scale the text down slightly to fit side-by-side */
    }

    /* Shrink the email button's minimum width so it doesn't squish the copyright */
    #copy-email-btn {
        min-width: 140px;
    }


    /* --- 5. Mobile Typography Adjustments --- */

    /* The giant statement h2 ("BABA MALAY?") */
    .statement-text h2 {
        font-size: 5rem;
        /* Shrink from 5.5rem */
        letter-spacing: 2px;
        line-height: 1;
    }

    /* The statement subhead ("WHAT IS") and split-text h3 */
    .statement-text h3,
    .split-left h3 {
        font-size: 2.3rem;
        /* Shrink from 2.5rem / 2rem */
        letter-spacing: 1px;
        margin-bottom: 10px;
        /* Adds breathing room before the paragraph starts */
    }

    /* Your standard paragraphs (Project description & split-text descriptions) */
    p,
    .project-desc,
    .split-right p {
        font-size: 0.95rem;
        /* Slightly smaller than the 1rem desktop size */
        line-height: 1.5;
        /* Keeps the lines readable and not too cramped */
    }

    /* --- 6. Mobile Video Height --- */
    .video-wrapper {
        /* Changes it from cinematic (16/6) to standard widescreen (16/9) */
        aspect-ratio: 16 / 9;
    }

    .offset-grid {
        padding-right: 0;
    }

    .project-hero-split {
        grid-template-columns: 1fr;
        /* Stacks text on top, video on bottom */
        gap: 40px;
    }

    /* Mobile Typography adjustment for this new column */

    .text-column h3 {
        font-size: 1.6rem;
    }

    .text-column p {
        font-size: 0.95rem;
    }

    .custom-gap {
        gap: 20px;
    }

    .back-to-top-btn {
        width: 15%; /* Shrinks the box to take up 85% of the screen */
        bottom: 80px;
        right: 20px;
        padding: 8px 15px;
        font-size: 1rem;
    }

}