/**
 * AI聲繪本 - 專屬樣式表
 * AI Storybook Custom Styles
 * Version: 2.0
 */

/* ===========================
   CSS Variables
   =========================== */
:root {
  --storybook-primary: #6366f1;
  --storybook-secondary: #8b5cf6;
  --storybook-accent: #ec4899;
  --storybook-success: #10b981;
  --storybook-warning: #f59e0b;
  --storybook-dark: #1e293b;
  --storybook-light: #f8fafc;
  
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-nature: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-magic: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-hero: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --transition: all 0.3s ease;
}

/* ===========================
   Breadcrumbs Override
   =========================== */
body section#breadcrumbs2.storybook-breadcrumbs {
  background: var(--gradient-hero) !important;
  padding: 15px 0 !important;
  position: sticky !important;
  top: 66px !important;
  z-index: 997 !important;
  box-shadow: var(--shadow-md) !important;
  margin-top: 0 !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#breadcrumbs2.storybook-breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
}

#breadcrumbs2.storybook-breadcrumbs ol li {
  color: rgba(255, 255, 255, 0.8);
}

#breadcrumbs2.storybook-breadcrumbs ol li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

#breadcrumbs2.storybook-breadcrumbs ol li a:hover {
  color: #fff;
}

#breadcrumbs2.storybook-breadcrumbs ol li.page {
  color: #fff;
  font-weight: 600;
}

#breadcrumbs2.storybook-breadcrumbs ol li + li::before {
  content: '/';
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .hero-bg-animation {
    animation: none !important;
  }
}

/* ===========================
   Hero Section
   =========================== */
.hero-storybook {
  position: relative;
  background: var(--gradient-hero);
  padding: 120px 0 80px;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  animation: heroGradientMove 15s ease infinite;
}

@keyframes heroGradientMove {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-20px, 20px); }
  50% { transform: translate(20px, -20px); }
  75% { transform: translate(-20px, -20px); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 50px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-badge .badge-icon {
  color: var(--storybook-accent);
  font-size: 18px;
}

.hero-badge .badge-text {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-title .highlight {
  display: block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-description {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.btn-primary-storybook {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-primary);
  color: #fff;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary-storybook:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  color: #fff;
}

.btn-secondary-storybook {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #fff;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.btn-secondary-storybook:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

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

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* Hero Visual */
.hero-visual {
  position: relative;
  z-index: 2;
}

.hero-image-wrapper {
  position: relative;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 22px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  animation: float 4s ease-in-out infinite;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 500;
}

.floating-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.floating-card img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.floating-card span {
  font-weight: 500;
  letter-spacing: 0.3px;
}

.floating-card.card-1 {
  top: 8%;
  left: 5%;
  animation-delay: 0s;
}

.floating-card.card-2 {
  top: 15%;
  right: 8%;
  animation-delay: 1s;
}

.floating-card.card-3 {
  bottom: 12%;
  left: 8%;
  animation-delay: 2s;
}

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

.hero-main-visual {
  position: relative;
  width: 100%;
  max-width: 450px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}


@keyframes imagePulse {
  0%, 100% {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(99, 102, 241, 0.25);
  }
  50% {
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), 0 0 60px rgba(139, 92, 246, 0.35);
  }
}

.book-animation {
  position: relative;
  width: 200px;
  height: 250px;
  perspective: 1000px;
}

.book-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  transform: rotateY(-10deg);
  animation: bookHover 3s ease-in-out infinite;
}

.book-cover i {
  font-size: 64px;
  color: #fff;
  margin-bottom: 10px;
}

.book-cover span {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.book-page {
  position: absolute;
  width: 90%;
  height: 95%;
  background: #fff;
  border-radius: 5px 10px 10px 5px;
  left: 5%;
  top: 2.5%;
}

.book-page.page-1 { transform: translateZ(-5px); }
.book-page.page-2 { transform: translateZ(-10px); }
.book-page.page-3 { transform: translateZ(-15px); }

@keyframes bookHover {
  0%, 100% { transform: rotateY(-10deg) translateY(0); }
  50% { transform: rotateY(-5deg) translateY(-10px); }
}

/* ===========================
   Hero Section Responsive
   =========================== */
@media (max-width: 992px) {
  .hero-image-wrapper {
    height: 420px;
  }

  .hero-main-visual {
    max-width: 380px;
  }

  .floating-card {
    padding: 12px 18px;
    font-size: 13px;
    border-radius: 12px;
  }

  .floating-card img {
    width: 24px;
    height: 24px;
  }

  .floating-card.card-1 {
    top: 5%;
    left: 2%;
  }

  .floating-card.card-2 {
    top: 12%;
    right: 5%;
  }

  .floating-card.card-3 {
    bottom: 10%;
    left: 5%;
  }
}

@media (max-width: 768px) {
  .hero-image-wrapper {
    height: 350px;
    margin-top: 30px;
  }

  .hero-main-visual {
    max-width: 320px;
  }

  .floating-card {
    padding: 10px 16px;
    font-size: 12px;
    border-radius: 10px;
  }

  .floating-card img {
    width: 20px;
    height: 20px;
  }

  .floating-card.card-1 {
    top: 3%;
    left: 1%;
  }

  .floating-card.card-2 {
    top: 10%;
    right: 2%;
  }

  .floating-card.card-3 {
    bottom: 8%;
    left: 3%;
  }
}

/* Hero Wave */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
}

.hero-wave svg {
  width: 100%;
  height: 100%;
}

/* ===========================
   Section Headers
   =========================== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 1;
}

.section-header.light .section-title,
.section-header.light .section-subtitle {
  color: #fff;
}

.section-header.light .section-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-header.light .section-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
}

.section-header.light .section-tag {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.section-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  color: var(--storybook-primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--storybook-dark);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================
   What Is Section
   =========================== */
.what-is-section {
  padding: 100px 0;
  background: #fff;
}

.what-is-content .lead-text {
  font-size: 20px;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 40px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon i {
  font-size: 28px;
  color: #fff;
}

.feature-icon.gradient-1 { background: var(--gradient-primary); }
.feature-icon.gradient-2 { background: var(--gradient-nature); }
.feature-icon.gradient-3 { background: var(--gradient-warm); }

.feature-text h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 8px;
}

.feature-text p {
  font-size: 15px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

/* Process Flow */
.what-is-visual {
  padding: 40px;
}

.process-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.process-step {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f8fafc;
  padding: 20px;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.process-step:hover {
  background: #f1f5f9;
  transform: translateX(10px);
}

.process-step.final {
  background: var(--gradient-primary);
}

.process-step.final .step-circle,
.process-step.final h5,
.process-step.final p {
  color: #fff;
}

.process-step.final .step-circle {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--storybook-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--storybook-primary);
  flex-shrink: 0;
}

.step-content h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.process-arrow {
  display: flex;
  justify-content: center;
  color: #cbd5e1;
  font-size: 24px;
}

/* ===========================
   FAQ Section
   =========================== */
.faq-section {
  padding: 80px 0;
  background: #f8fafc;
}

.faq-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: #fff;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid #e2e8f0;
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-item.highlight {
  border: 2px solid var(--storybook-primary);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.faq-item.highlight .faq-question {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.faq-question:hover {
  background: #f8fafc;
}

.faq-question h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin: 0;
}

.faq-question i {
  font-size: 24px;
  color: var(--storybook-primary);
  transition: var(--transition);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 24px 24px;
  color: #64748b;
  line-height: 1.8;
  margin: 0;
}

/* ===========================
   Features Section
   =========================== */
.features-section {
  padding: 100px 0;
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 992px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: #fff;
  border-radius: var(--border-radius-lg);
  padding: 32px;
  border: 1px solid #e2e8f0;
  transition: var(--transition);
  position: relative;
}

/* Use column flex so footer tags stick to bottom */
.feature-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

/* Featured card style */
.feature-card.featured {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  border: 2px solid var(--storybook-primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.feature-card.featured::before {
  content: '⭐ 核心優勢';
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--gradient-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.card-icon i {
  font-size: 32px;
  color: #fff;
}

.card-icon.gradient-1 { background: var(--gradient-primary); }
.card-icon.gradient-2 { background: var(--gradient-nature); }
.card-icon.gradient-3 { background: var(--gradient-warm); }
.card-icon.gradient-4 { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }
.card-icon.gradient-5 { background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%); }
.card-icon.gradient-6 { background: var(--gradient-magic); }

.feature-card h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 15px;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 20px;
}

.feature-tags {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

/* push tags to bottom of card regardless of content height */
.feature-tags {
  margin-top: auto;
}

.feature-tags li {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.feature-tags li.highlight-tag {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
}

/* ===========================
   Performance Section (Tech Advantages)
   =========================== */
.performance-section {
  padding: 120px 0;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.performance-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 60px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1200px) {
  .performance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .performance-grid {
    grid-template-columns: 1fr;
  }
}


.performance-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 32px 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.performance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.performance-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.perf-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.perf-icon i {
  font-size: 36px;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.perf-metric {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.perf-before {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.perf-metric i {
  color: var(--storybook-success);
  font-size: 20px;
}

.perf-after {
  font-size: 28px;
  font-weight: 700;
  color: var(--storybook-success);
}

.perf-number {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.performance-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.improvement-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: var(--storybook-success);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
}

.perf-description p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.6;
}

.perf-content {
  position: relative;
  z-index: 1;
}

.performance-section .performance-card .perf-content p{
  font-size: 15px;
  color: rgba(255, 255, 255, 0.87);
  line-height: 1.8;
  margin: 0;
  letter-spacing: 0.2px;
}

/* Tech Stack */
.tech-stack-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-lg);
  padding: 40px;
}

.tech-stack-section h3 {
  font-size: 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 32px;
}

.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .tech-stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .tech-stack-grid {
    grid-template-columns: 1fr;
  }
}

.tech-category h5 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #fff;
  margin-bottom: 16px;
}

.tech-category h5 i {
  color: var(--storybook-accent);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tags span {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
}

/* ===========================
   Use Cases Section
   =========================== */
.use-cases-section {
  padding: 100px 0;
  background: #f8fafc;
}

.use-cases-filter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--storybook-primary);
  border-color: var(--storybook-primary);
  color: #fff;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .use-cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .use-cases-grid {
    grid-template-columns: 1fr;
  }
}

.use-case-card {
  background: #fff;
  border-radius: var(--border-radius-lg);
  padding: 32px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.use-case-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.case-icon {
  width: 56px;
  height: 56px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.case-icon i {
  font-size: 26px;
  color: var(--storybook-primary);
}

.case-tag {
  display: inline-block;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.case-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 8px;
}

.case-content p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  margin: 0;
}

/* ===========================
   Comparison Section
   =========================== */
.comparison-section {
  padding: 100px 0;
  background: #fff;
}

.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.comparison-table th,
.comparison-table td {
  padding: 20px 24px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--storybook-dark);
  font-size: 16px;
}

.comparison-table th.highlight-col {
  background: var(--gradient-primary);
  color: #fff;
}

.comparison-table td {
  font-size: 15px;
  color: #64748b;
}

.comparison-table td.highlight-col {
  background: rgba(99, 102, 241, 0.05);
  color: var(--storybook-primary);
  font-weight: 500;
}

.comparison-table td.highlight-col i {
  color: var(--storybook-success);
  margin-right: 6px;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .bx-x {
  color: #ef4444;
}

.comparison-table .bx-check {
  color: var(--storybook-success);
}

/* ===========================
   Demo Section
   =========================== */
.demo-section {
  padding: 120px 0 140px;
  background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 60%, #eef2ff 100%);
}

.demo-carousel-grid {
  padding: 20px 0 40px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: nowrap; /* keep three cards on one row when space allows */
  /* overflow-x: auto; allow horizontal scroll on very narrow viewports */
  -webkit-overflow-scrolling: touch;
}

/* Responsive: allow wrapping when viewport is too narrow to fit three cards */
@media (max-width: 1160px) {
  .demo-carousel-grid {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }
  .demo-card {
    margin-bottom: 24px;
  }
}

.demo-carousel {
  padding: 20px 0 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.demo-carousel .owl-stage-outer {
  /* padding: 0 20px; */
  background: transparent;
}

.demo-carousel .owl-item {
  display: flex;
  justify-content: center;
}

.demo-card {
  background: #fff;
  border-radius: 28px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  height: 680px;
  width: 360px;
  transition: var(--transition);
}

.demo-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
}

.demo-visual {
  height: 360px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 65%, #111827 100%);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}

.demo-visual::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 18px;
  background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.25), transparent 55%);
  pointer-events: none;
  mix-blend-mode: screen;
}


.story-video {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.5);
  z-index: 1;
}

.demo-content {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.demo-content h4 {
  font-size: 22px;
  font-weight: 700;
  color: var(--storybook-dark);
  margin-bottom: 16px;
  line-height: 1;
}

.story-excerpt {
  font-size: 15px;
  /* color: #64748b; */
  line-height: 1.8;
  margin-bottom: 20px;
  /* flex: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden; */
  /* height: 42px; */
}

.demo-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--border-radius);
}

.play-btn {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.play-btn:hover {
  transform: scale(1.1);
}

.play-btn i {
  font-size: 22px;
  color: #fff;
  margin-left: 2px;
}

.audio-progress {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.audio-time {
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}

.demo-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.demo-tags span {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
}

.demo-carousel .owl-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.demo-carousel .owl-dots button {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.3);
}

.demo-carousel .owl-dots .owl-dot.active {
  background: #0f172a;
}

.demo-carousel .owl-nav button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

.demo-carousel .owl-nav button.owl-prev {
  left: -20px;
}

.demo-carousel .owl-nav button.owl-next {
  right: -20px;
}

.demo-carousel .owl-nav button i {
  font-size: 18px;
  color: #0f172a;
}

@media (max-width: 992px) {
  .demo-card {
    width: 100%;
    max-width: 480px;
  }

  .demo-carousel .owl-nav button {
    display: none;
  }
}

@media (max-width: 768px) {
  .demo-section {
    padding-top: 80px;
  }

  .demo-visual {
    height: 280px;
  }
}

/* ===========================
   Deployment Section
   =========================== */
.deployment-section {
  padding: 100px 0;
  background: #fff;
}

.deployment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 992px) {
  .deployment-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
}

.deployment-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.deployment-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.deployment-card.featured {
  border: 2px solid var(--storybook-primary);
  transform: scale(1.05);
}

.deployment-card.featured:hover {
  transform: scale(1.05) translateY(-8px);
}

.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: #fff;
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.deployment-icon {
  width: 80px;
  height: 80px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.deployment-icon i {
  font-size: 36px;
  color: var(--storybook-primary);
}

.deployment-card h4 {
  font-size: 22px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 12px;
}

.deployment-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
  line-height: 1.7;
}

.deployment-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
}

.deployment-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}

.deployment-features li:last-child {
  border-bottom: none;
}

.deployment-features li i {
  color: var(--storybook-success);
  font-size: 18px;
}

.deployment-btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid var(--storybook-primary);
  color: var(--storybook-primary);
  background: transparent;
}

.deployment-btn:hover {
  background: var(--storybook-primary);
  color: #fff;
}

.deployment-btn.primary {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
}

.deployment-btn.primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ===========================
   Contact Section
   =========================== */
.contact-section {
  padding: 100px 0;
  background: #f8fafc;
}

.contact-info h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--storybook-dark);
  margin-bottom: 16px;
}

.contact-info > p {
  color: #64748b;
  margin-bottom: 40px;
}

.contact-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-item i {
  width: 50px;
  height: 50px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--storybook-primary);
  flex-shrink: 0;
}

.contact-item h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 4px;
}

.contact-item p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.version-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--border-radius);
}

.version-badge {
  background: var(--gradient-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.version-text {
  font-size: 14px;
  color: var(--storybook-primary);
  font-weight: 500;
}

/* Contact Form */
.contact-form-wrapper {
  background: #fff;
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.contact-form-wrapper h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--storybook-dark);
  margin-bottom: 30px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form .form-control {
  padding: 14px 20px;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-size: 15px;
  transition: var(--transition);
  min-height: 45px;
}

.contact-form .form-control:focus {
  border-color: var(--storybook-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

.contact-form select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M1 4l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
  cursor: pointer;
}

.contact-form select.form-control::-ms-expand {
  display: none;
}

.contact-form textarea.form-control {
  resize: vertical;
  min-height: 120px;
  padding-top: 14px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ===========================
   Footer Override
   =========================== */
#footer {
  background: var(--storybook-dark);
}

#footer .copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 992px) {
  .hero-title {
    font-size: 42px;
  }
  
  .hero-subtitle {
    font-size: 22px;
  }
  
  .hero-visual {
    display: none;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .hero-storybook {
    min-height: auto;
    padding: 100px 0 60px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 18px;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-stats {
    flex-wrap: wrap;
    gap: 24px;
  }
  
  .section-header {
    margin-bottom: 40px;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* ===========================
   Animations
   =========================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Owl Carousel Override */
.owl-theme .owl-dots .owl-dot span {
  background: #cbd5e1;
}

.owl-theme .owl-dots .owl-dot.active span {
  background: var(--storybook-primary);
}

.owl-carousel .owl-item {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.owl-carousel .owl-item.active {
  opacity: 1;
}

/* ===========================
   SVG Image Styles
   =========================== */
.hero-illustration {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(99, 102, 241, 0.25);
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
  animation: imagePulse 4s ease-in-out infinite;
}

.hero-main-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-card img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.case-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.deployment-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.deployment-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deployment-features li img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.story-cover-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.play-btn .play-icon {
  width: 24px;
  height: 24px;
}

.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* Infographic Styles */
.infographic-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.infographic-container img {
  width: 100%;
  height: auto;
}

/* Responsive SVG Adjustments */
@media (max-width: 991px) {
  .hero-illustration {
    max-width: 450px;
    margin-top: 40px;
  }
  
  .story-cover-img {
    height: 180px;
  }
}

@media (max-width: 767px) {
  .hero-illustration {
    max-width: 350px;
  }
  
  .story-cover-img {
    height: 150px;
  }
  
  .card-icon img {
    width: 32px;
    height: 32px;
  }
  
  .case-icon img {
    width: 48px;
    height: 48px;
  }
  
  .deployment-icon img {
    width: 50px;
    height: 50px;
  }
}
