@font-face {
    font-family: 'Neue Regrade';
    src: url('../assets/fonts/Neue Regrade Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

:root {
    --bg-color: #1d1c1e;
    --text-color: #d6d1db;
    --primary-color: #fff;
    --secondary-color: #fff;
    --accent-color: #fff; 
    --card-bg: #1d1c1e;

    /* --bg-color: #faf6f0;
    --text-color: #3d362c;
    --primary-color: #b36ece;
    --secondary-color: #d07eee;
    --accent-color: #af67cc; 
    --card-bg: #fbf7f1; */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Neue Regrade', sans-serif;
    scroll-behavior: smooth;

    /* font anti aliasing */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
}

*::selection {
    background-color: white;
    color: black;
}

*::-webkit-scrollbar {
  display: none;
}

html {
    scroll-behavior: smooth;
}

#land_username {
    width: fit-content;
}


#glcanvas {
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#tail {
    height: 20px;
    width: 20px;
    background-color: var(--secondary-color);
    border-radius:50%;
    position: fixed;
    left: 0px;
    top: 0px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    transform-origin: center center; 
}

#tail.morphing {
    border-radius: 0;
    background-color: var(--secondary-color);
    mix-blend-mode: normal;
    filter: none;
}

#tail.roundmorphing {
    border-radius: 50px;
    mix-blend-mode: normal;
    filter: none;
}

#tail.extern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    border-top: 2px solid var(--bg-color);
    border-right: 2px solid var(--bg-color);
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#tail.extern.arrow-visible::after {
    transform: translate(-50%, -50%) scale(1); /* scale up */
    opacity: 1;
}

body:hover > #tail {
    opacity: 1;
}


body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
}

header {
    pointer-events: none;
}

nav {
    pointer-events: all;
}

nav a {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.1em;

    z-index: 100;
    padding: 10px 15px;
}

nav a:hover {
    color: var(--bg-color);
}

main {
    padding: 0 4rem;
}

section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0;
}

#landing {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#hero {
    text-align: left;
    /* width: 50%; */
    width: 100vw;
    height: 100%;
}

#hero h1 {
    /* font-size: 8rem; */
    /* font-size: 7vw; */
    /* font-size: 5rem; */
    font-size: clamp(24px, 8vw, 128px);
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

#hero h2 {
    font-size: 2rem;
    font-size: 1.5vw;
    font-weight: 400;
    color: var(--secondary-color);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

h2 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-image-preview {
    opacity: 0;
    scale: 0.8;
    
    position: fixed; 
    z-index: 99;
    
    pointer-events: none; 
    
    width: 400px;
    height: 300px;
    border-radius: 8px;
    
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    transition: opacity 0.2s ease, 
                scale 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), 
                transform 0.2s linear;
    
    background-size: cover;
    background-position: center;
}

.project-list {
    margin: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
    flex-direction: column;
    max-width: 1000px;
    justify-content: left;

    background-color: rgba(0, 0, 0, 0.3);
    isolation: isolate;
    position: relative;
}

.project-list::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(https://grainy-gradients.vercel.app/noise.svg);
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid transparent;
    transition: all 0.3s ease;
    opacity: 1;
    overflow: hidden;
    max-height: 600px;
    transition: all 0.6s ease;
    flex-shrink: 0;
}

.project-item.anim-hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
    
    pointer-events: none;
}
.project-item.filtered-out {
    display: none !important;
}

.project-item .project-info {
    flex-basis: 55%;
    transition: all 0.3s ease;
}

.project-item .project-preview {
    flex-basis: 40%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 40 / 17; /* when the number magics */
    transition: all 0.3s ease;
    transform-origin: center right;
}

.project-item .project-preview .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 0%;

    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);

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

.project-item:hover .project-preview {
    transform: scale(1.1);
    aspect-ratio: 40 / 22;
}

.project-item h3 {
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
    transition: all 0.3s ease;
}

.project-item p {
    font-size: 1rem;
    color: #999;
    font-weight: 500;
    margin: 0.5rem 0 0;
}

.project-item span {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
}

.project-list:hover .project-item {
    opacity: 0.5;
}

.project-list .project-item:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
}

.project-list .project-item:hover h3 {
    transform: translateX(1rem);
    margin-bottom: -1rem;
}

.project-context, .skills-container>span {
    background-color: var(--bg-color);
    width: fit-content;
    padding: 2px 8px;
    border-radius: 8px;
}

.project-data {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}


#about {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 2rem;
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#about h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #ffffff;
}

#about-text {
    display: flex;
    flex-wrap: wrap;
}

.about-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#about p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

#about-profile article {
    margin-bottom: 2.5rem;
}

.skills-container {
    line-height: 1.6;
    color: #bbb;
}

.language-list {
    list-style: none;
    padding-left: 0;
}

.language-list li {
    margin-bottom: 0.5rem;
}

.language-list strong {
    color: #f0f0f0;
    font-weight: 500;
    min-width: 100px;
    display: inline-block;
}
.education-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.education-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.education-year {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

.education-year p {
    color: #f0f0f0;
    margin: 0;
}

.education-school {
    margin-top: 1rem;
    font-style: italic;
    color: #ccc;
    margin-bottom: 0;
}

.skills-marquee {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    opacity: 1;
    animation: fadeInUp 0.6s ease-out forwards;
}

.skills-marquee:nth-of-type(1) {
    margin-top: 0;
    animation-delay: 0.2s;
}
.skills-marquee:nth-of-type(2) {
    animation-delay: 0.4s;
}
.skills-marquee:nth-of-type(3) {
    animation-delay: 0.6s;
}

.skills-track ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.75rem;
    z-index: 100;
}

.skills-track li {
    font-size: 1rem;
    font-weight: 500;
    color: #f0f0f0;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: default;
    z-index: 100;
    transition: all 0.3s ease,
    transform 0.2s ease-out,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.skills-track li:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    color: var(--bg-color);
    z-index: 100;
}

.skills-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    margin-left: 1rem;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.lightbox-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-section {
    margin-bottom: 1.5rem;
}

.lightbox-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-section p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.lightbox-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lightbox-section li {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-section li:last-child {
    border-bottom: none;
}

.skill-level-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.skill-level-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.skill-level-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.skill-level-text {
    font-weight: 600;
    min-width: 50px;
}

@media (max-width: 950px) {
    #about {
        padding: 1rem;
    }

    #about h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    #about-text {
        flex-direction: column;
        gap: 1.5rem;
    }

    #about-profile article {
        margin-bottom: 2rem;
    }
    
    .about-title {
        font-size: 1.3rem;
    }

    .education-year {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(var(--scroll-width) * -1));
    }
}

@keyframes scroll-right {
    from {
        transform: translateX(calc(var(--scroll-width) * -1));
    }
    to {
        transform: translateX(0);
    }
}

#contact {
    text-align: center;
}

#contact p {
    font-size: 1.5rem;
}

#contact-socials {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    transition: filter 0.3s ease;
}

footer {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

#projects {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding-top: 8rem;
}

#projects-display {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transition: opacity 1s ease;
    opacity: 0;
}

.project-info > p {
    text-align: justify;
}

#portfolio-filters {
    font-family: sans-serif;
    color: #fff;
    margin-bottom: 40px;
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.label {
    font-weight: bold;
    color: #888;
}

.options-container {
    position: relative;
    display: inline-flex;
    background: #161616;
    border-radius: 4px;
    padding: 4px;
}

.f-btn {
    position: relative;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
}

.f-btn:hover {
    color: #fff;
}

.f-btn.active {
    color: #000;
}

.slide-rect {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 3px;
    width: 0;
    opacity: 0; 
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#references {
    margin-top: 2rem;
}

#references > div {
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    color: #ccc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    display: flex;
    gap: 1.5rem;
}

.reference-card {
    width: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.reference-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

@media only screen and (max-width: 1320px) {
    #landing {
        flex-direction: column;
    }
    #hero {
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    #hero h1 {
        font-size: clamp(20px, 8vw, 64px);
        
    }

    #hero h2 {
        font-size: 2rem;
    }

    nav a {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .project-item:hover .project-preview {
        transform: scale(1);
        aspect-ratio: 40 / 22;
    }
}

@media only screen and (max-width: 768px) {
    main {
        overflow: hidden;
        padding: 0 2rem;
    }

    #hero h1 {
        font-size: clamp(20px, 8vw, 64px);
    }

    #hero h2 {
        font-size: clamp(16px, 4vw, 32px);
    }

    header {
        background: linear-gradient(180deg,rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.5) 65%, rgba(0, 0, 0, 0) 100%);
    }

    nav {
        width: 100%;
        display: flex;
        justify-content: center;

    }

    nav a {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .project-list {
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .project-info h3 {
        font-size: 1.5em;
    }

    .project-item p {
        font-size: 0.9rem;
    }

    .project-item span {
        display: none;
    }

    .project-item {
        flex-direction: column;
        align-items: flex-start;
    }

    #references > div {
        flex-direction: column;
        margin: 0;
        padding: 0;
    }
    .reference-card {
        width: 100%;
    }

    #about-text {
        flex-direction: column;
    }

    #about p {
        max-width: 100%;
        font-size: 1rem;
    }

    .project-data {
        margin-bottom: 1rem;
    }
}

@media only screen and (max-width: 1450px) {
    #projects-display {
        width: 100%;
    }
}

.comment {
    color: #8e8992;
    padding-left: 1rem;
    font-size: 1rem;
    cursor: auto;
}

.comment:hover {
    color: #8e8992;
}

@media only screen and (max-width: 550px) {
    .project-list {
        width: 100vw;
    }

    nav > a {
        font-size: 4vw;
    }
}

@media (hover: none) and (pointer: coarse) {
    #tail {
        display: none; /* just to be sure */
    }
    
    nav a:hover {
        color: var(--secondary-color);
    }

    .skills-track ul li:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #f0f0f0;
        z-index: 100;
    }
}
