:root {
  --bg-color: #FFFFFF;
  --button-color: #f9f9f9;
  --shadow-light: #ffffff;
  --shadow-dark: #a3b1c6;
  --text-color: #333;
}

body.dark {
  --bg-color: #1e1e1e;
  --button-color: #2c2c2c;
  --shadow-light: #2e2e2e;
  --shadow-dark: #000;
  --text-color: #f0f0f0;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  transition: background-color 0.3s;
}

.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.splash-logo {
  width: 120px;
  animation: fade 1.5s ease-in-out infinite alternate;
}

.splash-text {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: var(--text-color);
}

@keyframes fade {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.logo-corner {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  opacity: 0.85;
}

.calculator {
  margin-top: 130px;
  width: 95%;
  max-width: 400px;
  padding: 1rem;
  border-radius: 20px;
  box-shadow: 8px 8px 16px var(--shadow-dark),
              -8px -8px 16px var(--shadow-light);
  background: var(--bg-color);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggles span {
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.display {
  margin-top: 1rem;
  font-size: 2rem;
  padding: 0.5rem;
  text-align: right;
  background: var(--button-color);
  border-radius: 10px;
  box-shadow: inset 4px 4px 8px var(--shadow-dark),
              inset -4px -4px 8px var(--shadow-light);
  overflow-x: auto;
}

.notes {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border-radius: 10px;
  resize: vertical;
  height: 40px;
  font-size: 0.9rem;
  background: var(--button-color);
  color: var(--text-color);
  border: none;
  box-shadow: inset 4px 4px 8px var(--shadow-dark),
              inset -4px -4px 8px var(--shadow-light);
}

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

button {
  font-size: 1.2rem;
  padding: 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: var(--button-color);
  box-shadow: 4px 4px 8px var(--shadow-dark),
              -4px -4px 8px var(--shadow-light);
  color: var(--text-color);
  transition: transform 0.1s;
}

button:active {
  transform: scale(0.96);
}

.equals {
  background: #ff5e5e;
  color: white;
}

.history {
  margin-top: 1rem;
  font-size: 0.9rem;
  max-height: 150px;
  overflow-y: auto;
  background: var(--button-color);
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: inset 2px 2px 6px var(--shadow-dark),
              inset -2px -2px 6px var(--shadow-light);
}
