
:root {
  --bg: #050816;
  --bg-2: #112347;
  --panel: rgba(13, 22, 43, 0.72);
  --panel-soft: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.12);
  --text: #f7fbff;
  --muted: rgba(229, 238, 255, 0.68);
  --accent: #8ad7ff;
  --accent-2: #9f8cff;
  --accent-3: #74f4d1;
  --shadow: 0 32px 80px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(116,244,209,0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(159,140,255,0.25), transparent 30%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  overflow-x: hidden;
}
button { font: inherit; }
.ambient {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}
.ambient-a { top: -10rem; left: -8rem; background: radial-gradient(circle, rgba(138,215,255,0.9), transparent 70%); }
.ambient-b { right: -6rem; bottom: -12rem; background: radial-gradient(circle, rgba(159,140,255,0.85), transparent 68%); }
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 1.2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}
.panel, .panel-soft {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.panel {
  background: var(--panel);
  border-radius: 28px;
  padding: 1.1rem;
}
.panel-soft {
  background: var(--panel-soft);
  border-radius: 22px;
}
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.eyebrow, .mini-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
}
.mini-label { color: var(--muted); }
h1, h2, p, ul { margin-top: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 0.98; margin-bottom: 0.9rem; }
.hero-text, .history-copy, .empty-state span, .display-top, .expression { color: var(--muted); }
.hero-text { max-width: 40rem; line-height: 1.6; font-size: 1.02rem; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.feature-pills span {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 0.92rem;
}
.hero-card { padding: 1rem 1.1rem; }
.hero-card ul { padding-left: 1.1rem; color: var(--muted); line-height: 1.7; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
}
.calculator { display: grid; gap: 1rem; }
.display-wrap { padding: 1rem; }
.display-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.ghost-btn {
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
.expression {
  min-height: 2.2rem;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  margin-top: 1rem;
  word-break: break-all;
}
.result {
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin-top: 0.5rem;
  word-break: break-all;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.key {
  min-height: 4.5rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.key:hover { transform: translateY(-1px); background: rgba(255,255,255,0.11); }
.key:active { transform: translateY(0); }
.operator {
  background: linear-gradient(135deg, rgba(138,215,255,0.22), rgba(159,140,255,0.22));
  border-color: rgba(138,215,255,0.34);
}
.utility {
  background: rgba(116,244,209,0.1);
  border-color: rgba(116,244,209,0.24);
}
.key-equals {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #05111d;
  border-color: transparent;
}
.key-wide { grid-column: span 2; }
.history { display: flex; flex-direction: column; gap: 1rem; min-height: 100%; }
.history-header { display: grid; gap: 0.25rem; }
.history-list {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}
.history-list.empty { min-height: 18rem; }
.history-item {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 0.9rem 1rem;
  color: var(--text);
  cursor: pointer;
}
.history-item .history-expression { color: var(--muted); font-size: 0.95rem; }
.history-item .history-result { margin-top: 0.35rem; font-size: 1.2rem; font-weight: 700; }
.empty-state {
  border-radius: 22px;
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  padding: 1.2rem;
}
@media (max-width: 980px) {
  .hero, .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app-shell { width: min(100% - 0.9rem, 1000px); }
  .panel { border-radius: 24px; padding: 0.95rem; }
  .key { min-height: 4rem; border-radius: 18px; }
  .display-top { flex-direction: column; align-items: flex-start; }
}
