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

html, body {
  height: 100%;
  width: 100%;
  font-family: "Rajdhani", sans-serif;
  background-color: #040008;
  color: #fff;
  overflow: hidden;
}

#main {
  position: relative;
  overflow: hidden;
}

/* ===== NAV ===== */
#nav {
  width: 100%;
  position: fixed;
  z-index: 9;
  height: 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 30px;
  background: rgba(10, 0, 20, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#nav h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
  color: #00eaff;
  text-shadow: 0 0 15px #00eaff, 0 0 40px #ff00ff;
}

#nav h3 span {
  color: #ff00ff;
  text-shadow: 0 0 20px #ff00ff;
}

#nav button {
  padding: 12px 28px;
  border-radius: 50px;
  background: linear-gradient(90deg, #ff00ff, #00eaff);
  color: white;
  border: none;
  font-weight: 600;
  font-family: "Rajdhani";
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px #00eaff;
}
#nav button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px #ff00ff;
}

/* ===== LOOP ===== */
#loop {
  display: flex;
  width: 100%;
  position: absolute;
  height: 25%;
  top: 30%;
  font-size: 90px;
  white-space: nowrap;
  font-family: "Orbitron";
  letter-spacing: 3px;
}
#loop h1 {
  font-weight: 700;
  animation: anim 18s linear infinite;
  color: #ffffff;
  text-shadow: 0 0 20px #00eaff, 0 0 60px #ff00ff;
}
#loop h1 span {
  -webkit-text-stroke: 2px #ff00ff;
  color: transparent;
}
@keyframes anim {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-100%); }
}

/* ===== CANVAS ===== */
canvas {
  max-width: 100vw;
  max-height: 100vh;
  position: relative;
  z-index: 9;
  filter: brightness(1.15) contrast(1.2);
}

/* ===== PAGE BACKGROUNDS ===== */
#page, #page1, #page2, #page3 {
  position: relative;
  height: 100vh;
  width: 100vw;
}

#page { background: radial-gradient(circle at 20% 30%, #0f002b, #01010a); }
#page1 { background: linear-gradient(160deg, #090046, #340b8e); }
#page2 { background: linear-gradient(200deg, #2a003e, #7a00c2, #ff00ff); }
#page3 { background: radial-gradient(circle at bottom right, #000428, #004e92, #00eaff); }

/* ===== TEXTS ===== */
h1, h3, p {
  transition: all 1s ease;
}

h3 { color: #00eaff; font-weight: 400; }
h1 {
  font-size: 4vw;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(0, 238, 255, 0.6);
}
p { color: #ddd; font-size: 18px; letter-spacing: 1px; }

/* ===== INTRO PAGE ===== */
#page .c1 {
  position: absolute;
  top: 55%;
  left: 5%;
  color: #aaa;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.4em;
}
#page .c2 {
  position: absolute;
  top: 55%;
  right: 5%;
  color: #aaa;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.4em;
  text-align: right;
}
#page .s1 {
  position: absolute;
  top: 65%;
  left: 10%;
  color: #999;
  letter-spacing: 2px;
}
#page .s2 {
  position: absolute;
  top: 65%;
  right: 10%;
  color: #999;
  letter-spacing: 2px;
  text-align: right;
}

/* ===== PAGE 1 TEXT ===== */
#page1 #right-text {
  position: absolute;
  top: 30%;
  left: 10%;
  text-align: left;
}
#page1 #left-text {
  position: absolute;
  top: 50%;
  right: 10%;
  text-align: right;
}

/* ===== PAGE 2 TEXT ===== */
#page2 #text1 {
  position: absolute;
  top: 30%;
  left: 10%;
  text-align: left;
}
#page2 #text2 {
  position: absolute;
  top: 55%;
  right: 8%;
  text-align: right;
}

/* ===== PAGE 3 TEXT ===== */
#page3 #text3 {
  position: absolute;
  top: 40%;
  right: 10%;
  text-align: right;
}

/* ===== INITIAL ANIMATION ===== */
#page .c1, #page .c2, #page .s1, #page .s2,
#page1 #right-text, #page1 #left-text,
#page2 #text1, #page2 #text2,
#page3 #text3 {
  opacity: 0;
  transform: translateY(50px);
}

/* ===== SCROLL FADE EFFECT ===== */
.fade-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: all 1.2s ease-out;
}

/* ===== END PAGE ===== */
#endpage {
  position: relative;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at center, #0a001f, #01010a, #000);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

/* Main Text (center) */
#endpage .end-content {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1.5s ease;
}

#endpage .end-content.fade-in {
  opacity: 1;
  transform: translateY(0);
}

#endpage h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 3.5vw;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 25px #00eaff, 0 0 60px #ff00ff;
}

#endpage h1 span {
  color: #ff00ff;
  text-shadow: 0 0 35px #ff00ff, 0 0 70px #00eaff;
}

#endpage p {
  color: #aaa;
  font-size: 1.1vw;
  margin-top: 15px;
  letter-spacing: 1px;
  font-family: "Rajdhani";
}

/* ===== DESIGNER SIGNATURE (Right Bottom) ===== */
#endpage .designer {
  position: absolute;
  bottom: 40px;
  right: 60px;
  text-align: right;
  opacity: 0;
  transform: translateY(40px);
  transition: all 1.5s ease;
}

#endpage .designer.fade-in {
  opacity: 1;
  transform: translateY(0);
}

#endpage .designer h3 {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.4vw;
  color: #00eaff;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  text-shadow: 0 0 15px #00eaff, 0 0 30px #ff00ff;
}

#endpage .designer h3 span {
  color: #ff00ff;
  font-weight: 700;
  text-shadow: 0 0 20px #ff00ff, 0 0 40px #00eaff;
}

/* =========================================================
   RESPONSIVE STYLES (LAPTOP / TABLET)
   ========================================================= */
@media (max-width: 1200px) {
  #nav {
    height: auto;
    padding: 10px 20px;
  }

  #nav h3 {
    font-size: 20px;
  }

  #nav button {
    padding: 10px 20px;
    font-size: 14px;
  }

  #loop {
    font-size: 60px;
    top: 28%;
  }

  h1 {
    font-size: 3.6vw;
  }

  p {
    font-size: 16px;
  }

  #page .c1,
  #page .c2 {
    font-size: 18px;
  }
}

/* =========================================================
   MOBILE / SMALL TABLETS (STACKED LAYOUT)
   ========================================================= */
@media (max-width: 768px) {
  html, body {
    font-size: 14px;
  }

  #nav {
    padding: 8px 16px;
  }

  #nav h3 {
    font-size: 16px;
  }

  #nav button {
    padding: 8px 16px;
    font-size: 12px;
  }

  /* Marquee text smaller so it fits better */
  #loop {
    top: 25%;
    height: auto;
    font-size: 36px;
  }

  #loop h1 {
    text-shadow: 0 0 12px #00eaff, 0 0 30px #ff00ff;
  }

  /* Intro text: stack + center */
  #page .c1,
  #page .c2,
  #page .s1,
  #page .s2 {
    position: static;
    text-align: center;
    margin: 10px 16px 0;
    font-size: 14px;
  }

  #page .s1,
  #page .s2 {
    letter-spacing: 1px;
    margin-bottom: 6px;
  }

  /* Pages become flex-column centered */
  #page1,
  #page2,
  #page3 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 16px 40px;
    text-align: center;
  }

  #page1 #right-text,
  #page1 #left-text,
  #page2 #text1,
  #page2 #text2,
  #page3 #text3 {
    position: static;
    text-align: center;
    padding: 10px 0;
  }

  #page1 h1,
  #page2 h1,
  #page3 h1 {
    font-size: 7vw;
  }

  /* End page fonts bigger on mobile */
  #endpage h1 {
    font-size: 6vw;
  }

  #endpage p {
    font-size: 14px;
  }

  #endpage .designer {
    position: static;
    margin-top: 30px;
    text-align: center;
  }

  #endpage .designer h3 {
    font-size: 14px;
  }
}

/* =========================================================
   EXTRA-SMALL PHONES
   ========================================================= */
@media (max-width: 480px) {
  #nav h3 {
    font-size: 14px;
  }

  #loop {
    font-size: 28px;
    top: 30%;
  }

  #page1,
  #page2,
  #page3 {
    padding: 90px 12px 40px;
  }

  #page1 h1,
  #page2 h1,
  #page3 h1 {
    font-size: 8vw;
  }

  #endpage h1 {
    font-size: 7vw;
    line-height: 1.2;
  }
}
