/* ===================== Reset ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================= Base Styles ================= */
html, body {
  font-family: 'Manrope', sans-serif;
  background: #111;
  color: #eee;
  line-height: 1.4;
  overflow-x: hidden;
  height: 100%;
  perspective: 1200px; /* enables 3D tilt */
}

/* === Geometric Background with Gradients === */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(120deg, rgba(255,255,255,0.03) 25%, transparent 25%) -40px 0/ 80px 80px,
    linear-gradient(60deg, rgba(255,255,255,0.02) 25%, transparent 25%) 0px 0/ 80px 80px,
    linear-gradient(0deg, #111, #1a1a1a);
  z-index: -2;
}

/* Floating Magical Dots */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 2px, transparent 3px);
  background-size: 80px 80px;
  animation: floatDots 30s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes floatDots {
  from { transform: translate(0,0); }
  to { transform: translate(40px, 40px); }
}

/* ================= Hero Section ================= */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  background: linear-gradient(135deg, #1b1b1b, #222);
  border-bottom: 2px solid #333;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.hero p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: #ccc;
}

/* ================= Grid Section ================= */
.noncore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
  position: relative;
  z-index: 1;
}

/* ================= Cards ================= */
.noncore-card {
  background: rgba(26, 26, 26, 0.9);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  transition: transform 0.15s ease, box-shadow 0.3s ease, color 0.3s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}

/* Remove inner conic gradient */
.noncore-card::before {
  content: none;
}

/* Card hover glow: electric blue outside */
.noncore-card:hover {
  transform: translateY(-5px);
  animation: pulseGlow 1.5s infinite alternate;
}

/* Pulsating electric blue glow outside card */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 15px #0096ff, 0 0 30px #0096ff, 0 0 45px #0096ff;
  }
  50% {
    box-shadow: 0 0 25px #00ccff, 0 0 50px #00ccff, 0 0 75px #00ccff;
  }
  100% {
    box-shadow: 0 0 15px #0096ff, 0 0 30px #0096ff, 0 0 45px #0096ff;
  }
}

/* Make text glow electric blue on hover */
.noncore-card:hover h3,
.noncore-card:hover p {
  color: #00ccff;
  transition: color 0.3s ease;
}

/* Content stays above */
.noncore-card h3,
.noncore-card p {
  position: relative;
  z-index: 1;
}

.noncore-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
}

.noncore-card p {
  font-size: 0.95rem;
  color: #bbb;
}

/* ================= Footer ================= */
footer {
  text-align: center;
  padding: 1rem;
  background: #0d0d0d;
  color: #777;
  font-size: 0.85rem;
  border-top: 1px solid #333;
  position: relative;
  z-index: 1;
}

/* ================= Modal / Zoom Styles ================= */
.card-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.card-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.card-modal-content {
  background: #1a1a1a;
  padding: 2rem;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0,150,255,0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.card-modal.active .card-modal-content {
  transform: scale(1);
}

.card-modal-content h3 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #fff;
}

.card-modal-content p {
  font-size: 1.1rem;
  color: #ccc;
}

.card-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

/* ===================== MOBILE OPTIMIZATION ===================== */
@media (max-width: 768px) {

  /* Hero adjustments */
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }

  /* Grid spacing and padding */
  .noncore-grid {
    gap: 0.8rem;
    padding: 1rem;
  }

  /* Cards adjustments */
  .noncore-card {
    padding: 1rem;
    transform: none !important; /* remove 3D tilt on mobile */
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
  }
  .noncore-card h3 {
    font-size: 1.1rem;
  }
  .noncore-card p {
    font-size: 0.9rem;
  }

  /* Tap glow effect for touch devices */
  .noncore-card.tap-effect {
    animation: pulseGlowTap 0.6s forwards;
  }

  @keyframes pulseGlowTap {
    0% {
      box-shadow: 0 0 15px #0096ff, 0 0 30px #0096ff, 0 0 45px #0096ff;
    }
    50% {
      box-shadow: 0 0 25px #00ccff, 0 0 50px #00ccff, 0 0 75px #00ccff;
    }
    100% {
      box-shadow: 0 0 8px rgba(0,0,0,0.5);
    }
  }

  /* Modal adjustments */
  .card-modal-content {
    padding: 1rem;
    max-width: 95%;          /* mobile-friendly width */
    max-height: 90vh;        /* limit to viewport height */
    transform: scale(1);     /* show full size immediately */
    overflow-y: auto;        /* scroll if content exceeds screen */
  }

  /* Remove floating dots for performance */
  body::after {
    display: none;
  }
}

/* ===================== SMALLER MOBILE DEVICES ===================== */
@media (max-width: 480px) {

  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 0.95rem;
  }

  .noncore-card h3 {
    font-size: 1rem;
  }
  .noncore-card p {
    font-size: 0.85rem;
  }

  .noncore-grid {
    gap: 0.6rem;
    padding: 0.8rem;
  }
}
