/* HK Journey — açılış kapısı, yıldız alanı, altın yol ve scroll ile 3B bölüm girişleri.
   Bağımlılık yok. home-universe.css'in ÜZERİNE yüklenir. */

:root{--hk-gold:#e0bb78;--hk-gold-soft:#f1d9a8;--hk-night:#061326;--fx-amp:1}
@media(max-width:900px){:root{--fx-amp:.55}}

/* ---------- 1. AÇILIŞ: KAPIDAN GEÇİŞ ---------- */
.hk-intro{display:none}
html.hk-intro-on{overflow:hidden}
html.hk-intro-on .hk-intro{display:grid;position:fixed;inset:0;z-index:1000;place-items:center;background:#040b18;overflow:hidden;cursor:pointer;transition:opacity .7s ease .35s}
.hk-intro-stars{position:absolute;inset:-10%;opacity:.7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%,#e2c18e,transparent),radial-gradient(1px 1px at 28% 72%,#bbd8f6,transparent),
    radial-gradient(2px 2px at 70% 12%,#e2c18e,transparent),radial-gradient(1.5px 1.5px at 92% 44%,#fff,transparent),
    radial-gradient(1px 1px at 84% 88%,#fff,transparent),radial-gradient(1.5px 1.5px at 44% 38%,#fff,transparent),
    radial-gradient(1px 1px at 58% 64%,#bbd8f6,transparent),radial-gradient(1.5px 1.5px at 8% 86%,#e2c18e,transparent),
    radial-gradient(1px 1px at 36% 8%,#fff,transparent),radial-gradient(1.5px 1.5px at 64% 92%,#fff,transparent),
    radial-gradient(1px 1px at 20% 50%,#fff,transparent),radial-gradient(1px 1px at 76% 36%,#bbd8f6,transparent),
    radial-gradient(1.5px 1.5px at 50% 20%,#e2c18e,transparent),radial-gradient(1px 1px at 96% 70%,#fff,transparent);
  animation:hk-warp 3.2s cubic-bezier(.4,0,.8,1) both}
@keyframes hk-warp{to{transform:scale(1.9);opacity:.15}}
.hk-intro-core{position:relative;display:grid;place-items:center;width:min(78vw,420px);aspect-ratio:1;transition:transform 1.05s cubic-bezier(.7,0,.25,1),opacity .8s ease .25s,filter 1s ease}
.hk-intro-light{position:absolute;inset:-30%;border-radius:50%;background:radial-gradient(circle,#fff8e6 0%,#f3d6a0 18%,#c9933f66 38%,transparent 62%);opacity:0;transform:scale(.1);animation:hk-light 1.5s cubic-bezier(.2,.7,.2,1) .75s both}
@keyframes hk-light{0%{opacity:0;transform:scale(.1)}60%{opacity:.95}100%{opacity:.85;transform:scale(1)}}
.hk-intro-ring{position:absolute;inset:6%;border-radius:50%;border:1px solid #e8c88e55;box-shadow:0 0 0 18px #e8c88e10,0 0 80px #e0bb7822 inset;animation:hk-ring 1.6s cubic-bezier(.2,.7,.2,1) .4s both}
.hk-intro-ring:after{content:"";position:absolute;inset:-14%;border-radius:50%;border:1px dashed #e8c88e33;animation:u-spin 40s linear infinite}
@keyframes hk-ring{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}
.hk-intro-door{position:relative;width:52%;aspect-ratio:340/287;animation:hk-door 1s cubic-bezier(.2,.7,.2,1) .15s both}
.hk-intro-door img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 28px #e6c384aa) drop-shadow(0 18px 24px #000a)}
@keyframes hk-door{from{opacity:0;transform:scale(.55) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}
.hk-intro-text{position:absolute;bottom:-14%;left:0;right:0;text-align:center;color:#f7ecd6;animation:hk-text 1.2s ease .7s both}
.hk-intro-text b{display:block;font:700 15px/1.2 Georgia,serif;letter-spacing:.14em}
.hk-intro-text span{display:block;margin-top:9px;font:800 10px/1.4 ui-sans-serif,system-ui,sans-serif;letter-spacing:.42em;color:var(--hk-gold)}
@keyframes hk-text{from{opacity:0;letter-spacing:.5em;transform:translateY(10px)}to{opacity:1;transform:none}}
.hk-intro-skip{position:absolute;right:22px;bottom:22px;appearance:none;background:#ffffff10;border:1px solid #ffffff2e;color:#dfe7f3;border-radius:999px;padding:10px 16px;font:800 11px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:.14em;cursor:pointer;animation:hk-text .6s ease 1.2s both}
.hk-intro-skip:hover{background:#ffffff22}
/* kameranın kapıdan geçişi */
.hk-intro.is-leaving{opacity:0;pointer-events:none}
.hk-intro.is-leaving .hk-intro-core{transform:scale(7.5);opacity:0;filter:blur(12px)}
.hk-intro.is-leaving .hk-intro-light{animation:none;opacity:1;transform:scale(1.6);transition:transform .9s cubic-bezier(.7,0,.25,1)}
.hk-intro-flash{position:absolute;inset:0;background:#fff6e4;opacity:0;pointer-events:none}
.hk-intro.is-leaving .hk-intro-flash{animation:hk-flash .9s ease-out both}
@keyframes hk-flash{0%{opacity:0}35%{opacity:.9}100%{opacity:0}}

/* ---------- 2. VARIŞ: HERO GİRİŞİ ---------- */
/* html.hk-pre = henüz varmadık (intro sürüyor). Kaldırıldığında geçişler oynar. */
.js-journey .u-hero-copy>*{transition:opacity .9s ease,translate .9s cubic-bezier(.2,.8,.2,1)}
.js-journey .u-hero-copy>*:nth-child(2){transition-delay:.08s}
.js-journey .u-hero-copy>*:nth-child(3){transition-delay:.16s}
.js-journey .u-hero-copy>*:nth-child(4){transition-delay:.24s}
.js-journey .u-hero-copy>*:nth-child(5){transition-delay:.32s}
html.hk-pre .js-journey .u-hero-copy>*{opacity:0;translate:0 34px}
.js-journey .u-portal-stage{transition:opacity 1.1s ease .1s,scale 1.3s cubic-bezier(.2,.8,.2,1) .05s}
html.hk-pre .js-journey .u-portal-stage{opacity:0;scale:.78}
.js-journey .u-scroll-cue{transition:opacity .8s ease .9s}
html.hk-pre .js-journey .u-scroll-cue{opacity:0}
/* Portal 3B eğim (fare): yalnızca dekor katmanları eğilir, tıklanan düğümler yerinde kalır */
.js-journey .u-portal-wrap{--tilt-x:0deg;--tilt-y:0deg}
.js-journey .u-orbit-one,.js-journey .u-orbit-two,.js-journey .u-portal-halo,.js-journey .u-portal-aura{rotate:x var(--tilt-x);transition:rotate .5s ease-out,translate .22s ease-out}
.js-journey .u-orbit-one{transform:rotate(-18deg) rotateY(var(--tilt-y));transition:transform .5s ease-out,rotate .5s ease-out}
.js-journey .u-portal-center img{rotate:x calc(var(--tilt-x) * .4);transition:rotate .5s ease-out,transform .3s}
.js-journey .u-portal-stage{transition:opacity 1.1s ease .1s,scale 1.3s cubic-bezier(.2,.8,.2,1) .05s}

/* ---------- 3. HERO ÇIKIŞI (scroll) ---------- */
/* --hp: 0 (üstte) → 1 (hero'dan çıkıldı) */
.js-journey .universe-hero{--hp:0}
.js-journey .u-hero-copy{transform:translateY(calc(var(--hp) * -70px));opacity:calc(1 - var(--hp) * 1.15)}
.js-journey .u-portal-wrap{transform:translateY(calc(var(--hp) * 40px)) scale(calc(1 - var(--hp) * .18));opacity:calc(1 - var(--hp) * 1.05)}
.js-journey .u-nebula-a{translate:0 calc(var(--hp) * 120px)}
.js-journey .u-nebula-b{translate:0 calc(var(--hp) * -90px)}
.js-journey .u-scroll-cue{opacity:calc(1 - var(--hp) * 3)}

/* ---------- 4. GÖKYÜZÜ (canvas) ---------- */
.hk-sky{position:fixed;inset:0;z-index:0;pointer-events:none;background:var(--hk-night)}
.js-journey main{position:relative;z-index:1}
.js-journey .site-footer{position:relative;z-index:1}
/* Koyu bölümlerin arka planı yarı saydam → yıldızlar görünür */
.js-journey .universe-hero{background:radial-gradient(ellipse at 76% 44%,#193658e8 0%,#0c203bd9 32%,#08172dbb 65%,#06132699 100%)}
.js-journey .u-games{background:linear-gradient(180deg,#07162bcf,#0a1e37d9)}
.js-journey .hk-guide-feature{background:linear-gradient(180deg,#070e1ccc,#0d1930d9)}
.js-journey .u-resources{background:#0d2338d6}
.js-journey .u-challenge{background:radial-gradient(circle at 15% 70%,#2a346de6,#141c3dd9 55%,#0a1930c9)}
.js-journey .u-ending{background:radial-gradient(circle at 50% 20%,#214262e0,#07172bc4 70%)}
/* Açık bölümler bir "ada" gibi hafif kavisli kenarla gelir */
.js-journey .u-journey,.js-journey .u-story,.js-journey .u-video,.js-journey .u-more{position:relative}
.js-journey .u-journey{border-radius:38px 38px 0 0;box-shadow:0 -30px 80px #0007}
.js-journey .u-story{border-radius:0 0 38px 38px;box-shadow:0 30px 80px #0007}
.js-journey .u-video{border-radius:38px 38px 0 0;box-shadow:0 -30px 80px #0007}
.js-journey .u-more{border-radius:0 0 38px 38px;box-shadow:0 30px 80px #0007}
.js-journey .u-ticker{position:relative;z-index:2}

/* İmleç ışığı */
.hk-glow{position:fixed;left:0;top:0;width:560px;height:560px;border-radius:50%;pointer-events:none;z-index:2;opacity:0;transition:opacity .6s;
  background:radial-gradient(circle,rgba(230,195,130,.11) 0%,rgba(230,195,130,.04) 35%,rgba(230,195,130,0) 62%);transform:translate(-50%,-50%);will-change:transform}
.hk-glow.is-on{opacity:1}
@media(hover:none){.hk-glow{display:none}}

/* ---------- 6. BÖLÜM GİRİŞLERİ (--p: 0→1) ---------- */
.js-journey .u-reveal{transition:none}            /* eski fade sistemi devre dışı */
.js-journey [data-fx]{--p:1}
.js-journey .fx-rise{opacity:var(--p);translate:0 calc((1 - var(--p)) * 54px * var(--fx-amp))}
.js-journey .fx-tilt{opacity:var(--p);transform-origin:50% 100%;rotate:x calc((1 - var(--p)) * 24deg * var(--fx-amp));translate:0 calc((1 - var(--p)) * 70px * var(--fx-amp))}
.js-journey .fx-tilt-wrap{perspective:1300px}
.js-journey .u-games-rail{perspective:1200px}
.js-journey .fx-fan{opacity:var(--p);transform-origin:50% 100%;rotate:x calc((1 - var(--p)) * 26deg * var(--fx-amp));translate:0 calc((1 - var(--p)) * 90px * var(--fx-amp)) calc((1 - var(--p)) * -120px * var(--fx-amp))}
.js-journey .u-story-library{perspective:1100px}
.js-journey .fx-book{opacity:var(--p);transform-origin:20% 50%;rotate:y calc(-7deg + (1 - var(--p)) * -34deg * var(--fx-amp));translate:calc((1 - var(--p)) * 60px) calc((1 - var(--p)) * 30px);transition:rotate .45s ease-out}
.js-journey .fx-book:hover{rotate:y -2deg}
.js-journey .u-challenge-grid{perspective:1300px}
.js-journey .fx-flip{opacity:var(--p);transform-origin:0 50%;rotate:y calc((1 - var(--p)) * 58deg * var(--fx-amp));translate:calc((1 - var(--p)) * 80px) 0}
.js-journey .fx-tiles{opacity:var(--p);translate:0 calc((1 - var(--p)) * 46px) calc((1 - var(--p)) * -120px * var(--fx-amp))}
.js-journey .hk-guide-feature-inner{perspective:1200px}
.js-journey .fx-pop{opacity:var(--p);scale:calc(.85 + var(--p) * .15)}
/* Hover kuralları fx ile çakışmasın (home-universe hover'ları transform kullanır, fx kullanmaz) */

/* Başlık kelimeleri: satır satır yükselir */
.hk-w{display:inline-block;overflow:hidden;vertical-align:bottom;padding:.08em .02em .2em;margin:-.08em -.02em -.2em}
.hk-w>span{display:inline-block;translate:0 calc(clamp(0, 1 - (var(--p) - var(--i) * .09) / (1 - var(--i) * .09), 1) * 115%);opacity:clamp(0, (var(--p) - var(--i) * .09) / (1 - var(--i) * .09) * 1.6, 1)}

/* ---------- 7. Sayaç ---------- */
.hk-count{display:inline-block;min-width:1.2em;text-align:left}

/* ---------- 8. Hareket azaltma ---------- */
@media(prefers-reduced-motion:reduce){
  .hk-intro{display:none!important}
  html.hk-pre .js-journey .u-hero-copy>*,html.hk-pre .js-journey .u-portal-stage,html.hk-pre .js-journey .u-scroll-cue{opacity:1;translate:none;scale:none}
  .js-journey [data-fx]{--p:1!important}
  .js-journey .universe-hero{--hp:0!important}
  .hk-glow{display:none}
  .hk-w>span{translate:none;opacity:1}
}


