/* ---------------- GLOBAL ---------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-image: url("Knight Background.png");
  background-position: center;
  background-attachment: fixed;
  background-size: cover;
  font-family: "Poppins", sans-serif;
  color: white;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* adjust darkness here */
  z-index: -1;
  pointer-events: none;
}

/* ---------------- HEADINGS ---------------- */
h1 {
  text-align: center;
  font-size: clamp(36px, 5vw, 60px);
  background: linear-gradient(90deg, #ff6347, #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 50px;
  font-weight: 800;
  letter-spacing: 3px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

h2 {
  text-align: center;
  font-size: clamp(28px, 4vw, 44px);
  color: white;
  margin-top: 80px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ---------------- SUBTITLE ---------------- */
.subtitle {
  text-align: center;
  font-size: clamp(16px, 1.8vw, 22px);
  color: #f1f1f1;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 10px;
  font-weight: 500;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
}

/* ---------------- TEXT ---------------- */
p {
  text-align: center;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
  color: #f1f1f1;
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 10px;
  background: none;
}

/* ---------------- SECTIONS ---------------- */
section {
  padding: 120px 20px;
  margin-top: 80px;
}

/* ---------------- NAVBAR ---------------- */
.navbar {
  width: 100%;
  background: rgba(51, 51, 51, 0.85);
  position: relative;
  z-index: 1000;
  padding: 15px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.navbar ul {
  list-style-type: none;
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.navbar li {
  padding: 12px 20px;
}

.navbar a {
  display: inline-block;
  text-decoration: none;
  color: white;
  font-size: 20px;
  position: relative;
  transition: color 0.4s ease, transform 0.4s ease, text-shadow 0.4s ease;
}

.navbar a:hover,
.navbar a:focus {
  color: #ff6347;
  text-shadow: 0 0 25px rgba(255, 99, 71, 0.9),
               0 0 35px rgba(255, 99, 71, 0.8);
  transform: scale(1.1);
  outline: none;
}

/* Glowing underline */
.navbar a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #ff6347;
  bottom: -5px;
  left: 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.navbar a:hover::after,
.navbar a:focus::after {
  transform: scaleX(1);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 10px rgba(255, 99, 71, 0.8),
                0 0 20px rgba(255, 99, 71, 0.7);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 99, 71, 1),
                0 0 25px rgba(255, 99, 71, 0.8);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 99, 71, 0.8),
                0 0 20px rgba(255, 99, 71, 0.7);
  }
}

/* ---------------- SOCIAL LINKS ---------------- */
.social_links {
  display: flex;
  justify-content: center;
  padding: 15px;
}

.social_links a {
  height: 60px;
  width: 60px;
  margin: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-color: #222;
  border-radius: 50%;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.social_links i {
  font-size: 30px;
  color: #4d7177;
  transition: transform 0.3s ease, color 0.3s ease;
}

.social_links a:hover,
.social_links a:focus {
  background: #ff6347;
  transform: translateY(-5px);
  box-shadow: 0 0 25px rgba(255, 99, 71, 1),
              0 0 35px rgba(255, 99, 71, 0.7);
  outline: none;
}

.social_links i:hover,
.social_links i:focus {
  transform: scale(1.2);
}

/* ---------------- PROJECTS ---------------- */
.projects-grid {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  padding: 60px 0;
}

.crateninja,
.flaptofreedom,
.skyblaster {
  flex: 0 0 auto;
  max-width: 320px;
  border-radius: 15px;
  background: #1a1a1a;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.crateninja:hover,
.flaptofreedom:hover,
.skyblaster:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 99, 71, 0.9),
              0 0 35px rgba(255, 99, 71, 0.7);
}

.crateninja h3,
.flaptofreedom h3,
.skyblaster h3 {
  color: white;
  font-size: 24px;
  text-align: center;
  margin: 20px 0;
}

.crateninja a,
.flaptofreedom a,
.skyblaster a {
  text-decoration: none;
}

.crateninja img,
.flaptofreedom img,
.skyblaster img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.crateninja:hover img,
.flaptofreedom:hover img,
.skyblaster:hover img {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 99, 71, 0.9),
              0 0 20px rgba(255, 99, 71, 0.7);
}

/* ---------------- CONTACT FORM ---------------- */
form {
  max-width: 600px;
  margin: 50px auto;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(15px);
  box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3);
}

input,
textarea {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #ff6347;
  box-shadow: 0 0 8px rgba(255, 99, 71, 0.6);
}

button {
  padding: 15px;
  background: #ff6347;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s ease;
  margin-top: 20px;
}

button:hover {
  background: #e5533c;
}

button:focus-visible {
  outline: 2px solid #ff6347;
  outline-offset: 4px;
}

/* ---------------- FOOTER ---------------- */
.trademark {
  text-align: right;
  padding: 10px 20px;
  font-size: 8px;
  font-family: "Roboto", sans-serif;
  color: #888;
  opacity: 0.7;
  white-space: nowrap;
}

/* ---------------- MOBILE ---------------- */
@media (max-width: 768px) {
  h1 {
    font-size: clamp(32px, 8vw, 40px);
    margin-top: 30px;
  }

  h2 {
    font-size: clamp(26px, 6vw, 32px);
    margin-top: 50px;
  }

  .navbar ul {
    flex-direction: column;
  }

  .projects-grid {
    flex-direction: column;
  }

  .crateninja,
  .flaptofreedom,
  .skyblaster {
    max-width: 90%;
    margin: auto;
  }

  form {
    width: 90%;
  }

  button {
    width: 100%;
  }

  .social_links a:hover,
  .crateninja:hover,
  .flaptofreedom:hover,
  .skyblaster:hover {
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.7);
  }
}

/* ---------------- FADE-IN ANIMATION ---------------- */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Apply fade-in to main elements */
h1, h2, p, .projects-grid div, .about-selfie img, form {
    animation: fadeIn 1s ease-out;
}

/* ---------------- PROJECT HOVER OVERLAY ---------------- */
.projects-grid div {
    position: relative; /* ensure overlay sits on top */
    overflow: hidden;
}

.projects-grid div .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* semi-transparent dark overlay */
    color: #ff6347; /* highlight color for text */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 18px;
    line-height: 1.4;
}

.projects-grid div:hover .overlay {
    opacity: 1;
    transform: scale(1.02); /* subtle zoom */
}

/* ---------------- SCROLL BUTTONS STACKED RIGHT ---------------- */
.scroll-btn {
    position: fixed;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #ff6347;
    color: white;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.5);
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.4s;
}

/* Vertical stacking using top */
.scroll-up {
    top: 93%; /* Adjust as needed */
    left: 93%;
}

.scroll-down {
    top: 93%; /* Slightly below the up button */
}

/* Hover effect */
.scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 99, 71, 0.7);
}

/* MOBILE ADJUSTMENT */
@media (max-width: 768px) {
    .scroll-btn {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 20px;
    }

    .scroll-up {
        top: 38%;
    }

    .scroll-down {
        top: 48%;
    }
}



/* MOBILE ADJUSTMENT */
@media (max-width: 768px) {
    .scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        line-height: 40px;
    }

    .scroll-up {
        transform: translateY(-70%);
    }

    .scroll-down {
        transform: translateY(60%);
    }
}

/* ---------------- PROJECT HOVER ENHANCEMENT ---------------- */
.projects-grid div img {
    transition: transform 0.4s ease, filter 0.4s ease;
}

.projects-grid div:hover img {
    transform: scale(1.05); /* subtle zoom */
    filter: brightness(0.85); /* darken a bit so overlay stands out */
}

.projects-grid div .overlay {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.projects-grid div:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------- SECTION FADE-IN ON SCROLL ---------------- */
.section1, .section2, .section3, .section4 {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section1.visible, .section2.visible, .section3.visible, .section4.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------- SECTION FADE-IN ---------------- */
.section1, .section2, .section3, .section4 {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 1s ease forwards;
}

.section1 {
    animation-delay: 0.2s;
}
.section2 {
    animation-delay: 0.4s;
}
.section3 {
    animation-delay: 0.6s;
}
.section4 {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------- SOCIAL ICON PULSE HOVER ---------------- */
.social_links a {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social_links a:hover {
    animation: pulseIcon 1s infinite;
    transform: scale(1.1);
}

@keyframes pulseIcon {
    0% {
        box-shadow: 0 0 10px rgba(255, 99, 71, 0.7), 0 0 20px rgba(255, 99, 71, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 99, 71, 0.9), 0 0 30px rgba(255, 99, 71, 0.7);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 99, 71, 0.7), 0 0 20px rgba(255, 99, 71, 0.5);
    }
}


/* ---------------- ABOUT SELFIE (Professional Rectangular) ---------------- */
.about-selfie {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.about-selfie img {
    width: 400px;
    max-width: 80%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #ff6347;
    box-shadow: 0 0 25px rgba(255, 99, 71, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.about-selfie img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 35px rgba(255, 99, 71, 0.7);
}

@media (max-width: 768px) {
    .about-selfie img {
        width: 280px;
    }
}
