/* ===== BA CASE — shared CSS (put once) ===== */
.ba-case, .ba-case *{
  font-family:"Ubuntu",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans";
}

/* backgrounds */
.ba-case{
  --text:#fff;
  --muted:rgba(255,255,255,.72);
  --muted2:rgba(255,255,255,.60);
  --bd:rgba(255,255,255,.12);
  --radius:22px;

  position:relative;
  width:100%;
  min-height: 100svh;
  overflow:hidden;
  color:var(--text);
  background:#0e0f12;
  padding: clamp(18px,4vw,44px) clamp(14px,4vw,40px);
  box-sizing:border-box;
}
.ba-bg{
  position:absolute; inset:0;
  background:center/cover no-repeat;
  z-index:0;
  will-change: opacity;
  transition: opacity .9s ease;
  transform: translateZ(0);
}
.ba-veil{
  position:absolute; inset:0; z-index:1;
  pointer-events:none;
  background:
    linear-gradient(
      to bottom,
      rgba(7,36,66,0.65) 0%,
      rgba(7,36,66,0.35) 30%,
      rgba(254,255,239,0.08) 65%,
      rgba(254,255,239,0.22) 100%
    );
}

/* layout */
.ba-inner{
  position:relative;
  z-index:2;
  max-width: 1180px;
  margin: 0 auto;
  display:grid;
  gap:16px;
  padding-top: 70px;
}

/* sticky switch */
.ba-sticky{
  position: sticky;
  top: 12px;
  z-index: 20;
  display:flex;
  justify-content:center;
  padding-top: 4px;
  pointer-events:none;
}
.ba-switchbar{
  pointer-events:auto;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.ba-label{
  font-weight:800;
  font-size:14px;
  letter-spacing:.2px;
  color: rgba(255,255,255,.7);
  transition: color .25s ease, transform .25s ease;
  user-select:none;
  white-space:nowrap;
}
.ba-case[data-mode="before"] .ba-label--left{ color:#fff; transform: translateY(-.5px); }
.ba-case[data-mode="after"]  .ba-label--right{ color:#fff; transform: translateY(-.5px); }

.ba-switch{ border:0; background: transparent; padding:0; cursor:pointer; line-height:0; }
.ba-track{
  width: 66px; height: 36px; border-radius: 999px;
  background: rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.18);
  display:inline-flex; align-items:center;
  position:relative;
  transition: background .25s ease, border-color .25s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.ba-knob{
  width: 30px; height: 30px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  position:absolute; left: 3px; top: 50%;
  transform: translateY(-50%);
  transition: left .28s cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 8px 18px rgba(0,0,0,.22), inset 0 0 0 1px rgba(0,0,0,.14);
  display:grid; place-items:center;
}
.ba-knobIcon{
  width: 10px; height: 10px; border-radius: 3px;
  background: rgba(0,0,0,.22);
  box-shadow: 0 0 0 6px rgba(0,0,0,.06);
  transition: background .25s ease, box-shadow .25s ease;
}
.ba-case[data-mode="after"] .ba-track{
  background: rgba(34,197,94,.22);
  border-color: rgba(34,197,94,.35);
}
.ba-case[data-mode="after"] .ba-knob{ left: 33px; }
.ba-case[data-mode="after"] .ba-knobIcon{
  background: rgba(34,197,94,.75);
  box-shadow: 0 0 0 6px rgba(34,197,94,.18);
}

/* panels */
.ba-panel{
  border-radius: var(--radius);
  border:1px solid var(--bd);
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
  overflow:hidden;
}
.ba-head{ padding: 18px 18px 8px; }
.ba-title{
  margin:0;
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 900;
  letter-spacing: .1px;
}
.ba-sub{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  max-width: 72ch;
}

/* AFTER: убрать ТОЛЬКО галочку */
.ba-case[data-mode="after"] .ba-highlightIcon{ display:none !important; }

.ba-body{
  padding: 14px 18px 18px;
  display:grid;
  gap: 14px;
  align-items:start;
}
.ba-body--before{ grid-template-columns: 1.15fr .85fr; }
.ba-body--after{ grid-template-columns: 1.05fr .95fr; }

.ba-text p{
  margin:0 0 12px;
  color: rgba(255,255,255,.88);
  line-height:1.42;
  font-size: 14px;
}

.ba-list{
  margin: 10px 0 0;
  padding: 0;
  list-style:none;
  display:grid;
  gap:10px;
}
.ba-list li{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.32;
}
.ba-dot{
  width:10px; height:10px; border-radius:999px; margin-top: 4px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.ba-dot--ok{
  background: rgba(34,197,94,.85);
  box-shadow: 0 0 0 4px rgba(34,197,94,.16);
}

/* quote */
.ba-quote{
  margin: 14px 0 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,212,122,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,212,122,.22);
  position:relative;
  overflow:hidden;
}
.ba-quoteMark{
  position:absolute;
  top: 10px; left: 12px;
  font-size: 22px;
  opacity: .7;
  color: rgba(255,212,122,.95);
}
.ba-quoteText{
  display:block;
  padding-left: 20px;
  color: rgba(255,255,255,.92);
  font-weight: 700;
  line-height: 1.32;
  font-size: 14px;
}

/* chaos */
.ba-noiseCard{
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border:1px dashed rgba(255,255,255,.18);
  padding: 14px;
}
.ba-noiseTitle{
  font-weight: 900;
  font-size: 13px;
  color: rgba(255,255,255,.86);
  margin-bottom: 10px;
}
.ba-noisePills{ display:flex; flex-wrap:wrap; gap:8px; }
.ba-pill{
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.72);
}

/* after highlight */
.ba-highlight{
  display:flex; gap:10px; align-items:flex-start;
  padding: 12px;
  border-radius: 18px;
  background: rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.22);
  margin: 10px 0 8px;
}
.ba-highlightIcon{
  width: 28px; height: 28px; border-radius: 10px;
  display:grid; place-items:center;
  background: rgba(34,197,94,.20);
  border:1px solid rgba(34,197,94,.26);
  font-weight: 900;
}
.ba-highlightText{ color: rgba(255,255,255,.88); font-size: 14px; line-height: 1.32; }
.ba-highlightText b{ color:#fff; }

/* photos */
.ba-photos{
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  padding: 14px;
}
.ba-photosTitle{
  font-weight: 900;
  font-size: 13px;
  color: rgba(255,255,255,.86);
  margin-bottom: 10px;
}
.ba-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
}
.ba-shot{
  margin:0;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  aspect-ratio: 4 / 5;
  display:flex;
  align-items:center;
  justify-content:center;
}
.ba-shot img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center !important;
  transform:none !important;
}

/* video wrapper ONLY */
.ba-afterLeft{
  display:flex;
  flex-direction:column;
  gap: 12px;
  min-height: 100%;
}
.ba-videoDock{
  margin-top:auto;
  align-self:flex-start;
}

/* mode */
.ba-panel--before,
.ba-panel--after{ display:none !important; }
.ba-case[data-mode="before"] .ba-panel--before{ display:block !important; }
.ba-case[data-mode="after"]  .ba-panel--after{ display:block !important; }

/* mobile */
@media (max-width: 860px){
  .ba-inner{ padding-top: 64px; }
  .ba-body--before, .ba-body--after{ grid-template-columns: 1fr; }

  .ba-afterLeft{ order: 1; }
  .ba-photos{ order: 2; }
  .ba-videoDock{ order: 3; margin-top: 10px; }

  .ba-afterLeft{ min-height: initial; }
  .ba-videoDock{ margin-top: 10px; }

  .ba-case{
    --ba-gutter: 10px;
    --ba-right-extra: 4px;
    padding-left:  max(var(--ba-gutter), env(safe-area-inset-left)) !important;
    padding-right: calc(max(var(--ba-gutter), env(safe-area-inset-right)) + var(--ba-right-extra)) !important;
  }

  .ba-inner{ padding-left: 0 !important; padding-right: 0 !important; }
  .ba-panel{ margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; box-sizing: border-box !important; }
}

@media (prefers-reduced-motion: reduce){
  .ba-bg, .ba-track, .ba-knob, .ba-label{ transition:none !important; }
}

/* ===== HERO AVATAR (BEFORE) — fixed: sticks out + correct text reserve ===== */

/* якорь */
.ba-panel--before .ba-head{
  position: relative;
  overflow: visible !important; /* чтобы круг не резался */
}

/* панель тоже не режем */
.ba-case[data-mode="before"] .ba-panel--before{
  overflow: visible !important;
}

/* управление резервом под текст */
.ba-case{
  --ba-hero-avatar-size: 11rem;
  --ba-hero-avatar-right: 24px;

  /* СКОЛЬКО КРУГА ВЫЛЕЗАЕТ НАРУЖУ СПРАВА (влияет на ширину текста!)
     если right отрицательный -20px => outset: 20px
     если right положительный (внутри) => outset: 0px */
  --ba-hero-avatar-outset: 0px;

  --ba-hero-avatar-gap: 14px;

  /* сколько резервируем под текст внутри карточки */
  --ba-hero-avatar-reserve: calc(var(--ba-hero-avatar-size) - var(--ba-hero-avatar-outset));
}

/* резерв под текст (чтобы строки реально пересчитывались) */
.ba-case[data-mode="before"] .ba-panel--before .ba-head{
  padding-right: calc(18px + var(--ba-hero-avatar-reserve) + var(--ba-hero-avatar-gap)) !important;
}

/* круг */
.ba-panel--before .ba-caseAvatar{
  position: absolute;

  /* ВЫЛЕТ СВЕРХУ НАРУЖУ (по умолчанию) */
  top: calc(var(--ba-hero-avatar-size) / -3);
  right: var(--ba-hero-avatar-right);

  width: var(--ba-hero-avatar-size);
  height: var(--ba-hero-avatar-size);
  border-radius: 999px;

  background-color: #0e0f12;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border: var(--ba-hero-avatar-border, 3px) solid rgba(255,255,255,.45);
  box-shadow:
    0 18px 42px rgba(0,0,0,.45),
    0 0 0 var(--ba-hero-avatar-ring, 10px) rgba(255,255,255,.10);

  z-index: 3;
  pointer-events: none;
}

/* в AFTER прячем */
.ba-case[data-mode="after"] .ba-caseAvatar{
  display: none !important;
}

/* чтобы тумблер не пересекался — добавим воздуха сверху всей карточке */
.ba-case[data-mode="before"] .ba-panel--before{
  margin-top: calc(var(--ba-hero-avatar-size) / 5) !important;
}

/* мобилка */
@media (max-width: 860px){
  .ba-case{
    --ba-hero-avatar-size: 9rem;
  }
  .ba-case[data-mode="before"] .ba-panel--before{
    margin-top: calc(var(--ba-hero-avatar-size) / 5) !important;
  }
}

.ba-sticky--bottom{
  position: static !important; /* не липнет */
  top: auto !important;
  padding-top: 16px;          /* воздух над нижним тумблером */
  padding-bottom: 6px;
}

/* ===== bottom switch: mobile only ===== */

/* по умолчанию скрыт (десктоп) */
.ba-sticky--bottom{
  display: none;
}

/* показываем только на мобилке */
@media (max-width: 860px){
  .ba-sticky--bottom{
    display: flex;
  }
}

/* ===== VIDEO CIRCLE: AFTER — desktop only position/scale ===== */
@media (min-width: 861px){

  /* только в режиме AFTER */
  .ba-case[data-mode="after"] .ba-videoDock{
    margin-top: 4rem !important;     /* вместо margin-top:auto (он тащит вниз) */
    align-self: center !important;   /* по центру колонки */
    transform: scale(1.18);          /* крупнее */
    transform-origin: center;
  }

  /* если хочешь ещё выше — просто увеличь отрицательный margin-top */
  /* .ba-case[data-mode="after"] .ba-videoDock{ margin-top: -10px !important; } */

}
