/* ═══════════════════════════════════════════════════════════
   DENDRA · Görsel İyileştirme Katmanı
   styles.css'ten SONRA yüklenir — styles.css'e dokunmayın
   ═══════════════════════════════════════════════════════════ */

/* ─── 0. Header logo boyutu ──────────────────────────────── */
/*
  height + width:auto yaklaşımı — logo boyutundan bağımsız çalışır.
  max-height: none ile styles.css'teki 82px kısıtlaması kaldırılır.
*/
.site-header .brand.has-wordmark img {
  height: clamp(56px, 5.8vw, 72px);
  width: auto;
  max-width: min(420px, 34vw);
  max-height: none;
}

@media (max-width: 1460px) {
  .site-header .brand.has-wordmark img {
    height: clamp(50px, 5.2vw, 64px);
    max-width: min(360px, 30vw);
    max-height: none;
    width: auto;
  }
}

@media (max-width: 1180px) {
  .site-header .brand.has-wordmark img {
    height: 52px;
    max-width: min(280px, 42vw);
    max-height: none;
    width: auto;
  }
}

@media (max-width: 720px) {
  .site-header .brand.has-wordmark img {
    height: 46px;
    max-width: min(250px, 58vw);
    max-height: none;
    width: auto;
  }
}

@media (max-width: 560px) {
  .site-header .brand.has-wordmark img {
    height: 40px;
    max-width: min(220px, 64vw);
    max-height: none;
    width: auto;
  }
}

@media (max-width: 420px) {
  .site-header .brand.has-wordmark img {
    height: 36px;
    max-width: min(196px, 68vw);
    max-height: none;
  }
}

/* ─── 1. Font rendering kalitesi ─────────────────────────── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─── 2. Yazı seçimi rengi ───────────────────────────────── */
::selection {
  background: rgba(76, 143, 255, 0.18);
  color: var(--primary-strong);
}

/* ─── 3. İnce markalı kaydırma çubuğu ───────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 90, 179, 0.2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 90, 179, 0.44);
}

/* ─── 4. Buton etkileşimleri — yaylı geçiş ──────────────── */
.button,
.button-secondary,
.button-quiet,
.menu-toggle {
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 180ms ease,
    box-shadow 210ms ease,
    color 170ms ease,
    border-color 170ms ease;
}

.button:hover {
  box-shadow: 0 26px 44px rgba(0, 90, 179, 0.30);
}

.button-whatsapp:hover {
  box-shadow: 0 22px 38px rgba(18, 140, 126, 0.36);
}

/* ─── 5. Portal chip ─────────────────────────────────────── */
.portal-chip {
  transition:
    transform 210ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 200ms ease;
}
.portal-chip:hover,
.portal-chip:focus-visible {
  box-shadow: 0 6px 18px rgba(0, 90, 179, 0.10);
}

/* ─── 6. Kart hover — akıcı yaylı geçiş ─────────────────── */
.card,
.role-card,
.legal-card,
.faq-item,
.timeline-step {
  transition:
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 280ms ease;
}

/* Kart ikonu mikro-animasyonu */
.card-icon {
  transition:
    transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 240ms ease;
}
.card:hover .card-icon,
.role-card:hover .card-icon {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 10px 22px rgba(0, 90, 179, 0.14);
}

/* İlk özellik kartı (koyu) için beyaz ikon */
.feature-grid .card:first-child:hover .card-icon {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

/* ─── 7. Metrik kart hover ───────────────────────────────── */
.metric {
  transition:
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 280ms ease;
}
.metric:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px rgba(10, 22, 43, 0.13);
}

/* ─── 8. Image panel hover ───────────────────────────────── */
.image-panel {
  transition:
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 300ms ease;
}
.image-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 58px rgba(10, 22, 43, 0.14);
}

/* ─── 9. Nav link geçişi ─────────────────────────────────── */
.nav-links a,
.nav-link-button {
  transition:
    background 160ms cubic-bezier(0.4, 0, 0.2, 1),
    color 160ms ease;
}

/* ─── 10. Login dropdown link geçişi ─────────────────────── */
.login-dropdown a {
  transition:
    background 160ms cubic-bezier(0.4, 0, 0.2, 1),
    color 160ms ease;
}

/* ─── 11. Eyebrow badge ──────────────────────────────────── */
.eyebrow {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ─── 12. Trust listesi görsel derinliği ─────────────────── */
.trust-list {
  box-shadow:
    0 24px 56px rgba(10, 22, 43, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

/* ─── 13. CTA panel derinliği ────────────────────────────── */
.cta-panel {
  box-shadow: 0 42px 76px rgba(7, 24, 50, 0.22);
}

/* ─── 14. Page hero alt çizgisi ──────────────────────────── */
.page-hero {
  position: relative;
}
.page-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(76, 143, 255, 0.28) 40%, rgba(76, 143, 255, 0.28) 60%, transparent 100%);
}

/* ─── 15. Footer link alt çizgi animasyonu ───────────────── */
.footer-grid a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition:
    text-decoration-color 180ms ease,
    color 180ms ease;
}
.footer-grid a:hover,
.footer-grid a:focus-visible {
  text-decoration-color: rgba(218, 229, 247, 0.5);
}

/* ─── 16. Focus ring geliştirmesi ────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(76, 143, 255, 0.16);
}

/* ─── 17. Kaydırma-tetikli giriş animasyonları ───────────── */

@keyframes d-enter {
  from {
    opacity: 0;
    translate: 0 20px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes d-enter-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/*
  Yalnızca hareket azaltma tercihi OLMAYAN ve
  animation-timeline'ı destekleyen tarayıcılarda çalışır.
  Desteklemeyen tarayıcılarda elementler olduğu gibi görünür.
*/
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {

    /* Kartlar ve bloklar — kayarak giriş */
    .card,
    .role-card,
    .legal-card,
    .portal-card,
    .stat-card,
    .faq-item,
    .timeline-step,
    .metric,
    .image-panel,
    .contact-card {
      animation: d-enter linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 22%;
    }

    /* Izgara öğelerinde kademeli giriş (pozisyona göre) */
    .feature-grid > :nth-child(2),
    .role-grid > :nth-child(2),
    .metric-strip > :nth-child(2),
    .stats-grid > :nth-child(2),
    .portal-grid > :nth-child(2),
    .legal-grid > :nth-child(2),
    .faq-grid > :nth-child(2),
    .timeline > :nth-child(2) {
      animation-range: entry 3% entry 25%;
    }

    .feature-grid > :nth-child(3),
    .role-grid > :nth-child(3),
    .metric-strip > :nth-child(3),
    .stats-grid > :nth-child(3),
    .portal-grid > :nth-child(3),
    .faq-grid > :nth-child(3),
    .timeline > :nth-child(3) {
      animation-range: entry 6% entry 28%;
    }

    .feature-grid > :nth-child(4),
    .metric-strip > :nth-child(4),
    .faq-grid > :nth-child(4),
    .timeline > :nth-child(4) {
      animation-range: entry 9% entry 31%;
    }

    .faq-grid > :nth-child(5),
    .faq-grid > :nth-child(6) {
      animation-range: entry 12% entry 34%;
    }

    /* Başlık ve öncü metin — soluklu giriş */
    .section-title,
    .section-lead,
    .page-hero h1,
    .page-hero p,
    .eyebrow {
      animation: d-enter-fade linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 18%;
    }

    /* Trust listesi ve metrik bandı */
    .trust-list,
    .metric-strip {
      animation: d-enter linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 20%;
    }
  }
}

/* ─── 18. Bölüm arası ince ayırıcı ──────────────────────── */
.section-alt + .section,
.section + .section-alt {
  border-top: 1px solid rgba(123, 139, 167, 0.07);
}

/* ─── 19. Başlık gölgesi scroll'da yoğunlaşır ────────────── */
@supports (animation-timeline: scroll()) {
  @keyframes header-shadow {
    from { box-shadow: 0 10px 28px rgba(10, 22, 43, 0.04); }
    to   { box-shadow: 0 10px 28px rgba(10, 22, 43, 0.10); }
  }
  .site-header {
    animation: header-shadow linear both;
    animation-timeline: scroll(root block);
    animation-range: 0px 120px;
  }
}

/* ─── 20. Hero başlık parlaklık katmanı ──────────────────── */
.hero-copy h1 {
  text-shadow: 0 0 80px rgba(76, 143, 255, 0.18);
}

/* ─── 21. Buton yükleme durumunda pulse engeli ───────────── */
.button-passive {
  animation: none !important;
}

/* ─── 22. Responsive: hareket animasyonlarını kısalt ─────── */
@media (max-width: 720px) {
  @supports (animation-timeline: view()) {
    .card,
    .role-card,
    .legal-card,
    .portal-card,
    .stat-card,
    .faq-item,
    .timeline-step,
    .metric,
    .image-panel,
    .contact-card {
      animation-range: entry 0% entry 30%;
    }
  }
}

/* ═══════════════════════════════════════════════════════════
   Sayfa Geçiş Animasyonları — View Transitions API
   Chrome 126+ · Edge 126+ · Safari 18.2+
   Desteklemeyen tarayıcılarda normal sayfa geçişi yapılır.
   ═══════════════════════════════════════════════════════════ */

/* Aynı-kaynak navigasyonlarda otomatik geçiş etkinleştir */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {

  /* İçerik: hafif yukarı kayarak çıkar, aşağıdan girerek gelir */
  ::view-transition-old(root) {
    animation: 180ms ease-in both vt-page-out;
  }
  ::view-transition-new(root) {
    animation: 280ms ease-out both vt-page-in;
  }

  @keyframes vt-page-out {
    to {
      opacity: 0;
      transform: translateY(-6px) scale(0.996);
    }
  }

  @keyframes vt-page-in {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.996);
    }
  }

  /* Başlık sabit kalır — geçiş animasyonuna dahil edilmez */
  .site-header {
    view-transition-name: site-header;
  }

  ::view-transition-old(site-header),
  ::view-transition-new(site-header) {
    animation: none;
    mix-blend-mode: normal;
  }
}

/* Hareket azaltma tercihinde geçişi kapat */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
