body {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, Menlo, Monaco, monospace;
  line-height: 1.6;
  color: #e0e0e0;
  text-align: center;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-color: #171c26; /* fallback if video doesn't load */
}

/* ===== Fade-In on Load ===== */
body {
  animation: fadeInBg 1.5s ease-in-out forwards;
}

@keyframes fadeInBg {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ===== Background Video Crossfade ===== */
#bg-video1,
#bg-video2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.3s linear;
  filter: brightness(0.55) contrast(1.3) saturate(1.15);
  pointer-events: none;
}

/* Start with video 1 visible */
#bg-video1 {
  opacity: 0.18;
}
/* Smooth fade for crossfade loop */
#bg-video1,
#bg-video2 {
  transition: opacity 1s ease-in-out;
}

/* ===== Texture Overlay ===== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/texture.jpg");
  background-repeat: repeat;
  background-size: auto;
  background-position: center;
  opacity: 0.08; /* very subtle texture */
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: -1; /* sits above the video */
}


    .container {
      width: 720px;
      margin:auto;
      padding: 24px;
    }
    .btn {
      display: inline-block;
      padding: 10px 16px;
      border-radius: 8px;
      border: 1px solid;
      color: black;
      background: rgb(11, 241, 134);
      font-weight: 600;
      cursor:pointer;
    }

    body.dark_mode {
      background-color: #171c26;
    }
    body.dark_mode h1 {
      color: cyan;
    }
    body.dark_mode h2 {
      color: silver;
    }
    body.dark_mode p {
      color: rgb(24, 234, 41);
    }
    body.dark_mode ul {
      color: rgb(29, 232, 157);
    }

  
  h1 {
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    color: darkcyan;
    margin-top: 0px;
    margin-bottom: 40px;
    font-size: 60px;
  }
  
  h2 {
    color: darkblue;
    margin-bottom: 25px;
  }
  nav a {
    margin: 50px;
    font-size: 17px;
    text-decoration: underline;
    text-align: center;
    color: aquamarine;    
  }
  p {
    font-size: 20px;
    color:rgb(0, 126, 99);
    margin-bottom: 10px;
  }

  ul {
    font-size: 15px;
    font-family: Arial, Helvetica, sans-serif;
    list-style-type: none;
    margin-left: 20px;
    padding-left: 10px;
    list-style-position: inside;
  }
  ul li::before {
    content: ">> ";
    color: rgb(19, 232, 200);
    font-size: 20px;
  }
  img {
    display: block;
    margin: 20px auto;
    border:1px solid #ccc;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
  }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* exactly 3 per row */
  gap: 36px;
  margin-top: 40px;
  justify-items: center;
  padding: 0 20px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
  }
}

@media (max-width: 600px) {
  .portfolio-grid {
    grid-template-columns: 1fr; /* 1 per row on phones */
  }
}

.portfolio-item {
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.3s ease;
}

.portfolio-item:hover {
  transform: scale(1.05);
}

.portfolio-item img {
  width: 100%;
  max-width: 350px;
  border-radius: 16px;
  border: 2px solid #1effc1;
  box-shadow: 0 0 25px rgba(0, 255, 200, 0.25);
  transition: all 0.3s ease;
}

.portfolio-item img:hover {
  box-shadow: 0 0 35px rgba(0, 255, 200, 0.55);
}

.portfolio-item h3 {
  margin-top: 12px;
  color: rgb(19, 232, 157);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Header Logo */
.logo-header {
  display: block;
  max-width: clamp(260px, 25vw, 400px); /* scales smoothly on all screens */
  margin: 0 auto;
  border: none;
  box-shadow: none;
  transition: all 0.3s ease;
  position: relative;
  top: -20px;   /* raises the image */
  left: -15px;  /* nudges slightly left */
}

/* Keep it well-positioned on smaller devices */
@media (max-width: 768px) {
  .logo-header {
    max-width: clamp(200px, 40vw, 280px);
    top: -300px;
    left: 0;
  }
}
.logo-header:hover {
  transform: scale(1.05);
}