:root {
  --coral: #c45a4f;
  --coral-deep: #9e3f36;
  --ink: #1c1716;
  --panel: #2a2220;
  --panel-lift: #3a2f2c;
  --cream: #f3ebe6;
  --key: #efe4dd;
  --key-press: #e0d0c6;
  --op: #d9786a;
  --op-text: #fff8f5;
  --eq: #2f6b5a;
  --mic: #1f4d6d;
  --mic-live: #b33a32;
  --shadow: 0 24px 60px rgba(28, 23, 22, 0.35);
  --radius: 22px;
  --font-ui: "Outfit", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--cream);
  background: var(--coral);
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  position: relative;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 220, 200, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 85%, rgba(80, 30, 25, 0.35), transparent 50%),
    linear-gradient(160deg, #d46a5d 0%, #c45a4f 45%, #a8473d 100%);
  animation: wash 12s ease-in-out infinite alternate;
}

@keyframes wash {
  from { filter: saturate(1) brightness(1); }
  to { filter: saturate(1.08) brightness(0.96); }
}

.shell {
  width: min(100%, 380px);
  position: relative;
  z-index: 1;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand {
  margin-bottom: 1rem;
  text-align: center;
}

.brand-name {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.brand-tag {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.9;
}

.calc {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.display {
  background: var(--ink);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
}

.heard {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(243, 235, 230, 0.55);
  text-align: right;
  word-break: break-word;
}

.screen {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 600;
  text-align: right;
  color: var(--cream);
  word-break: break-all;
  line-height: 1.2;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.key {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-height: 3.35rem;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--key);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  touch-action: manipulation;
}

.key:hover {
  background: #f7efe9;
}

.key:active {
  transform: translateY(1px) scale(0.98);
  background: var(--key-press);
}

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

.key-op:hover {
  background: #e28678;
}

.key-clear {
  background: #6b534c;
  color: var(--cream);
}

.key-clear:hover {
  background: #7a6159;
}

.key-eq {
  grid-column: span 3;
  background: var(--eq);
  color: #eef8f3;
  font-size: 1.45rem;
}

.key-eq:hover {
  background: #37806c;
}

.key-mic {
  background: var(--mic);
  color: #e8f3fa;
  display: grid;
  place-items: center;
}

.key-mic:hover {
  background: #275d82;
}

.key-mic.listening {
  background: var(--mic-live);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 58, 50, 0.55); }
  50% { box-shadow: 0 0 0 10px rgba(179, 58, 50, 0); }
}

.status {
  margin: 0.75rem 0 0.15rem;
  min-height: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(243, 235, 230, 0.7);
}

@media (max-width: 380px) {
  body { padding: 0.75rem; }
  .key { min-height: 3.1rem; font-size: 1.15rem; }
}
