* {
    box-sizing: border-box;
}

body {
    --text: 221, 223, 244;
    --background: 4, 6, 13;
    --primary: 39, 55, 138;
    --secondary: 24, 45, 151;
    --accent: 61, 88, 225;


    color: rgb(var(--text));
    background-color: rgb(var(--background));
    background-image: radial-gradient(circle at center,
        rgba(var(--primary), 0.5) 0%,
        rgb(var(--background)) 70%
    );
    background-repeat: repeat;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    padding: 1em;
    line-height: 2em;
}

h3 {
    font-weight: 200;
    font-style: italic;
}

h1, h2, h3 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

a:link {
        color: color-mix(in srgb, rgb(var(--text)) 90%, blue 10%);
}

a:visited {
        color: color-mix(in srgb, rgb(var(--text)) 75%, blue 25%);
}

a:hover {
        color: rgb(var(--text));
}

.container, .button-link {
    box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    margin-top: 1%;
    margin-bottom: 1%;
}

.content {
    min-width: 0; 
    padding: 0.5em 1em;
}

.button-link, .button-link:link, .button-link:visited, .button-link:hover {
    display: inline-block;
    text-decoration: none;
    background-color: rgba(var(--accent), 1);
    color: #eff1f4;
    padding: 1em 1.5em;
    border-radius: 50px;
    box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-align: center;
    transition: all 0.1s ease;
}

.button-link:hover {
    transform: translateY(-1%) scale(1.02);
    background-color: color-mix(in srgb, rgb(var(--accent)) 90%, white 10%);
}

header {
    grid-area: header;
}

#headline {
    font-style: italic;
}

#header-container {
    border-radius: 10px 10px 5px 5px;
    box-shadow: none;
}

nav {
    border-radius: 5px;
    background-color: rgba(var(--secondary), 1);
    grid-area: nav;
}

nav a {
    text-decoration: none;
    font-size: 1.2em;
    line-height: 2.5em;
    transition: font-weight 0.1s ease;
}

nav a:link, nav a:visited {
    color: rgb(var(--text));
}

nav a:hover {
    color: color-mix(in srgb, rgb(var(--text)) 90%, black 10%);
    font-weight: bold;
}

nav ul {
    list-style-type: none;

    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: space-around;
    margin: 0;
    padding: 0;
    align-items: center;
}

#about-me,
#project-highlight-container {
    line-height: 2em;
}

#about-me {
    border-radius: 5px 5px 5px 10px;
    grid-area: about-me;
    background-color: rgba(var(--primary), 0.3);
}

#project-highlight-container {
    grid-area: project-highlight;
    overflow-y: auto;
    background-color: rgba(var(--secondary), 0.1);
}

.project-img {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 4 / 3;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

#project-1-img { background-image: url(res/jatui.png); }
#project-2-img { background-image: url(res/finance.svg); }
#project-3-img { background-image: url(res/paint.png); }

#projects-container {
    background-color: rgba(var(--secondary), 0.1);
    grid-area: projects;
}

.row {
    display: flex;
    gap: 2%;
}

.project-container {
    background-color: rgba(var(--primary), 0.5);
    flex: 50%;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-container:hover {
     background-color: rgba(var(--primary), 0.7);
     transform: translateY(-1%);
     box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#skills-container {
    background-color: rgba(var(--primary), 0.1);
}

#skills-table-container {
    background-color: rgba(var(--primary), 0.1);
}

#skills-table {
    margin-left: auto;
    margin-right: auto;
    border: none;
    width: 100%;
    table-layout: fixed;
}

#skills-table thead tr {
    background-color: rgba(var(--primary), 0.2);
}

#skills-table tbody tr:nth-of-type(odd), #skills-table-small tr:nth-of-type(odd) {
    background-color: rgba(var(--secondary), 0.3);
}

#skills-table tbody tr:nth-of-type(even), #skills-table-small tr:nth-of-type(even) {
    background-color: rgba(var(--primary), 0.2);
}

#skills-table tr {
    transition: transform 0.3s ease;
}

#skills-table tr:hover {
    transform: scale(1.01);
}

#contact-container {
    background-color: rgba(var(--primary), 0.1);
}

#contact-form-container {
    padding-top: 2%;
    background-color: rgba(var(--primary), 0.2);
}

form {
    margin-left: auto;
    margin-right: auto;
    width: 75%;
    display: grid;
    grid-template-columns: 10em auto;
    gap: 1em;
}

.text-input {
    background-color: rgba(var(--background), 0.8);
    border: none;
    border-radius: 5px;
    color: var(--text);
    min-height: 2em;
}

.text-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent), 0.8);
    background-color: rgba(var(--background), 0.95);
}

input[type="submit"] {
    margin-left: auto;
    margin-right: auto;
    min-width: 75%;
    border: none;
    font-weight: bold;
}

footer {
    grid-area: footer; 
    text-align: center;
}

#footer-container {
    width: 20em;
    height: auto;
    line-height: normal;
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(var(--secondary), 0.3);
    border-radius: 50px;
}

#footer-content {
    padding: 0.5em 0;
}

.small-only {
    display: none;
}

/* Base layout grid */
.wrapper {
    display: grid;
    grid-template-columns: 5fr 4fr;
    grid-template-rows: auto auto auto;
    gap: 1em;
    grid-template-areas:
        "header nav"
        "content content"
        "footer footer";
    max-width: 1400px;
    margin: 0 auto;
}

/* Ensure nav stays compact and aligns with header */
nav {
    align-self: start;
    margin-top: 1em; /* align with header content */
}

/* Content areas */
main {
    grid-area: content;
    width: 100%;
}

@media (max-width: 720px) {
    .wrapper {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "nav"
            "content"
            "footer";
    }
    .small-only {
        display: block;
    }

    .row {
        display: block;
    }

    #skills-table {
        display: none;
    }

    #skills-table-small td {
        display: block;
        padding: 1em;
    }

    form {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    body {
        padding: 0
    }

    .container {
        margin: 0;
    }

}