:root {
  --bg-color: #1a1520; /* Deep plum/night sky almost black */
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #fcfcfc;
  --text-accent: #ffb7b2; /* Blossom pink */
  --btn-primary: rgba(255, 183, 178, 0.2);
  --btn-primary-hover: rgba(255, 183, 178, 0.4);
  --btn-secondary: rgba(181, 234, 215, 0.2);
  --btn-secondary-hover: rgba(181, 234, 215, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.glass-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3rem 4rem;
  text-align: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  pointer-events: auto;
  animation: float 6s ease-in-out infinite;
  max-width: 90%;
  overflow: hidden;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.title {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 2;
}

.name {
  color: var(--text-accent);
  font-style: italic;
  text-shadow: 0 0 20px rgba(255, 183, 178, 0.5);
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: var(--btn-primary);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 183, 178, 0.2);
}

.btn-secondary {
  background: var(--btn-secondary);
}
.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(181, 234, 215, 0.2);
}

.btn-outline {
  background: transparent;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Subtle glowing blobs inside the card */
.glass-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 183, 178, 0.4);
  filter: blur(50px);
  z-index: 0;
}

.glass-card::after {
  content: '';
  position: absolute;
  bottom: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(181, 234, 215, 0.4);
  filter: blur(50px);
  z-index: 0;
}

@media (max-width: 600px) {
  .title {
    font-size: 2.5rem;
  }
  .glass-card {
    padding: 2rem;
  }
}

/* Modals and Floating Buttons */
.hidden {
  display: none !important;
}

.floating-btn {
  position: fixed;
  z-index: 10;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.floating-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.top-right {
  top: 2rem;
  right: 2rem;
}

.bottom-left {
  bottom: 2rem;
  left: 2rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.modal-content {
  position: relative;
  max-width: 600px;
  width: 90%;
  animation: modalFadeIn 0.3s ease-out;
  pointer-events: auto; /* Ensuring it catches clicks inside */
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  z-index: 10;
}

.close-btn:hover {
  opacity: 1;
}

.styled-input {
  width: 120px;
  padding: 0.8rem;
  font-size: 1.5rem;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  margin-right: 1rem;
  outline: none;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 2px;
}

.styled-input:focus {
  border-color: var(--text-accent);
}

.error-text {
  color: #ffb7b2;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.equations-card p {
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.math-container {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  font-size: 1.2rem;
}

.math-desc {
  font-size: 0.9rem;
  opacity: 0.7;
}
