:root {
  --bg: #eef1f6;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #101726;
  --muted: #617089;
  --line: rgba(16, 23, 38, 0.08);
  --brand: #2e6df6;
  --brand-strong: #1747b8;
  --operator: #1f2937;
  --shadow: 0 32px 80px rgba(20, 32, 64, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(46, 109, 246, 0.2), transparent 24%),
    radial-gradient(circle at bottom right, rgba(16, 23, 38, 0.08), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.intro-block {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.calculator-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

h1,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
}

.lede {
  color: var(--muted);
  line-height: 1.6;
  max-width: 52ch;
  margin: 0 auto;
}

.calculator-shell {
  display: flex;
  justify-content: center;
}

.calculator-card {
  width: min(100%, 390px);
  padding: 22px;
}

.display-panel {
  min-height: 148px;
  padding: 18px 18px 14px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.92));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.display-expression {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.2em;
}

.display-value {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

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

.key {
  min-height: 70px;
  border: 0;
  border-radius: 22px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 10px 22px rgba(20, 32, 64, 0.1);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.key:hover {
  transform: translateY(-1px);
}

.key:active {
  transform: translateY(1px) scale(0.99);
}

.key-muted {
  background: rgba(225, 232, 243, 0.88);
  color: #304056;
}

.key-operator {
  background: linear-gradient(180deg, var(--operator), #0f1723);
  color: #fff;
}

.key-equals {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.key-zero {
  grid-column: span 2;
}

@media (max-width: 920px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 22px;
  }

  .calculator-card {
    border-radius: 28px;
    padding: 16px;
  }

  .display-panel {
    min-height: 132px;
  }

  .key {
    min-height: 64px;
    border-radius: 18px;
  }
}
