@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+Bengali:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #070a13;
  --bg-secondary: #0f1424;
  --bg-tertiary: #161f38;
  --accent-indigo: #6366f1;
  --accent-teal: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(15, 20, 36, 0.75);
  --glass-border: rgba(255, 255, 255, 0.05);
  --font-heading: 'Outfit', 'Noto Sans Bengali', sans-serif;
  --font-body: 'Inter', 'Noto Sans Bengali', sans-serif;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --glow-shadow: 0 0 30px rgba(99, 102, 241, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

/* Floating background letters and decorative graphics */
.bg-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-letter {
  position: absolute;
  font-family: var(--font-heading);
  color: rgba(255, 255, 255, 0.035);
  user-select: none;
  font-weight: 700;
  animation: float 25s infinite linear;
}

.floating-letter.bangla {
  font-family: 'Noto Sans Bengali', sans-serif;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-20vh) rotate(360deg);
    opacity: 0;
  }
}

/* Positioning letters */
.letter-1 { left: 5%; bottom: 10%; font-size: 5rem; animation-duration: 35s; }
.letter-2 { left: 85%; bottom: 30%; font-size: 8rem; animation-duration: 40s; animation-delay: -5s; }
.letter-3 { left: 15%; bottom: 50%; font-size: 7rem; animation-duration: 30s; animation-delay: -10s; }
.letter-4 { left: 75%; bottom: 70%; font-size: 6rem; animation-duration: 45s; animation-delay: -15s; }
.letter-5 { left: 40%; bottom: 20%; font-size: 4rem; animation-duration: 28s; animation-delay: -2s; }
.letter-6 { left: 60%; bottom: 85%; font-size: 9rem; animation-duration: 50s; animation-delay: -20s; }
.letter-7 { left: 10%; bottom: 90%; font-size: 6rem; animation-duration: 38s; animation-delay: -8s; }
.letter-8 { left: 80%; bottom: 5%; font-size: 5rem; animation-duration: 42s; }

/* Grid glow artifacts */
.glow-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(7, 10, 19, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.blob-1 { top: 10%; left: -100px; }
.blob-2 { top: 50%; right: -150px; }
.blob-3 { top: 80%; left: 10%; }

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
}

.logo svg {
  width: 32px;
  height: 32px;
  fill: var(--accent-indigo);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-btn-github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
  color: var(--text-primary) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem !important;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-btn-github:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Sections */
section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-teal));
  border-radius: 2px;
}

/* Hero Section */
.hero {
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4rem;
  padding-top: 8rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  align-self: flex-start;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-indigo);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-teal) 70%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
  color: var(--text-primary);
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-shadow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

/* Kindle Device & Simulator */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.kindle-frame {
  width: 320px;
  height: 480px;
  background: #181a1b;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
}

.kindle-bezel-text {
  text-align: center;
  color: #555;
  font-size: 0.7rem;
  margin-top: 8px;
  letter-spacing: 0.2em;
  font-family: var(--font-heading);
}

.kindle-screen {
  flex: 1;
  background: #fdfdfd;
  color: #111;
  border-radius: 4px;
  padding: 1.5rem;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.kindle-header {
  font-size: 0.65rem;
  color: #777;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.kindle-text-content {
  flex: 1;
  line-height: 1.6;
  text-align: justify;
}

.kindle-word {
  background: rgba(99, 102, 241, 0.12);
  border-bottom: 2px dashed var(--accent-indigo);
  cursor: pointer;
  padding: 0 2px;
  font-weight: 600;
  transition: var(--transition);
}

.kindle-word:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* Kindle Dictionary Popup Panel */
.kindle-popup {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

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

.kindle-popup-header {
  display: flex;
  justify-content: space-between;
  color: #666;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 6px;
  font-weight: bold;
}

.kindle-popup-word {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 2px;
  color: #111;
}

.kindle-popup-details {
  color: #444;
  line-height: 1.4;
}

.kindle-popup-pos {
  font-style: italic;
  color: #888;
  margin-right: 4px;
}

.kindle-popup-close {
  cursor: pointer;
  color: #999;
  font-size: 0.9rem;
}
.kindle-popup-close:hover {
  color: #333;
}

.kindle-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

/* Download Section */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.download-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.download-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
  opacity: 0;
  transition: var(--transition);
}

.download-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--card-shadow), 0 0 20px rgba(99, 102, 241, 0.1);
}

.download-card:hover::before {
  opacity: 1;
}

.card-lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-lang h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.lang-tag {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--accent-teal);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-stats {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-download-btn {
  width: 100%;
  justify-content: center;
}

/* Release Stats Bar */
.release-info-bar {
  grid-column: 1 / -1;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.release-version-tag {
  font-weight: 700;
  color: var(--accent-indigo);
}

.release-loader {
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Architecture section */
.architecture-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
}

.arch-flow-grid {
  display: grid;
  grid-template-columns: 1.2fr auto 1.2fr auto 1.4fr;
  align-items: center;
  gap: 1.5rem;
}

.arch-column {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.arch-column-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-teal);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-align: center;
}

.arch-box {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.arch-box:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.arch-box-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.arch-arrow {
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  font-size: 1.5rem;
  animation: pulseArrow 2s infinite ease-in-out;
}

@keyframes pulseArrow {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50% { transform: translateX(5px); opacity: 1; }
}

.arch-step-badge {
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-indigo);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: bold;
}

/* Ingestion databases grid style */
.ingest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.ingest-item {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.02);
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  border-radius: 4px;
}

/* Kindle Installation Steps */
.install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  position: relative;
}

.install-step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.step-num {
  position: absolute;
  top: -1.5rem;
  left: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.install-step-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-top: 0.5rem;
}

.install-step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.folder-tree {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: var(--accent-teal);
}

/* Local Development Section (Tabs) */
.dev-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-indigo);
  border-bottom-color: var(--accent-indigo);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-pane.active {
  display: block;
}

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

.code-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow-x: auto;
}

.code-block {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.code-comment { color: var(--text-muted); }
.code-cmd { color: var(--accent-teal); }
.code-output { color: #34d399; }

.tab-pane h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.tab-pane p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.tab-pane ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tab-pane li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-pane li::before {
  content: '✓';
  color: var(--accent-teal);
  font-weight: bold;
}

/* Footer styling */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  background: var(--bg-primary);
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
}

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

.badge-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .badge, .hero-ctas {
    align-self: center;
    justify-content: center;
  }
  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arch-flow-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .arch-arrow {
    transform: rotate(90deg);
    animation: pulseArrowVertical 2s infinite ease-in-out;
  }
  @keyframes pulseArrowVertical {
    0%, 100% { transform: rotate(90deg) translateX(0); opacity: 0.4; }
    50% { transform: rotate(90deg) translateX(5px); opacity: 1; }
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2.75rem;
  }
  .download-grid {
    grid-template-columns: 1fr;
  }
  .install-steps {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  .dev-container {
    padding: 1.5rem;
  }
  .tabs-nav {
    flex-wrap: wrap;
  }
  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
