@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
  box-sizing: border-box;
  cursor: crosshair;
}

body {
  background-color: slategrey;
  padding: 0;
  margin: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
  font-size: 1.15rem;
  font-family: 'Orbitron', monospace;
  letter-spacing: 2px;
  word-spacing: 4px;
  font-variant: small-caps;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0 0 10px 0;
}

h1, h4, p {
  color: white;
}

h4 {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  margin: 0 0 10px 0;
}

p {
  font-size: clamp(12px, 2vw, 14px);
  line-height: 1.6;
}

span {
  background: linear-gradient(
    45deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #0000ff,
    #4b0082,
    #9400d3
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow-animation 3s ease-in-out infinite;
  cursor: wait;
}

@keyframes rainbow-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#markdown-canvas {
  background-image: url('./images/heartless.gif');
  background-position: center;
  background-size: cover;
  width: min(90vw, 1600px);
  height: 750px;
  margin: auto;
  margin-top: 5%;
  padding: clamp(15px, 3vw, 20px);
  border-radius: 5px;
  border: 1px solid white;
  box-shadow: 0 0 25px 10px white;
  position: relative;
}

#markdown-canvas::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  border-radius: inherit;
}

#markdown-canvas h1,
#markdown-canvas h4,
#markdown-canvas p,
#markdown-canvas * {
  position: relative;
  z-index: 2;
}

#markdown-canvas h1,
#markdown-canvas h4,
#markdown-canvas p {
  text-shadow: 2px 2px 3px #000;
}

#pfp {
  background-image: url('./images/pfp.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid white;
  border-radius: 100%;
  height: 100px;
  width: 100px;
  margin-bottom: 10px;
}

.text-em {
  font-style: italic;
}

.text-bold {
  font-weight: bold;
}

.spider {
  position: absolute;
  top: 20px;
  left: 20px;
  width: clamp(30px, 6vw, 40px);
  height: clamp(23px, 4.5vw, 30px);
  z-index: 10;
  animation: spider-crawl 15s linear infinite;
}

/* Spider body */
.spider-body {
  position: absolute;
  width: 40%;
  height: 67%;
  background: radial-gradient(circle, #8B0000, #4B0000);
  border-radius: 50%;
  top: 17%;
  left: 30%;
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.6);
}

.spider-abdomen {
  position: absolute;
  width: 30%;
  height: 53%;
  background: radial-gradient(circle, #A0A0A0, #333);
  border-radius: 60%;
  top: 60%;
  left: 35%;
  box-shadow: 0 0 6px rgba(160, 160, 160, 0.4);
}

/* Spider legs */
.spider-leg {
  position: absolute;
  width: 5%;
  background: linear-gradient(to bottom, #4B0000, #8B0000);
  border-radius: 1px;
  transform-origin: top center;
}

.leg-1 {
  height: 60%;
  top: 27%;
  left: 20%;
  transform: rotate(-45deg);
  animation: leg-wiggle-1 0.8s ease-in-out infinite alternate;
}

.leg-2 {
  height: 67%;
  top: 40%;
  left: 15%;
  transform: rotate(-70deg);
  animation: leg-wiggle-2 0.9s ease-in-out infinite alternate;
}

.leg-3 {
  height: 63%;
  top: 53%;
  left: 17%;
  transform: rotate(-110deg);
  animation: leg-wiggle-3 0.7s ease-in-out infinite alternate;
}

.leg-4 {
  height: 57%;
  top: 67%;
  left: 22%;
  transform: rotate(-135deg);
  animation: leg-wiggle-4 0.8s ease-in-out infinite alternate;
}

.leg-5 {
  height: 60%;
  top: 27%;
  right: 20%;
  transform: rotate(45deg);
  animation: leg-wiggle-5 0.9s ease-in-out infinite alternate;
}

.leg-6 {
  height: 67%;
  top: 40%;
  right: 15%;
  transform: rotate(70deg);
  animation: leg-wiggle-6 0.7s ease-in-out infinite alternate;
}

.leg-7 {
  height: 63%;
  top: 53%;
  right: 17%;
  transform: rotate(110deg);
  animation: leg-wiggle-7 0.8s ease-in-out infinite alternate;
}

.leg-8 {
  height: 57%;
  top: 67%;
  right: 22%;
  transform: rotate(135deg);
  animation: leg-wiggle-8 0.9s ease-in-out infinite alternate;
}

/* Spider eyes */
.spider-eyes {
  position: absolute;
  top: 23%;
  left: 40%;
}

.eye {
  width: 7.5%;
  height: 10%;
  background: #ff0000;
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 3px #ff0000;
  animation: eye-glow 2s ease-in-out infinite alternate;
}

.eye-1 { top: 7%; left: 2.5%; }
.eye-2 { top: 7%; left: 12.5%; }
.eye-3 { top: 17%; left: 0%; }
.eye-4 { top: 17%; left: 15%; }

/* Animations */
@keyframes spider-crawl {
  0% {
    top: 20px;
    left: 20px;
    transform: rotate(0deg);
  }
  25% {
    top: 50px;
    left: calc(100vw - 80px);
    transform: rotate(90deg);
  }
  50% {
    top: calc(100vh - 80px);
    left: calc(100vw - 60px);
    transform: rotate(180deg);
  }
  75% {
    top: calc(100vh - 60px);
    left: 40px;
    transform: rotate(270deg);
  }
  100% {
    top: 20px;
    left: 20px;
    transform: rotate(360deg);
  }
}

@keyframes leg-wiggle-1 {
  0% { transform: rotate(-45deg); }
  100% { transform: rotate(-35deg); }
}

@keyframes leg-wiggle-2 {
  0% { transform: rotate(-70deg); }
  100% { transform: rotate(-60deg); }
}

@keyframes leg-wiggle-3 {
  0% { transform: rotate(-110deg); }
  100% { transform: rotate(-120deg); }
}

@keyframes leg-wiggle-4 {
  0% { transform: rotate(-135deg); }
  100% { transform: rotate(-145deg); }
}

@keyframes leg-wiggle-5 {
  0% { transform: rotate(45deg); }
  100% { transform: rotate(35deg); }
}

@keyframes leg-wiggle-6 {
  0% { transform: rotate(70deg); }
  100% { transform: rotate(60deg); }
}

@keyframes leg-wiggle-7 {
  0% { transform: rotate(110deg); }
  100% { transform: rotate(120deg); }
}

@keyframes leg-wiggle-8 {
  0% { transform: rotate(135deg); }
  100% { transform: rotate(145deg); }
}

@keyframes eye-glow {
  0% { 
    box-shadow: 0 0 3px #ff0000;
    background: #ff0000;
  }
  100% { 
    box-shadow: 0 0 8px #ff4444;
    background: #ff4444;
  }
}

/* Hover effect - only on devices that support hover */
@media (hover: hover) {
  .spider:hover {
    animation-duration: 5s;
  }

  .spider:hover .spider-leg {
    animation-duration: 0.3s;
  }
}

/* Mobile responsive breakpoints */
@media screen and (max-width: 1000px) {
  body {
    cursor: default;
    background-attachment: scroll;
  }

  #markdown-canvas {
    width: 95vw;
    margin-top: 3vh;
    border-width: 3px;
    height: 500px;
  }

  h1, h4, p {
    text-align: center;
  }

  #pfp {
    margin: auto;
  }
}

@media screen and (max-width: 600px) {
  #markdown-canvas {
    width: 92vw;
    padding: 15px;
    border-width: 2px;
    height: 350px;
  }

  .spider {
    width: 25px;
    height: 19px;
  }
}

@media screen and (max-width: 480px) {
  #markdown-canvas {
    margin-top: 2vh;
    height: auto;
    width: 90vw;
  }

  span {
    display: block;
    text-align: center;
    margin: 5px 0;
  }
}