.calc-page {
  padding: 56px 0 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.calc-intro {
  text-align: center;
  max-width: 40ch;
  margin-bottom: 40px;
}

.calc-intro .hero__eyebrow {
  margin-bottom: 18px;
}

.calc-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.calc-intro p {
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

.calc-wrap {
  width: 100%;
  max-width: 340px;
}

.calculator {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 30px 60px -25px rgba(27, 31, 59, 0.45);
}

.calc-screen {
  padding: 26px 12px 18px;
  text-align: right;
  color: #fff;
}

.calc-screen__prev {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.42);
  min-height: 1.2em;
  transition: opacity var(--dur-fast) var(--ease);
}

.calc-screen__current {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 2.6rem);
  line-height: 1.2;
  overflow-x: auto;
  scrollbar-width: none;
  transition: transform var(--dur-fast) var(--ease);
}

.calc-screen__current.pulse {
  animation: screen-pulse 220ms var(--ease);
}

@keyframes screen-pulse {
  0% {
    transform: scale(0.96);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.key {
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 16px 0;
  cursor: pointer;
  transition: transform 120ms var(--ease), background var(--dur-fast) var(--ease);
}

.key:hover {
  background: rgba(255, 255, 255, 0.12);
}

.key:active {
  transform: scale(0.92);
}

.key--fn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--highlight);
}

.key--fn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.key--sci {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  padding: 12px 0;
}

.key--sci:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.key--del {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.key--del .icon {
  width: 20px;
  height: 20px;
}

.key--del:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.key--op {
  background: var(--accent);
}

.key--op:hover {
  background: #4d67ff;
}

.key--op.is-active {
  background: var(--highlight);
  color: var(--ink);
}

.key--equals {
  background: var(--teal);
}

.key--equals:hover {
  background: #14b2a8;
}

.key--wide {
  grid-column: span 2;
  text-align: left;
  padding-left: 26px;
}

.calc-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 18px;
}

@media (max-width: 400px) {
  .calc-wrap {
    max-width: 100%;
  }
}
