/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  position: relative;
  padding: var(--space-16) 0 var(--space-20);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(163, 255, 75, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  filter: blur(60px);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(112, 217, 60, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  filter: blur(50px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-content {
  max-width: var(--reading-width);
}

.hero-eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent-primary);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  display: inline-block;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

/* ── Product Showcase ── */
.product-showcase {
  position: relative;
  height: 560px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow-lg);
}

.product-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  overflow: hidden;
}

.product-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(135deg, #1a221e, #0f1715);
  border-bottom: var(--border-width) solid var(--border);
}

.product-window {
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-4);
  overflow: hidden;
}

.product-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-width) solid var(--border);
  margin-bottom: var(--space-3);
}

.product-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.product-dot--red { background: #ff5f56; box-shadow: 0 0 6px rgba(255, 95, 86, 0.4); }
.product-dot--yellow { background: #ffbd2e; box-shadow: 0 0 6px rgba(255, 189, 46, 0.4); }
.product-dot--green { background: #27c93f; box-shadow: 0 0 6px rgba(39, 201, 63, 0.4); }

.product-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.product-content {
  height: calc(100% - 80px);
  overflow-y: auto;
  padding-right: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.product-content::-webkit-scrollbar {
  width: 6px;
}

.product-content::-webkit-scrollbar-track {
  background: transparent;
}

.product-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.message {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  animation: fadeInUp var(--transition-slow) backwards;
}

.message--user {
  flex-direction: row-reverse;
}

.message--user .message-bubble {
  text-align: right;
  align-self: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: var(--border-width) solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--accent-primary);
}

.message-bubble {
  max-width: 70%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-primary);
  background: var(--bg-card);
  border: var(--border-width) solid var(--border);
}

.message--user .message-bubble {
  background: rgba(163, 255, 75, 0.08);
  border-color: rgba(163, 255, 75, 0.2);
  color: var(--text-primary);
}

.message--ai .message-bubble {
  background: var(--bg-card);
  border-color: var(--border);
}

.math-block {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: rgba(0, 0, 0, 0.3);
  border: var(--border-width) solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-secondary);
  overflow-x: auto;
}

.exercise-card {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent-primary);
}

.exercise-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
  letter-spacing: var(--ls-wide);
}

.exercise-text {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.exercise-hint {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-style: italic;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

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

/* ── Mobile Hero ── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-content {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .product-showcase {
    height: 420px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

  .hero-content {
    order: -1;
  }
}

@media (max-width: 600px) {
  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .product-showcase {
    max-width: 100%;
  }

  .message-bubble {
    max-width: 85%;
  }
}