/* ================= RESET ================= */

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

body {
  background: #050507;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
}

/* ================= PROJECTS BASE ================= */

.projects-section {
  position: relative;
  padding: 80px 0 100px;
  overflow: hidden;
}

/* ================= BACKGROUND ================= */

.projects-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(
      90deg,
      rgba(88,28,135,0.35),
      rgba(0,0,0,0) 35%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04),
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 80px
    ),
    #050507;
}

/* HUD LINES */
.projects-hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
  animation: hudPulse 6s ease-in-out infinite;
}

@keyframes hudPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.45; }
}

/* ================= HEADER ================= */

.projects-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 80px;
  padding: 0 24px;
}

.projects-header h1 {
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(90deg, #8b5cf6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-header p {
  margin-top: 12px;
  color: rgba(255,255,255,0.65);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.projects-header a {
  color: #c084fc;
  text-decoration: none;
}

/* ================= CUBE CLUSTER ================= */

.projects-cluster {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 1;
}

/* ================= SHOWCASE ================= */

.projects-showcase {
  position: relative;
  z-index: 1;
}

.projects-track {
  display: flex;
  gap: 48px;
  padding: 0 8%;
  overflow-x: auto;
  scrollbar-width: none;
}

.projects-track::-webkit-scrollbar {
  display: none;
}

/* ================= CARD ================= */

.projects-card {
  width: 420px;
  height: 560px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}

/* PREVIEW */
.projects-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HOVER CONTENT */
.projects-hover {
  position: absolute;
  inset: 0;
  padding: 32px;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.projects-card:hover .projects-hover {
  opacity: 1;
}

.projects-hover h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.projects-hover p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}

/* TECH */
.projects-tech {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.projects-tech span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(139,92,246,0.2);
  border: 1px solid rgba(139,92,246,0.4);
  font-size: 13px;
}

/* LINK */
.projects-link {
  align-self: flex-start;
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg,#ec4899,#8b5cf6);
  color: white;
  text-decoration: none;
  font-weight: 500;
}

/* ================= RESPONSIVE ================= */

/* Tablets */
@media (max-width: 1024px) {
  .projects-header h1 {
    font-size: 48px;
  }

  .projects-card {
    width: 360px;
    height: 500px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .projects-header h1 {
    font-size: 36px;
  }

  .projects-cluster {
    display: none;
  }

  .projects-track {
    padding: 0 20px;
    gap: 24px;
    scroll-snap-type: x mandatory;
  }

  .projects-card {
    width: 90vw;
    height: 460px;
    scroll-snap-align: center;
  }

  /* Mobile fallback for hover */
  .projects-hover {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(10,10,15,0.95),
      rgba(10,10,15,0.6),
      rgba(10,10,15,0.15)
    );
  }
}

/* Small phones */
@media (max-width: 420px) {
  .projects-header h1 {
    font-size: 30px;
  }

  .projects-card {
    height: 420px;
  }
}
