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

/*Custom Properties */
:root {
    --ff-primary: 'Source Sans Pro', sans-serif;
    --ff-secondary: 'Source Code Pro', monospace;

    --fw-reg: 300;
    --fw-bold: 900;

    --clr-light: #fff;
    --clr-dark: #303030;
    --clr-accent: #3c70e2;

    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;

    --bs: .25em .25em .75em rgba(0, 0, 0, .25),
        .125em .125em .25em rgba(0, 0, 0, .15);
}

@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3.75rem;
        --fs-h3: 1.75rem;
        --fs-body: 1.125rem;
    }
}

/* General Styles */
html {
    scroll-behavior: smooth;
}

body {
    background: #1a1a1a;
    color: var(--clr-light);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
}

section {
    padding: 5em 2em;
}

img {
    display: block;
    max-width: 100%;
}

strong {
    font-weight: var(--fw-bold)
}

:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

/* Typography */
h1,
h2,
h3 {
    line-height: 1;
    margin: 0;
}

h1 {
    font-size: var(--fs-h1)
}

h2 {
    font-size: var(--fs-h2)
}

h3 {
    font-size: var(--fs-h3)
}

/* Home Section */
.home, .about {
    text-align: center;
}

.section__title {
    margin-top: 1.5em;
    margin-bottom: .25m;
}

.section__title--home {
    font-weight: var(--fw-reg);
}

.section__title--home span {
    color: var(--clr-accent);
    font-weight: 400;
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h3);
}

.section__subtitle--home {
    background: var(--clr-accent);
    padding: .5em 1em;
    font-family: var(--ff-secondary);
    margin-top: .5em;
    margin-bottom: 1em;
}

/* About Section */
.about, 
.projects,
.contact {
    text-align: center;
}

.section__subtitle--about,
.section__subtitle--projects,
.section__subtitle--contact {
    background: var(--clr-accent);
    padding: .5em 1em;
    font-family: var(--ff-secondary);
    font-weight: var(--fw-bold);
    margin: .5em auto 1em auto; 
    font-size: var(--fs-h2)
}

.about__body {
    font-size: 1.5rem;
    text-align: left;
    max-width: 600px; 
    margin: 0 auto; 
    line-height: 1.8;
    display: block; 
}

/* Skills Sections */
.skills {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 20px; 
}

.skills__row {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 20px; 
    width: 100%; 
}

.skills__item {
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    background: transparent; 
    color: var(--clr-light);
    border: 2px solid var(--clr-accent); 
    padding: .5em;
    border-radius: 10px;
    width: 140px; 
    height: 105px; 
    box-sizing: border-box; 
}

.skills__item-name {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s;
    letter-spacing: 1px;
    margin-top: 10px; 
}

.skills__item-content {
    text-align: center;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
}

.skills__item img {
    width: 50px; 
    height: auto;
    max-width: 100%; 
    max-height: 100px;
}

/* Projects Sections */
.project {
    display: flex;
    align-items: center; 
    gap: 20px; 
}

.project-left {
    flex-direction: row; /* Image on the left, text on the right */
    justify-content: flex-start; 
}

.project-right {
    flex-direction: row-reverse; /* Image on the right, text on the left */
    justify-content: flex-start; 
}

/* Project image container styles */
.project__image-container {
    position: relative; /* Ensures z-index applies */
    height: 550px;
    width: 800px;
    background-color: var(--clr-accent);
    transition: transform 200ms ease-in-out;
    margin-bottom: 75px;
    z-index: 10;
}

.project__image-container:hover {
    transform: scale(1.04);
}

.project__info {
    flex: 1; /* Allows the description to grow and take up available space */
    max-width: 600px; 
    margin-bottom: 50px;
}

.project__description {
    font-size: 1.5rem;
    text-align: center;
    line-height: 1.8;
}

.project-btn {
    margin-bottom: 20px;
}

.cell,
.leaflet,
.spotify,
.interest {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Clear Cell Game Setup */
.project__image-cell {
    max-width: 85%; 
    max-height: 85%; 
}

/* Leaflet Exercise Setup */
.project__image-leaflet {
    max-width: 75%; 
    max-height: 90%;
    margin-left: auto; /* Aligns the image to the right */
}

/* Spotify App Setup */
.project__image-spotify {
    max-width: 95%;
    max-height: 98%;
}

/* Interest Calculator Setup */
.project__image-interest {
    max-width: 90%; 
    max-height: 95%;
    margin-left: auto; 
}

/* Contact Section */
.contact__text {
    font-size: 1.5rem;
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
    display: block;
}

.container {
    padding: 20px;
}

form {
    display: flex;
    flex-direction: column; 
    align-items: center; 
}

input[type=text],
textarea {
    width: 550px;
    padding: 12px;
    border: 1.5px solid var(--clr-accent); 
    background-color: var(--clr-dark); 
    color: var(--clr-light); 
    border-radius: 10px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
    display: flex;
    flex-direction: column;
    align-items: center;  
}

textarea {
    height: 200px;
}

input[type=submit] {
    background: var(--clr-accent);
    color: var(--clr-light); 
    border: 2px solid var(--clr-accent); 
    margin-top: 6px;
    width: 150px;
}

.btn,
input[type=submit] {
    display: inline-block;
    padding: .5em 2.5em;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
    position: relative;
    z-index: 10;
}

/* Buttons setup */
.btn {
    background: transparent; /* Remove background fill */
    color: var(--clr-accent); 
    border: 2px solid var(--clr-accent); 
    width: 236px;
}

.btn:hover,
input[type=submit]:hover {
    transform: scale(1.1);
}

/* The navigation bar */
.navbar {
    overflow: hidden;
    background-color: var(--clr-dark);
    position: fixed; 
    top: 0; /* Position the navbar at the top of the page */
    width: 100%; 
    z-index: 1000;
}

/* Links inside the navbar */
.navbar a {
    float: right; 
    display: block;
    color: var(--clr-accent);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

/* Change background on mouse-over */
.navbar a:hover {
    color: var(--clr-light);
}

.nav__link {
    font-weight: var(--fw-bold);
}

/* Footer */
.footer {
    background: var(--clr-dark);
    color: var(--clr-accent);
    text-align: center;
    padding: 2.5em 0;
    font-size: var(--fs-h3);
}

.footer a {
    text-decoration: none;
    color: var(--clr-accent);
}

.footer__link {
    font-weight: var(--fw-bold);
}

.footer__link:hover,
.social-list__link:hover {
    color: var(--clr-light);
}

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0;
    padding: 0;
}

.social-list__item {
    margin: 0 .5em;
}