:root {
    --bg: #131415;
    --box: #1f2123;
    --box-hover: #292c2f;

    --line: #3b3f44;
    --green: #3a7d4a;
    --green-light: #52a165;
    --green-dark: #1f4a2b;

    --text: #f2f2f2;

    --border: 4px solid var(--line);
    --radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    min-height: 100vh;

    background: radial-gradient(ellipse at 10% 30%,
            #536b42 0%,
            #394832 35%,
            #292e27 65%,
            #1f2123 100%);

    background-attachment: fixed;

    color: var(--text);
    font-family: Verdana, Geneva, sans-serif;
    font-size: 20px;
    line-height: 1.5;
    text-align: center;
}

h1,
h2,
h3 {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-weight: 400;
    margin: 0;
}

:focus-visible {
    outline: 3px solid var(--green-light);
    outline-offset: 3px;
}

/* Sections */
section {
    padding: 90px 24px 60px;
}

#about {
    padding-top: 140px;
}

.page {
    padding-top: 40px;
}

/* Headings */
.heading {
    display: inline-block;
    font-size: 72px;
    line-height: 1.1;
    padding: 0 8px 4px;
    margin: 32px 0 40px;
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 32px;
    color: var(--text);
    background: var(--box);
    border: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 6px 36px;
    text-decoration: none;
    cursor: pointer;

    box-shadow: 0 4px 0 var(--green-dark);

    transition:
        transform 0.1s,
        box-shadow 0.1s,
        background 0.1s;
}

.btn:hover {
    background: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--green-dark);
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--green-dark);
}

.btn.wide {
    width: min(420px, 100%);
    font-size: 36px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;

    display: flex;
    justify-content: center;
    gap: 24px;

    padding: 16px;
    background: var(--bg);
    border-bottom: var(--border);
}

/* Box */
.box {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 32px;

    background: var(--box);
    border: var(--border);
    border-radius: var(--radius);
}

/* Projects / Cards */
.list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

.card {
    width: min(640px, 100%);
    padding: 0;

    font: inherit;
    color: inherit;
    background: var(--box);

    border: var(--border);
    border-radius: var(--radius);

    overflow: hidden;
    cursor: pointer;

    transition:
        transform 0.15s,
        border-color 0.15s,
        background 0.15s;
}

.card:hover {
    background: var(--box-hover);
    border-color: var(--green);
    transform: translateY(-4px);
}

.card:active {
    transform: translateY(0);
}

.thumb {
    aspect-ratio: 16 / 9;
    background: #1a1b1d;
    border-bottom: var(--border);
    overflow: hidden;
}

.thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}

.card:hover .thumb img {
    transform: scale(1.04);
}

.thumb.noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #888;
}

.card-title {
    font-size: 44px;
    line-height: 1.2;
    padding: 10px 16px;
}

/* Popup */
.modal {
    width: min(760px, 100% - 32px);
    max-height: calc(100vh - 40px);
    padding: 0;

    color: var(--text);
    background: var(--box);

    border: 4px solid var(--green);
    border-radius: var(--radius);

    overflow-y: auto;
    text-align: center;
}

.modal[open] {
    animation: pop 0.15s ease-out;
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    padding: 24px 28px 32px;
}

.modal-content h3 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.modal-content p {
    margin: 0 0 16px;
}

.tags {
    margin: 8px 0 24px;
}

.tag {
    display: inline-block;
    font-size: 16px;
    padding: 2px 12px;
    margin: 4px;

    border: 3px solid var(--green);
    border-radius: 6px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* Mobile */
@media (max-width: 640px) {
    body {
        font-size: 18px;
    }

    .heading {
        font-size: 52px;
    }

    .nav {
        gap: 8px;
        padding: 12px 8px;
    }

    .nav .btn {
        font-size: 24px;
        padding: 4px 14px;
    }

    #about {
        padding-top: 120px;
    }

    .card-title {
        font-size: 36px;
    }

    .mod•al-content h3 {
        font-size: 44px;
    }
}


/* All Projects Grid */
.projects-page .list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto 40px;
    align-items: start;
}

.projects-page .card {
    width: 100%;
    max-width: none;
}

.back-btn {
    display: table;
    margin: 0 auto 40px;
}

/* Mobile */
@media (max-width: 640px) {
    .projects-page .list {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Garlicman Easter Egg */
.garlicman {
    position: fixed;
    z-index: 1000;

    right: 0;
    top: 50%;
    height: min(55vh, 450px);
    max-width: 40vw;

    object-fit: contain;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translate(30px, -50%) scale(0.8);

    transition:
        opacity 0.25s ease,
        transform 0.35s ease,
        visibility 0.25s;
}

.garlicman.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
}

@media (max-width: 640px) {
    .garlicman {
        height: 35vh;
        max-width: 55vw;
    }
}

/* CV Navigation */
.nav-cv {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    gap: 12px;
}

.nav-cv .btn {
    font-size: 22px;
    padding: 6px 18px;
}

@media (max-width: 900px) {
    .nav {
        flex-wrap: wrap;
        position: relative;
    }

    .nav-cv {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }
}