/* --------------------------------------- */
/* ----- Basic Setup ----- */
/* --------------------------------------- */

@font-face {
    font-family: 'Hk Grotesk';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/HKGrotesk-Regular.woff') format('woff');
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/Jost-Regular.ttf') format('woff');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: inherit;
}

:root {
    --font-size-small: 1.8rem;
    --font-size-normal: 2.2rem;
    --font-size-medium: 2.8rem;
    --font-size-medium-1: 3.6rem;
    --font-size-large: 5.5rem;
    --font-size-huge: 7.5rem;
    --font-stack: 'Hk Grotesk', sans-serif;

    --line-height-normal: 1.7;
    --line-height-small: 1.2;

    --black: #0a0a0a;
    --yellow: #ffbf00;
    --white: #f0e9f2;
    --white-1: #e5e5e6da;


    --container-max-width: 1180px;
    --container-normal-width: 800px;
    --container-medium-width: 700px; 
    --container-small-width: 500px;

    --gutter-huge: 12rem;
    --gutter-medium: 6rem;
    --gutter-normal: 3rem;
    --gutter-small-1: 2.5rem;
    --gutter-small: 2rem;

    --border-light: 1px solid rgb(36, 35, 35);
}

html {
    font-size: 62.5%; /* (16/10)*100 = 62.5% => 1rem = 10px */
    box-sizing: border-box;
    scroll-behavior: smooth;
}

@media(max-width: 1000px) {
    html {
        font-size: 52%;
    }
}

body {
    font-size: var(--font-size-small);
    font-family: var(--font-stack);
    font-weight: 400;
    color: var(--white-1);
    line-height: var(--line-height-normal);
    background: var(--black);
    overflow-x: hidden;
}

.row {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

@media(max-width: 1340px) {
    .row {
        max-width: 1100px;
    }
}

@media(max-width: 1240px) {
    .row {
        padding: 0 var(--gutter-medium);
    }
}

@media(max-width: 600px) {
    .row {
        padding: 0 var(--gutter-normal);
    }
}

@media(max-width: 600px) {
    .row {
        padding: 0 var(--gutter-small);
    }
}

section {
    padding: var(--gutter-huge) 0;
    border-bottom: var(--border-light);
}

img {
    object-fit: contain;
    max-width: 100%;
}

/* --------------------------------------- */
/* ----- Headlines and Paragraphs ----- */
/* --------------------------------------- */

h1,
h2,
h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    line-height: var(--line-height-small);
    color: var(--white);
}

.heading-primary {
    line-height: 1;
    font-size: var(--font-size-huge);
    font-weight: 400;
}

@media(max-width: 900px) {
    .heading-primary {
        font-size: 6.5rem;
    }
}

h2 {
    font-size: var(--font-size-large);
    margin-bottom: var(--gutter-medium);
}

h2::after {
    content: '';
    display: block;
    height: 2px;
    width: 10rem;
    background: var(--yellow);
    margin: var(--gutter-small) 0;
}

h3 {
    font-size: var(--font-size-medium-1);
    margin-bottom: var(--gutter-small);
}

@media(max-width: 500px) {
    .heading-primary {
        font-size: var(--font-size-large);
    }

    h2 {
        font-size: var(--font-size-medium-1);
    }

    h3 {
        font-size: var(--font-size-medium);
    }
}

p {
    margin: var(--gutter-small-1) 0;
}

@media(max-width: 900px) {
    p { 
        max-width: var(--container-small-width);
    }
}

/* --------------------------------------- */
/* ----- Buttons and Links ----- */
/* --------------------------------------- */

a {
    color: var(--white);
    font-weight: 400;
    font-family: 'Jost', sans-serif;
    transition: all .2s;
    outline: 2px solid transparent;
}

::-moz-focus-inner {
    border: 0;
}

button:focus,
a:focus {
    outline: 2px solid var(--yellow);
}

body:not(.user-is-tabbing) button:focus,
body:not(.user-is-tabbing) a:focus {
    outline: none;
}

.link:hover {
    color: var(--yellow);
}

.btn {
    position: relative;
    display: inline-block;
    padding: 1rem 4.2rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid  var(--yellow);
    font-weight: 400;
}

.btn:focus {
    outline: none;
}

.btn::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 100%;
    background: var(--white);
    height: 100%;
    z-index: -1;
    transition: all 0.2s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.btn:hover::after,
.btn:focus::after {
    right: 0;
    background: var(--yellow);
}

.--yellow {
    background: var(--yellow);
    transition: all 0.2s;
}

.btn--yellow::after {
    display: none;
}

.btn--yellow:hover,
.btn--yellow:focus {
    background: transparent;
}

.link__text {
    position: relative;
    display: inline-block;
    padding: .6rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--yellow);
}

.link__text::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 100%;
    background: var(--white);
    height: 100%;
    z-index: -1;
    transition: all 0.2s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.link__text:focus {
    outline: none;
}

.link__text:hover::after,
.link__text:focus:after {
    right: 0;
    background: var(--yellow);
}

.link__text span {
    padding-left: 1rem;
    font-family: sans-serif;
}

/* ----- Back to Top ----- */

.back-to-top {
    position: fixed;
    bottom: 4rem;
    right: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 5.5rem;
    width: 5.5rem;
    background-color: var(--yellow);
    border-radius: 50%;
    z-index: 10;
    visibility: hidden;
    transition: all .4s;
}

.back-to-top__image {
    height: 70%;
}

@media(max-width: 900px) {
    .back-to-top {
        right: 2rem;
    }
}

@media(max-width: 500px) {
    .back-to-top {
        right: 1rem;
    }
}

/* --------------------------------------- */
/* ----- Navigation ----- */
/* --------------------------------------- */

.nav {
    display: flex;
    justify-content: flex-end;
    padding: var(--gutter-normal) 0;
}

.nav__items {
    display: flex;
    list-style: none;
}

.nav__item:not(:last-child) {
    margin-right: var(--gutter-medium);
}

@media(max-width: 500px) {
    .nav {
        justify-content: center;
    }
}

@media(max-width: 400px) {
    .nav__item:not(:last-child) {
        margin-right: var(--gutter-normal);
    }
}

@media(max-width: 300px) {
    .nav {
        font-size: var(--font-size-small);
    }
}

.nav__link {
    position: relative;
    display: inline-block;
    padding: 1rem 0;
    text-decoration: none;
    color: inherit;
    transition: all .2s;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 100%;
    display: inline-block;
    height: 1rem;
    background: var(--white);
    transition: all 0.25s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.nav__link:hover {
    color: var(--yellow);
}

.nav__link:hover::after {
    right: 0;
    height: 2px;
    background: var(--yellow);
}

/* --------------------------------------- */
/* ----- Header ----- */
/* --------------------------------------- */

.header {
    min-height: 65vh; 
    padding-bottom: var(--gutter-medium);
    font-size: var(--font-size-normal);
    position: relative;
    overflow: hidden;
}

.header__video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.header__video-bg video.header-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.header__video-bg video.header-track.active {
    opacity: 1;
}

.header__video-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0, 0.5), rgba(0,0,0, 0.85));
    z-index: 2;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    margin-top: var(--gutter-medium);
}

.header__text-box {
    flex: 1;
}

.header__text-box p {
    margin: 1.5rem 0 3.5rem;
    max-width: var(--container-medium-width);
    font-family: 'Jost', sans-serif;
    font-size: var(--font-size-medium);
}

.header__photo-box {
    flex: 0 0 300px;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
}

.header__photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--yellow);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    object-fit: cover;
}

@media(max-width: 800px) {
    .header {
        min-height: auto;
    }

    .header__content {
        flex-direction: column-reverse;
        text-align: center;
        margin-top: var(--gutter-normal);
    }
    
    .header__photo-box {
        flex: 0 0 200px;
        width: 200px;
        height: 200px;
    }
}

@media(max-width: 500px) {
    .header__text-box p {
        transform: scale(.9);
    }
}

/* --------------------------------------- */
/* ----- Work ----- */
/* --------------------------------------- */

.work__box {
    display: flex;
    align-items: center;
}

@media(max-width: 900px) {
    .work__box {
        align-items: initial;
        flex-direction: column-reverse;
    }
}

.work__box:not(:last-child) {
    margin-bottom: 25rem;
}

@media(max-width: 500px) {
    .work__box:not(:last-child) {
        margin-bottom: 20rem;
    }
}

.work__links {
    display: flex;
    align-items: center;
}

.work__text {
    flex: 0 0 30%;
}

.work__list {
    /* list-style-type: square; */
    list-style-position: inside;
    margin-bottom: var(--gutter-normal);
}

.work__code {
    display: block;
    height: 3rem;
    margin-left: var(--gutter-normal);
    transition: all .3s;
}

.work__code:hover {
    transform: scale(1.2);
}

.work__image-box {
    margin-bottom: var(--gutter-normal);
}

@media(min-width: 901px) {
    .work__image-box {
        flex: 1;
        margin: 0 0 0 10rem;
    }
}

@media(max-width: 900px) {
    .work__code {
        height: 4rem;
    }
}


.work__boxes {
    display: grid;
    /* Create 3 equal columns, with a minimum width to prevent overcrowding */
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    /* The space between the project cards */
    gap: 4rem;
    margin-top: var(--gutter-normal);
}

/* --- Project Card Styling --- */
.work__box {
    background-color: #1a1a1a; /* Very dark gray, slightly lighter than black */
    border-radius: 15px; /* Rounded corners for the card */
    overflow: hidden; /* Important to keep the top video/image within rounded corners */
    display: flex;
    flex-direction: column; /* Content flows top-to-bottom */
    
    /* RESET previous work__box styles */
    align-items: flex-start !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 2rem; /* Give some space at the bottom of the card */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Subtle lift effect on hover */
.work__box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* --- Media (Video/Image) Container --- */
.work__image-box {
    width: 100%;
    /* Keep previous min-width setup, but now fill the container */
    margin: 0 !important;
    height: 200px; /* Force a consistent height for all images/videos */
    overflow: hidden; /* Crop images that are too tall */
}

/* Apply image/video styles specifically within the grid box */
.work__box video,
.work__box img.work__image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the 200px area without distortion (crops edges) */
    display: block; /* Eliminate small gaps below media */
}

/* --- Text Container Setup --- */
.work__text {
    flex: 1 1 auto; /* Allow text block to grow/shrink, but always fill the space */
    padding: 2rem 2.5rem 0; /* Add padding inside the card for the text */
    
    /* RESET previous flex-shrink */
    flex: 0 0 auto !important; 
}

/* Text Element Spacing */
.work__text h3 {
    margin-top: 0;
    font-size: 2.2rem; /* Slightly smaller heading for the smaller cards */
}

.work__text p {
    font-size: 1.6rem;
    line-height: 1.5;
    margin: 1rem 0 2rem;
    color: var(--white-1);
    
    /* A quick way to ensure descriptions don't get too long and misalign the buttons */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit description to 3 lines */
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* --- Links (Itch/GitHub) Container --- */
.work__links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto; /* Pushes links to the bottom of the card if text is short */
    gap: 1.5rem; /* Space between the Itch link and GitHub icon */
    border-top: 1px solid rgba(255,255,255,0.1); /* Subtle divider */
    padding-top: 1.5rem;
}

/* Specific styling for the link__text within cards */
.work__text .link__text {
    font-size: 1.4rem;
    padding: 0.5rem;
    border-bottom: 1px solid transparent; /* Remove previous underline style */
}

.work__text .link__text::after {
    display: none; /* Disable the old hover fill effect in cards */
}

.work__text .link__text:hover {
    color: var(--yellow);
    border-bottom: 1px solid var(--yellow);
}

/* GitHub Icon Specifics in cards */
.work__code {
    margin-left: 0 !important; /* RESET previous margin */
    height: 2.5rem !important; /* Scale it down */
}

/* --------------------------------------- */
/* ---- Special Section: Software Logos --- */
/* --------------------------------------- */

/* The new container you will add in HTML */
.work__software-logos {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem; /* Space between software icons */
    margin-top: 2rem;
    padding: 1rem 0;
}

/* Scaling and styling the software logos */
.work__software-logo {
    height: 3rem; /* Set a consistent height */
    max-width: 6rem; /* Prevent wide logos from taking too much space */
    object-fit: contain; /* Ensure logos scale correctly */
    filter: grayscale(100%) opacity(0.7); /* Subtle design: gray and faded */
    transition: filter 0.3s ease;
}

/* Light up the logo on hover */
.work__software-logo:hover {
    filter: grayscale(0%) opacity(1);
}

/* --------------------------------------- */
/* ------- Work Responsiveness ----------- */
/* --------------------------------------- */

@media(max-width: 1000px) {
    .work__boxes {
        /* Drop to 2 columns on medium screens */
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 650px) {
    .work__boxes {
        /* Single column on small mobile screens */
        grid-template-columns: 1fr;
    }
    
    .work__box {
        max-width: 500px; /* Optional: limit width on mobile for better reading */
        margin: 0 auto;
    }
}


/* --------------------------------------- */
/* ----- Clients ----- */
/* --------------------------------------- */

.client__logos {
    display: flex;
    justify-content: space-between;
    filter: opacity(.8);
}

.client__logo {
    height: 6.5rem;
    max-width: 18rem;
}

@media(max-width: 1240px) {
    .client__logos {
        overflow-x: scroll;
        padding: var(--gutter-normal);
    }

    .client__logo:not(:last-of-type) {
        margin-right: var(--gutter-medium);
    }
}

/* --------------------------------------- */
/* ----- About ----- */
/* --------------------------------------- */

.about__content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

@media(max-width: 900px) {
    .about__content {
        flex-direction: column-reverse;
        align-items: initial;
        
    }
}

.about__photo-container {
    margin-bottom: var(--gutter-normal);
}

@media(min-width: 901px) {

    .about__content {
        display: flex;
        justify-content: center; 
        align-items: center;
        gap: 4rem;
    }

    .about__text {
        flex: 0 1 450px;
        text-align: left;
    }
    
    .about__photo-container {
        flex: 0 0 auto;
        margin: 0 var(--gutter-huge) 0 0;
    }
}

/* --------------------------------------- */
/* ----- Project Modal System ----- */
/* --------------------------------------- */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
	
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal--open {
    opacity: 1;
    pointer-events: auto;
}

.modal__content {
    background-color: #1a1a1a;
    border: 2px solid var(--yellow);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 3.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal--open .modal__content {
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal__close:hover {
    color: var(--yellow);
}

.modal__media {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 2.5rem;
}

.modal__body h2 {
    color: var(--white);
    font-size: var(--font-size-medium-1);
    margin-bottom: 1.5rem;
    font-family: 'Jost', sans-serif;
}

.modal__body p {
    color: #cccccc;
    font-size: var(--font-size-normal);
    line-height: var(--line-height-normal);
    margin-bottom: 2.5rem;
}

.modal__content::-webkit-scrollbar {
    width: 8px;
}

.modal__content::-webkit-scrollbar-track {
    background: #111111;
    border-radius: 12px;
}

.modal__content::-webkit-scrollbar-thumb {
    background: var(--yellow);
    border-radius: 12px;
}

.modal__content::-webkit-scrollbar-thumb:hover {
    background: #e6ac00;
}

/* --------------------------------------- */
/* ----- Contact ----- */
/* --------------------------------------- */

.contact__info {
    max-width: var(--container-medium-width);
}

/* --------------------------------------- */
/* ----- Footer ----- */
/* --------------------------------------- */

.footer {
    text-align: center;
    padding: var(--gutter-medium) 0 var(--gutter-normal);
}

.footer__social-links {
    display: flex;
    justify-content: center;
    padding: var(--gutter-normal) 0;
    list-style: none;
}

.footer__social-link-item:not(:last-of-type) {
    margin-right: var(--gutter-small);
}

.footer__social-image {
    height: 4rem;
}

.footer__github-buttons {
    display: flex;
    justify-content: center;
}

.footer__github-buttons iframe {
    height: 2.5rem;
    width: 84px;
    transform: translateY(3px);
}

@media(max-width: 500px) {
    .footer {
        padding: var(--gutter-medium) 0;
    } 
}


