/* ═══════════════════════════════════════════════════════════════════
   STOAIX — kayan duyuru bandı (nav'ın üstü)
   İşaretleme: tools/v2-chrome.mjs → ticker(). Davranış: js/ticker.js.
   Hem v2.css hem pricing.css sayfalarında çalışır; bu yüzden tema
   tokenlarına yaslanmaz, kendi renkleriyle kendi kendine yeter.

   Renk sabit marka mavisi (#2340F0): ink temasının #4F7BFF'i üzerinde
   beyaz küçük metin AA kontrastını geçmiyor, #2340F0 geçiyor (~6.5:1).

   Sayfaya yapışır ama okumayı bölmez: aşağı kaydırırken gizlenir,
   yukarı kaydırınca (menü arayan kullanıcı) geri gelir. Görünür bant
   yüksekliği --tk-off olarak köke yazılır; başka yapışkan öğeler
   (fiyat tablosu başlığı) top: var(--tk-off, 0px) ile altına oturur.

   "Canlı" hissi dört katmandan gelir, hepsi yalnız transform/opacity:
     1. rozette kalp atışı (lub-dub + yayılan halka)
     2. ayraç işaretlerinde sırayla nefes alan dalga
     3. ara ara bandın üstünden geçen ışık
     4. js/ticker.js: kaydırma hızına tepki, üzerine gelince yavaşlayıp durma
   Hareket azaltma tercihinde hepsi kapanır, mesajlar sırayla değişir.
   ═══════════════════════════════════════════════════════════════════ */

.tk {
  --tk-h: 36px;
  --tk-bg: #2340F0;
  --tk-bg2: #1A31CF;
  /* Akıllı yapışkan: tepeye yapışır; js/ticker.js aşağı kaydırırken
     .tk-hide ile yukarı kaydırır, yukarı kaydırınca geri getirir.
     z-index: içerikten üstte, mobil menüden (40) ve popup'tan (60) altta. */
  position: sticky;
  top: 0;
  z-index: 30;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  height: var(--tk-h);
  overflow: hidden;
  background: var(--tk-bg);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter v2", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.tk-hide { transform: translateY(-100%); }
.tk-stuck { box-shadow: 0 8px 22px -12px rgba(0,0,0,.55); }

/* 3 — ışık */
.tk::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.12) 50%, transparent 62%);
  transform: translateX(-100%);
  animation: tk-sheen 12s cubic-bezier(.45,0,.2,1) 2.5s infinite;
}

/* ─── Rozet ─────────────────────────────────────────────────────── */
.tk-badge {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px 0 max(18px, env(safe-area-inset-left));
  background: var(--tk-bg2);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* rozetten akan bölüme yumuşak geçiş */
.tk-badge::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: -28px;
  width: 28px;
  background: linear-gradient(90deg, var(--tk-bg2), rgba(26,49,207,0));
  pointer-events: none;
}

/* 1 — kalp atışı */
.tk-pulse {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: tk-beat 1.6s ease-in-out infinite;
}
.tk-pulse::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.85);
  animation: tk-ring 1.6s ease-out infinite;
}

/* ─── Akan bölüm ────────────────────────────────────────────────── */
.tk-view {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 56px), transparent);
}
.tk-track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
  /* JS yoksa da akar; JS varsa Web Animations ile devralır (hız kontrolü). */
  animation: tk-scroll 90s linear infinite;
}
.tk-on .tk-track { animation: none; }

.tk-list {
  display: flex;
  align-items: center;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tk-list li {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 520;
  letter-spacing: .005em;
  line-height: 1;
  color: rgba(255,255,255,.93);
}

/* 2 — nefes alan ayraçlar; gecikme sırayla kaydığı için dalga gibi akar */
.tk-sep {
  flex: none;
  width: 12px;
  height: 12px;
  margin: 0 24px;
  background: url('/assets/v2/stoaix-mark-white.png') center / contain no-repeat;
  opacity: .5;
  animation: tk-breathe 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -.45s);
}

/* Mobilde rozet yalnız nabza iner; marka adı ilk mesajın başına geçer. */
.tk-inl { display: none; }

.tk-demo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(255,255,255,.45);
  text-underline-offset: 4px;
}
.tk-demo:hover { opacity: 1; text-decoration-color: #fff; }
.tk-arr { display: inline-block; transition: transform .25s ease; }
.tk-demo:hover .tk-arr { transform: translateX(3px); }
.tk a:focus-visible, .tk button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* ─── Durdur / başlat (WCAG 2.2.2: hareket eden içerik durdurulabilmeli) ─ */
.tk-ctl {
  position: relative;
  z-index: 2;
  flex: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--tk-bg);
  color: rgba(255,255,255,.62);
  cursor: pointer;
  transition: color .2s ease;
}
.tk-on .tk-ctl { display: flex; }
.tk-ctl:hover { color: #fff; }
.tk-ctl svg { width: 9px; height: 9px; fill: currentColor; }
.tk-ctl .i-play, .tk-ctl[aria-pressed="true"] .i-pause { display: none; }
.tk-ctl[aria-pressed="true"] .i-play { display: block; }

/* ─── Mobil (Instagram içi tarayıcı dahil) ──────────────────────── */
@media (max-width: 640px) {
  .tk { --tk-h: 32px; }
  .tk-badge { padding: 0 12px 0 max(15px, env(safe-area-inset-left)); }
  .tk-badge::after { right: -18px; width: 18px; }
  .tk-name { display: none; }
  .tk-inl {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
  }
  .tk-inl::after { content: "·"; margin-left: 10px; opacity: .6; letter-spacing: 0; }
  .tk-list li { font-size: 12px; }
  .tk-sep { width: 11px; height: 11px; margin: 0 18px; }
  .tk-view {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 36px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 36px), transparent);
  }
  .tk-ctl { width: 34px; padding-right: env(safe-area-inset-right); }
}

/* ─── Hareket azaltma: akış yok, mesajlar yerinde sırayla değişir ── */
@media (prefers-reduced-motion: reduce) {
  .tk::after, .tk-pulse, .tk-pulse::after, .tk-sep, .tk-track { animation: none; }
  .tk { transition: none; }
  .tk-list[aria-hidden] { display: none; }
  .tk-list li { display: none; }
  /* JS yoksa ilk mesaj sabit durur; JS (.tk-rot) sırayla .on verir. */
  .tk-list:not(.tk-rot) li:first-child, .tk-rot li.on { display: flex; }
  .tk-rot li.on { animation: tk-fade .5s ease; }
}

@keyframes tk-scroll  { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@keyframes tk-sheen   { 0% { transform: translateX(-100%); } 30%, 100% { transform: translateX(100%); } }
@keyframes tk-beat    { 0%, 40%, 100% { transform: scale(1); } 8% { transform: scale(1.4); } 18% { transform: scale(1); } 26% { transform: scale(1.25); } }
@keyframes tk-ring    { 0% { transform: scale(1); opacity: .85; } 60%, 100% { transform: scale(3.4); opacity: 0; } }
@keyframes tk-breathe { 0%, 100% { opacity: .38; transform: scale(.86); } 50% { opacity: .92; transform: scale(1.04); } }
@keyframes tk-fade    { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
