/* Base */
:root {
  --bg: #000;
  --fg: #ffffff;
  --muted: #9aa0a6;
  --primary: #6c7cff;
  --glass: rgba(255,255,255,0.04);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* Typography helpers */
.fw-extrabold { font-weight: 800; }

/* Headings use Sofia Sans */
h1, h2, h3, h4, h5, h6 { font-family: 'Sofia Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; font-variant-ligatures: normal; font-feature-settings: "locl" 1; }

/* Sections */
.section-xl { padding: 96px 0; }
.section-xxl { padding: 140px 0 120px; }

/* Section min heights */
.section-xl, .section-xxl { min-height: 100vh; }

@media (max-width: 767.98px) {
  .section-xl { padding: 72px 0; }
  .section-xxl { padding: 120px 0 96px; }
}

/* Navbar glass */
.nav-glass {
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.35));
  background-color: rgba(0,0,0,0.35);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 1030;
}
.nav-glass .navbar-brand { letter-spacing: 0.2px; }
.brand-dot {
  display: inline-block;
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary), #4252ff);
  box-shadow: 0 0 24px rgba(108,124,255,0.7);
}

@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .nav-glass {
    background: rgba(0,0,0,0.85);
  }
}

/* Placeholder visuals */
.placeholder-block {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.08);
}
.placeholder-wide {
  height: 320px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.08);
}

/* Accordion subtle bg on dark */
.bg-dark-subtle-opaque {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
}
.accordion-button { background: transparent; color: #fff; font-size: 1.8rem; }
.accordion-button:focus { box-shadow: none; }
.accordion-button:not(.collapsed) {
  color: #fff;
  background: rgba(255,255,255,0.03);
}
.accordion-body { color: var(--muted) !important; font-size: 1.2rem !important; }

/* Fix accordion border flash in dark theme */
.accordion {
  --bs-accordion-border-color: rgba(255,255,255,0.06);
  --bs-accordion-bg: transparent;
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-color: #ffffff;
  --bs-accordion-btn-focus-border-color: rgba(255,255,255,0.10);
  --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-active-bg: rgba(255,255,255,0.03);
  --bs-accordion-active-color: #ffffff;
}

/* Pricing gradient background */
.gradient-bg {
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 100%, rgba(108,124,255,0.35) 0%, rgba(108,124,255,0.08) 45%, rgba(0,0,0,0) 70%),
              linear-gradient(180deg, rgba(108,124,255,0.08) 0%, rgba(0,0,0,0) 40%);
  pointer-events: none;
}

/* Buttons */
.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: #5a69ff;
  --bs-btn-hover-border-color: #5a69ff;
  --bs-btn-active-bg: #4e5cff;
  --bs-btn-active-border-color: #4e5cff;
}

.lead { color: var(--muted); }
.text-secondary { color: var(--muted) !important; font-size: 1.0rem }

/* Footer subtle border */
footer { background: #050505; }

/* Utilities */
html { scroll-behavior: smooth; }
.section-xl, .section-xxl { scroll-margin-top: 80px; }
.navbar .nav-link { opacity: .85; transition: opacity .2s ease; }
.navbar .nav-link:hover { opacity: 1; }

/* Hero vertical alignment */
#hero { display: flex; align-items: center; }
/* Pricing vertical alignment */
#pricing { display: flex; align-items: center; }

/* Responsive typography scale */
body { font-size: clamp(16px, 0.9vw + 0.25rem, 18px); line-height: 1.6; }

/* Typography overrides with breakpoints (predictable desktop sizes) */
.display-5, h1 { font-size: 3.0rem !important; line-height: 1.0; }
.h2, h2 { font-size: 2.8rem !important; line-height: 1.0 !important; font-weight: 900 !important; }
.lead { font-size: 1.1rem; }


@media (max-width: 767px) {
  .btn {font-size: 1.0rem;}
  .accordion-header, h3 {font-size: 1.0rem !important;}
  .accordion-body {font-size: 1.0rem !important;}
  .accordion-button {font-size: 1.4rem;}
  .text-secondary { font-size: 1.2rem !important; }
}

@media (min-width: 768px) {
  .display-5, h1 { font-size: 4.2rem !important; }
  .h2, h2 { font-size: 4.0rem !important; font-weight: 900 !important; }
  .lead { font-size: 1.3rem !important; line-height: 1.4 !important; }
  .text-secondary { font-size: 1.2rem; }
}

@media (min-width: 1200px) {
  .display-5, h1 { font-size: 4.2rem !important; line-height: 1.0 !important; }
  .h2, h2 { font-size: 4.0rem !important; font-weight: 900 !important; }
  .lead { font-size: 1.3rem !important; }
  .text-secondary { font-size: 1.2rem; }
} 

/* Site max width and centering */
.container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
  max-width: 1020px !important;
  margin-left: auto;
  margin-right: auto;
} 


/* Disable overscroll glow/bounce */
html, body { overscroll-behavior: none; }
body { overscroll-behavior-y: none; } 


/* Digest demo */
#digest-demo { width: 100%;}
#digest-demo .digest-viewport {
  position: relative;
  width: 100%;
  height: 160px; /* фиксированная высота */
  overflow: hidden;
  z-index: 2;
  background: rgb(0, 0, 0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
}
#digest-demo .digest-list {
  position: relative;
  height: 100%;
  list-style: none;
  margin: 0; padding: 0;
}
#digest-demo .digest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  width: 100%;
  position: absolute;
  left: 0; right: 0;
  top: 0;
  opacity: 1;
  will-change: top, opacity;
  color: #ffffff;
}
#digest-demo .digest-item + .digest-item { border-top: 1px solid rgba(255,255,255,0.06); }
#digest-demo .digest-avatar {
  flex: 0 0 14px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary), #4252ff);
  box-shadow: 0 0 12px rgba(108,124,255,0.6);
}
#digest-demo .digest-title { font-weight: 700; letter-spacing: 0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#digest-demo .digest-meta { display: none; }

/* Enter/exit transitions kept lightweight */
#digest-demo .digest-item.enter {
  opacity: 0;
}
#digest-demo .digest-item.enter-active {
  transition: top 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out;
  opacity: 1;
}
#digest-demo .digest-item.shift { transition: top 420ms cubic-bezier(0.22, 1, 0.36, 1); }
#digest-demo .digest-item.exit { transition: opacity 220ms ease-in; opacity: 0; }

#digest-demo .stream-viewport {
  position: relative;
  width: 90%;
  height: 160px;
  margin-top: 0;
  overflow: visible;
  z-index: 1;
  margin: auto;
}
#digest-demo .stream-post {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  margin: 0;
  padding: 16px 16px 20px;
  background: rgba(0, 0, 0, 0.616);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  will-change: transform, opacity;
  transform: translateY(110%);
  opacity: 0.95;
  max-height: 280px;
}
#digest-demo .stream-post.animate {
  animation: streamTravel var(--stream-travel, 5s) linear forwards;
}
@keyframes streamTravel {
  from { transform: translateY(110%); }
  to { transform: translateY(-120%); }
}
/* Remove old enter/exit effects for stream if present */
#digest-demo .stream-post.enter,
#digest-demo .stream-post.enter-active,
#digest-demo .stream-post.exit-active { transition: none; }

#digest-demo .digest-title { font-weight: 700; letter-spacing: 0.1px; }
#digest-demo .digest-meta { color: var(--muted); font-size: 0.95rem; }
#digest-demo .post-title { font-weight: 700; font-size: 1.15rem; }
#digest-demo .post-text { color: var(--muted); }

/* Контейнер без фона/рамки */
#digest-demo { 
    background: #7e98ff;
    border: 1px solid #ffffff1a;
    overflow: hidden;
    border-radius: 16px;
 }

/* Адаптивная высота для 3 строк дайджеста */
@media (min-width: 768px) {
  #digest-demo .digest-viewport { height: 160px; }
  #digest-demo .stream-viewport { height: 160px; }
}
@media (min-width: 1200px) {
  #digest-demo .digest-viewport { height: 160px; }
  #digest-demo .stream-viewport { height: 160px; }
}

/* Предпочтение уменьшенной анимации */
@media (prefers-reduced-motion: reduce) {
  #digest-demo .digest-item,
  #digest-demo .stream-post { transition: none !important; animation: none !important; }
  #digest-demo .stream-post.animate { animation: none !important; }
} 

/* Skeleton for stream posts */
#digest-demo .skeleton {
  position: relative;
  overflow: hidden;
}
#digest-demo .skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
}
#digest-demo .skeleton-line.sm { height: 10px; }
#digest-demo .skeleton-line.lg { height: 14px; }
#digest-demo .skeleton-gap { height: 10px; }
#digest-demo .skeleton .shimmer::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 48%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
} 

/* Chats demo */
#chats-demo { width: 100%; background-color: #7e98ff; border-radius: 14px; border: 1px solid #7e98ff;}
#chats-demo .chats-summary-viewport {
  position: relative;
  width: 100%;
  height: 164px;
  overflow: hidden;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background-color: #000;
}
#chats-demo .chats-summary-list {
  position: relative;
  height: 100%;
  list-style: none;
  margin: 0; padding: 0;
}
#chats-demo .chats-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  width: 100%;
  position: absolute;
  left: 0; right: 0;
  top: 0;
  opacity: 1;
  will-change: top, opacity;
  color: #ffffff;
}
#chats-demo .chats-summary-item + .chats-summary-item { border-top: 1px solid rgba(255,255,255,0.06); }
#chats-demo .chats-summary-avatar {
  flex: 0 0 14px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary), #4252ff);
  box-shadow: 0 0 12px rgba(108,124,255,0.6);
}
#chats-demo .chats-summary-title { font-weight: 700; letter-spacing: 0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Enter transitions */
#chats-demo .chats-summary-item.enter { opacity: 0; }
#chats-demo .chats-summary-item.enter-active {
  transition: top 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out;
  opacity: 1;
}
#chats-demo .chats-summary-item.shift { transition: top 420ms cubic-bezier(0.22, 1, 0.36, 1); }

#chats-demo .chats-stream-viewport {
  position: relative;
  width: 100%;
  height: 180px;
  margin-bottom: 10px;
  overflow: visible;
  z-index: 1;
}

/* Bubble comments */
#chats-demo .chat-bubble {
  position: absolute;
  left: 12px; top: 0;
  transform: translate(0, -30%) scale(0.8);
  opacity: 0;
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.95rem;
  max-width: 70%;
  will-change: transform, opacity;
}
#chats-demo .chat-bubble .line { height: 10px; border-radius: 6px; background: rgba(255,255,255,0.16); margin: 6px 0; }
#chats-demo .chat-bubble .line.sm { width: 60%; }
#chats-demo .chat-bubble .line.md { width: 84%; }
#chats-demo .chat-bubble .line.lg { width: 92%; }

#chats-demo .chat-bubble.dir-left { transform-origin: left top; }
#chats-demo .chat-bubble.dir-right { transform-origin: right top; }

/* Float in oscillation */
#chats-demo .chat-bubble.float-in {
  animation: bubbleFloatIn 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes bubbleFloatIn {
  0% { opacity: 0; transform: translate(0, -30%) scale(0.85) rotate(-6deg); }
  100% { opacity: 1; transform: translate(var(--x, 0), var(--y, -20%)) scale(1) rotate(var(--rot, 0deg)); }
}

/* Flocking to summary */
#chats-demo .chat-bubble.flock {
  animation: bubbleFlock 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes bubbleFlock {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.9) rotate(0deg); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #chats-demo .chat-bubble, #chats-demo .chats-summary-item { transition: none !important; animation: none !important; }
} 

/* Chats demo refinements */
#chats-demo .chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: clamp(220px, 66%, 420px);
  background: #0b0b0b;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
#chats-demo .chat-avatar {
  flex: 0 0 22px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary), #4252ff);
  box-shadow: 0 0 10px rgba(108,124,255,0.6);
  margin-top: 2px;
}
#chats-demo .bubble-content { flex: 1 1 auto; min-width: 0; }
#chats-demo .chat-bubble .line { position: relative; overflow: hidden; }
#chats-demo .chat-bubble .line.shimmer::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 48%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}
#chats-demo .chat-bubble.dir-right { flex-direction: row; }
#chats-demo .chat-bubble.dir-right .bubble-content { text-align: left; }
#chats-demo .chat-bubble, #chats-demo .chat-bubble.dir-left, #chats-demo .chat-bubble.dir-right { transform-origin: left top; }

/* Fix flock animation start to use current position */
@keyframes bubbleFlock {
  0% { opacity: 1; transform: translate(var(--x, 0), var(--y, 0)) scale(1) rotate(var(--rot, 0deg)); }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.9) rotate(0deg); }
} 