*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    height: 100%;
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #0a0a0a;
    scroll-behavior: smooth;
}

/* Nav and Footer */
nav, footer {
    background-color: #0f0f0f;
    text-align: center;
    padding: 10px;
}

nav {
    font-family: 'Silkscreen', cursive;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

nav a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #4e54c8;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

footer {
    color: azure;
}

/* Hero Canvas */
#canvas-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 90vh;
}

#canvas {
    position: inherit;
    background-color: black;
    height: 100%;
    width: 100%;
    user-select: none;
    -webkit-touch-callout: none;
}

#welcome {
    position: absolute;
    z-index: 5;
    color: #e0e0e0;
    text-align: center;
}

a#intro {
    font-size: 40px;
    font-family: 'Silkscreen', cursive;
}

/* Buttons */
.projects-button-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.button-container {
    position: relative;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 20px 0;
}

a.styled-button {
    padding: 10px 20px;
    background-image: linear-gradient(to right, #4e54c8, #8f94fb);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-family: 'Silkscreen', cursive;
    font-size: 20px;
    transition: all 0.3s ease;
}

a.styled-button:hover {
    background-image: linear-gradient(to left, #4e54c8, #8f94fb);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

#back2top {
    position: relative;
}

/* Sections */
section {
    display: block;
    justify-content: center;
    text-align: center;
}

#projects {
    padding-top: 100px;
    padding-bottom: 110px;
}

h1, h2 {
    position: relative;
    font-family: 'Silkscreen', cursive;
    color: white;
    z-index: 5;
}

h3 {
    position: relative;
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: bold;
    color: aliceblue;
}

p {
    color: aliceblue;
}

p a {
    color: #8ab4f8;
    transition: color 0.3s ease;
}

p a:hover {
    color: #aecbfa;
}

.summary {
    text-align: left;
    margin: 0 10%;
}

/* Project Grid */
.grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 10px;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.grid-item {
    background-color: #0e0e0e;
    aspect-ratio: 3 / 2;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.005) translateY(-2px);
}

.project-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    aspect-ratio: 3 / 2;
    border-radius: 5px;
}

/* Project Content (iframes, images) */
.content {
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.content iframe {
    max-width: 100%;
    border: 0;
}

.content .image-container {
    max-width: 100%;
}

.content .image-container img {
    max-width: 100%;
    height: auto;
}

/* Contact */
.contact {
    position: relative;
    text-align: center;
    padding: 40px 0;
    background-color: #2f2f2f;
}

.contact-heading {
    font-size: 2em;
    margin-bottom: 40px;
    color: #fafafa;
    font-family: 'Silkscreen', cursive;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-icon {
    font-size: 30px;
    margin: 0 15px;
    padding-bottom: 20px;
    color: #fafafa;
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-icon:hover {
    color: #4e54c8;
    transform: scale(1.1);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .grid-section {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    a#intro {
        font-size: 32px;
    }

    .summary {
        margin: 0 5%;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    nav a {
        font-size: 14px;
        margin: 0 8px;
    }

    a#intro {
        font-size: 24px;
    }

    #welcome p {
        font-size: 14px;
        padding: 0 16px;
    }

    a.styled-button {
        font-size: 16px;
        padding: 8px 16px;
    }

    .grid-section {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .contact-heading {
        font-size: 1.5em;
    }
}
