/* ─────────────────────────────────────────────────────────────────────────
 * landing-ru-caps.css
 * ─────────────────────────────────────────────────────────────────────────
 * Capabilities section — Russian landing only (loaded by /ru/index.php).
 * Apple-style 2026: strict, monochrome, hairlines, generous spacing,
 * single accent. No gradients on cards. No shadows on cards. No emojis.
 * ───────────────────────────────────────────────────────────────────────── */

.cap-section {
  /* Section background: a half-shade above page bg, no gradients.
   * Hairline rule above and below glues it to the icon strip and the
   * ChatBuilder demo without competing with them.
   *
   * The dotted grid is a technical, non-decorative texture — anchored to
   * the section's own coordinate system so it stays put while content
   * scrolls. background-attachment:local keeps the dots aligned to the
   * section frame, not the viewport. */
  position: relative;
  background-color: #060606;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 120px 40px 128px;
  overflow: hidden;
}

/* Bottom-anchored fade — kills the dot pattern as it approaches the
 * footer/next section so the seam is a soft black, not a hard texture
 * cut-off. Sits above the dots (z-index implicit by ::after) but below
 * the content (which we lift onto a stacking context via .cap-wrap). */
.cap-section::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1280px;
  background: linear-gradient(
    to top,
    #060606 0%,
    rgba(6, 6, 6, 0.85) 35%,
    rgba(6, 6, 6, 0)   100%
  );
  pointer-events: none;
}

.cap-wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

/* Header structure
 * ─────────────────
 * <header.cap-section-head>
 *   <span.cap-eyebrow>           ← stand-alone label, normal block flow
 *   <div.cap-section-row>        ← single grid row: title | aside
 *      <h2.cap-section-title>
 *      <p.cap-section-aside>
 *
 * The eyebrow is a real block above the row, so it cannot push the aside
 * up or down. Title and aside live in the SAME grid row, so their top
 * edges sit on the same horizontal axis automatically. No magic margins,
 * no baseline math, no ::before spacers. */
.cap-section-head {
  margin-bottom: 72px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cap-eyebrow {
  display: block;
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.cap-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  column-gap: 48px;
  align-items: center;
}
.cap-section-title {
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1.05;
  margin: 0;
  color: #fff;
  max-width: 720px;
}
.cap-section-title em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}
[dir="rtl"] .cap-section-title em {
  display: block;
}
.cap-section-aside {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  max-width: 360px;
  font-weight: 400;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.cap-card {
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 44px 44px 12px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.cap-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cap-card-num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cap-card-num::before {
  content: "";
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}
.cap-card-title {
  font-size: clamp(28px, 2.8vw, 36px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  color: #fff;
  margin: 4px 0 6px;
}
.cap-card-sub {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1px;
  margin: 0;
}

/* ── Video frame ────────────────────────────────────────────────────────── */
.cap-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}
.cap-video video,
.cap-video img.cap-poster,
.cap-video .cap-video-poster,
.cap-video .cap-video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  /* Lock the element to its frame — never let the browser scale it on
   * play (mobile Safari otherwise enlarges video to viewport on first
   * touch). The custom controller below handles play/pause inline; no
   * fullscreen, no picture-in-picture, no remote-playback UI. */
  max-width: 100%;
  max-height: 100%;
  background: #050505;
}
.cap-video .cap-video-poster {
  /* Cover image sits below the play button, above the (still hidden)
   * <video>. Once the user hits play and we flip data-state, the
   * poster fades out to reveal the video stream underneath. */
  z-index: 1;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s ease;
}
.cap-video[data-state="playing"] .cap-video-poster,
.cap-video[data-state="paused"]  .cap-video-poster {
  opacity: 0;
}
.cap-video .cap-video-el {
  /* Hidden until JS flips data-state to "playing". Avoids first-frame
   * flash before metadata loads. Sits above the poster image so the
   * cross-fade reveals the moving frame underneath the static cover. */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}
.cap-video[data-state="playing"] .cap-video-el,
.cap-video[data-state="paused"]  .cap-video-el {
  opacity: 1;
  pointer-events: auto;
}
.cap-video[data-state="playing"] .cap-video-play,
.cap-video[data-state="paused"]  .cap-video-play {
  /* Once playback starts the big centre button is permanently retired:
   * the bottom transport bar takes over (toggle + scrubber + time).
   * Two play buttons in the same frame would dilute the hierarchy. */
  opacity: 0;
  pointer-events: none;
}
/* Strip every native UI affordance Safari/Chrome would otherwise show.
 * The element has no `controls` attribute, but we belt-and-braces every
 * pseudo that could leak a fullscreen / PiP / download button. */
.cap-video .cap-video-el::-webkit-media-controls,
.cap-video .cap-video-el::-webkit-media-controls-enclosure,
.cap-video .cap-video-el::-webkit-media-controls-fullscreen-button,
.cap-video .cap-video-el::-webkit-media-controls-overlay-play-button,
.cap-video .cap-video-el::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* ── Custom transport controls ──────────────────────────────────────────
 *
 * Strict, monochrome, hairline-driven — same vocabulary as the rest of the
 * landing (no shadows, no gradients on the chrome itself, only a soft
 * legibility scrim under the bar). Visible only when the user is actively
 * interacting with the frame (hover / focus-within / paused state).
 * Auto-hides 2 s after the cursor goes still while playing — the JS
 * controller adds `data-controls="visible"` to keep the bar mounted
 * during that grace window. */
.cap-video-controls {
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0)  0%,
    rgba(0, 0, 0, 0.45) 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cap-video[data-state="playing"]:hover               .cap-video-controls,
.cap-video[data-state="playing"]:focus-within        .cap-video-controls,
.cap-video[data-state="playing"][data-controls="visible"] .cap-video-controls,
.cap-video[data-state="paused"]                      .cap-video-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cap-video-toggle {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.cap-video-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
}
.cap-video-toggle:active {
  transform: scale(0.96);
}
.cap-video-toggle [data-lucide],
.cap-video-toggle svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
/* Toggle the right glyph based on data-state. The play icon needs a 1px
 * optical nudge so the triangle visually centres in the circle. */
.cap-video-toggle .cap-icon-play  { display: none; }
.cap-video-toggle .cap-icon-pause { display: inline-flex; }
.cap-video[data-state="paused"] .cap-video-toggle .cap-icon-play  { display: inline-flex; margin-left: 1px; }
.cap-video[data-state="paused"] .cap-video-toggle .cap-icon-pause { display: none; }

/* ── Scrubber (custom, no <input type="range">) ─────────────────────── */
.cap-video-track {
  flex: 1 1 auto;
  height: 28px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  touch-action: none;
}
.cap-video-track-rail {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  transition: height 0.15s ease;
}
.cap-video-track:hover .cap-video-track-rail,
.cap-video-track[data-dragging="true"] .cap-video-track-rail {
  height: 5px;
}
.cap-video-track-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  pointer-events: none;
}
.cap-video-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 2px;
  pointer-events: none;
}
.cap-video-track-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.18s ease;
  pointer-events: none;
}
.cap-video-track:hover .cap-video-track-thumb,
.cap-video-track[data-dragging="true"] .cap-video-track-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* ── Time readout ───────────────────────────────────────────────────── */
.cap-video-time {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cap-video-time-sep { color: rgba(255, 255, 255, 0.32); }
.cap-video-time-dur { color: rgba(255, 255, 255, 0.52); }

/* Video placeholder stays a clean dark surface — the dotted texture now
 * belongs to the whole section, so we don't repeat it inside videos. */
.cap-video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  z-index: 2;
}
.cap-video-play:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
}
.cap-video-play:active {
  transform: translate(0, 1px);
}
.cap-video-play [data-lucide],
.cap-video-play svg {
  width: 22px !important;
  height: 22px !important;
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  margin-left: 2px; /* optical centering of the play triangle */
}

/* ── Features list ──────────────────────────────────────────────────────── */
.cap-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cap-features li {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.cap-features li:first-child {
  border-top: 0;
  padding-top: 6px;
}

.cap-feat-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 211, 102, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.cap-feat-icon [data-lucide],
.cap-feat-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke: #25d366 !important;
  fill: none !important;
  stroke-width: 1.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.cap-feat-text {
  flex: 1;
  min-width: 0;
}
.cap-feat-text h4 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1.35;
  color: #ffffff;
  margin: 0 0 4px;
}
.cap-feat-text p {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  letter-spacing: 0.05px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cap-section { padding: 96px 32px 104px; }
  .cap-card { padding: 36px 32px 10px; gap: 28px; }
  .cap-section-head { margin-bottom: 56px; }
}

@media (max-width: 880px) {
  .cap-section { padding: 80px 20px 88px; }
  .cap-section-head {
    margin-bottom: 40px;
    padding-bottom: 24px;
  }
  .cap-eyebrow { margin-bottom: 14px; }
  .cap-section-row {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
  .cap-section-aside { max-width: 100%; }
  .cap-grid { grid-template-columns: 1fr; gap: 20px; }
  .cap-card { padding: 32px 28px 8px; gap: 24px; border-radius: 20px; }
  .cap-features li { padding: 18px 0; gap: 14px; }
  .cap-feat-text h4 { font-size: 14.5px; }
  .cap-feat-text p { font-size: 13px; }
  .cap-video-play { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  .cap-section { padding: 64px 16px 72px; }
  .cap-card { padding: 26px 22px 6px; border-radius: 18px; }
  .cap-card-title { font-size: clamp(22px, 6vw, 28px); }
  .cap-card-sub { font-size: 13px; }
}
