/* ============================================
   SITE NAVIGATION (Floating)
   ============================================ */
.nav-btn {
  position: fixed;
  top: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  overflow: hidden;
}

.nav-btn-left {
  left: 20px;
}

.nav-btn-right {
  right: 20px;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.nav-btn:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .nav-btn {
    display: none;
  }
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #ffffff;
  background: linear-gradient(135deg, #5566d8 0%, #6a3b92 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  max-width: 800px;
  width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tagline {
  font-size: 1.125rem;
  opacity: 0.9;
  font-weight: 400;
}

.main {
  margin-bottom: 2rem;
}

.demo-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 3rem 2rem;
}

@media (min-width: 768px) {
  .demo-card {
    padding: 4rem 3rem;
  }
}

/* ============================================
   DEMO SECTION
   ============================================ */
.demo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.demo-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.demo-intro {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
  display: inline-block;
  padding: 16px 32px;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  user-select: none;
  width: 420px;
  max-width: 90vw;
}

.btn-primary {
  background: linear-gradient(135deg, #5566d8 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.1) inset;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.btn-primary:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.2) inset;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Liquid fill loading animation */
.btn-primary.loading {
  pointer-events: none;
}

.btn-primary.loading::before,
.btn-primary.revealed::before {
  display: none;
}

/* Revealed state with click-to-copy cursor */
.btn-primary.revealed {
  cursor: pointer;
}

.btn-primary.revealed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}

.btn-primary .btn-text {
  position: relative;
  z-index: 3;
  display: inline-block;
}

/* ============================================
   LIQUID WAVE ANIMATION
   ============================================ */
.liquid-wave {
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 300%;
  height: 200px;
  z-index: 1;
  animation: waveRise 3s ease-out forwards, waveSlide 3s linear infinite;
}

.liquid-wave > svg:first-child {
  width: 100%;
  height: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
}

@keyframes waveRise {
  from {
    transform: translateY(200px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes waveSlide {
  from {
    left: -100%;
  }
  to {
    left: 0;
  }
}

.liquid-wave.completed {
  transform: translateY(0);
  animation: waveSlide 3s linear infinite;
}

/* Bubble mask container */
.bubble-mask-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  overflow: hidden;
  z-index: 2;
  animation: waveRise 3s ease-out forwards;
  pointer-events: none;
}

.bubble-mask-container.completed {
  transform: translateY(0);
  animation: none;
}

.bubble-stream {
  position: absolute;
  width: 500px;
  height: 500px;
  left: 0;
  bottom: -200px;
  transform-origin: center center;
  animation: bubbleRotate 30s linear infinite;
  pointer-events: none;
}

@keyframes bubbleRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Phone revealed hint */
.phone-revealed {
  margin-top: 1rem;
  min-height: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.8;
  color: rgba(255, 255, 255, 0.9);
  transition: opacity 0.3s ease;
}

.phone-revealed:empty {
  opacity: 0;
}

/* ============================================
   HOW IT WORKS FLOW DIAGRAM
   ============================================ */
.flow-section {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.flow-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffffff;
  text-align: center;
}

.flow-phase {
  margin-bottom: 1.5rem;
}

.phase-label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  text-align: center;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.flow-card {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.flow-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.flow-card:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.flow-card:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.flow-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.flow-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.flow-card-badge {
  display: inline-block;
  background: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.flow-card-explanation {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.flow-connector {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.flow-connector svg {
  width: 30px;
  height: 40px;
  color: rgba(255, 255, 255, 0.5);
}

.flow-loop-indicator {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.flow-loop-indicator span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Animated dot for conversation loop */
.flow-grid-loop {
  position: relative;
}

.flow-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #8b5cf6;
  border-radius: 50%;
  box-shadow: 0 0 15px #8b5cf6, 0 0 30px rgba(139, 92, 246, 0.5);
  animation: dotLoop 6s ease-in-out infinite;
  z-index: 100;
  pointer-events: none;
}

@keyframes dotLoop {
  0%, 100% {
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
  }
  25% {
    top: 0;
    left: 100%;
    transform: translate(-50%, -50%);
  }
  50% {
    top: 100%;
    left: 100%;
    transform: translate(-50%, -50%);
  }
  75% {
    top: 100%;
    left: 0;
    transform: translate(-50%, -50%);
  }
}

.flow-caption {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
  font-style: italic;
}

/* Responsive flow */
@media (max-width: 600px) {
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .flow-card {
    padding: 1.25rem;
  }

  .flow-card-icon {
    font-size: 1.75rem;
  }

  .flow-card-title {
    font-size: 1rem;
  }

  .flow-card-explanation {
    font-size: 0.85rem;
  }
}

/* ============================================
   ARCHITECTURE SECTION
   ============================================ */
.architecture-section {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.architecture-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
}

.architecture-intro {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tech-item {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-item::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.tech-item:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.tech-item:hover {
  transform: translateY(-3px);
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.tech-icon {
  font-size: 1rem;
}

.tech-content {
  display: flex;
  flex-direction: column;
}

.tech-content strong {
  font-weight: 600;
}

.tech-content span {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ============================================
   VALUE PROPOSITION
   ============================================ */
.value-prop {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.value-prop h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
}

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

.benefit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.benefit::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.benefit:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.benefit:hover {
  transform: translateY(-5px);
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.1);
}

.benefit strong {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.benefit span {
  font-size: 0.9rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   METRICS SECTION
   ============================================ */
.metrics-section {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.metrics-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
}

/* ============================================
   CHALLENGES SECTION
   ============================================ */
.challenges-section {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
}

.challenges-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffffff;
}

.challenges {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.challenge {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.challenge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.challenge:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.challenge:hover {
  transform: translateY(-3px);
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.challenge-header strong {
  font-size: 1rem;
  color: #ffffff;
}

.challenge-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.status-resolved {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.status-progress {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f59e0b;
}

.challenge p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.challenge code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
}

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

.metric {
  text-align: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.metric:hover::before {
  transform: translateX(100%) rotate(45deg);
}

.metric:hover {
  transform: translateY(-3px);
  background: rgba(0, 0, 0, 0.15);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.85rem;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

.toast-message {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  line-height: 1;
}

.toast-close:hover {
  color: #4b5563;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #10b981;
  width: 100%;
  transform-origin: left;
  animation: progressShrink 4s linear forwards;
}

.toast.hiding {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

@keyframes progressShrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: 1.5rem 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.footer a:hover {
  opacity: 0.7;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .demo-card {
    padding: 2rem 1.5rem;
  }

  .tech-stack {
    gap: 0.5rem;
  }

  .tech-item {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .benefits {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}
