/* ============================================
   UX Master — Landing Page Styles
   Organized: Reset → Typography → Layout →
   Components → Animations → Responsive
   ============================================ */

/* --- Reset & Base --- */
* {
  box-sizing: border-box;
}

html,
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #09090b;
  color: #fafafa;
  overflow-x: hidden;
  max-width: 100vw;
}

code,
pre {
  overflow-wrap: break-word;
  word-break: break-all;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: #09090b;
}

::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.stat-value {
  font-variant-numeric: tabular-nums;
}

.quote-mark {
  font-size: 4rem;
  line-height: 1;
  color: rgba(124, 58, 237, .2);
  font-family: Georgia, serif;
}

/* --- Navigation --- */
.nav-glass {
  background: rgba(9, 9, 11, .75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .06);
}

.mobile-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all .35s cubic-bezier(.16, 1, .3, 1);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #a1a1aa;
  border-radius: 1px;
  transition: all .3s ease;
}

/* --- Language Dropdown --- */
.lang-dropdown {
  position: relative;
}

.lang-trigger {
  font-family: ui-monospace, monospace;
  color: #a1a1aa;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

.lang-trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(24, 24, 27, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0.75rem;
  padding: 4px;
  z-index: 100;
  box-shadow: 0 8px 40px -8px rgba(0, 0, 0, .6);
}

.lang-menu.open {
  display: block;
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
}

.lang-menu button:hover {
  background: rgba(124, 58, 237, .12);
  color: #fff;
}

.lang-menu button.active {
  background: rgba(124, 58, 237, .15);
  color: #a78bfa;
}

/* --- Hero --- */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  width: 900px;
  height: 900px;
  top: -300px;
  left: -200px;
  background: radial-gradient(circle, rgba(124, 58, 237, .15) 0%, transparent 70%);
  animation: f1 18s ease-in-out infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(236, 72, 153, .1) 0%, transparent 70%);
  animation: f2 22s ease-in-out infinite;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 30%, transparent 100%);
}

/* --- Decorative Lines --- */
.glow-line {
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, .3), rgba(236, 72, 153, .2), transparent);
  height: 1px;
}

/* --- Cards --- */
.glass-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: all .4s cubic-bezier(.16, 1, .3, 1);
}

.glass-card:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(124, 58, 237, .25);
  box-shadow: 0 8px 60px -12px rgba(124, 58, 237, .15);
  transform: translateY(-4px);
}

.before-card {
  background: rgba(239, 68, 68, .04);
  border: 1px solid rgba(239, 68, 68, .15);
}

.after-card {
  background: rgba(16, 185, 129, .04);
  border: 1px solid rgba(16, 185, 129, .2);
}

/* --- Pills & Buttons --- */
.persona-pill {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: all .3s ease;
}

.persona-pill:hover {
  background: rgba(124, 58, 237, .1);
  border-color: rgba(124, 58, 237, .3);
  transform: scale(1.02);
}

.cta-primary {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  position: relative;
  overflow: hidden;
}

.cta-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.cta-primary:hover::after {
  opacity: 1;
}

.share-btn {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .3s ease;
}

.share-btn:hover {
  background: rgba(124, 58, 237, .15);
  border-color: rgba(124, 58, 237, .4);
  transform: scale(1.05);
}

/* --- Steps --- */
.step-ring {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .15), rgba(236, 72, 153, .1));
  border: 2px solid rgba(124, 58, 237, .3);
}

/* --- Glow Effects --- */
.glow-purple {
  box-shadow: 0 0 80px -20px rgba(124, 58, 237, .35);
}

/* --- Animations --- */
@keyframes f1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(80px, 60px) scale(1.1);
  }
}

@keyframes f2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-60px, -40px) scale(1.05);
  }
}

@keyframes fb {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.float-badge {
  animation: fb 3s ease-in-out infinite;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all .7s cubic-bezier(.16, 1, .3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: .1s;
}

.reveal-delay-2 {
  transition-delay: .2s;
}

.reveal-delay-3 {
  transition-delay: .3s;
}

/* --- Responsive --- */
@media (max-width: 639px) {
  .section-pad {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .section-title-mb {
    margin-bottom: 2.5rem;
  }

  .mobile-code-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-code-scroll code {
    white-space: nowrap;
    word-break: normal;
  }
}

@media (min-width: 640px) {
  .section-pad {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .section-title-mb {
    margin-bottom: 4rem;
  }
}

/* --- Telegram Magic Section --- */
.magic-container {
  display: flex;
  background: #17212b;
  /* Telegram Dark Theme BG */
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .05);
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .5);
  height: 500px;
}

.magic-sidebar {
  width: 260px;
  background: #17212b;
  border-right: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  flex-direction: column;
}

.magic-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.magic-sidebar-item {
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.magic-sidebar-item:hover {
  background: rgba(255, 255, 255, .03);
}

.magic-sidebar-item.active {
  background: #2b5278;
  /* Telegram Active Item color */
}

.case-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.case-info {
  overflow: hidden;
}

.case-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-status {
  font-size: 0.75rem;
  color: #8fa6b2;
}

.magic-chat {
  flex: 1;
  background: #0e1621;
  /* Telegram Pattern BG area */
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-45c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm26 18c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm16 18c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zM24 46c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm34 26c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm-18-24c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zM66 6c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd' text-rendering='optimizeLegibility'/%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
}

.magic-chat-header {
  background: #17212b;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.magic-chat-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.magic-chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tg-bubble {
  max-width: 85%;
  position: relative;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.tg-bubble.user {
  align-self: flex-end;
  background: #2b5278;
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.tg-bubble.ai {
  align-self: flex-start;
  background: #182533;
  color: #fff;
  border-bottom-left-radius: 0.25rem;
}

.tg-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, .5);
}

.tg-time {
  font-family: ui-monospace, monospace;
}

.tg-check {
  display: flex;
  color: #40a7e3;
}

.ai-inner-card {
  background: rgba(124, 58, 237, .1);
  border: 1px solid rgba(124, 58, 237, .2);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
}

.ai-inner-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
}

.dot {
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, .4);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-4px);
  }
}

@media (max-width: 639px) {
  .magic-container {
    flex-direction: column;
    height: auto;
  }

  .magic-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
  }

  .magic-sidebar-header {
    display: none;
  }

  .magic-sidebar-item {
    padding: 0.75rem;
    flex-shrink: 0;
  }

  .case-info {
    display: none;
  }

  .magic-chat {
    height: 400px;
  }
}

.bg-claw {
  background-color: #7c3aed;
}

.bg-magic {
  background-color: #ec4899;
}