/* ==========================================================================
   TALS — HERO (Refined, SSOT)
   - Base: stage/slide, dots, flash
   - Mobile (≤900): tam ekran, “Daha” joystick/pill + panel
   - Desktop (≥901): sadece proje adı (sol alt) + flash title
   ========================================================================== */

/* ---------- BASE CONTAINER & STAGE ---------- */
:is(#hero, .hero-hero) {
  position: relative;
  isolation: isolate;
  background: var(--section-bg, #050608);
  color: var(--c-text, #fff);
}

/* Stage & Slide (dikey geçiş) */
:is(#hero, .hero-hero) .hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: inherit;
  overflow: hidden;
}
:is(#hero, .hero-hero) .hero-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  transform: translateY(100%);
  transition:
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  opacity: 0;
}
:is(#hero, .hero-hero) .hero-slide.hero-active {
  transform: translateY(0);
  opacity: 1;
}
:is(#hero, .hero-hero) .hero-slide.hero-above {
  transform: translateY(-100%);
  opacity: 0.6;
}

/* Medya tam kapla */
:is(#hero, .hero-hero) .hero-slide > img,
:is(#hero, .hero-hero) .hero-slide picture > img,
:is(#hero, .hero-hero) .hero-media > img,
:is(#hero, .hero-hero) .hero-media > picture > img,
:is(#hero, .hero-hero) .hero-media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--hero-fit, cover);
  object-position: var(--hero-pos, 50% 50%);
  outline: 1px solid transparent;
  background: transparent;
}

/* ---------- DESKTOP ALT BILGI BLOĞU ---------- */
:is(#hero, .hero-hero) .hero-dock {
  position: absolute;
  left: 50%;
  bottom: var(--hero-dock-bottom-d, max(26px, calc(var(--footer-safe, 0px) + 26px)));
  z-index: 85;
  width: min(72vw, 760px);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  pointer-events: none;
  will-change: opacity, transform;
}

:is(#hero, .hero-hero) .hero-projcopy {
  display: grid;
  gap: 10px;
  max-width: min(72vw, 760px);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

:is(#hero, .hero-hero) .hero-projcopy__title,
:is(#hero, .hero-hero) .hero-projcopy__desc {
  margin: 0;
}

:is(#hero, .hero-hero) .hero-projcopy__title {
  color: var(--hero-projcopy-title-color-d, var(--hero-title-color-d, #fff));
  font-family: var(
    --hero-projcopy-title-font-d,
    var(--hero-title-font-d, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif)
  );
  font-weight: var(--hero-projcopy-title-weight-d, 600);
  font-size: var(--hero-projcopy-title-size-d, clamp(18px, 1.8vw, 24px));
  line-height: 1.12;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

:is(#hero, .hero-hero) .hero-projcopy__desc {
  color: var(--hero-projcopy-desc-color-d, rgba(255, 255, 255, 0.92));
  font-family: var(
    --hero-projcopy-desc-font-d,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Arial,
    sans-serif
  );
  font-weight: var(--hero-projcopy-desc-weight-d, 500);
  font-size: var(--hero-projcopy-desc-size-d, clamp(13px, 1vw, 16px));
  line-height: 1.68;
}

:is(#hero, .hero-hero) .hero-dock.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  :is(#hero, .hero-hero) .hero-dock {
    display: none;
  }

  :is(#hero, .hero-hero) .hero-projname {
    position: absolute;
    left: calc(var(--hero-projname-left-m, 18px) + env(safe-area-inset-left, 0px));
    bottom: var(--hero-projname-bottom-m, max(18px, calc(var(--footer-safe, 0px) + 18px)));
    z-index: 85;
    max-width: min(72vw, 24ch);
    margin: 0;
    color: var(--hero-projname-color-m, var(--hero-title-color-m, #fff));
    font-family: var(
      --hero-projname-font-m,
      var(--hero-title-font-m, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif)
    );
    font-weight: var(--hero-title-weight-m, 800);
    font-size: var(--hero-projname-size-m, var(--hero-title-size-m, 16px));
    line-height: 1.12;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition:
      opacity 220ms ease,
      transform 220ms ease;
    pointer-events: none;
  }

  :is(#hero, .hero-hero) .hero-projname.is-show {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(#hero, .hero-hero) .hero-dock {
    transition: none !important;
  }
}

/* ---------- DOTS ---------- */
:is(#hero, .hero-hero) .hero-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--dot-gap, 10px);
  z-index: 6;
}
:is(#hero, .hero-hero) .hero-dot {
  appearance: none;
  width: var(--dot-size, 8px);
  height: var(--dot-size, 8px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: transparent;
  cursor: pointer;
  opacity: 0.9;
  padding: 0;
  margin: 0;
  outline: none;
}
:is(#hero, .hero-hero) .hero-dot[aria-current='true'] {
  background: #fff;
}

/* ---------- FLASH TITLE (ortak) ---------- */
:is(#hero, .hero-hero) .hero-flash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 60;
  pointer-events: none;
}
:is(#hero, .hero-hero) .hero-flash__inner {
  font-family: var(
    --hero-title-font-d,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    Arial,
    sans-serif
  );
  font-weight: var(--hero-title-weight-d, 800);
  font-size: clamp(22px, 5.5vw, 34px);
  line-height: 1.1;
  color: var(--hero-title-color-d, #fff);
  text-align: var(--hero-align-d, center);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: scale(0.96);
}
:is(#hero, .hero-hero) .hero-flash.is-on .hero-flash__inner {
  animation: hero-flash-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1;
}
@keyframes hero-flash-in {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- DESKTOP (≥901px) ---------- */
@media (min-width: 901px) {
  /* Mobile overlay bileşenlerini gizle */
  :is(#hero, .hero-hero) .hero-mobile-info,
  :is(#hero, .hero-hero) .hero-panel,
  :is(#hero, .hero-hero) .hero-more {
    display: none !important;
  }

  /* Stage section içine otursun */
  :is(#hero, .hero-hero) .hero-stage,
  :is(#hero, .hero-hero) .hero-slide {
    position: absolute;
    inset: 0;
  }

  /* Kart içi "İzle" butonu (panel kalırsa) */
  #hero .hero-watch-btn,
  #hero .hero-panel__watch {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.32);
    color: #fff;
    font:
      600 13px/1 system-ui,
      -apple-system,
      Segoe UI,
      Roboto,
      Arial;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
      background 0.2s ease,
      transform 0.2s ease,
      box-shadow 0.2s ease,
      border-color 0.2s ease;
  }
  #hero .hero-watch-btn:hover,
  #hero .hero-panel__watch:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.45);
  }
  #hero .hero-watch-btn:active,
  #hero .hero-panel__watch:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  :is(#hero, .hero-hero) .hero-caption,
  :is(#hero, .hero-hero) .hero-flash {
    display: none !important;
  }

  /* Desktop slide Ken Burns */
  :is(#hero, .hero-hero) .hero-slide > img,
  :is(#hero, .hero-hero) .hero-slide picture > img {
    transform-origin: center center;
    will-change: transform;
  }
  :is(#hero, .hero-hero) .hero-slide.hero-active > img,
  :is(#hero, .hero-hero) .hero-slide.hero-active picture > img {
    animation: hero-kenburns-desktop 18s ease-out forwards;
  }
  :is(#hero, .hero-hero) .hero-slide.hero-above > img,
  :is(#hero, .hero-hero) .hero-slide:not(.hero-active) > img {
    animation: none;
    transform: scale(1.02);
  }
}

/* ---------- MOBILE (≤900px) ---------- */
@media (max-width: 900px) {
  :is(#hero, .hero-hero) {
    padding: 0;
    margin: 0;
    background: var(--section-bg, #050608);
    overflow: hidden;
  }

  /* Stage/slayt section içine sabitlenir */
  :is(#hero, .hero-hero) .hero-stage,
  :is(#hero, .hero-hero) .hero-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
  }

  /* Medya: mobile varsayılanları */
  :is(#hero, .hero-hero) .hero-slide > img,
  :is(#hero, .hero-hero) .hero-slide picture > img,
  :is(#hero, .hero-hero) .hero-media > img,
  :is(#hero, .hero-hero) .hero-media > picture > img,
  :is(#hero, .hero-hero) .hero-media > video {
    object-fit: var(--hero-fit-m, cover);
    object-position: var(--hero-pos-m, 50% 50%);
  }

  /* Mobile slide derinlik + Ken Burns */
  :is(#hero, .hero-hero) .hero-slide.hero-active {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  :is(#hero, .hero-hero) .hero-slide.hero-above {
    transform: translateY(-12%) scale(0.96);
    opacity: 0.45;
  }
  :is(#hero, .hero-hero) .hero-slide:not(.hero-active):not(.hero-above) {
    transform: translateY(12%) scale(1.04);
    opacity: 0;
  }
  :is(#hero, .hero-hero) .hero-slide > img,
  :is(#hero, .hero-hero) .hero-slide picture > img {
    transform-origin: center center;
    will-change: transform;
  }
  :is(#hero, .hero-hero) .hero-slide.hero-active > img,
  :is(#hero, .hero-hero) .hero-slide.hero-active picture > img {
    animation: hero-kenburns-in 14s ease-out forwards;
  }
  :is(#hero, .hero-hero) .hero-slide.hero-above > img,
  :is(#hero, .hero-hero) .hero-slide:not(.hero-active) > img {
    animation: none;
    transform: scale(1.02);
  }
  @keyframes hero-kenburns-in {
    from {
      transform: scale(1.02);
    }
    to {
      transform: scale(1.1);
    }
  }

  /* Mobile “Daha” butonu — (fp-more varsa zaten JS’de gizleniyor olabilir) */
  :is(#hero, .hero-hero) .hero-more {
    position: fixed;
    right: calc(var(--fp-more-right-mobile, 26px) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--fp-more-bottom-mobile, 28px) + env(safe-area-inset-bottom, 0px));
    z-index: 2147482000;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: rgba(20, 20, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  :is(#hero, .hero-hero) .hero-more svg {
    width: 22px;
    height: 22px;
    opacity: 0.95;
  }
  :is(#hero, .hero-hero) .hero-more span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  /* Açılan panel (hero-panel) */
  :is(#hero, .hero-hero) .hero-panel {
    position: absolute;
    left: clamp(24px, 4vw, 64px);
    right: clamp(24px, 6vw, 64px);
    bottom: calc(var(--footer-safe, 0px) + 64px);
    z-index: 100;
    border-radius: 14px;
    background: rgba(10, 10, 12, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px;
    max-height: min(42vh, 360px);
    overflow: auto;
    display: none;
  }
  :is(#hero, .hero-hero) .hero-panel.is-open {
    display: block;
  }
  :is(#hero, .hero-hero) .hero-panel__title {
    margin: 6px 0 6px;
    font-family: var(--hero-title-font-m, system-ui, -apple-system, Segoe UI, Roboto, Arial);
    font-size: var(--hero-title-size-m, 24px);
    line-height: 1.2;
    font-weight: var(--hero-title-weight-m, 800);
    color: var(--hero-title-color-m, #fff);
    text-align: var(--hero-align-m, center);
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
  }
  :is(#hero, .hero-hero) .hero-panel__desc {
    margin: 0 0 10px;
    font:
      500 13px/1.65 system-ui,
      -apple-system,
      Segoe UI,
      Roboto,
      Arial;
    opacity: 0.95;
    text-align: var(--hero-align-m, center);
  }
}

/* ---------- MOBILE (≤768px) ---------- */
@media (max-width: 768px) {
  #hero .hero-more {
    right: calc(var(--fp-more-right-mobile, 26px) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--fp-more-bottom-mobile, 28px) + env(safe-area-inset-bottom, 0px));
  }

  #hero .hero-more > * {
    pointer-events: none;
  }

  :is(#hero, .hero-hero) .hero-panel {
    left: clamp(24px, 4vw, 64px);
    right: clamp(24px, 6vw, 64px);
    bottom: calc(var(--fp-more-bottom-mobile, 28px) + env(safe-area-inset-bottom, 0px) + 76px);
  }
}

/* ---------- VIDEO MODAL (hero-video-modal) ---------- */
.hero-video-modal[hidden] {
  display: none !important;
}
.hero-video-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-video-modal .hvm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
}
.hero-video-modal .hvm__dialog {
  position: relative;
  width: min(1100px, 86vw);
  max-height: min(88vh, 720px);
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.hero-video-modal .hvm__viewport {
  display: grid;
  grid-template-rows: auto auto;
}
.hero-video-modal .hvm__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.hero-video-modal .hvm__frame iframe,
.hero-video-modal .hvm__frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.hero-video-modal .hvm__meta {
  padding: 12px 14px;
  background: rgba(10, 10, 12, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(6px);
}
.hero-video-modal .hvm__title {
  margin: 0 0 6px;
  font:
    800 clamp(16px, 2.4vw, 20px) / 1.2 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
}
.hero-video-modal .hvm__excerpt {
  margin: 0;
  font:
    500 13px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
  opacity: 0.95;
}
.hero-video-modal .hvm__close {
  position: absolute;
  top: clamp(10px, 3vw, 14px);
  right: clamp(10px, 3vw, 14px);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
}
.hero-video-modal .hvm__close span {
  font-size: 22px;
  line-height: 1;
}
@media (max-width: 900px) {
  .hero-video-modal .hvm__close {
    width: 48px;
    height: 48px;
  }
}

/* Modal açıkken sayfa scroll'unu kilitle */
html.modal-open,
body.modal-open {
  overflow: hidden;
}

/* ---------- SECTION HEIGHT & CAPTION HIDE ---------- */
:is(#hero, .hero-hero, section[data-section='hero']) {
  position: relative;
  min-height: var(--app-hf);
  overflow: visible !important;
}
:is(#hero, .hero-hero) .hero-slide {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
}
:is(#hero, .hero-hero) .hero-caption {
  pointer-events: none !important;
  display: none !important;
}
:is(#hero, .hero-hero) .hero-caption .hero-title,
:is(#hero, .hero-hero) .hero-caption .hero-desc {
  display: none !important;
}

/* Section-nav geçişinde hafif kararma */
:is(#hero.hero-out, .hero-hero.hero-out) .hero-slide.hero-active > img {
  filter: brightness(0.82) saturate(0.9);
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
:is(#hero.hero-in, .hero-hero.hero-in) .hero-slide.hero-active > img {
  filter: none;
}

/* Tap erişilebilirliği (iOS) */
#hero .hero-more,
#hero .hero-cta,
#hero .video-badge,
#hero .hero-play {
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop için Ken Burns animasyonu (mobil ile benzer) */
@keyframes hero-kenburns-desktop {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.1);
  }
}

.hero-info-modal .prjm__viewport {
  position: relative;
  width: 100%;
  background: #000;
}

.hero-info-modal .prjm__frame {
  width: 100%;
  aspect-ratio: 16/9;
}

/* ✅ Meta artık video üstünde overlay */
.hero-info-modal .prjm__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 14px 12px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.68),
    rgba(0, 0, 0, 0.18) 60%,
    rgba(0, 0, 0, 0)
  );
  pointer-events: none; /* video tıklaması rahat olsun */
}

.hero-info-modal .prjm__title {
  margin: 0 0 6px;
  font:
    800 clamp(16px, 2.4vw, 20px) / 1.2 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

.hero-info-modal .prjm__excerpt {
  margin: 0;
  font:
    500 13px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
  opacity: 0.92;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

/* watch butonu overlay’de tıklanabilir olsun */
.hero-info-modal .prjm__watch {
  pointer-events: auto;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
