/* ========================= */
/*  Copyright (c) AJ-Holzer  */
/*  All rights reserved      */
/* ========================= */


/* Import Jetbrains font */
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap");

/* Import Font Awesome */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css");

/* Change selection color */
::-moz-selection {
    background: var(--glow);
}

::selection {
    background: var(--glow);
}

/* html and body elements */
html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    flex-direction: column;
    display: flex;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;

    /* Font */
    font-family: "JetBrains Mono", monospace;
    font-feature-settings: "liga" 1, "calt" 1;
    font-variant-ligatures: contextual common-ligatures;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
}

footer {
    padding: 1rem 5vw;
    background: var(--transparent-background-color);
    box-shadow: 4px 0 20px var(--box-shadow-color);
    display: flex;
    justify-content: center;
}

/* Make headings slightly heavier */
h1,
h2,
h3,
.logo {
    font-weight: 600;
    text-align: center;
}

/* Background */
#liquid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: var(--text);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--navbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    background: var(--transparent-background-color);
    box-shadow: 4px 0 20px var(--box-shadow-color);
    z-index: 1001;
    box-sizing: border-box;
    transition: top 0.3s ease;
}

.navbar nav a {
    margin-left: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    touch-action: manipulation;

    position: relative;
    z-index: 1002;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-muted);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

#about {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.hero-text {
    max-width: 600px;
}

.hero-text h1 {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    text-align: left;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-text .subtle {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 2rem;
    transition: transform 0.25s ease, color 0.25s ease;
}

.accent {
    color: var(--accent);
}

/* Image */
.hero-image {
    justify-self: center;
}

.hero-image img {
    width: 15rem;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px var(--glow);
}

/* Site content */
.content {
    padding: 0 25vw 10rem 25vw;
    gap: 5rem;
}

/* Projects */
.projects {
    display: grid;
    gap: 0.5rem;
}

.project {
    display: grid;
    column-gap: 3rem;
    grid-template-columns: 12rem 1fr 8rem;
    align-items: start;
    text-decoration: none;

    padding: 0.5rem 1rem;
    border-radius: 0.5rem;

    transition: transform 0.25s ease, background-color 0.25s ease;
}

.project-header {
    font-weight: 600;
    opacity: 0.7;
    pointer-events: none;
}

.project-commit-header {
    text-align: right;
}

.project-title {
    display: flex;
    align-self: center;
    font-weight: 600;
    opacity: 0.8;
    color: var(--accent);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.project-description {
    color: var(--text);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.project-commit-count {
    text-align: right;
    align-self: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.project-header * {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Footer table */
footer table {
    border-collapse: separate;
    border-spacing: 3rem 0;
    width: 100%;
    max-width: 50%;
}

footer table thead th {
    text-align: left;
    font-weight: 600;
    font-size: larger;
    color: var(--accent);
    opacity: 0.6;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

footer table tbody td {
    padding: 0.5rem 0;
    color: var(--text-muted);
    vertical-align: top;
}

footer table tbody td a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer table tbody tr {
    transition: background-color 0.25s ease;
    border-radius: 0.3rem;
}

/* Phone view */
@media (max-width: 768px) {

    /* Hero */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 5rem;
        box-sizing: border-box;
        gap: 0;
        min-height: fit-content;
    }

    .hero h1 {
        text-align: center;
    }

    #about {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }

    .hero-image {
        justify-self: center;
        margin-bottom: 2rem;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-image img {
        width: 220px;
    }

    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }

    /* Navbar */
    .navbar {
        justify-content: center;
        padding: 0;
    }

    .navbar nav a {
        margin-left: 0;
    }

    .nav-toggle {
        display: block;
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        min-width: 30%;
        background: rgba(18, 24, 33, 0.6);
        backdrop-filter: blur(12px);
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        border-radius: 0 1rem 1rem 0;

        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
        z-index: 1000;
    }

    /* Inner navbar wrapper to maintain padding */
    .nav-menu-inner {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 6rem 3.5rem;
    }

    .nav-menu a {
        font-size: 1.1rem;
    }

    .nav-menu.open {
        transform: translateX(0);

        /* Shadow to sharpen edges */
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Navbar overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 999;
    }

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

    /* Site content */
    .content {
        padding: 0;
    }

    .content h1 {
        text-align: center;
        margin: 3rem 0 0 0;
    }

    /* Projects */
    .projects {
        padding: 0 1rem 1rem 1rem;
    }

    .project {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        row-gap: 0.25rem;
        padding: 0.75rem 0;
        justify-content: center;
    }

    .project-header {
        display: none;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-description {
        text-align: center;
        align-self: center;
    }

    .project-commit-count {
        display: none;
    }

    /* Footer table */
    footer table {
        border-spacing: 1rem 0.5rem;
        width: 100%;
        max-width: 100%;
    }
}