:root {
  --bg-main: #05030b;
  --bg-panel: #0b0415;
  --accent-purple: #a855f7;
  --accent-purple-soft: #7c3aed;
  --accent-neon: #f97316;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
}

body.dark-theme {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  line-height: 1.6;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

a:hover {
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--accent-purple-soft), var(--accent-purple));
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  color: white;
  text-shadow: none;
}

.btn-google {
  background: white;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-google:hover {
  background: #f3f4f6;
  color: #333;
}

.card {
  background-color: var(--bg-panel);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 4rem;
  padding: 6rem 0;
  min-height: 80vh;
}

.hero-content {
  flex: 1;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}

h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.cta-group {
  display: flex;
  gap: 1rem;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Tone Demo Section */
#tone-demo {
  padding: 6rem 0;
}

.control-panel {
  background: rgba(255, 255, 255, 0.03);
  padding: 2rem;
  border-radius: 1rem;
}

.slider-group {
  margin-bottom: 1.5rem;
}

.slider-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-purple);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-value {
  font-family: monospace;
  min-width: 3rem;
  text-align: right;
}

/* SVG Styles */
#brain-svg {
  width: 100%;
  max-width: 500px;
  height: auto;
}

#brain path {
  fill: none;
  stroke: var(--accent-purple-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#headphones path {
  fill: none;
  stroke: var(--accent-purple);
  stroke-width: 3;
  stroke-linecap: round;
}

.sound-wave {
  fill: none;
  stroke: var(--accent-purple);
  stroke-width: 2;
  opacity: 0;
  stroke-linecap: round;
}

.sound-wave.active {
  animation: wave-pulse 1.2s ease-out forwards;
}

@keyframes wave-pulse {
  0% { opacity: 0; stroke-width: 2; }
  50% { opacity: 1; stroke-width: 3; }
  100% { opacity: 0; stroke-width: 2; }
}

.spark {
  fill: none;
  stroke: var(--accent-neon);
  stroke-width: 2;
  opacity: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px var(--accent-neon));
}

.spark.flash {
  opacity: 1;
  transition: opacity 0.1s ease-in;
}

/* Login Page */
.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

/* Referrals Page */
.referral-link-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 0.5rem;
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.referral-link-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  flex: 1;
  font-family: monospace;
  font-size: 1rem;
}

.stat-card {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Footer */
footer {
  padding: 4rem 0;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 3rem 0;
  }

  .hero-visual {
    order: -1;
  }

  h1 {
    font-size: 2.5rem;
  }

  .cta-group {
    justify-content: center;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}