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

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent: #60a5fa;
  --accent-secondary: #3b82f6;
  --header-bg-scrolled: rgba(10, 10, 11, 0.8);
  --gradient-overlay-1: rgba(59, 130, 246, 0.15);
  --gradient-overlay-2: rgba(96, 165, 250, 0.1);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f2;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.04);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 0, 0, 0.12);
  --text-primary: #1a1a1b;
  --text-secondary: rgba(0, 0, 0, 0.6);
  --text-muted: rgba(0, 0, 0, 0.4);
  --accent: #2563eb;
  --accent-secondary: #6366f1;
  --header-bg-scrolled: rgba(250, 250, 250, 0.85);
  --gradient-overlay-1: rgba(59, 130, 246, 0.08);
  --gradient-overlay-2: rgba(96, 165, 250, 0.06);
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle gradient overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--gradient-overlay-1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, var(--gradient-overlay-2), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 40px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  background: var(--header-bg-scrolled);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo-img {
  width: 32px;
  height: 32px;
}

.header-logo-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.header-cta {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-cta:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Dark mode (default) - show moon */
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

/* Light mode - show sun */
[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .site-header {
    padding: 12px 20px;
  }

  .header-nav {
    display: none;
  }

  .header-cta {
    padding: 8px 16px;
    font-size: 13px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 100px;
}

.hero-title {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.handwritten-underline {
  position: relative;
  display: inline-block;
}

.handwritten-underline::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -2px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 Q 15 2, 30 7 T 55 6 T 80 8 T 98 5' stroke='%2360a5fa' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  background-size: 100% 100%;
  z-index: -1;
  opacity: 0.8;
  animation: draw-underline 1s ease-out forwards;
}

@keyframes draw-underline {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 0.8;
  }
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
}

.hero-cta.chrome-cta {
  gap: 10px;
}

.chrome-icon {
  flex-shrink: 0;
}

.hero-version {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Video Link */
.video-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 14px 26px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-link svg {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

.video-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--text-primary);
}

.video-link:hover svg {
  opacity: 1;
  color: var(--accent);
}

/* Video Modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.video-modal.active .video-modal-content {
  transform: scale(1);
}

.video-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.video-modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Product Showcase */
.product-showcase {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 60px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

/* Scroll indicators - hidden on desktop */
.scroll-indicator {
  display: none;
}

.showcase-card {
  padding: 24px;
  width: 340px;
  height: 420px;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  overflow: hidden;
  position: relative;
  will-change: transform, opacity;
}

.showcase-card .showcase-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.showcase-card.main {
  width: 380px;
  z-index: 3;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-card.left {
  transform: rotateY(8deg) translateX(40px);
  opacity: 0.8;
  z-index: 1;
  margin-right: -50px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-card.right {
  transform: rotateY(-8deg) translateX(-40px);
  opacity: 0.8;
  z-index: 1;
  margin-left: -50px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card.showcase-card.left:hover,
.glass-card.showcase-card.right:hover {
  opacity: 1;
  z-index: 10;
  transform: rotateY(0deg) translateX(0px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.glass-card.showcase-card.main:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.showcase-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.showcase-header-simple {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.showcase-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.showcase-title {
  font-size: 18px;
  font-weight: 500;
}

.showcase-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.showcase-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.showcase-word {
  display: inline;
  padding: 2px 6px;
  margin: 0 2px;
  background: rgba(96, 165, 250, 0.15);
  border-radius: 4px;
  color: var(--accent);
}

.showcase-translation {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.showcase-translation-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.showcase-translation-text {
  font-size: 14px;
  color: var(--text-primary);
}

.showcase-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

/* Showcase Box */
.showcase-box {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.showcase-box-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.showcase-box-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}

/* Main Card Text Content */
.showcase-text-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.showcase-word {
  display: inline;
  padding: 4px 8px;
  margin: 0 2px;
  background: rgba(96, 165, 250, 0.15);
  border-radius: 6px;
  color: var(--accent);
}

/* Showcase Icon */
.showcase-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.showcase-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-left: auto;
}

/* Translate Card Styles */
.showcase-translate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.showcase-translate-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.showcase-word-chip {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.showcase-word-chip.dark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.showcase-word-chip.light {
  background: rgba(96, 165, 250, 0.2);
  color: var(--accent);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.showcase-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.showcase-vocab-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

.showcase-vocab-icon {
  font-size: 18px;
}

.showcase-vocab-text {
  color: #4ade80;
  font-size: 14px;
  font-weight: 500;
}

.showcase-vocab-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Chat Card Styles */
.showcase-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 95%;
}

.showcase-chat-bubble.tutor {
  align-self: flex-start;
}

.showcase-chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.showcase-chat-bubble span {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.showcase-chat-bubble.tutor span {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.showcase-chat-bubble.user span {
  background: rgba(96, 165, 250, 0.2);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.showcase-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Grammar Card Styles */
.showcase-grammar-sentence {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.showcase-grammar-sentence .highlight {
  color: var(--accent);
  font-weight: 600;
}

.showcase-grammar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.showcase-tag {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.showcase-tag.purple {
  background: rgba(96, 165, 250, 0.15);
  color: var(--accent);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.showcase-tag.green {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.showcase-grammar-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.showcase-conjugation {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.showcase-conjugation-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.showcase-conjugation-items {
  display: flex;
  gap: 10px;
}

.showcase-conj-chip {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Demo Browser */
.demo-browser {
  max-width: 1000px;
  margin: 60px auto 0;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1c;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.demo-browser-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #252528;
  border-bottom: 1px solid var(--border-color);
}

.demo-browser-dots {
  display: flex;
  gap: 8px;
}

.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.demo-dot.red { background: #ff5f57; }
.demo-dot.yellow { background: #ffbd2e; }
.demo-dot.green { background: #28c840; }

.demo-browser-url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.demo-browser-url svg {
  color: #28c840;
}

.demo-browser-content {
  position: relative;
  display: flex;
  height: 420px;
  background: #f8f9fa;
  overflow: hidden;
}

/* Wikipedia Sidebar */
.demo-wiki-sidebar {
  width: 160px;
  background: #f8f9fa;
  border-right: 1px solid #e0e0e0;
  padding: 12px;
  flex-shrink: 0;
}

.demo-wiki-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin-bottom: 12px;
  color: #202122;
  font-size: 13px;
  font-weight: 500;
}

.demo-wiki-logo svg {
  opacity: 0.7;
}

.demo-wiki-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-wiki-nav a {
  font-size: 12px;
  color: #36c;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.demo-wiki-nav a:hover {
  background: rgba(0, 0, 0, 0.05);
}

.demo-wiki-nav a.active {
  background: rgba(51, 102, 204, 0.1);
}

/* Main Page Content */
.demo-page {
  flex: 1;
  padding: 20px 24px;
  background: #fff;
  overflow: hidden;
  transition: filter 0.3s ease;
}

.demo-animated .demo-page {
  animation: blurPage 0.3s ease 4s forwards;
}

@keyframes blurPage {
  to { filter: blur(2px); }
}

.demo-page-header {
  border-bottom: 1px solid #a2a9b1;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.demo-page-title {
  font-size: 26px;
  font-weight: 400;
  font-family: 'Linux Libertine', 'Georgia', serif;
  margin-bottom: 8px;
  color: #202122;
}

.demo-page-tabs {
  display: flex;
  gap: 4px;
  font-size: 12px;
}

.demo-page-tabs span {
  padding: 6px 12px;
  color: #36c;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.demo-page-tabs span.active {
  background: #fff;
  color: #202122;
  border: 1px solid #a2a9b1;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}

.demo-page-body {
  display: flex;
  gap: 20px;
}

.demo-page-main {
  flex: 1;
}

.demo-page-text {
  font-size: 14px;
  line-height: 1.7;
  color: #202122;
  margin-bottom: 12px;
}

.demo-text-secondary {
  color: #54595d;
  font-size: 13px;
}

.demo-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #202122;
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #a2a9b1;
}

/* Infobox */
.demo-infobox {
  float: right;
  width: 140px;
  margin: 0 0 12px 16px;
  padding: 8px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  font-size: 11px;
  line-height: 1.4;
}

.demo-infobox-title {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #a2a9b1;
  color: #202122;
}

.demo-infobox-image {
  margin-bottom: 8px;
}

.demo-infobox-caption {
  font-size: 10px;
  color: #54595d;
  text-align: center;
  margin-top: 4px;
}

.demo-infobox-row {
  display: flex;
  padding: 3px 0;
  border-bottom: 1px solid #eaecf0;
  color: #202122;
}

.demo-infobox-label {
  font-weight: 600;
  width: 55px;
  flex-shrink: 0;
  color: #54595d;
}

/* Fake images */
.demo-fake-image {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, #c8ccd1 0%, #a2a9b1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.demo-fake-image-wide {
  height: 60px;
}

.demo-content-image {
  margin: 12px 0;
}

.demo-image-caption {
  font-size: 11px;
  color: #54595d;
  text-align: center;
  margin-top: 4px;
}

.demo-page-links {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
}

.demo-page-links a {
  color: #3366cc;
  text-decoration: none;
}

.demo-page-links a:hover {
  text-decoration: underline;
}

.demo-page-text.secondary {
  opacity: 0.6;
}

/* Wikipedia Infobox */
.demo-wiki-infobox {
  width: 180px;
  flex-shrink: 0;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  font-size: 12px;
}

.demo-wiki-image {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #a2a9b1;
}

.demo-wiki-image-placeholder {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #c8ccd1 0%, #a2a9b1 100%);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #72777d;
  margin-bottom: 6px;
}

.demo-wiki-caption {
  font-size: 11px;
  color: #54595d;
  font-style: italic;
}

.demo-wiki-table {
  width: 100%;
  border-collapse: collapse;
}

.demo-wiki-table th,
.demo-wiki-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eaecf0;
  text-align: left;
  vertical-align: top;
}

.demo-wiki-table th {
  background: #eaecf0;
  color: #202122;
  font-weight: 600;
  width: 40%;
}

.demo-wiki-table td {
  color: #202122;
}

/* Table of Contents */
.demo-wiki-toc {
  display: inline-block;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
}

.demo-wiki-toc-title {
  font-weight: 600;
  color: #202122;
  margin-bottom: 6px;
}

.demo-wiki-toc ol {
  margin: 0;
  padding-left: 20px;
  color: #36c;
}

.demo-wiki-toc li {
  margin: 3px 0;
}

.demo-wiki-toc a {
  color: #36c;
  text-decoration: none;
}

.demo-wiki-toc a:hover {
  text-decoration: underline;
}

.demo-word {
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.demo-word:hover {
  background: rgba(102, 51, 153, 0.15);
  color: #663399;
}

.demo-word.selected {
  background: rgba(102, 51, 153, 0.2);
  color: #5a2d82;
}

/* Demo Popup */
.demo-popup {
  position: absolute;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%);
  width: 420px;
  background: rgba(50, 50, 55, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.demo-animated .demo-popup.anim-popup {
  transform: translate(-50%, -50%) scale(1);
}

.demo-popup-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.demo-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.demo-popup-close svg {
  width: 14px;
  height: 14px;
}

.demo-popup-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  padding-top: 4px;
}

.demo-popup-word {
  padding: 3px 6px;
  background: rgba(96, 165, 250, 0.2);
  border-radius: 4px;
  font-size: 14px;
  color: #e5e7eb;
}

.demo-popup-translation {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.demo-popup-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.demo-popup-text {
  font-size: 13px;
  color: var(--text-primary);
}

.demo-popup-footer {
  background: rgba(60, 60, 65, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 -16px -16px;
  padding: 0;
  border-radius: 0 0 16px 16px;
}

.demo-popup-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-popup-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.demo-popup-input input::placeholder {
  color: var(--text-muted);
}

.demo-popup-input-actions {
  display: flex;
  gap: 3px;
}

.demo-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.demo-icon-btn svg {
  width: 14px;
  height: 14px;
}

.demo-popup-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 8px;
}

.demo-popup-actions {
  display: flex;
  gap: 8px;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.demo-btn.primary {
  background: #007AFF;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.demo-btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border: none;
}

.demo-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
}

/* Demo Widget */
.demo-widget {
  position: absolute;
  bottom: 20px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(60, 60, 65, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 240px;
}

.demo-widget-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.demo-widget-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.demo-widget-message {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.demo-widget-actions {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
}

.demo-widget-actions span {
  cursor: pointer;
  transition: color 0.2s ease;
}

.demo-widget-actions span:hover {
  color: var(--text-primary);
}

/* Demo Animation Styles */
.demo-animated {
  min-height: 580px;
}

/* Tutor question in popup */
.demo-tutor-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-tutor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-tutor-bubble {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.demo-tutor-bubble.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* User answer */
.demo-user-answer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.demo-user-bubble {
  background: rgba(96, 165, 250, 0.2);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 85%;
}

/* Tutor response */
.demo-tutor-response {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

/* Demo sentence with dotted words */
.demo-sentence {
  font-size: 18px;
  line-height: 2;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding: 8px 0;
}

.demo-dotted {
  position: relative;
  border-bottom: 2px dotted rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  margin: 0 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-dotted:hover {
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.demo-dotted.highlighted {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  border-bottom: none;
}

/* Popup buttons */
.demo-popup-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-popup-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.demo-btn {
  position: relative;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
}

.demo-btn.primary {
  background: #007AFF;
  color: white;
}

.demo-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.demo-btn.with-icon svg {
  margin-left: 2px;
}

/* Word translation card */
.demo-word-card {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  width: 200px;
  background: rgba(60, 60, 65, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  z-index: 11;
}

.demo-word-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.demo-word-card-original {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.demo-word-card-translation {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.vocab-btn {
  width: 100%;
  justify-content: center;
  border-radius: 12px;
}

.demo-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  z-index: 2;
}

/* Demo conversation */
.demo-conversation {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-tutor-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.demo-tutor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-tutor-bubble {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 85%;
}

.demo-tutor-bubble.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Input row with icons */
.demo-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.demo-input-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
}

.demo-input-field {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.demo-placeholder {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.demo-animated .demo-placeholder {
  animation: fadeOut 0.2s ease 8s forwards;
}

.demo-typing-text {
  position: absolute;
  top: 50%;
  left: 14px;
  right: auto;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  z-index: 1;
  width: 0;
  opacity: 1;
  pointer-events: none;
  text-align: left;
}

.demo-animated .demo-typing-text {
  animation: typeText 2.5s steps(35) 8s forwards;
}

.demo-typing-text.cleared {
  opacity: 0 !important;
  width: 0 !important;
}

@keyframes typeText {
  from { width: 0; }
  to { width: 290px; }
}


/* Demo controls */
.demo-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 101;
}

.demo-control-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.demo-control-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.demo-control-btn .play-icon {
  display: none;
}

.demo-control-btn.paused .pause-icon {
  display: none;
}

.demo-control-btn.paused .play-icon {
  display: block;
}

/* Paused state - freeze all animations */
.demo-animated.paused,
.demo-animated.paused * {
  animation-play-state: paused !important;
}

/* Progress bar */
.demo-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 0 2px 2px 0;
  z-index: 100;
}

.demo-animated .demo-progress-bar {
  animation: progressFill 15s linear forwards;
}

@keyframes progressFill {
  from { width: 0; }
  to { width: 100%; }
}

/* Click indicator styles */
.click-indicator {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.4);
  border: 2px solid rgba(96, 165, 250, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  z-index: 100;
}

.click-widget {
  bottom: 10px;
  right: 10px;
}

.click-word,
.click-ask,
.click-grammar {
  top: 50%;
  left: 50%;
  margin-top: -12px;
  margin-left: -12px;
}

.demo-animated .click-widget {
  animation: clickRipple 0.6s ease forwards;
  animation-delay: 2.5s;
}

.demo-animated .click-word {
  animation: clickRipple 0.6s ease forwards;
  animation-delay: 5.3s;
}

.demo-animated .click-ask {
  animation: clickRipple 0.6s ease forwards;
  animation-delay: 6.8s;
}

.demo-animated .click-grammar {
  animation: clickRipple 0.6s ease forwards;
  animation-delay: 13.3s;
}

@keyframes clickRipple {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.demo-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.demo-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.demo-icon-btn.send-btn {
  color: #60a5fa;
}

.demo-user-message {
  display: flex;
  justify-content: flex-end;
}

.demo-user-bubble {
  background: rgba(96, 165, 250, 0.2);
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 85%;
}

/* Grammar explanation */
.demo-grammar {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.demo-grammar-header {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.demo-grammar-tag {
  padding: 4px 10px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #60a5fa;
}

.demo-grammar-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.demo-grammar-content strong {
  color: var(--text-primary);
}

/* Animation states */
/* Animation initial states */
.anim-widget {
  opacity: 0;
  transform: translateY(20px);
}

.anim-popup {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

.anim-controls,
.anim-close {
  opacity: 0;
}

.anim-word-card {
  opacity: 0;
  transform: translateY(-50%) translateX(20px);
}

/* Animations triggered by .demo-animated parent */
.demo-animated .anim-widget {
  animation: slideInWidget 0.5s ease forwards 1s,
             fadeOutWidget 0.3s ease forwards 2.8s;
}

.demo-animated .anim-popup {
  animation: fadeInPopup 0.4s ease forwards;
  animation-delay: 4s;
}

.demo-animated .anim-select {
  animation: highlightWord 0.3s ease forwards;
  animation-fill-mode: both;
}

.demo-animated .anim-select[data-delay="1"] { animation-delay: 3s; }
.demo-animated .anim-select[data-delay="2"] { animation-delay: 3.2s; }
.demo-animated .anim-select[data-delay="3"] { animation-delay: 3.4s; }

.demo-animated .anim-controls {
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 4.5s;
}

.demo-animated .anim-close {
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 4.2s;
}

.demo-animated .anim-highlight {
  animation: highlightWordNew 0.3s ease forwards;
  animation-delay: 5.5s;
}

.demo-animated .anim-word-card {
  animation: slideInCard 0.4s ease forwards;
  animation-delay: 6s;
}

/* Button click animations */
.demo-animated .anim-btn-ask {
  animation: buttonClick 0.3s ease forwards;
  animation-delay: 7s;
}

.demo-animated .anim-btn-grammar {
  animation: buttonClick 0.3s ease forwards;
  animation-delay: 13.5s;
}

/* Conversation animations */
.demo-conversation {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  animation: expandSection 0.4s ease forwards;
  animation-delay: 7.3s;
}

/* Conversation animation initial states */
.anim-tutor-q,
.anim-user-a,
.anim-tutor-success {
  opacity: 0;
  transform: translateY(10px);
}

.anim-typing-input {
  opacity: 0;
}

/* Conversation animations triggered by .demo-animated */
.demo-animated .anim-tutor-q {
  animation: slideUp 0.3s ease forwards;
  animation-delay: 7.5s;
}

.demo-animated .anim-typing-input {
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 8s;
}

.demo-animated .anim-user-a {
  animation: slideUp 0.3s ease forwards;
  animation-delay: 11s;
}

.demo-animated .anim-tutor-success {
  animation: slideUp 0.3s ease forwards;
  animation-delay: 12s;
}

/* Grammar animation initial state */
.demo-popup .demo-grammar {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 0 14px;
}

.demo-animated .demo-grammar {
  animation: expandGrammar 0.4s ease forwards;
  animation-delay: 14s;
}

/* Keyframes */
@keyframes slideInWidget {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutWidget {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }
}

@keyframes fadeInPopup {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes highlightWord {
  from {
    background: transparent;
  }
  to {
    background: rgba(102, 51, 153, 0.25);
    color: #5a2d82;
  }
}

@keyframes highlightWordNew {
  from {
    background: transparent;
    border-bottom: 2px dotted rgba(255, 255, 255, 0.3);
  }
  to {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    border-bottom: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; display: none; }
}



@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes buttonClick {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
  }
  50% {
    transform: scale(0.95);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

@keyframes expandSection {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 400px;
  }
}

@keyframes expandGrammar {
  from {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 150px;
    margin-top: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

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

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

/* Demo Steps */
.demo-steps {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.demo-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.demo-step-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .demo-browser {
    margin: 40px 10px 0;
  }

  .demo-browser-content {
    position: relative;
    height: 450px;
    overflow: hidden;
  }

  .demo-wiki-sidebar {
    display: none;
  }

  .demo-page {
    padding: 10px 12px;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .demo-page-header {
    margin-bottom: 6px;
    padding-bottom: 4px;
  }
  
  .demo-page-title {
    font-size: 16px;
  }
  
  .demo-page-tabs {
    font-size: 9px;
  }
  
  .demo-page-tabs span {
    padding: 3px 6px;
  }

  .demo-page-body {
    display: block;
  }
  
  .demo-page-text {
    font-size: 10px;
    line-height: 1.5;
    margin-bottom: 5px;
  }
  
  .demo-section-title {
    font-size: 11px;
    margin: 6px 0 3px;
  }
  
  .demo-infobox,
  .demo-wiki-infobox,
  .demo-wiki-toc,
  .demo-text-secondary,
  .demo-content-image,
  .demo-section-title:not(:first-of-type),
  .demo-page-links {
    display: none;
  }

  /* Widget on mobile */
  .demo-widget {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 12px;
  }
  
  .demo-widget-avatar {
    width: 36px;
    height: 36px;
  }
  
  .demo-widget-message {
    font-size: 12px;
  }
  
  .demo-widget-actions {
    font-size: 10px;
  }

  /* Popup on mobile - simple centered overlay */
  .demo-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 20px);
    max-width: 300px;
    max-height: 95%;
    padding: 12px;
    border-radius: 12px;
    overflow-y: auto;
  }
  
  .demo-sentence {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
    text-align: center;
  }
  
  .demo-dotted {
    margin: 0 1px;
  }
  
  .demo-conversation {
    margin-top: 8px;
    padding-top: 8px;
    gap: 6px;
  }
  
  .demo-tutor-bubble,
  .demo-user-bubble {
    font-size: 10px;
    padding: 6px 8px;
  }
  
  .demo-tutor-avatar {
    width: 24px;
    height: 24px;
  }
  
  .demo-input-row {
    gap: 4px;
    margin-bottom: 8px;
  }
  
  .demo-input-field {
    padding: 6px 8px;
    font-size: 10px;
  }
  
  .demo-icon-btn {
    width: 28px;
    height: 28px;
  }
  
  .demo-icon-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .demo-typing-text,
  .demo-placeholder {
    font-size: 10px;
    left: 8px;
  }
  
  .demo-popup-buttons {
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
  }
  
  .demo-popup-actions {
    display: flex;
    gap: 6px;
    width: 100%;
  }
  
  .demo-popup-actions .demo-btn {
    flex: 1;
  }
  
  .demo-btn {
    padding: 8px 10px;
    font-size: 10px;
    border-radius: 8px;
    justify-content: center;
  }
  
  .demo-btn.with-icon {
    width: 100%;
  }
  
  .demo-grammar {
    padding: 8px;
    margin-top: 6px;
    font-size: 9px;
  }
  
  .demo-grammar-tag {
    font-size: 7px;
    padding: 2px 4px;
  }
  
  .demo-grammar-content {
    font-size: 9px;
  }
  
  /* Hide word card on mobile */
  .demo-word-card {
    display: none;
  }
  
  /* Conversation on mobile */
  .demo-conversation {
    margin-top: 10px;
    padding-top: 10px;
  }
  
  .demo-tutor-avatar {
    width: 28px;
    height: 28px;
  }
  
  .demo-tutor-bubble,
  .demo-user-bubble {
    font-size: 11px;
    padding: 8px 10px;
  }
  
  .demo-input-row {
    gap: 6px;
    margin-bottom: 10px;
  }
  
  .demo-input-field {
    padding: 8px 10px;
    font-size: 11px;
  }
  
  .demo-icon-btn {
    width: 34px;
    height: 34px;
  }
  
  .demo-icon-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .demo-typing-text,
  .demo-placeholder {
    font-size: 11px;
    left: 10px;
  }
  
  .demo-grammar {
    padding: 10px;
    margin-top: 8px;
  }
  
  .demo-grammar-header {
    margin-bottom: 6px;
  }
  
  .demo-grammar-tag {
    font-size: 8px;
    padding: 2px 6px;
  }
  
  .demo-grammar-content {
    font-size: 10px;
  }

  .demo-steps {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .demo-popup-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .demo-popup-actions {
    order: -1;
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }
}

/* Section Header */
.section {
  padding: 100px 20px;
  position: relative;
  z-index: 1;
}

.section-label {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-title .highlight {
  color: var(--text-secondary);
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
}

.section.center {
  text-align: center;
}

.section.center .section-subtitle {
  margin: 0 auto;
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 60px auto 0;
}

.feature-card {
  padding: 32px;
  display: flex;
  gap: 20px;
}

.feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(96, 165, 250, 0.1);
  border-radius: 12px;
  font-size: 24px;
}

.feature-content h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.feature-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Tutors Grid */
.tutors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 60px auto 0;
}

.tutor-card {
  padding: 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tutor-card.coming-soon {
  opacity: 0.7;
}

.tutor-card.coming-soon:hover {
  opacity: 0.85;
}

.tutor-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.tutor-card-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  position: relative;
  z-index: 1;
  animation: float 4s ease-in-out infinite;
}

.tutor-card-avatar.placeholder {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.tutor-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.tutor-card:hover .tutor-glow {
  opacity: 1;
}

.tutor-glow.mila {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, transparent 70%);
}

.tutor-glow.max {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
}

.tutor-glow.leo {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.2) 0%, transparent 70%);
}

.tutor-card-name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tutor-card-style {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 500;
}

.tutor-card.coming-soon .tutor-card-style {
  color: var(--text-muted);
}

.tutor-card-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.tutor-card-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.tutor-tag {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tutor-card-status {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tutor-card-status.available {
  color: #22c55e;
}

.tutor-card-status.coming {
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Philosophy Section */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 60px auto 0;
}

.philosophy-card {
  padding: 32px;
}

.philosophy-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-color: rgba(96, 165, 250, 0.2);
}

.philosophy-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.philosophy-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* CTA Section */
.cta-section {
  padding: 120px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 40px;
  text-align: center;
}

.cta-card h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.cta-card p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.cta-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.cta-features span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer */
.footer {
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1000px) {
  /* Mobile slider for tutors */
  .tutors-grid {
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    margin: 40px -20px 0;
    width: calc(100% + 40px);
    max-width: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tutors-grid::-webkit-scrollbar {
    display: none;
  }

  .tutor-card {
    flex: 0 0 85%;
    max-width: 320px;
    min-width: 280px;
    scroll-snap-align: center;
    padding: 32px 24px;
  }
}

@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .features-grid,
  .philosophy-grid {
    grid-template-columns: 1fr;
  }

  .philosophy-card.featured {
    grid-column: span 1;
  }

  /* Mobile slider for showcase cards */
  .product-showcase {
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    margin: 40px -20px 0;
    width: calc(100% + 40px);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .product-showcase::-webkit-scrollbar {
    display: none;
  }

  .showcase-card {
    flex: 0 0 85%;
    max-width: 340px;
    min-width: 280px;
    scroll-snap-align: center;
    height: auto;
    min-height: 380px;
  }

  .showcase-card.left,
  .showcase-card.right {
    display: flex;
    transform: none;
    opacity: 1;
    margin: 0;
  }

  .showcase-card.main {
    width: auto;
    max-width: 340px;
  }

  .glass-card.showcase-card.left:hover,
  .glass-card.showcase-card.right:hover,
  .glass-card.showcase-card.main:hover {
    transform: none;
  }

  /* Scroll indicators */
  .scroll-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }

  .scroll-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
  }

  .scroll-indicator .dot:hover {
    background: var(--text-muted);
  }

  .scroll-indicator .dot.active {
    background: var(--accent);
    transform: scale(1.2);
  }
}

@media (max-width: 600px) {
  .hero-section {
    padding: 60px 20px 40px;
  }

  .cta-features {
    flex-direction: column;
    gap: 12px;
  }

  .feature-card {
    flex-direction: column;
    text-align: center;
  }

  .feature-icon {
    margin: 0 auto;
  }
}

/* Light theme specific overrides */
[data-theme="light"] .demo-browser {
  background: #fff;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .demo-control-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: #333;
}

[data-theme="light"] .demo-control-btn:hover {
  background: rgba(255, 255, 255, 1);
}

[data-theme="light"] .demo-browser-header {
  background: #f5f5f5;
}

[data-theme="light"] .demo-browser-url {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .demo-popup,
[data-theme="light"] .demo-widget {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .demo-popup-footer {
  background: rgba(245, 245, 247, 0.95);
}

[data-theme="light"] .demo-popup-word {
  background: rgba(37, 99, 235, 0.15);
  color: #5b21b6;
}

[data-theme="light"] .demo-popup-translation {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-popup-input input {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] .demo-icon-btn {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-btn.secondary {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-key {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .demo-widget-avatar {
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .demo-tutor-question {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-tutor-bubble {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .demo-tutor-bubble.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="light"] .demo-user-bubble {
  background: rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .demo-btn.secondary {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-popup-buttons {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-dotted {
  border-bottom-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .demo-dotted:hover {
  border-bottom-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .demo-dotted.highlighted,
[data-theme="light"] .anim-highlight {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .demo-word-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .demo-conversation {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-tutor-bubble {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .demo-tutor-bubble.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="light"] .demo-user-bubble {
  background: rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .demo-input-field {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .demo-icon-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .demo-icon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-icon-btn.send-btn {
  color: #2563eb;
}

[data-theme="light"] .demo-grammar {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .demo-grammar-tag {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  color: #2563eb;
}

[data-theme="light"] .showcase-chat-bubble.tutor span {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .showcase-chat-bubble.user span {
  background: rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .showcase-word-chip.dark {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .showcase-word-chip.light {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .showcase-conj-chip {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .showcase-conjugation {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .video-link:hover {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .hero-cta {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-cta:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .glass-card.showcase-card.left:hover,
[data-theme="light"] .glass-card.showcase-card.right:hover,
[data-theme="light"] .glass-card.showcase-card.main:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .philosophy-card.featured {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(59, 130, 246, 0.06) 100%);
  border-color: rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .handwritten-underline::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 Q 15 2, 30 7 T 55 6 T 80 8 T 98 5' stroke='%232563eb' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  background-size: 100% 100%;
}

[data-theme="light"] ::selection {
  background: rgba(37, 99, 235, 0.25);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Selection */
::selection {
  background: rgba(96, 165, 250, 0.3);
  color: var(--text-primary);
}
