@font-face {
    font-family: 'Made Mirage';
    src: url('fonts/made-mirage/made-mirage-regular.woff2') format('woff2'),
         url('fonts/made-mirage/made-mirage-regular.woff') format('woff'),
         url('fonts/made-mirage/made-mirage-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}


body {
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    /* background-color: #450303; */
    overflow-y: auto;
    padding: 40px;
    font-family: 'Made Mirage', 'sans-serif';
}

.title {
    color: white;
    margin: 20px 0;
    position: absolute;
    top: 20px;
    left: 50px;
}

.title h1,
.title h2 {
    margin: 0;
    color: inherit;
}

.title h1 {
    font-size: 40px;
    opacity: 0.9;
}

.title h2 {
    font-size: 30px;
    opacity: 0.6;
}

.title p {
    margin: 5px 0;
    font-size: 16px;
    opacity: 0.6;
    max-width: 800px;
    text-align: left;
}

a {
    color: rgb(171, 171, 171);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover,
a:active {
    color: #ff9690;
}

.back-link {
    position: absolute;
    top: 50px;
    right: 50px;
    font-family: 'Made Mirage', 'sans-serif';
}


#scramble-text {
    display: inline-block;
    max-width: 95vw;
    min-width: 32ch;
    white-space: nowrap;
    opacity: 0.6;
}

.scramble-resolved {
    opacity: 0.75;
}

.project-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px; 
}

.project-showcase p {
    color: white;
    font-size: 16px;
    opacity: 0.6;
    max-width: 800px;
    text-align: left;
    margin-top: 20px;
}

.project-section {
    display: flex;
    flex-direction: column;
    gap: 50px;
    width: 100%;
    max-width: 950px;
    margin-top: 50px;
}


.project-item {
    display: grid;
    gap: 10px; 
    align-items: start; 
    width: 100%;
}

.project-image {
    flex-shrink: 0; /* prevents image from shrinking */
    width: 380px; /* keep image column fixed */
}

.project-link {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: center;
}

.project-text {
    color: white;
    opacity: 0.9;
    text-align: left;
    justify-content: flex-start;
}

.project-title {
    font-size: 28px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.2;
    text-align: left;
    transition: opacity 0.5s;
}

.project-link:hover .project-title {
    opacity: 0.85;
    color: #ff9690;
}

.project-description {
    margin: 8px 0 12px;
    font-size: 16px;
    opacity: 0.6;
    line-height: 1.5;
    text-align: left;
}

.tag-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 115px;
    max-width: 700px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 10px;
    font-size: 15px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    opacity: 0.8;
    cursor: pointer;
    transition: background-color 0.25s ease, opacity 0.25s ease;
}

.tag:hover,
.tag.active {
    background-color: rgba(255, 150, 144, 0.6);
    opacity: 1;
}

.project-item .project-tags .tag {
    pointer-events: none;
    opacity: 0.7; 
}

.project-item .project-tags .tag:hover {
    background-color: rgba(255, 255, 255, 0.3);
}


.has-blurb {
    position: relative;
}

/* tooltip container */
.has-blurb::after {
    content: attr(data-blurb);
    position: absolute;
    left: 0;
    top: 120%;

    max-width: min(600px, 90vw); 
    width: max-content;


    padding: 10px 12px;
    border-radius: 12px;

    background-color: rgba(255, 255, 255, 0.9);
    color: #450303;

    white-space: pre-line;

    font-size: 15px;
    line-height: 1.4;
    font-style: normal;

    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;

    z-index: 10;
}

/* show on hover */
.has-blurb:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.project-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.85;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-link:hover img {
    transform: scale(1.02);
    opacity: 1;
}



/* =====================
   MOBILE RESPONSIVE CSS
   ===================== */
@media screen and (max-width: 768px) {

    .title {
        left: 20px;
        top: 20px;
    }

    .title h1 {
        font-size: 30px;
    }

    .title h2 {
        font-size: 24px;
    }

    .title p {
        font-size: 14px;
        max-width: 95vw; 
    }

    .back-link {
        top: 45px;
        right: -65px;
    }

    .tag-filter {
        display: flex;
        flex-direction: column;
        align-items: center; 
        width: 250%; 
        margin-top: 180px; 
        padding: 0 15px;
        box-sizing: border-box;
    }

    .tag-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tag {
        font-size: 13px;
        padding: 3px 8px;
    }

    .project-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100vw; /* really full width */
        margin: 0 auto;
        gap: 30px;
        padding: 0;
    }

    .project-item {
        margin-bottom: 35px; 
    }

    .project-link {
        display: grid;
        grid-template-areas:
            "title"
            "image"
            "description"
            "tags";
        row-gap: 5px;
        width: 100%;
        max-width: 100%;    
        margin: 0 auto;     
        padding: 0 auto;    
        box-sizing: border-box;
    }

    .project-text {
        display: contents;
    }

    .project-title {
        grid-area: title;
        text-align: center;
        font-size: 22px;
        line-height: 1.3;
        width: 100%;
    }

    .project-image {
        grid-area: image;
        width: 100%;       
        max-width: 100vw; 
        margin: 0 auto;
    }

    .project-description {
        grid-area: description;
        font-size: 14px;
        line-height: 1.4;
        text-align: center;
        width: 100%;
    }

    .project-tags {
        grid-area: tags;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
        width: 100%;
    }
    .has-blurb::after {
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
        max-width: 90vw;
        font-size: 14px;
        padding: 8px 10px;
    }

    .has-blurb:hover::after {
        transform: translateX(-50%) translateY(0);
    }
}

/* =====================
   VERY SMALL SCREENS (<480px)
   ===================== */
@media screen and (max-width: 480px) {
    .title h1 {
        font-size: 26px;
    }

    .title h2 {
        font-size: 20px;
    }

    .title p {
        font-size: 13px;
        max-width: 95vw;
    }

    #scramble-text {
        max-width: 90vw; 
    }
    .project-title {
        font-size: 20px;
    }

    .project-description {
        font-size: 13px;
    }

    .back-link {
        top: 45px;
        right: -275px;
    }

    .tag-filter {
        display: flex;
        flex-direction: column;
        align-items: center; 
        width: 250%; 
        margin-top: 140px; 
        padding: 0 15px;
        box-sizing: border-box;
        margin-bottom: 50px;
    }


    .tag-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tag {
        font-size: 12px;
        padding: 2px 6px;
        }

    .project-showcase {
        display: flex;
        align-items: center;  /* centers everything horizontally */
        width: 100%;           /* fill the screen */
        max-width: 100vw;      /* prevent horizontal overflow */
        margin: 0 auto;        /* center container */
        padding: 0 15px;       /* breathing room on sides */
        box-sizing: border-box; 
        gap: 30px;             /* space between project items */
    }
    
    .project-section {
        display: flex;
        flex-direction: column;
        align-items: center; /* center all project items horizontally */
        width: 100%;         /* full parent width */
        max-width: 100%;     /* prevent overflow */
        margin: 0 auto;      /* center container itself */
        gap: 30px;
        padding: 0 15px;     /* optional side padding for breathing room */
        box-sizing: border-box; /* include padding in width */
    }

    .project-item {
        width: 100%;          /* make item fill container width */
        max-width: 480px;     /* optional: constrain so it doesn’t stretch too wide */
        margin: 0 auto;       /* center each item inside container */
    }


    .project-link,
    .project-title,
    .project-description,
    .project-tags,
    .project-image {
        width: 100vw;     
        max-width: 100vw; 
    }

    .project-image {
        margin: 0 auto;
    }
}
