
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Inter', sans-serif;
  color: #f8fafc;
  background: #0b1120;
  font-synthesis: none;
}

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

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, #163c45 0, transparent 35%),
    radial-gradient(circle at 85% 85%, #32245b 0, transparent 35%),
    #0b1120;
}

.calculator {
  width: min(100%, 390px);
  padding: 25px;
  border: 1px solid #ffffff17;
  border-radius: 28px;
  background: rgba(17, 25, 43, 0.94);
  box-shadow: 0 25px 80px #0007;
  backdrop-filter: blur(16px);
}

.calculator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  color: #39d6b0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 7px;
}

h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #39d6b0;
  box-shadow: 0 0 15px #39d6b080;
}

.display {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  padding: 22px 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.expression {
  width: 100%;
  min-height: 24px;
  color: #8d9bb2;
  text-align: right;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.result {
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 600;
  letter-spacing: -2px;
  overflow-wrap: anywhere;
  text-align: right;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.btn {
  min-width: 0;
  height: 62px;
  border: 1px solid #ffffff09;
  border-radius: 17px;
  background: #1b263a;
  color: #edf3ff;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: #293850;
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.95);
}

.btn:focus-visible {
  outline: 2px solid #39d6b0;
  outline-offset: 3px;
}

.utility {
  background: #263345;
  color: #39d6b0;
  font-size: 15px;
}

.operator {
  background: #173b3c;
  color: #48e0bc;
}

.operator:hover {
  background: #205653;
}

.equals {
  background: linear-gradient(135deg, #42dfb6, #19ae96);
  color: #08231f;
  box-shadow: 0 7px 22px #25c6a333;
}

.equals:hover {
  background: linear-gradient(135deg, #72f0ce, #35cdb0);
}

.calculator-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 23px;
  color: #718096;
  font-size: 10px;
}

@media (max-width: 380px) {
  .calculator {
    padding: 18px;
  }

  .buttons {
    gap: 9px;
  }

  .btn {
    height: 56px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
