@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

:root {
  --primary-color: #186f8a;
  --primary-color-dark: #020f46;
  --secondary-color: #169094;
  --text-light: #ffffff;
  --text-medium: #d6d6d6;
  --text-dark: #a8a8a8;
  --background-medium: #1990c7;
  --background-dark: #07413e;
  --max-width: 1400px;
  --max-width-desktop: 4000px;
  --max-width-tablet: 1400px;
}

html {
  scroll-behavior: smooth;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-light);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: transparent; 
}

#vantajs {
  position: fixed;   
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;       
}

.dark-text {
  color: var(--primary-color-dark);
}

/* -------------------- NAVIGATION -------------------- */
nav {
  width: 100%;
  background: var(--background-dark);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
}

.nav__content {
  max-width: var(--max-width);
  margin: auto;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo a {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--primary-color);
  transition: 0.3s;
}

nav .logo a:hover {
  color: var(--primary-color-dark);
}

nav .checkbox {
  display: none;
}

nav input {
  display: none;
}

nav .checkbox i {
  font-size: 2rem;
  color: var(--primary-color);
  cursor: pointer;
}

ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  transition: left 0.3s;
}

ul li a {
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-light);
  transition: 0.3s;
}

ul li a:hover {
  border-top-color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

/* -------------------- GENERAL SECTIONS -------------------- */
.section {
  background: transparent;
}

.section__container {
  min-height: 100vh;
  max-width: var(--max-width);
  margin: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.sectionTitle {
  background: transparent;
  text-align: center; 
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.subtitle {
  letter-spacing: 2px;
  color: var(--primary-color-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.contactTitle {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.aboutMeText {
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--text-medium);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.title span {
  font-weight: 600;
  color: var(--primary-color-dark);
}

.description {
  line-height: 1.5rem;
  color: var(--primary-color-dark);
  margin-bottom: 2rem;
}

/* -------------------- BUTTONS -------------------- */
.action__btns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.action__btns button {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 1rem 2rem;
  outline: none;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  transition: 0.3s;
  cursor: pointer;
}

.hire__me {
  background-color: var(--primary-color);
  color: #ffffff;
}

.hire__me:hover {
  background-color: var(--primary-color-dark);
}

.portfolio {
  color: var(--primary-color);
}

.portfolio:hover {
  background-color: var(--primary-color-dark);
  color: #ffffff;
}

/* -------------------- IMAGES -------------------- */
.image {
  display: grid;
  place-items: center;
}

.image img {
  width: min(25rem, 90%);
  border-radius: 100%;
}

/* -------------------- PORTFOLIO SECTION -------------------- */
#portfolio {
  padding: 4rem 1rem;
  text-align: center;
}

#portfolio .titleProjects {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 3rem;
  margin-bottom: 2rem;
  color: var(--text-light);
}

#portfolio .contactContainer {
  min-height: auto;         
  justify-content: flex-start;
  padding-top: 2rem;
  width: 100%;
}

#portfolio .project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  justify-items: center;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

@media (min-width: 640px) {
  #portfolio .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #portfolio .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: block;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  background: #222;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: scale(1.015);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #333;
}

.project-card .card-content {
  padding: 1rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-dark);
}

/* Tags */
.tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background-color: var(--secondary-color);
  color: #000;
}

.tag.in-progress {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.tag.finished {
  background-color: var(--secondary-color);
  color: #000;
}

/* -------------------- CONTACT SECTION -------------------- */
.contactContainer {
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
}

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

.contactButton button {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 1rem 2rem;
  outline: none;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  transition: 0.3s;
  cursor: pointer;
}

/* -------------------- FOOTER -------------------- */
footer {
  background-color: var(--primary-color);
  height: 10vh;
  display: grid;
  justify-content: center;
  place-items: center;
}

footer img {
  height: 3rem;
  width: 3rem;
}

footer ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  transition: left 0.3s;
}

footer ul li a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-light);
  border: none;
}

/* -------------------- MEDIA QUERIES -------------------- */
@media screen and (min-width: 751px) and (max-width: 1920px) {
  .titleProjects {
    text-align: center;
  }
}

@media screen and (min-width: 1921px) {
  html {
    font-size: 1.5rem;
  }
  .nav__content {
    max-width: var(--max-width-desktop);
    margin: auto;
    padding: 1rem 10rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 750px) {
  nav .checkbox {
    display: block;
  }
  ul {
    position: absolute;
    width: 100%;
    height: calc(100vh - 85px);
    left: -100%;
    top: 85px;
    background-color: var(--background-dark);
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    transition: left 0.3s;
  }
  nav #check:checked ~ ul {
    left: 0;
  }
  ul li a {
    font-size: 1.25rem;
  }
  .section__container {
    padding: 10rem 1rem 5rem 1rem;
    text-align: center;
    grid-template-columns: repeat(1, 1fr);
  }
  .image {
    grid-area: 1/1/2/2;
  }
  .action__btns {
    margin: auto;
  }
  input,
  textarea {
    width: 100%;
  }
  .titleProjects {
    margin-left: 0;
  }
  .contactContainer {
    padding: 10rem 1rem 5rem 1rem;
    text-align: center;
    grid-template-columns: repeat(1, 1fr);
  }
  #portfolio .project-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    max-width: 100%;
    width: 100%;
  }
  .project-card img {
    height: auto;
  }
  .text-left,
  .image-top-right,
  .image-bottom-left,
  .text-right {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  .image-top-right img,
  .image-bottom-left img {
    width: 100%;
    max-width: 100%;
  }
}


/* project page layout */

.blogContainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 20px;
  padding: 40px;
  width: 100%;
  max-width: 1000px;
  box-sizing: border-box;
  margin: 0 auto;
  align-items: start;
}

.text-left {
  grid-column: 1 / 2;
  grid-row: 1;
}

.image-top-right {
  grid-column: 2;
  grid-row: 1;
}

.image-bottom-left {
  grid-column: 1;
  grid-row: 3;
}

.text-right {
  grid-column: 2;
  grid-row: 3;
}

/* Ensure blog images don't overflow their grid cells */
.blogContainer img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 0.5rem;
}

/* Stack the blog grid on small screens */
@media (max-width: 750px) {
  .blogContainer {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 20px;
    gap: 12px;
  }
  .text-top,
  .image-top-right,
  .image-bottom-left,
  .text-right {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Additional safeguards to prevent horizontal overflow */
html, body {
  overflow-x: hidden;
}

/* Limit large images so they don't dominate layout on wide screens */
.image-top-right img,
.image-bottom-left img {
  max-width: 420px;
  width: 150%;
  height: auto;
}

/* Make text wrap inside grid cells */
.blogContainer .description {
  word-wrap: break-word;
  hyphens: auto;
}