html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}
body {
	font-family: 'acvarela';
	display: flex;
	flex-direction: column;
	align-items: center;
	background-color: white;
	font-size: 1rem;
}
p {
	text-align: center;
}
h1 {
	font-size: 4rem;

}
h1,h2,h3 {
	width: 100%;
	text-align:center;
}
.head, header {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	font-family: 'Barlow Condensed', sans-serif;
}
.title {
	display: inherit;
	flex-direction: column;
	align-items: center;
}
.title > * {
	margin: 0;
}
#logo {
	max-width: 12rem;
	max-height: 10rem;
}
a {
	color: inherit;
	text-decoration: inherit;
	padding: 20px;
}
.bg {
	display:none;
}
.page {
	width: 100%;
	transition: opacity 1s linear;
	display: visible;
	align-items: center;
    padding: 0.5rem 0.2rem 2rem 0.2rem;
}


.welcome {
	min-height: 2em; /* Prevent shifting */
	font-family: 'acvarela', 'Noto Sans', 'Segoe UI', 'Arial Unicode MS', 'DejaVu Sans', sans-serif;
    font-size: 3rem;
    text-shadow: 1px 1px 2px black;
}

.projects {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 75rem;
    margin: auto;
    justify-content: center;
}

.project-card {
	flex: 1 1 300px; /* Grow, shrink, base width */
	padding: 1.5rem 1.5rem 0 1.5rem;
    max-width: 20vw;
	transition: transform 0.2s;
	background-color: rgba(210, 210, 210, 0.7);
	border-radius: 0.2rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.project-card:hover {
	transform: translateY(-4px) scale(1.02);
}
.project-title {
	margin: 0 0 0.5rem 0;
	font-size: 1.2rem;
}

.project-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
}
.project-links a {
	color: var(--accent);
	margin-right: 1rem;
	text-decoration: none;
	font-size: 0.95rem;
}


.text-container {
	max-width: 60em;
	margin: 3rem;
	padding: 1rem;
	text-align: center;
}

/* --- Navbar styles --- */
.navbar {
    width: 100%;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.15);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-logo {
    height: 3rem;
    width: 3rem;
    border-radius: 0.3rem;
    filter: invert(1); /* Invert logo colors */
    margin: 0.5rem;
}
.navbar-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.navbar-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    padding-right: 2rem;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
}
.navbar-toggle .bar {
    width: 1.8rem;
    height: 0.22rem;
    background: #fff;
    margin: 0.22rem 0;
    border-radius: 2px;
    transition: 0.3s;
}



/* Responsive styles */
@media (max-width: 800px) {
    .navbar-links {
        position: absolute;
        top: 3.5rem;
        right: 0;
        background: #222;
        flex-direction: column;
        width: 100vw;
        max-width: 300px;
        transform: translateX(100%);
        transition: transform 0.3s;
        box-shadow: -2px 2px 10px rgba(0,0,0,0.15);
        padding: 1rem 0;
        text-align: center;
    }
    .navbar-links.open {
        transform: translateX(0);
    }
    .navbar-toggle {
        display: flex;
        margin: 1rem;
    }
    .navbar-title {
        font-size: 1rem;
    }
    .navbar-logo {
        height: 3rem;
        width: 3rem;
    }
    .page, .bg {
        width: 100vw;
        min-width: 0;
        padding: 0.5rem 0.2rem 2rem 0.2rem;
        box-sizing: border-box;
    }
    .projects {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.5rem;
        margin: auto;
        justify-items: center;
    }
    .project-card {
        flex: 1 1;
        max-width: 100%;
    }
    .text-container {
        margin: 1rem 0.2rem;
        padding: 0.5rem;
        max-width: 100vw;
    }
    h1 {
        font-size: 2.2rem;
    }
    h2 {
        font-size: 1.6rem;
        text-shadow: 1px 1px 1px black;
    }
    h3 {
        font-size: 1.1rem;
    }
    .welcome {
        font-size: 2rem;
        text-shadow: 1px 1px 2px black;
    }
}

/* Optional: for very small screens */
@media (max-width: 500px) {
    .navbar-title {
        font-size: 1.2rem;
    }
    h1 {
        font-size: 1.4rem;
    }
    .project-card {
        flex: 1 1;
        max-width: 100%;
    }
}

.navbar-links a {
  position: relative;
  display: block;
  font-size: 1.1rem;
  padding: 0.625rem 1.25rem;
  transition: .5s;
  z-index: 1;
}
.navbar-links a:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: scaleY(2);
  opacity: 0;
  transition: .3s;
}
.navbar-links a:after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  transform: scale(0);
  opacity: 0;
  transition: .3s;
  z-index: -1;
}
.navbar-links a:hover {
  color: black;
}
.navbar-links a:hover:before {
  transform: scaleY(1);
  opacity: 1;
}
.navbar-links a:hover:after {
  transform: scaleY(1);
  opacity: 1;
}
