/* ====== RESET ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(-45deg, #0f0f1a, #1b1b2f, #2c2c54, #6c5ce7);
  background-size: 400% 400%;
  animation: bgshift 15s ease infinite;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

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


/* ====== TITLE ====== */
.title {
  position: sticky;
  top: 0;
  z-index: 999;
  
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 40px;
  padding: 20px 15px 30px;
  text-align: center;
  letter-spacing: 3px;

  background: linear-gradient(90deg, #ff4d4d, #ff9f43, #f8f32b, #3ae374, #18dcff, #7d5fff, #ff4d4d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 300%;
  animation: flow 6s linear infinite;

  text-shadow: 0 0 25px rgba(255,255,255,0.8);

  /* neon underline */
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, #ff4d4d, #18dcff, #7d5fff);
  border-image-slice: 1;
  box-shadow: 0 4px 30px rgba(255,0,200,0.6);
}

@keyframes flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ====== CALCULATOR CONTAINER ====== */
.calculator {
  width: 340px;
  padding: 25px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);

  box-shadow: 
    0 0 30px rgba(255, 0, 200, 0.4),
    0 0 60px rgba(24, 220, 255, 0.2),
    inset 0 0 10px rgba(255,255,255,0.1);

  display: flex;
  flex-direction: column;
  transform: perspective(1000px) rotateX(10deg) rotateY(-8deg);
  transition: transform 0.6s ease;
  margin-bottom: 80px;
}

.calculator:hover {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.02);
  box-shadow: 
    0 0 40px rgba(255, 0, 200, 0.6),
    0 0 80px rgba(24, 220, 255, 0.3);
}

/* ====== DISPLAY ====== */
.display {
  width: 100%;
  height: 80px;
  margin-bottom: 25px;
  border-radius: 15px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 6px 15px rgba(0,0,0,0.7);
  color: #fff;
  font-size: 2.2rem;
  padding: 20px;
  text-align: right;
  letter-spacing: 2px;
  overflow: hidden;
}

/* ====== GRID BUTTONS ====== */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ====== BUTTON STYLES ====== */
button {
  height: 65px;
  border: none;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0,0,0,0.7),
              inset 0 2px rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

button:hover {
  background: linear-gradient(135deg, #18dcff, #7d5fff);
  box-shadow: 0 0 20px rgba(24,220,255,0.6),
              0 0 40px rgba(125,95,255,0.4);
  transform: scale(1.08);
}

button:active {
  transform: scale(0.96);
  box-shadow: inset 0 6px 12px rgba(0,0,0,0.9);
}

/* Accent buttons */
.op { color: #ff9f43; }

.eq { 
  background: linear-gradient(135deg, #ff9f43, #ff3f34); 
  color: #fff;
  box-shadow: 0 8px 25px rgba(255,63,52,0.5),
              0 0 30px rgba(255,63,52,0.6);
  transition: all 0.3s ease;
}

.eq:hover {
  background: linear-gradient(135deg, #ff3f34, #ff9f43);
  box-shadow: 0 0 25px rgba(255,63,52,0.7),
              0 0 50px rgba(255,63,52,0.5);
}
