:root {
    --bg-color: #E1E5F2;
    --text-color: #1F7A8C;
    --primary-color: #1F7A8C;
    --secondary-color: #022B3A;
    --highlight-color: #BFDBF7;
    --light-color: #FFFFFF;
}

html {
    background-image: url("../media/hatter.jpg");
    background-attachment: fixed;
    background-size: cover;
    background-color: var(--secondary-color);
}

body {
    font-family: Arial, sans-serif;
    font-size: 1.1em;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    max-width: 1000px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 10px;
}

h1 {
    text-align: center;
}

h2 {
    color: var(--primary-color);
}

h3 {
    color: var(--secondary-color);
}

section h3,
section p {
    margin-left: 10px;
}

p {
    margin-bottom: 15px;
    text-align: justify;
}

ul, ol, li {
    text-align: left;
}

a {
    color: var(--primary-color);
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    text-decoration: underline;
}

a:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

a:visited {
    background-color: var(--secondary-color);
    color: #2aaec9;
}

nav a:visited {
    color: var(--light-color);
    background-color: var(--primary-color);
}

a[href^="http"]::after {
    content: " ↗";
    font-size: 0.8em;
}

nav {
    background-color: var(--primary-color);
    padding: 10px 0;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

nav ul li a {
    text-decoration: none;
    color: var(--light-color);
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

@media (max-width: 600px) {
    body {
        padding: 15px;
        font-size: 1em;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    nav ul li a {
        display: block;
        width: 100%;
        text-align: center;
    }

    .thumbnail {
        width: 100px;
    }
}

img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.thumbnail {
    width: 150px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
}

a.thumbnail-link {
    display: block;
    width: fit-content;
    margin: 0 auto;
    cursor: pointer;
    all: unset;
}

audio, video {
    display: block;
    margin: 15px auto;
    max-width: 100%;
}

pre {
    background: var(--highlight-color);
    color: var(--secondary-color);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    font-family: "Courier New", monospace;
}

figcaption, footer p {
    text-align: center;
}

table,
td,
th {
    border: 1px solid var(--primary-color);
    padding: 5px;
}

table {
    border-collapse: collapse;
    background-color: var(--highlight-color);
    caption-side: bottom;
    align-items: center;
}

iframe {
    display: block;
    margin: 0 auto;
    width: 80%;
    border: none;
}

hr {
    border-top: 2px solid var(--primary-color);
    margin: 20px 10px 10px 10px;
}

textarea {
    height: 80%;
}

input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(31,122,140,0.5);
}

fieldset {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 15px;
}

legend {
    font-weight: bold;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 10px;
    z-index: 100;
}

.skip-link:focus {
    top: 10px;
    left: 10px;
    transition: top 0.3s ease;
}

button,
input[type="submit"],
input[type="reset"] {
    background-color: var(--primary-color);
    color: var(--light-color);
    border: 2px solid var(--secondary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s;
    margin: 5px;
}

button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
    background-color: var(--secondary-color);
    color: var(--highlight-color);
    transform: scale(1.05);
}

button:active,
input[type="submit"]:active,
input[type="reset"]:active {
    transform: scale(0.98);
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.flex-container > section {
    flex: 1 1 45%;
    min-width: 300px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.project-container aside {
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.project-container .project-description {
    max-width: 800px;
}   

@media (min-width: 576px) {
    .bottom-group {
        display: flex;
        flex-direction: row;
        gap: 20px;
    }
    .form-feedback, .form-buttons {
        flex: 1;
    }
}

@media (min-width: 768px) {
    .top-group {
        display: flex;
        flex-direction: row;
        gap: 20px;
    }
    .form-info, .form-message {
        flex: 1;
    }
    .project-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .project-container aside {
        flex: 0 0 30%;
        margin-top: 3rem;
    }

    .project-container .project-description {
        flex: 1;
    }
}