/* =========================================================================
   UYAN — GİRİŞ: canlı iki dünya (KOD / FİT)
   Her dünya tam ekran bir katman; ikisi ek yerinde (--split) kırpılır. Üzerine gelinen taraf genişler,
   seçilen taraf ekranı kaplar ve o dünyaya erir. Masaüstünde yan yana, telefonda üst–alt; tek tasarım.
   FİT katmanı yeni FİT'in kendisi: kâğıt, mürekkep, kırmızı ve sağ kenarda hero'daki video duvarı.
   Durumlar js/gate.js'ten: .intro[data-hot="code|fit|ncode|nfit"], .intro.opening.go-code|go-fit, .intro.fade
   ========================================================================= */

.intro {
  --split: 50%; --pad: clamp(24px, 3.4vw, 56px); --t: .9s; --e: cubic-bezier(.16, 1, .3, 1);
  --paper: #efebe4; --ink: #111; --red: #ff3b1f;
  display: block; background: #000; perspective: none;
}
.intro[data-hot="fit"]  { --split: 42%; }
.intro[data-hot="code"] { --split: 58%; }
.intro[data-hot="nfit"]  { --split: 47.5%; }     /* boşta "davet": ek yeri hafifçe nefes alır */
.intro[data-hot="ncode"] { --split: 52.5%; }
.intro.opening.go-fit  { --split: 0%; }
.intro.opening.go-code { --split: 100%; }
.intro.fade { opacity: 0; transition: opacity .4s ease; pointer-events: none; }

/* ---- katmanlar ---- */
.intro-half {
  position: absolute; inset: 0; display: block; flex: none; padding: 0; overflow: hidden; cursor: pointer; text-align: left;
  transition: clip-path var(--t) var(--e), -webkit-clip-path var(--t) var(--e);
}
.intro-half:hover, .intro-half:focus-visible { flex-grow: 0; outline: none; }
.intro-code { -webkit-clip-path: inset(0 calc(100% - var(--split)) 0 0); clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.intro-fit  { -webkit-clip-path: inset(0 0 0 var(--split)); clip-path: inset(0 0 0 var(--split)); background: var(--paper); color: var(--ink); align-items: initial; text-align: left; }
/* kâğıt greni (FİT ile aynı doku) */
.intro-fit::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06; z-index: 3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.25 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px;
}

/* ---- metin blokları ---- */
.g-txt { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; transition: opacity .5s ease, transform var(--t) var(--e), left var(--t) var(--e), bottom var(--t) var(--e); transform-origin: 0 100%; }
.intro-code .g-txt { bottom: var(--pad); }
.intro-fit  .g-txt { left: calc(var(--split) + var(--pad)); bottom: var(--pad); }
.ih-code-rain { -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%); mask-image: linear-gradient(180deg, #000 0%, transparent 78%); }

.intro-fit .ih-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(14px, 1.6vw, 24px); font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .24em; opacity: 1; }
.intro-fit .ih-kicker::before { content: ""; width: 7px; height: 7px; background: var(--red); flex: none; }
.intro-fit .ih-title { font-family: "Inter Tight", sans-serif; font-weight: 900; font-size: clamp(64px, 12vw, 190px); line-height: .8; letter-spacing: -.07em; }
/* kırmızı italik kelime video duvarının kenarına taşar (hero'daki bağ) */
.ih-em { position: relative; z-index: 1; display: block; margin: .04em 0 0 34%; white-space: nowrap; font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(40px, 5.6vw, 92px); line-height: .9; letter-spacing: -.03em; color: var(--red); }
.intro-fit .ih-sub { margin-top: clamp(14px, 1.6vw, 24px); font-family: "Inter Tight", sans-serif; font-size: clamp(13px, 1.05vw, 15.5px); color: #57534d; opacity: 1; }
.intro-fit .ih-enter {
  position: relative; overflow: hidden; margin-top: clamp(16px, 1.8vw, 26px); min-height: 52px; padding: 0 24px; border: 0; border-radius: 6px;
  background: var(--ink); color: #f3efe8; font: 700 15px/1 "Inter Tight", sans-serif; letter-spacing: -.01em;
}
.intro-fit .ih-enter::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red); transform: translate3d(-101%, 0, 0); transition: transform .55s var(--e); }
.intro[data-hot="fit"] .intro-fit .ih-enter::after, .intro-fit:focus-visible .ih-enter::after { transform: none; }
.intro-half:focus-visible .ih-enter { outline: 2px solid currentColor; outline-offset: 4px; }

/* seçilmeyen taraf geri çekilir */
.intro[data-hot="fit"]  .intro-code .g-txt, .intro[data-hot="code"] .intro-fit .g-txt { opacity: .38; }
.intro[data-hot="code"] .intro-fit .g-txt { transform: scale(.8); }
.intro[data-hot="fit"]  .intro-code .g-txt { transform: scale(.9); }

/* ---- KOD: terminal duvarı — FİT'teki video duvarının aynası (sol kenarda, KOD alanının %44'ü).
   İçinde kod yazılır, "yayınlanınca" altta küçük bir site önizlemesi kurulur (js/gate.js). ---- */
.ih-code-rain { opacity: .35; }
.g-term {
  position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: min(calc(var(--split) * .44), 28vw); overflow: hidden; pointer-events: none;
  display: flex; flex-direction: column; padding: clamp(60px, 9vh, 92px) 16px 20px clamp(16px, 1.6vw, 26px);
  background: linear-gradient(180deg, #03120b, #020a06); box-shadow: inset -1px 0 0 rgba(0,255,156,.28), 18px 0 60px -30px rgba(0,255,156,.35);
  font-family: "JetBrains Mono", monospace; font-size: clamp(10.5px, .86vw, 13.5px); line-height: 1.8; color: rgba(230,255,244,.78);
  transition: width var(--t) var(--e), height var(--t) var(--e), opacity .5s ease;
}
.g-term-bar { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid rgba(0,255,156,.18); font-size: .82em; color: rgba(230,255,244,.5); white-space: nowrap; }
.g-term-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,255,156,.3); flex: none; }
.g-term-bar i:first-child { background: #00ff9c; box-shadow: 0 0 10px rgba(0,255,156,.7); }
.g-term-bar b { margin-left: 6px; font-weight: 500; letter-spacing: .04em; }
.g-term code { display: block; white-space: pre; font: inherit; flex: none; }
.g-term .k { color: #ff2bd6; } .g-term .s { color: #ffd400; } .g-term .f { color: #00e5ff; } .g-term .g { color: #00ff9c; text-shadow: 0 0 12px rgba(0,255,156,.5); } .g-term .c { color: rgba(230,255,244,.38); }
.g-term .cur { display: inline-block; width: .6em; height: 1.1em; margin-left: 1px; vertical-align: -.18em; background: #00ff9c; box-shadow: 0 0 12px rgba(0,255,156,.8); animation: gCur 1s steps(2) infinite; }
@keyframes gCur { 50% { opacity: 0; } }
/* site önizlemesi: parçalar sırayla kurulur */
.g-prev { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px; border: 1px solid rgba(0,255,156,.3); border-radius: 6px; background: rgba(0,255,156,.03); opacity: .25; transition: opacity .5s; }
.g-prev.built { opacity: 1; }
.g-prev > * { grid-column: 1 / -1; transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--e); }
.g-prev.built > * { transform: none; }
.gp-bar { display: flex; align-items: center; gap: 4px; transform: none !important; font-size: .74em; color: rgba(230,255,244,.45); }
.gp-bar i { width: 5px; height: 5px; border-radius: 50%; background: rgba(0,255,156,.4); } .gp-bar em { font-style: normal; margin-left: 4px; }
.gp-nav { height: 5px; background: rgba(230,255,244,.2); transition-delay: .05s !important; }
.gp-h1 { height: 16px; width: 72%; background: #00ff9c; box-shadow: 0 0 14px rgba(0,255,156,.5); transition-delay: .18s !important; }
.gp-h2 { height: 6px; width: 54%; background: rgba(230,255,244,.35); transition-delay: .3s !important; }
.gp-btn { height: 12px; width: 30%; background: none; box-shadow: inset 0 0 0 1px #00ff9c; transition-delay: .42s !important; }
.gp-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; transform: none !important; }
.gp-cards i { height: clamp(22px, 4vh, 40px); background: rgba(0,229,255,.16); box-shadow: inset 0 0 0 1px rgba(0,229,255,.4); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .5s var(--e) .55s; }
.gp-cards i:nth-child(2) { transition-delay: .65s; background: rgba(255,43,214,.14); box-shadow: inset 0 0 0 1px rgba(255,43,214,.4); } .gp-cards i:nth-child(3) { transition-delay: .75s; }
.g-prev.built .gp-cards i { transform: none; }
.intro[data-hot="fit"] .g-term { opacity: .5; }
.intro.opening .g-term { opacity: 0; transition: opacity .35s; }
@media (min-width: 900px) { .intro.go-code .g-term { opacity: 1; } .intro.go-code .g-term code, .intro.go-code .g-prev { opacity: 0; transition: opacity .4s; } }

/* ---- iki taraf aynı iskelet: mono etiket · dev başlık · ikinci kelime · tek satır açıklama · aynı boy düğme ---- */
.intro-code .g-txt { left: calc(var(--split) * .44 + var(--pad)); }
.intro-code .ih-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(14px, 1.6vw, 24px); font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .24em; opacity: 1; color: rgba(230,255,244,.75); }
.intro-code .ih-kicker::before { content: ""; width: 7px; height: 7px; background: #00ff9c; box-shadow: 0 0 10px #00ff9c; flex: none; }
.intro-code .ih-title { font-size: clamp(56px, 9.6vw, 152px); line-height: .86; }
.intro-code .ih-em { margin: .18em 0 0 22%; font-family: "JetBrains Mono", monospace; font-style: normal; font-weight: 500; font-size: clamp(22px, 2.9vw, 46px); letter-spacing: -.04em; color: #00e5ff; text-shadow: 0 0 22px rgba(0,229,255,.55); }
.intro-code .ih-em::before { content: ">"; margin-right: .5em; color: rgba(230,255,244,.4); }
.intro-code .ih-sub { margin-top: clamp(14px, 1.6vw, 24px); font-size: clamp(12px, .98vw, 14.5px); color: rgba(230,255,244,.7); opacity: 1; }
.intro-code .ih-enter, .intro-fit .ih-enter { position: relative; overflow: hidden; margin-top: clamp(16px, 1.8vw, 26px); min-width: 0; min-height: 52px; padding: 0 24px; border-radius: 6px; font-size: 15px; letter-spacing: 0; }
.intro-code .ih-enter { border: 0; box-shadow: inset 0 0 0 1.5px #00ff9c, 0 0 24px rgba(0,255,156,.18); color: #00ff9c; font-weight: 700; transition: background-color .3s, color .3s, opacity .7s ease .8s, transform .9s var(--e) .8s; }
.intro[data-hot="code"] .intro-code .ih-enter, .intro-code:focus-visible .ih-enter { background: #00ff9c; color: #000; }

/* ---- hiza: iki tarafta etiket, başlık tabanı, ikinci kelime, açıklama ve düğme aynı yatay çizgilerde ----
   Başlık ve ikinci kelime sabit yükseklikte kutularda, tabana oturur; harflerin sol boşluğu etiketle hizalanır. */
.intro-code .ih-title, .intro-fit .ih-title { display: flex; align-items: flex-end; height: clamp(64px, 11.4vw, 180px); line-height: .8; white-space: nowrap; }
.intro-code .ih-title { margin-left: -.045em; }
.intro-fit .ih-title { margin-left: -.05em; }
.intro-code .ih-em, .intro-fit .ih-em { display: flex; align-items: center; height: clamp(40px, 5.8vw, 92px); margin-top: clamp(4px, .6vw, 10px); line-height: 1; }
.intro-code .ih-em { margin-left: 0; }
.intro-code .ih-kicker, .intro-fit .ih-kicker { margin-bottom: clamp(10px, 1.2vw, 18px); }

/* metin blokları kendi alanını aşmaz: uzun açıklama (ör. Lehçe) ek yerinde kırpılmak yerine alt satıra geçer */
@media (min-width: 900px) {
  .intro-code .g-txt { width: calc(var(--split) * .56 - var(--pad) * 2); }
  .intro-fit  .g-txt { width: calc((100% - var(--split)) * .56 - var(--pad) * 2); }
  /* kırmızı kelime videoya yarım taşmasın: sola hizalı, her dilde metin alanının içinde (KOD'daki "> çalışsın." ile aynı hiza) */
  .intro-fit .ih-em { margin-left: 0; font-size: clamp(36px, 4.9vw, 82px); }
  .g-txt .ih-sub { max-width: 100%; line-height: 1.5; min-height: clamp(38px, 3.2vw, 48px); }   /* iki satırlık yer: tek / çift satırda hizalar bozulmaz */
}

/* ---- açılış koreografisi (html.gate-pre → kalkınca): ek yeri çizilir, dünyalar ek yerinden açılır, metinler yükselir ---- */
.g-line { position: absolute; z-index: 4; left: var(--split); top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: #fff; mix-blend-mode: difference; opacity: .55; pointer-events: none; transform-origin: 50% 0; transition: left var(--t) var(--e), top var(--t) var(--e), transform .7s var(--e), opacity .3s; }
.intro.opening .g-line { opacity: 0; }
.g-txt > * { transition: opacity .7s ease, transform .9s var(--e); }
.g-txt > :nth-child(1) { transition-delay: .55s; } .g-txt > :nth-child(2) { transition-delay: .62s; } .g-txt > :nth-child(3) { transition-delay: .72s; }
.g-txt > :nth-child(4) { transition-delay: .8s; } .g-txt > :nth-child(5) { transition-delay: .88s; }
.gate-pre .g-txt > * { opacity: 0; transform: translate3d(0, 26px, 0); transition: none; }
.gate-pre .g-line { transform: scaleY(0); transition: none; }
.gate-pre .intro-code, .gate-pre .intro-fit { -webkit-clip-path: inset(0 calc(100% - var(--split)) 0 var(--split)); clip-path: inset(0 calc(100% - var(--split)) 0 var(--split)); transition: none; }
.gate-pre .g-seam, .gate-pre .lang-intro { opacity: 0; }
.g-seam, .lang-intro { transition: left var(--t) var(--e), top var(--t) var(--e), opacity .6s ease .9s; }
.intro-half { transition-delay: .28s; }                       /* ilk açılışta çizgi önce çizilir */
.intro[data-hot] .intro-half, .intro.opening .intro-half { transition-delay: 0s; }

/* ---- FİT: video duvarı — sağ kenarda, FİT alanının %44'ü; tam açılınca hero'daki duvarla aynı yer ve kadraj ---- */
.g-wall { position: absolute; z-index: 1; top: 0; bottom: 0; right: 0; width: calc((100% - var(--split)) * .44); overflow: hidden; background: #151413; transition: width var(--t) var(--e), top var(--t) var(--e); }
.g-wall-in { position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 64px); transform: scale(1.08); transform-origin: 50% 40%; background: url("../video/hero-poster.jpg") center / cover no-repeat; }
.g-wall video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .5s; }
.g-wall.playing video { opacity: 1; }

/* ---- ek yeri: dikey etiket (her iki zeminde okunur) ---- */
.g-seam {
  position: absolute; z-index: 4; left: var(--split); top: 50%; transform: translate(-50%, -50%) rotate(180deg); writing-mode: vertical-rl; pointer-events: none;
  display: flex; align-items: center; gap: 14px; white-space: nowrap; font: 500 10px/1 "JetBrains Mono", monospace; letter-spacing: .3em; text-transform: uppercase;
  color: #fff; mix-blend-mode: difference; transition: left var(--t) var(--e), top var(--t) var(--e), opacity .3s;
}
.g-seam i { width: 1px; height: 38px; background: currentColor; opacity: .6; }
.lang-intro { z-index: 5; }

/* ---- seçim: taraf ekranı kaplar, metinler çekilir, sonra dünya görünür ---- */
.intro.opening { pointer-events: none; }
.intro.opening .g-txt { opacity: 0; transition: opacity .35s ease, left var(--t) var(--e), bottom var(--t) var(--e); }
.intro.opening .g-seam, .intro.opening .lang-intro { opacity: 0; transition: opacity .25s; }

/* =========================================================================
   TELEFON / DAR EKRAN (<900px): aynı fikir üst–alt. KOD üstte, FİT altta; dokununca o taraf ekranı kaplar.
   ========================================================================= */
@media (max-width: 899px) {
  .intro { --pad: 18px; }
  .intro[data-hot="fit"]  { --split: 44%; }
  .intro[data-hot="code"] { --split: 56%; }
  .intro[data-hot="nfit"]  { --split: 47%; }
  .intro[data-hot="ncode"] { --split: 53%; }
  .intro-code { -webkit-clip-path: inset(0 0 calc(100% - var(--split)) 0); clip-path: inset(0 0 calc(100% - var(--split)) 0); }
  .intro-fit  { -webkit-clip-path: inset(var(--split) 0 0 0); clip-path: inset(var(--split) 0 0 0); }
  .intro-code .g-txt { bottom: calc(100% - var(--split) + 26px); }
  .intro-fit  .g-txt { left: var(--pad); right: 46%; bottom: max(22px, env(safe-area-inset-bottom)); }
  .intro-fit .ih-title { font-size: clamp(60px, 20.5vw, 160px); }
  .ih-em { font-size: clamp(40px, 12.5vw, 96px); margin-left: 30%; }
  .intro-fit .ih-sub { font-size: 13px; line-height: 1.4; }
  /* üst yarı: solda terminal duvarı, sağda KOD; alt yarı: solda FİT, sağda video (çapraz) */
  .g-term { width: 50%; height: var(--split); bottom: auto; padding: 58px 10px 26px 14px; font-size: 8.5px; line-height: 1.7; box-shadow: inset -1px 0 0 rgba(0,255,156,.28); }
  .g-term-bar { padding-bottom: 7px; margin-bottom: 7px; }
  .g-prev { gap: 4px; padding: 6px; } .gp-h1 { height: 10px; } .gp-cards i { height: 16px; } .gp-btn { height: 8px; }
  .intro-code .g-txt { left: calc(50% + 14px); right: var(--pad); }
  .intro-code .ih-title { font-size: clamp(48px, 16.5vw, 120px); }
  .intro-code .ih-em { font-size: clamp(18px, 5.4vw, 40px); margin-left: 0; }
  .intro-code .ih-sub { font-size: 11px; line-height: 1.5; }
  .intro-code .ih-enter, .intro-fit .ih-enter { min-height: 46px; padding: 0 18px; font-size: 14px; align-self: flex-start; }
  .intro-code .ih-title, .intro-fit .ih-title { height: 22vw; }
  .intro-code .ih-em, .intro-fit .ih-em { height: 12vw; margin-top: 2px; }
  .g-line { left: 0; right: 0; top: var(--split); bottom: auto; width: auto; height: 1px; margin: -.5px 0 0; transform-origin: 0 50%; }
  .gate-pre .g-line { transform: scaleX(0); }
  .gate-pre .intro-code, .gate-pre .intro-fit { -webkit-clip-path: inset(var(--split) 0 calc(100% - var(--split)) 0); clip-path: inset(var(--split) 0 calc(100% - var(--split)) 0); }
  .g-wall { top: var(--split); width: 44%; }
  .g-wall-in { height: 100%; transform: none; background-image: url("../video/hero-poster-720.jpg"); }
  .g-seam { left: 50%; top: var(--split); writing-mode: horizontal-tb; transform: translate(-50%, -50%); gap: 10px; letter-spacing: .26em; }
  .g-seam i { width: 22px; height: 1px; }
  .intro[data-hot="code"] .intro-fit .g-txt, .intro[data-hot="fit"] .intro-code .g-txt { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-half, .g-txt, .g-txt > *, .g-wall, .g-term, .g-prev > *, .gp-cards i, .g-line, .g-seam, .intro-fit .ih-enter::after { transition: none !important; }
  .g-term .cur { animation: none; }
  .intro.fade { transition: opacity .2s; }
}

/* kısa telefonlar (≤700px yükseklik): üst yarıda KOD metni dil düğmelerine binmesin */
@media (max-width: 899px) and (max-height: 700px) {
  .intro-code .ih-sub { display: none; }
  .intro-code .ih-title, .intro-fit .ih-title { height: 19vw; }
  .intro-code .ih-enter, .intro-fit .ih-enter { min-height: 42px; margin-top: 12px; }
}

/* ---- .intro.live (js/gate.js ilk hareketten itibaren): ek yerine bağlı her şey --split'i kare kare izler; bu özelliklerde CSS geçişi yok ---- */
.intro.live .intro-half { transition: none; }
.intro.live .g-wall, .intro.live .g-term { transition: opacity .5s ease; }
.intro.live .g-line { transition: opacity .3s; }
.intro.live .g-seam, .intro.live .lang-intro { transition: opacity .3s; }
.intro.live .g-txt { transition: opacity .5s ease, transform .6s var(--e); }
.intro.live.opening .g-txt { transition: opacity .35s ease; }
