/* Language Toggle & Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.lang-link {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.lang-link:hover {
  color: var(--brand);
  background: var(--bg-alt);
}

.lang-link.active {
  color: var(--brand);
  background: var(--bg-alt);
}

.lang-separator {
  color: var(--border);
  font-weight: 300;
}



@media (max-width: 900px) {
  .header-actions {
    gap: 15px;
  }
  
  .language-toggle {
    font-size: 0.85rem;
    gap: 6px;
  }
  
  .lang-link {
    padding: 3px 6px;
  }
}

/* Brand Link Styling */
a.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

a.brand:hover {
  opacity: 0.8;
}

/* Screenshot card label always top-left */
.card-frame {
  position: relative;
}

.screenshot-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: linear-gradient(135deg, #f3f4f6 80%, #ede9fe 100%);
  color: #5b21b6;
  font-size: 1rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(139,92,246,0.08);
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 600px) {
  .screenshot-label {
    font-size: 0.95rem;
    padding: 5px 12px;
    top: 8px;
    left: 8px;
    border-radius: 8px;
  }
}
/* Lightbox Overrides */
.lightbox-content {
  max-width: 850px !important;
  width: 90vw !important;
  max-height: 85vh !important;
}

.lightbox-close {
  top: 8px !important; 
  right: 8px !important;
  width: 28px !important; 
  height: 28px !important;
  font-size: 16px !important;
}

.lightbox-image {
  flex: 1 !important;
  padding: 20px !important;
  min-height: auto !important;
}

.lightbox-screenshot {
  max-height: 65vh !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.lightbox-info {
  padding: 12px 20px !important;
  flex-shrink: 0 !important;
}

.lightbox-info h3 {
  font-size: 1rem !important;
}

/* Detail Panel Overrides: image on top, text below, smaller header */
.detail-content {
  max-width: 900px !important;
  width: 92vw !important;
}

.detail-header {
  padding: 12px 16px !important;
  gap: 10px !important;
}

.detail-icon {
  font-size: 1.4rem !important;
  padding: 8px !important;
  border-radius: 10px !important;
}

.detail-header h2 {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
}

.detail-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  padding: 20px !important;
}

.detail-image-container {
  width: 100% !important;
  max-height: 50vh !important;
  padding: 16px !important;
}

.detail-image-container img {
  max-height: 45vh !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

.detail-info {
  gap: 16px !important;
}

.detail-footer {
  padding: 16px 20px !important;
}

/* Pretty background for the main text under the image */
.detail-info p {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 20px 20px 20px 28px !important;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  position: relative !important;
  line-height: 1.6 !important;
  font-size: 15px !important;
  color: #475569 !important;
}

.detail-info p::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  opacity: 1;
}

/* Intro row: description + CTA button */
.detail-intro-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 16px;
}

.detail-try-btn {
  white-space: nowrap;
  height: auto;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25), 0 1px 3px rgba(139, 92, 246, 0.1) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
}

.detail-try-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3), 0 2px 6px rgba(139, 92, 246, 0.15) !important;
  background: linear-gradient(135deg, #9333ea 0%, #8b5cf6 100%) !important;
}

.detail-try-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2) !important;
}

.detail-try-btn:focus-visible {
  outline: 3px solid rgba(139, 92, 246, 0.4);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  /* Hide icons in modal (detail panel) titles on mobile */
  .detail-header .detail-icon { display: none !important; }

  /* Hero ecosystem mobile fixes: stack modules, prevent overlap */
  .hero-ecosystem .ecosystem-container {
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    justify-items: center !important;
    align-items: start !important;
    margin-top: 10px !important;
    padding: 0 8px !important;
  }

  .hero-ecosystem .feature-module {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 360px !important;
  }

  .hero-ecosystem .ai-module,
  .hero-ecosystem .main-module,
  .hero-ecosystem .progress-module {
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  .hero-ecosystem .feature-module:hover,
  .hero-ecosystem .main-module:hover {
    transform: none !important;
  }

  .hero-ecosystem .main-module:hover .mockup-frame img {
    transform: none !important;
  }

  .hero-ecosystem .mockup-frame.main-frame { max-width: 360px !important; }
  .hero-ecosystem .mockup-frame { max-width: 320px !important; }

  .detail-info p { 
    padding: 16px 16px 16px 24px !important; 
    font-size: 14px !important;
  }
  .detail-info p::before { left: 10px; top: 12px; bottom: 12px; }
  .detail-intro-row { 
    grid-template-columns: 1fr; 
    gap: 14px; 
    align-items: stretch;
  }
  .detail-try-btn { 
    width: 100%; 
    min-height: 52px;
    font-size: 15px;
  }
}

@media (prefers-color-scheme: dark) {
  .detail-info p {
    background: linear-gradient(135deg, #0f1629 0%, #1e293b 100%) !important;
    border-color: rgba(255,255,255,0.1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    color: #cbd5e1 !important;
  }
  
  .detail-try-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2), 0 1px 3px rgba(139, 92, 246, 0.1) !important;
  }
  
  .detail-try-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25), 0 2px 6px rgba(139, 92, 246, 0.15) !important;
  }
}

/* ===================== */
/* Mobile Nav (Hamburger)*/
/* ===================== */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--bg, #fff);
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.hamburger:focus-visible { outline: 3px solid rgba(139,92,246,.35); outline-offset: 2px; }
.hamburger-icon { stroke: var(--foreground, #111827); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.hamburger .line { transition: transform .25s ease, opacity .2s ease; }
.hamburger.active .line1 { transform: translateY(5px) rotate(45deg); transform-origin: 12px 12px; }
.hamburger.active .line2 { opacity: 0; }
.hamburger.active .line3 { transform: translateY(-5px) rotate(-45deg); transform-origin: 12px 12px; }

.mobile-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
  z-index: 60;
}
.mobile-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 360px);
  background: var(--bg, #fff);
  border-left: 1px solid var(--border, #e5e7eb);
  transform: translateX(100%);
  transition: transform .28s ease;
  z-index: 70;
  box-shadow: -8px 0 24px rgba(2,6,23,0.12);
}
.mobile-menu.active { transform: translateX(0); }

.mobile-menu-inner { display: flex; flex-direction: column; height: 100%; padding: 16px; gap: 16px; }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; }
.mobile-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-weight: 800; letter-spacing: .2px; }
.mobile-brand-logo { border-radius: 8px; box-shadow: 0 1px 3px rgba(2,6,23,0.08); }
.mobile-close { background: transparent; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--foreground, #111827); }
.mobile-links { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.mobile-links a { padding: 12px 10px; border-radius: 10px; text-decoration: none; color: var(--foreground, #111827); font-weight: 600; }
.mobile-links a:hover { background: var(--bg-alt, #f3f4f6); }
.mobile-extra { margin-top: auto; display: grid; gap: 12px; }
.mobile-cta { text-align: center; }

/* Layout swaps on small screens */
@media (max-width: 900px) {
  .header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
  .hamburger { display: inline-flex; order: 2; justify-self: end; }
  .nav { display: none; }
  .header-actions { display: none; }
}

@media (prefers-color-scheme: dark) {
  .hamburger { background: #0b1220; border-color: rgba(255,255,255,0.08); }
  .hamburger-icon { stroke: #e5e7eb; }
  .mobile-menu { background: #0b1220; border-color: rgba(255,255,255,0.1); box-shadow: -8px 0 24px rgba(0,0,0,0.4); }
  .mobile-links a:hover { background: rgba(255,255,255,0.06); }
}
