/*

CSS for all pages on oling.dev
with a focus on smoothness, intuitive UI/UX and user psychology (Doherty threshold) for maximum satisfaction

*/

html {

    /* Account for scrollbar */
    overflow-y: scroll;
}

body {
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    padding: 0;
    background-color: rgb(16, 16, 20);
    color: rgb(233, 233, 233);
    user-select: none;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    
    /* Add some space on the side! */
    margin-left: 5%;
    margin-right: 5%;

    margin-top: 3%;
}

/* Top header "navbar" colour */
.nav a, .bottom-sticky-bar-content a {
    color: #00acff;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav {
    font-size: 200%;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 5%;
}

header > p > span > a {
    color: #00acff;
}

header > p {
    margin: 0 auto 1.5rem;
    align-self: stretch;
    text-align: center; 
}

/* Colour change hover effect */
a:hover {
    color: #8ad8ff;
    transition: 0.5s;
}

a:not(:hover) {
    color: #00acff;
    transition: 0.5s;
}

/* Resize top GH | LI | CV links */
.nav a:hover {
    font-size: 110%;
}

.nav a:not(:hover) {
    font-size: 90%;
}


/* Main page grid layouts */
.main-grid-layout {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    grid-column-gap: 1rem;
    grid-row-gap: 3rem;
    padding: 10px;
    text-align: center;

    /* Add decent gap */
    margin-bottom: 10rem;
}

#name-header {
    font-size: 2rem;
}

p {
    font-size: 1.2rem;
}

/* "My Projects h1 */
#title-projects, #title-projects-container {
    display: inline;
    font-size: 2rem;
    /* padding-left: 1rem; */
    > #mainText {
        text-decoration: underline;
    }
}

#orderByLabel {
    font-size: 1.2rem;
    text-align: left;
    justify-content:center;
    align-self: baseline;
    color: #000;
    background-color: rgb(214, 214, 214);
    outline-color: transparent;
    outline-offset: .75rem;
    outline-style: solid;
    outline-width: 0;
    border-radius: .5em;
    height: 1.8rem;
    margin: auto;
}

/* Buttons within each project card 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
.projectButtonContainer {
    display: none;

    /* 03/07/2025 Fixes button alignment issues when nested - fix by Copilot (o4-mini) */
    position: absolute;
    bottom: 0.25rem;          /* pin to bottom, adjust as needed */
    left: 50%;             /* start at half‐width */
    transform: translateX(-50%); /* shift back by half its own width */
    margin: 0;             /* clear out the old margins */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 2rem;
    gap: 0px 20px;

    padding: 25px;
}

.projectButtonContainer > button {
    background-color: #eeeeee;
    font-size: large; 
    border-radius: .75em;
    padding: 3px 10px;

    outline-color: transparent;
    outline-offset: .75rem;
    outline-style: solid;
    outline-width: 0;
}

.projectButtonContainer > button:hover {
    /* font-size: larger; */
    transition: .4s; 
    background-color: #ffffff;
}

.projectButtonContainer > button:not(:hover) {
    /* font-size: large; */
    transition: .4s; 
}

/* Specifics for repository/view */
.repo-button, .open-button {
    background-color: #ffffff;
}

/* Override for disabled ones */
button:disabled, button:disabled:hover {
    font-size: large !important;
    transition: none !important; 
    background-color: #eeeeee !important;
}

.main-grid-project-card {
    outline-color: transparent;
    outline-offset: .75rem;
    outline-style: solid;
    outline-width: 0;
    border-radius: .75rem; /* creates curved corner */
    overflow: hidden; /* keeps content inside the rounded corners */
    position: relative;
    align-items: center;
    transition: transform 0.4s ease;
    background-color: rgba(30, 30, 34, 0.7);
    padding: 1rem;
    margin: 1.3rem;
    flex: 1 1 calc(26% - 1rem); /* 3 cards per row with subtracted border gap */
    /* display: inline-block; */
    min-width: 0;
    
    height: 92%;
}

/* …existing code … */

.main-grid-project-card h2 {
    position: absolute;
    left: 0; right: 0;
    top: 80%;            /* start 80% down */
    transform: none;
    text-align: center;
    width: 100%;
    color: #dbd8d8;
    margin-top: 5%;
    margin-bottom: 5%;
    /* include font-size in the transition */
    transition: top 0.4s ease,
                color 0.4s ease,
                font-size 0.4s ease;
}

.main-grid-project-card:hover h2 {
    top: 5%;
    color: #ffffff;
    font-size: 2rem;
    text-shadow: 2px 2px 36px rgba(255, 255, 255, 0.59);
    text-decoration: underline;
}

/* h3s in the main grid layout for each are the mini descriptions, hidden by default */
.main-grid-project-card h3 {
    position: absolute;
    display: none; /* hidden by default */
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 0 17px 0 17px;
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-style: normal;

    bottom: 1rem;

    /* hide off-screen by shifting down and making transparent */

    /* 03/07/2025 Attempt to prevent inner element from resizing outer one https://stackoverflow.com/a/10692413 */
    position: absolute;
    float:left;            /**/
    overflow:hidden;       /**/
    padding-bottom:0px;


    /* 03/07/2025 Centre elements when offset by padding - fix by Copilot. */
    left: 0;
    right: 0;
    
    overflow: hidden;  /* NEW */
    min-width: 0;      /* NEW; needed for Firefox */
}


.main-grid-project-card:hover h3 {
    display: block;
    font-size: clamp(0.5rem, 1vw + 0.15rem, 1.8rem);
    top: 30%;
    
    /* Doherty Threshold */
    animation: fade-in-delay 0.4s ease-in-out;
}

.main-grid-project-card:not(:hover) h3 {
    /* font-size: 0px; */
    bottom: 6rem;
    animation: 0.7s move-up reverse;
    /* transform: translateY(-100px); */
    /* display: none; */
    overflow: hidden;
}

@keyframes move-up {
    0% {
        opacity: 0;
    }
    1% {
        opacity: 0.0;
    }
    100% { 
        transform: translateY(-205%); 
        opacity: 1;
    }
}

@keyframes fade-in-delay {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes outline-appear {
    0% {
        outline-offset: 1.1rem; /* outwards and coming in */
        outline-color: rgba(255, 255, 255, 0.2); 
        outline-width: 1px;
    }
    60% { 
        outline-offset: 0.4rem; /* Overshoot inward a bit */
        outline-width: 5px;
    }
    100% { 
        outline-offset: 0.5rem; /* Final position */
        outline-color: rgba(255, 255, 255, 0.5);
        outline-width: 4px;
    }
}

@keyframes outline-disappear {
    0% {
        outline-offset: 0.5rem; /* Final position */
        outline-color: rgba(255, 255, 255, 0.5);
        outline-width: 4px;
    }
    60% { 
        outline-offset: 0.4rem; /* Overshoot inward a bit */
        outline-width: 5px;
    }
    100% { 
        outline-offset: 1.1rem; /* outwards and coming in */
        outline-color: rgba(255, 255, 255, 0.2);
        outline-width: 0rem;
    }
}

/* Content animations */
.main-grid-project-card-animator:hover:not(:disabled) {
    animation: outline-appear 0.4s forwards;
    transform: scale(1.1);
}


.main-grid-project-card-animator.has-been-hovered:not(:hover):not(:disabled) {
    animation: outline-disappear 0.3s;
}

/* Same as above but without the scaling */
.hover-effect-animator:hover {
    animation: outline-appear 0.4s forwards;
}

/* Same as above but without the scaling */
.hover-effect-animator.has-been-hovered:not(:hover) {
    animation: outline-disappear 0.3s forwards;
}

.main-grid-project-card:hover img {
    /* transform: scale(1.05); */
    filter: blur(0.3rem) brightness(0.2);
}


.main-grid-project-card:hover .projectButtonContainer {
    display: flex; /* Needed for justify-content */
    animation: fade-in 0.4s;
}

.main-grid-project-card img {
    width: 100%;
    /* border: dashed 2px;
    border-color: #727272; */
    border-radius: 0.75rem;
    transition: transform 0.4s ease, filter 0.4s ease;
    outline:#8ad8ff;
}


.main-grid-more {
    text-align: center;
    align-self: center;

    p {
        font-size: 1.5rem;
        font-weight: bold;
        font-style: italic;
    }
}

/* New: Bottom sticky bar that shows the page */

.bottom-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: rgba(30, 30, 34, 0.8);
    color: white;
    justify-content: center;
    backdrop-filter: blur(0.5rem); /* you're joking */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bottom-sticky-bar-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    
    justify-content: space-evenly;
    /* flex-basis: 0; */
}

.bottom-sticky-bar-content > a  {
    width: 33%;
    height: 100%;
    text-align: center;
    border-left: 2px solid #3f3f3f;
    align-self: center;

    display: flex;
    justify-content: center;
    align-items: center;
}

#footer-button-what {
    border-left: none !important;
}

/* About me page */
#portrait-photo-container {
    display: inline-flex;
    overflow: hidden;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    border: 5px dashed grey;

    /* Firefox fix for showing all in the same element [Copilot o4-mini] */
    > img {
        flex-shrink: 0;
    }
}

#portrait-photo-rotator {
    display: block;       
    width: 100%;          
    height: 100%;
    object-fit: cover;    
    border-radius: 50%;
    animation: reveal 1s;
}

#portrait-photo-rotator-next {
    display: inline;
    width: 100%;          
    height: 100%;
    object-fit: cover;    
    border-radius: 50%;
    animation: reveal 1s;
}


#about-me-paragraphs {
    h2 {
        margin-top: 3%;
        text-decoration: underline;
    }

    p {
        font-size: large;
    }

    
    margin-left: 5%;
    margin-right: 5%;
}

#about-me-paragraphs #title-projects {
    font-size: xx-large;
    text-align: center;

    margin-top: 0;

    /* Overrides */
    display: block;
    margin-left: 0;
}

#about-me-header {
    margin-bottom: 2rem;
}

#about-me-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

#about-me-header nav {
    margin: 10px 0 0 0;
}

/* typing out effect */
.cursor {
    animation: blink 1s infinite; /* So simple but effective */
}

@keyframes blink {
    50% { opacity: 0; } /* Holy moly, it's that easy */
}

@keyframes reveal {
    0% { opacity: 0; };
    100% { opacity: 1; }
}


@media (max-width: 876px) {
    body {
        margin-left: 3%;
        margin-right: 3%;
    }
    .main-grid-layout {
        grid-template-columns: repeat(1, 1fr);
        grid-row-gap: 5rem;
    }

    #title-projects-container {
        /* override the “column” layout */
        display: inline-flex;
        flex-direction: row;
        align-items: center;   /* vertically center text and select */
        gap: 0.5rem;           /* small space between title and dropdown */
        padding: 0;            /* if you don’t want any extra inset */
    }

    /* ensure the select itself stays inline */
    #orderByLabel {
        display: inline-block;
        margin: 0;
    }

    header {
        text-align: left;
        flex-direction: column;
        justify-content: center;
        align-items: center;

        /* specific read more text good colour (else very dark) */
        > p {
            margin-left: 5%;
            margin-right: 5%;
            > span > a {
                color: #00acff
            }
        }

        /* override */
        #name-header, #name-header-large {
            text-align: center;
        }

        nav {
            /* 10% gap works well for spacing and 5% left-right keeps one line on phone */
            margin: 10% 5%;
            font-size: 150%;
            text-align: center;
        }
    }

    /* Adjustments for scaling and transitions */
    .main-grid-project-card:hover h2 {
        top: 0.1%;
        font-size: clamp(1.5rem, 5vw + 0.2rem, 2.5rem);
    }

    .main-grid-project-card:hover h3 {
        bottom: 0.1rem;
        font-size: clamp(0.9rem, 3vw + 0.2rem, 2.5rem);
        top: 20%;
        margin: 0 clamp(0rem, 1vw - 20px, 10px);
    }

    .projectButtonContainer {
        bottom: 0;
        gap: clamp(5px, 5vw - 12px, 20px);
    }
}

@media (max-width: 1365px) and (min-width: 677px) {
    .main-grid-layout {
        grid-template-columns: repeat(2, 1fr);
        grid-row-gap: 5rem;
    }

    .main-grid-project-card:hover h2 {
        top: 0.1%;
        font-size: clamp(1rem, 5vw + 0.2rem, 1.5rem);
    }

    .main-grid-project-card:hover h3 {
        bottom: 0.1rem;
        font-size: clamp(0.8rem, 1.5vw + 0.15rem, 1.8rem);
        top: 20%;
        margin: 0 1vw;
    }

    .projectButtonContainer > button {
        bottom: 0;
        font-size: medium !important;
        gap: clamp(5px, 5vw - 12px, 10px);
    }
}

#special-temp-dontuse-css {
    background-position-x: 50%;
    background-position-y: 50%;
    background-repeat: no-repeat;
    background-size: cover;
    border-bottom-color: rgb(0, 0, 0);
    border-bottom-style: none;
    border-bottom-width: 0px;
    border-image-outset: 0;
    border-image-repeat: stretch;
    border-image-slice: 100%;
    border-image-source: none;
    border-image-width: 1;
    border-left-color: rgb(0, 0, 0);
    border-left-style: none;
    border-left-width: 0px;
    border-right-color: rgb(0, 0, 0);
    border-right-style: none;
    border-right-width: 0px;
    border-top-color: rgb(0, 0, 0);
    border-top-style: none;
    border-top-width: 0px;
    box-sizing: border-box;
    color: rgb(0, 0, 0);
    display: block;
    font-family:    'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-variation-settings: "wdth" 670, "wght" 650;
    line-height: 20px;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-right: 0px;
    margin-top: 0px;
    min-width: 0px;
    overflow-wrap: anywhere;
    overflow-x: clip;
    overflow-y: clip;
    padding-bottom: 0px;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 0px;
    tab-size: 2px;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    text-wrap-mode: nowrap;
    white-space-collapse: collapse;
    --_147h8yx0: #F7FF19;
    --_147h8yx1: #000;
    --_147h8yx2: 2rem;
    --_147h8yx3: #F7FF19;
    --_147h8yx4: _147h8yx5;
    --_1i6fbay0: .625rem;
    --_1i6fbay1: .1875rem;
    --_1i6fbay2: .1875rem;
    --_1xsb6uj0: undefined;
    --end-direction: right;
    --fnui-portal-zindex: 9000;
    --start-direction: left;
    --transform-direction: 1;
    --ue0mn0: 650;
    --ue0mn1: 670;
}
