/* ==================================================================
   KüPuzzle — 16'lı Küp Birleşme Animasyonu (hero sağ sütunu)
   Küp animasyonu hero görsel alanında durur; carousel hemen altında.
   Aşağı kaydırdıkça 16 parça birleşir.
   Tüm sınıflar "sc-" önekiyle izole edilmiştir; mevcut stillere dokunmaz.
   Motor: assets/js/scroll-cube.js
   ================================================================== */

:root {
  /* Küpün 6 yönünün fotoğrafları (trivision). Değiştirmek için url'i güncelle. */
  --sc-img-front: url("../img/scroll-cube/front.webp");
  --sc-img-back: url("../img/scroll-cube/back.webp");
  --sc-img-top: url("../img/scroll-cube/top.webp");
  --sc-img-bottom: url("../img/scroll-cube/bottom.webp");
  --sc-img-left: url("../img/scroll-cube/left.webp");
  --sc-img-right: url("../img/scroll-cube/right.webp");

  /* MOBİL KÜP İNCE AYARI — ölçek ve sahne yüksekliği buradan değiştirilir.
     Masaüstü değerleri ayrı tutulur; bu dört değişken yalnızca ≤640px'te kullanılır. */
  --sc-mobile-scale: 0.85;
  --sc-mobile-compact-scale: 0.75;
  --sc-mobile-stage-height: 400px;
  --sc-mobile-compact-stage-height: 360px;
}

@media (max-width: 640px) {
  :root {
    --sc-img-front: url("../img/scroll-cube/front-600.webp");
    --sc-img-back: url("../img/scroll-cube/back-600.webp");
    --sc-img-top: url("../img/scroll-cube/top-600.webp");
    --sc-img-bottom: url("../img/scroll-cube/bottom-600.webp");
    --sc-img-left: url("../img/scroll-cube/left-600.webp");
    --sc-img-right: url("../img/scroll-cube/right-600.webp");
  }
}

/* Hero: overflow-x:hidden iOS'ta kaydırma kabı gibi davranabiliyor; clip etmez.
   Mobil: içerik yüksekliği + üstten hizala (min-h 921 + items-center üst boşluk yaratıyordu).
   lg+: iki sütunlu yerleşimi ferah ama gereksiz uzun olmayan bir alanda ortala. */
.sc-hero-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  overflow-x: clip;
  overflow-y: visible;
}

@media (min-width: 1024px) {
  .sc-hero-section {
    min-height: 760px;
    justify-content: center;
  }
}

/* Hero grid — kaynak: copy → cta → visual.
   Mobil görsel sıra: copy → visual → cta.
   lg+: sol copy+cta; sağ visual. */
.sc-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
  width: 100%;
}

.sc-hero-copy { order: 1; }
.sc-hero-visual { order: 2; }
.sc-hero-cta { order: 3; }

.sc-title-word {
  display: inline-grid;
  grid-template-areas: "word";
  vertical-align: baseline;
}

.sc-title-word__coming,
.sc-title-word__complete {
  grid-area: word;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.sc-title-word__coming {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.sc-title-word__complete {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(0.18em);
}

.sc-hero-copy h1.is-complete .sc-title-word__coming {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(-0.18em);
}

.sc-hero-copy h1.is-complete .sc-title-word__complete {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Mobil: başlık → paragraf → animasyon → butonlar */
.sc-hero-copy {
  margin-bottom: 0.85rem;
}
.sc-hero-visual {
  margin-bottom: 0.85rem;
}
.sc-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}
.sc-hero-cta a,
.sc-hero-cta__btn {
  pointer-events: auto;
}

@media (min-width: 640px) {
  .sc-hero-cta {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Masaüstü: sol copy+cta; sağ visual */
@media (min-width: 1024px) {
  .sc-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 5rem;
    row-gap: 2.5rem;
    align-items: center;
  }

  .sc-hero-copy {
    order: unset;
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
    align-self: end;
  }

  .sc-hero-copy h1 {
    font-size: clamp(3rem, 3.75vw, 3.5rem);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .sc-hero-cta {
    order: unset;
    grid-column: 1;
    grid-row: 2;
    margin-top: 0;
    align-self: start;
  }

  .sc-hero-visual {
    order: unset;
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-bottom: 0;
    margin-top: 0;
    align-self: center;
  }
}

/* Animasyon sahnesi: hero sağ sütununda, carousel'in üstünde yer kaplar */
.sc-hero-stage {
  position: relative;
  width: 100%;
  max-width: 32rem; /* carousel'in max-w-lg genişliğiyle aynı */
  height: 458px; /* 10cm panel + altındaki tıklama yazısına yer */
  z-index: 1;
  /* Dağınık parçalar kardeşleri ezmesin — hidden değil clip (iOS scroll).
     preserve-3d çocuklar overflow'u delmesin diye clip-path + contain. */
  overflow: clip;
  clip-path: inset(0);
  contain: paint;
  isolation: isolate;
  /* Dekoratif 3D katman — dokunmayı yutmasın; kaydırma sayfaya geçsin */
  pointer-events: none;
}

/* Carousel: kendi ayrı div'inde, ekranın tam ortasında. Animasyondan
   bağımsızdır (animasyon solup kaybolur, buranın arkasına geçmez). */
.sc-carousel-standalone {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  justify-content: center; /* ekranın tam ortasına al */
  padding: 96px 16px 56px;
  background: var(--surface, #fff);
}

@media (max-width: 640px) {
  .sc-carousel-standalone { padding-top: 56px; }
}

.sc-carousel-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* SEO uyumlu başlık bloğu (carousel'in üstündeki boş alan) */
.sc-carousel-head {
  text-align: center;
  max-width: 620px;
  margin-bottom: 8px;
}

.sc-carousel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  color: #0b1c30;
  margin: 0 0 10px;
}

.sc-carousel-sub {
  font-size: 15px;
  line-height: 1.55;
  color: #56617a;
  margin: 0;
}

.sc-carousel-center {
  width: 100%;
  max-width: 700px;
  /* Büyütülmüş carousel. Kart ve JS yarıçapı (radius: 520) birlikte büyütüldü.
     Yalnızca ana sayfa örneğini etkiler (galeri farklı sınıf kullanır).
     ÖNEMLİ: perspektif SADECE .hero-carousel-scene'de tanımlıdır; burada
     tekrar tanımlanırsa iç içe perspektifler büyütmeyi (bulanıklığı) artırır. */
  /* NETLİK: kart CSS boyutu, perspektif büyütmesini (1.441x) karşılayacak
     şekilde 1.441x büyük tutulur; JS'teki aktif ölçek 0.694 ile birlikte
     ekrana 1:1 piksel eşlemesi sağlanır (bkz. hero-carousel.js). */
  --hero-card-w: 490px;
  --hero-card-h: 327px;
}

.sc-carousel-center .hero-carousel-scene {
  max-width: 680px;
  height: 470px;
  margin-left: auto;
  margin-right: auto;
  /* Perspektif: öndeki kart eskisinden büyük (472px) ama büyütme oranı
     düşük (~1.12) kalacak şekilde ayarlandı. will-change:auto ile birlikte
     öndeki kart net rasterize edilir (bulanıklık giderilir). */
  perspective: 1700px;
}

/* Öndeki kartın kendi katmanını doğal boyutta önbelleğe alıp büyüterek
   bulanıklaştıran will-change kaldırılır: tarayıcı son (büyütülmüş) boyutta
   yeniden rasterize eder -> net. */
.sc-carousel-center .carousel-3d {
  will-change: auto;
}

/* Kartlardaki tüm yazıları VE beyaz grid çizgilerini kaldır:
   yalnızca net fotoğraf görünsün */
.sc-carousel-center .hero-cube-caption,
.sc-carousel-center .hero-cube-badge,
.sc-carousel-center .hero-cube-face-badge,
.sc-carousel-center .hero-cube-face-strip,
.sc-carousel-center .hero-cube-grid-overlay {
  display: none !important;
}

/* Netlik: öndeki karta yumuşak kenarlık dışında filtre uygulanmasın.
   Görsel gelene kadar marka zemini (kırık kutu yok). */
.sc-carousel-center .hero-cube-side {
  border-color: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  background: #004ac6;
}
.sc-carousel-center .hero-cube-side--back-face {
  background: #5c3a1e;
}

/* 3D ölçekte yumuşamayı kes: görsel kendi katmanında, kapak kırpma net. */
.sc-carousel-center .hero-cube-side img {
  transform: translateZ(0.1px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sc-carousel-center .hero-cube-side img.is-loaded {
  opacity: 1;
}

/* Kart içi öğeler: kart CSS'i 1.441x büyütülüp 0.694 ölçeklendiği için
   içerideki punto/boşluklar aynı oranda büyütülür -> ekranda önceki
   boyutlarında ama artık 1:1 net görünürler. */
.sc-carousel-center .hero-cube-cta-title { font-size: 29px; }
.sc-carousel-center .hero-cube-cta-subtitle { font-size: 19px; }
.sc-carousel-center .hero-cube-cta-chip { font-size: 17px; padding: 10px 23px; }
.sc-carousel-center .hero-cube-cta-icon { width: 86px; height: 86px; }
.sc-carousel-center .hero-cube-cta-icon svg { width: 43px; height: 43px; }
.sc-carousel-center .hero-cube-count,
.sc-carousel-center .hero-cube-photo-count {
  font-size: 17px;
  padding: 7px 17px;
  right: 17px;
}
.sc-carousel-center .hero-cube-count { top: 17px; }
.sc-carousel-center .hero-cube-photo-count { top: 59px; }

/* Aktif slaytın sayaç + ad + açıklama + incele butonu (resim alanının dışında) */
.sc-slide-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  text-align: center;
}

/* Aktif senaryo vurgusu: "3 / 6" sayacı */
.sc-slide-counter {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #7c8aa5;
}

.sc-slide-headline {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.sc-slide-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  color: #0b1c30;
  margin: 0;
}

.sc-slide-desc {
  max-width: 520px;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #56617a;
}

.sc-carousel-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  text-align: center;
}

.sc-carousel-foot-copy {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 22px);
  color: #0b1c30;
}

.sc-slide-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #004ac6;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border-radius: 14px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 74, 198, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sc-slide-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 74, 198, 0.36);
}

.sc-slide-btn span {
  transition: transform 0.2s ease;
}

.sc-slide-btn:hover span {
  transform: translateX(4px);
}

/* Küp altındaki geri bildirim satırları. Mobilde tamamlanma mesajı ve ipucu için
   yer ilk boyamada ayrılır; görünürlük değişimleri aşağıdaki CTA'ları kaydırmaz. */
.sc-hero-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sc-completion-message {
  display: none;
  margin: 0;
}

/* Panel birleşirken beliren etkileşim ipucu. */
.sc-click-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  width: max-content;
  max-width: calc(100% - 1rem);
  margin: 0.35rem 0 0;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.45s ease;
  z-index: 5;
}

.sc-click-hint__icon {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
}

.sc-click-hint__arrow {
  display: none;
  width: 24px;
  height: 16px;
  flex: 0 0 auto;
}

.sc-click-hint__text--touch {
  display: none;
}

.sc-click-hint.is-visible {
  pointer-events: auto;
  animation: sc-hint-pulse 2.2s ease-in-out infinite;
}

@keyframes sc-hint-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.26), 0 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.32), 0 0 0 5px rgba(59, 130, 246, 0.12);
  }
}

@keyframes sc-hint-arrow {
  0%, 100% { transform: translateX(-1px); }
  50% { transform: translateX(2px); }
}

@media (min-width: 641px) {
  .sc-click-hint {
    gap: 9px;
    padding: 9px 20px;
  }
  .sc-click-hint__icon {
    display: none;
  }
  .sc-click-hint__arrow {
    display: block;
    animation: sc-hint-arrow 1.8s ease-in-out infinite;
  }
}

@media (max-width: 640px) {
  .sc-carousel-head {
    margin-bottom: 0;
  }

  .sc-carousel-center {
    /* 0.694 aktif ölçek + perspektif birleşince yaklaşık aynı piksel boyutu görünür. */
    --hero-card-w: clamp(370px, 100vw, 400px);
    --hero-card-h: clamp(247px, 66.67vw, 267px);
  }

  .sc-carousel-center .hero-carousel-scene {
    max-width: 100%;
    height: 330px;
    margin-top: 0;
    margin-bottom: 24px;
    touch-action: pan-y;
  }
}

.sc-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  --sc-scale: 1;
  pointer-events: none;
  /* JS her karede bu transform'u kayma (translateY) ekleyerek günceller */
  transform: translate(-50%, -50%) scale(var(--sc-scale));
  perspective: 1200px;
}

.sc-wrapper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* Hafif çapraz bakış açısı: yan yüzler de görünür */
  transform: rotateX(-15deg) rotateY(-25deg);
  /* Tıklayınca küpler döner (trivision) — masaüstünde panel; mobilde ipucu */
  cursor: pointer;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .sc-wrapper {
    pointer-events: auto;
  }
}

.sc-mini-cube {
  position: absolute;
  pointer-events: none;
  /* Gerçek ürün ölçüsü: her küp 2.5cm (= 94.488px, JS'teki CUBE_SIZE ile
     birebir aynı). 4x4 panel = 10x10cm. */
  width: 2.5cm;
  height: 2.5cm;
  left: 50%;
  top: 50%;
  margin-left: -1.25cm;
  margin-top: -1.25cm;
  transform-style: preserve-3d;
  --sc-col: 0;
  --sc-row: 0;
  --sc-tile: calc(var(--sc-col) * 100% / 3) calc(var(--sc-row) * 100% / 3);
}
.sc-mini-cube[data-col="0"] { --sc-col: 0; }
.sc-mini-cube[data-col="1"] { --sc-col: 1; }
.sc-mini-cube[data-col="2"] { --sc-col: 2; }
.sc-mini-cube[data-col="3"] { --sc-col: 3; }
.sc-mini-cube[data-row="0"] { --sc-row: 0; }
.sc-mini-cube[data-row="1"] { --sc-row: 1; }
.sc-mini-cube[data-row="2"] { --sc-row: 2; }
.sc-mini-cube[data-row="3"] { --sc-row: 3; }

/* JS gelmeden dağınık ilk kare — LCP elemanı HTML'de hazır. */
#scCubeWrapper:not(.is-live) .sc-mini-cube {
  transform:
    translate3d(
      calc((var(--sc-col) - 1.5) * 2.5cm + var(--sc-ox, 0px)),
      calc((var(--sc-row) - 1.5) * 2.5cm + var(--sc-oy, 0px)),
      var(--sc-oz, 0px)
    )
    rotateX(var(--sc-orx, 0deg))
    rotateY(var(--sc-ory, 0deg))
    rotateZ(var(--sc-orz, 0deg));
}

@media (prefers-reduced-motion: reduce) {
  #scCubeWrapper:not(.is-live) .sc-mini-cube {
    transform:
      translate3d(
        calc((var(--sc-col) - 1.5) * 2.5cm),
        calc((var(--sc-row) - 1.5) * 2.5cm),
        0
      );
  }
}

.sc-face {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-color: #eef0f2;
  /* 4x4 mozaik dilimi; dilim konumu JS'ten --sc-tile ile gelir */
  background-size: 400% 400%;
  background-position: var(--sc-tile, 50% 50%);
  background-image: var(--sc-img, none);
  /* Arkaya bakan yüzler çizilmez (performans) */
  backface-visibility: hidden;
}

/* Yüzlerin 3D yerleşimi (2.5cm küp -> yarısı 1.25cm) */
.sc-face--front  { transform: rotateY(0deg)    translateZ(1.25cm); background-image: var(--sc-img-front); }
.sc-face--back   { transform: rotateY(180deg)  translateZ(1.25cm); background-image: var(--sc-img-back); }
.sc-face--top    { transform: rotateX(90deg)   translateZ(1.25cm); background-image: var(--sc-img-top); }
.sc-face--bottom { transform: rotateX(-90deg)  translateZ(1.25cm); background-image: var(--sc-img-bottom); }
.sc-face--left   { transform: rotateY(-90deg)  translateZ(1.25cm); background-image: var(--sc-img-left); }
.sc-face--right  { transform: rotateY(90deg)   translateZ(1.25cm); background-image: var(--sc-img-right); }

/* Responsive: sahne orantılı küçülür. Scatter aralıkları JS'te stage
   boyutuna oranlanır; stage yüksekliği kutuya sığacak nefes payı bırakır.
   sticky header (h-20 = 5rem) için scroll-margin. */
@media (max-width: 640px) {
  .sc-hero-section {
    padding-top: 0.25rem;
  }
  .sc-hero-copy {
    margin-bottom: 1rem;
  }
  .sc-hero-copy .mb-6 {
    margin-bottom: 0.35rem;
  }
  .sc-hero-eyebrow {
    max-width: 100%;
    padding: 0.1875rem 0.4375rem;
    font-size: 0.5rem;
    line-height: 1.25;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .sc-hero-copy h1 {
    font-size: clamp(1.75rem, 7.4vw, 2rem);
    line-height: 1.08;
    margin-bottom: 0.4rem !important;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
  .sc-title-word__complete {
    display: none;
  }
  .sc-hero-copy h1.is-complete .sc-title-word__coming {
    opacity: 1;
    filter: none;
    transform: none;
  }
  .sc-hero-lead {
    margin-bottom: 0;
    font-size: 0.875rem;
    line-height: 1.4;
  }
  .sc-hero-cta {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }
  .sc-hero-cta__btn {
    flex: 1 1 0;
    padding: 0.65rem 0.5rem;
    font-size: 0.8125rem;
    text-align: center;
    border-radius: 0.75rem;
  }
  .sc-hero-stage {
    width: calc(100% + 3rem);
    max-width: none;
    margin-left: -1.5rem;
    height: var(--sc-mobile-stage-height);
    scroll-margin-top: 5rem;
    margin-top: 0.25rem;
  }
  .sc-scene { --sc-scale: var(--sc-mobile-scale); }
  .sc-hero-feedback {
    width: 100%;
    gap: 0.35rem;
  }
  .sc-completion-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    color: var(--primary, #004ac6);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    filter: blur(4px);
    transform: translateY(0.35rem);
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
  }
  .sc-completion-message.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
  .sc-click-hint {
    min-height: 1.875rem;
    margin-top: 0;
  }
  .sc-hero-visual { margin-top: 0; margin-bottom: 1.25rem; }
}

@media (hover: none), (pointer: coarse) {
  .sc-click-hint__text--desktop { display: none; }
  .sc-click-hint__text--touch { display: inline; }
}

@media (max-width: 400px) {
  .sc-hero-stage {
    height: var(--sc-mobile-compact-stage-height);
    scroll-margin-top: 5rem;
  }
  .sc-scene { --sc-scale: var(--sc-mobile-compact-scale); }
}

/* Hareket azaltma tercihi: JS küpü doğrudan birleşik ve sabit gösterir */
@media (prefers-reduced-motion: reduce) {
  .sc-wrapper { cursor: default; }
  .sc-click-hint.is-visible { animation: none; }
  .sc-click-hint__arrow {
    animation: none;
  }
  .sc-title-word__coming,
  .sc-title-word__complete,
  .sc-completion-message {
    transition: none;
  }
}
