@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
  margin: 0;
  padding: 0;
  background: #F7B267;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
  transition: background 0.8s ease;
}

/* Grain texture */
.grain {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://www.transparenttextures.com/patterns/noise.png");
  opacity: 0.5;
  z-index: 0;
}

/* Grid background */
.grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  cursor: grab;
  opacity: 0;
  background-image:
    linear-gradient(to right, rgba(0, 110, 255, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 110, 255, 0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(0, 110, 255, 0.25) 1px, transparent 50px),
    linear-gradient(to bottom, rgba(0, 110, 255, 0.25) 1px, transparent 50px);
  background-size: 60px 60px, 60px 60px, 300px 300px, 300px 300px;
  background-repeat: repeat;
  animation: gridFadeIn 1.8s ease forwards;
  transition: background-position 0.05s ease-out, background-image 0.5s ease;
  will-change: background-position;
}

@keyframes gridFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Project list (right aligned) */
.projects {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2.4em;
  padding-right: 8vw;
  z-index: 1;
}

/* Project names */
.project {
  position: relative;
  font-size: 1vw;
  text-transform: uppercase;
  color: white;
  background: transparent;
  letter-spacing: 0.05rem;
  padding: 0.4em 0.8em;
  cursor: pointer;
  opacity: 0;
  transition: all 0.4s ease;
  animation: fadeIn 0.8s ease forwards;
  border: 2px solid transparent;
}

.project:nth-child(1) { animation-delay: 0.2s; }
.project:nth-child(2) { animation-delay: 0.4s; }
.project:nth-child(3) { animation-delay: 0.6s; }
.project:nth-child(4) { animation-delay: 0.8s; }
.project:nth-child(5) { animation-delay: 1s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* White hover box + dynamic color text */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: -1;
}

.project:hover::before {
  transform: scaleX(1);
}

.project:hover {
  color: var(--hover-color);
}

/* Floating text box */
.intro-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 45%;
  max-width: 600px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 1.5em 2em;
  font-size: 0.75vw;
  letter-spacing: 0.05em;
  border-radius: 8px;
  z-index: 2;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.6s ease;
  backdrop-filter: blur(5px);
}
