/* Custom Properties for consistency */
:root {
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.15);
  --accent: #34d399;
  --bg: #030712;
  --surface: rgba(17, 24, 39, 0.7);
  --border: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: smooth;
  cursor: default;
}

body {
  background-color: var(--bg);
  color: #f8fafc;
  overflow-x: hidden;
}

/* --- THE "ALIVE" BACKGROUND --- */
/* Animated Grid + Radial Spotlight */
.bg-engine {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 80%);
  pointer-events: none;
  transition: mask-image 0.1s ease;
}

/* Subtle ambient glow in the corner */
body::before {
  content: "";
  position: fixed;
  top: -10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: -2;
  filter: blur(100px);
}

/* --- GLASSMORPHISM --- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* --- GLOWING CARD EFFECT --- */
.card-hover {
  position: relative;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-hover:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.03);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
}

/* --- SENIOR TYPOGRAPHY --- */
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- REVEAL ANIMATION --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* --- FLOATING ANIMATION FOR IMAGE --- */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

.frame-tech {
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.2);
}

/* --- CUSTOM CURSOR (Optional/Subtle) --- */
.cursor-follower {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  mix-blend-mode: screen;
}

/* --- THE FIXED CIRCULATING FRAME --- */
.frame-tech {
  position: relative;
  width: 100%;
  /* Controlled by the parent div's w-64/w-80 classes */
  aspect-ratio: 1 / 1;
  /* Forces a perfect square */
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s ease;
  background: #030712;
  /* Fallback background */
}

/* The Animated "Running Light" Border */
.frame-tech::before {
  content: '';
  position: absolute;
  width: 200%;
  /* Extra width to ensure no gaps during rotation */
  height: 200%;
  background: conic-gradient(transparent,
      transparent,
      transparent,
      #38bdf8
      /* Your primary sky-blue */
    );
  animation: rotate-frame 4s linear infinite;
  z-index: 1;
}

/* The Image - Fixed to prevent stretching */
.frame-tech img {
  position: absolute;
  inset: 4px;
  /* This creates the 4px border width automatically */
  width: calc(100% - 8px) !important;
  height: calc(100% - 8px) !important;
  object-fit: cover;
  /* This is the "Magic" - crops image instead of stretching */
  object-position: center;
  border-radius: 1.2rem;
  /* Slightly smaller than outer radius */
  z-index: 10;
  transition: all 0.5s ease;
}

/* Hover States */
.frame-tech:hover {
  transform: scale(1.05) !important;
  /* Gentle scale */
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

/* Optional: Make the image zoom slightly inside the frame on hover */
.frame-tech:hover img {
  transform: scale(1.02);
}

@keyframes rotate-frame {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}