/* =========================================================================
ASD Tasarım — 3D ve hareket katmanı stilleri
Mevcut yerleşime dokunmaz; 3D tuvaller mevcut öğelerin arkasına/yerine
oturur. 3D kapalıyken (.no3d) ya da WebGL yoksa her şey bugünkü haline döner.
========================================================================= */

/* ---------- Hero: 3D akış alanı ---------- */
.hero__field3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
opacity: 0; transition: opacity 1.4s var(--ease-out, ease); }
.hero__field3d.is-ready { opacity: 1; }
.hero__field { transition: opacity 1.2s var(--ease-out, ease); }
.hero__field.is-3d-hidden { opacity: 0; }

/* ---------- Yapay zekâ: Korkmaz küresi ---------- */
.has-orb { overflow: hidden; }
.ai-grid { position: relative; }
.ai-grid > .ai-copy, .ai-grid > .chat { position: relative; z-index: 1; }
.orb3d { position: absolute; z-index: 0; pointer-events: none; }
.orb3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
opacity: 0; transition: opacity 1.4s var(--ease-out, ease); }
.orb3d canvas.is-ready { opacity: 1; }
.orb3d__glow { position: absolute; inset: -18%; border-radius: 50%;
background: radial-gradient(closest-side, rgba(242, 93, 60, 0.30), rgba(146, 200, 62, 0.10) 58%, transparent 78%);
opacity: 0; transition: opacity 1.6s var(--ease-out, ease); }
.orb3d.is-ready .orb3d__glow { opacity: 1; }
/* Sohbet kartı buzlu cam olur: küre arkasından görünür, yazı okunur kalır */
.has-orb .chat { background-color: rgba(16, 16, 19, 0.62);
-webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25); }
[data-theme="light"] .has-orb .chat { background-color: rgba(255, 255, 255, 0.66); }

/* ---------- dipro.ai: 3D sonsuzluk amblemi ---------- */
.dipro3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
opacity: 0; transition: opacity 1.4s var(--ease-out, ease); }
.dipro3d.is-ready { opacity: 1; }
.dipro__media img { transition: opacity 1.2s var(--ease-out, ease), transform 1.6s var(--ease-out, ease); }
.dipro__media img.is-3d-hidden { opacity: 0; }
.dipro__media figcaption { z-index: 2; }

/* ---------- Footer: ofis küresi ---------- */
.footer-top { position: relative; }
.footer-top > :not(.globe3d) { position: relative; z-index: 1; }
.globe3d { position: absolute; z-index: 0; pointer-events: none;
width: clamp(240px, 21vw, 320px); aspect-ratio: 1;
left: 61%; top: 50%; transform: translate(-50%, -50%); }
.globe3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
opacity: 0; transition: opacity 1.4s var(--ease-out, ease); }
.globe3d canvas.is-ready { opacity: 1; }
.globe3d__label { position: absolute; left: 0; top: 0; margin: -0.55em 0 0 12px;
font-family: var(--f-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
color: var(--bone); white-space: nowrap; opacity: 0; padding: 3px 6px; background: color-mix(in srgb, var(--ink) 78%, transparent); transition: opacity 0.35s, color 0.35s; will-change: transform; }
.globe3d__label.is-on { opacity: 1; }
.globe3d__label.is-hot { color: var(--orange); }
.footer-offices .footer-col { transition: transform 0.35s var(--ease-out, ease); }
.has-3d .footer-offices .footer-col:hover h3 { color: var(--orange); }
@media (max-width: 960px) {
.globe3d { left: auto; right: -14%; top: 8%; transform: none; width: min(64vw, 300px); opacity: 0.55; }
.globe3d__label { display: none; } /* telefonda şehir etiketleri e-posta satırının üstüne binmesin */
}

/* ---------- Kitap: CSS ile gerçek 3D kitap ---------- */
.home-book__cover.b3d-on { transform: none; perspective: 1700px; }
.home-book__cover.b3d-on::after { display: none; }
.b3d { --rx: 0deg; --ry: 0deg; --t: clamp(16px, 2.1vw, 30px);
position: relative; aspect-ratio: 480 / 745; transform-style: preserve-3d;
transform: rotateX(calc(3deg + var(--rx))) rotateY(calc(-26deg + var(--ry)));
animation: b3d-float 7s ease-in-out infinite; }
.b3d > div { position: absolute; }
.b3d__front { inset: 0; transform-origin: left center; transform: translateZ(calc(var(--t) / 2));
transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); }
.b3d__front img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0 3px 3px 0; }
.b3d__front::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 6%;
background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.28) 45%, rgba(0, 0, 0, 0.08) 70%, transparent); }
.b3d__inner { inset: 0 0 0 0; transform: translateZ(calc(var(--t) / 2 - 1px));
background: linear-gradient(90deg, #e9e5da, #f6f3eb 12%, #f6f3eb); border-radius: 0 3px 3px 0;
display: grid; align-content: center; justify-items: center; gap: 14px; text-align: center; padding: 12%; color: #1d1d22; }
.b3d__inner p { font-size: clamp(1rem, 1.7vw, 1.5rem); line-height: 1.15; font-weight: 500; }
.b3d__inner strong { color: #e0482a; font-weight: 800; font-stretch: 80%; font-size: 1.4em; }
.b3d__inner span { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #5c5c63; }
.b3d__back { inset: 0; transform: translateZ(calc(var(--t) / -2)) rotateY(180deg); background: #ece9df; border-radius: 3px 0 0 3px; }
.b3d__spine { top: 0; bottom: 0; left: 0; width: var(--t); transform: translateX(calc(var(--t) / -2)) rotateY(-90deg);
background: linear-gradient(90deg, #d9d5ca, #f1eee6 40%, #d4cfc3); }
.b3d__pages { top: 3px; bottom: 3px; right: 0; width: var(--t); transform: translateX(calc(var(--t) / 2 - 3px)) rotateY(90deg);
background: repeating-linear-gradient(90deg, #f7f4ec 0 1px, #ddd8cb 1px 2px); }
.b3d__top { left: 0; right: 3px; top: 0; height: var(--t); transform: translateY(calc(var(--t) / -2 + 3px)) rotateX(90deg);
background: repeating-linear-gradient(0deg, #f7f4ec 0 1px, #ddd8cb 1px 2px); }
.b3d__bottom { left: 0; right: 3px; bottom: 0; height: var(--t); transform: translateY(calc(var(--t) / 2 - 3px)) rotateX(-90deg);
background: repeating-linear-gradient(0deg, #f7f4ec 0 1px, #ddd8cb 1px 2px); }
@media (hover: hover) {
.home-book__cover:hover .b3d__front, .home-book__cover:focus-visible .b3d__front { transform: translateZ(calc(var(--t) / 2)) rotateY(-32deg); }
}
@keyframes b3d-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .b3d { animation: none; } .b3d__front { transition: none; } }

/* ---------- 3D kapalıyken her şey bugünkü haline döner ---------- */
.no3d .hero__field3d, .no3d .orb3d, .no3d .dipro3d, .no3d .globe3d { display: none; }
.no3d .is-3d-hidden { opacity: 1 !important; }
.no3d .has-orb .chat { background-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.no3d .b3d { transform: rotateX(1.5deg) rotateY(-12deg); animation: none; }
.no3d .b3d > div:not(.b3d__front) { display: none; }

/* =========================================================================
Hareket katmanı (GSAP) — .has-motion açıkken
========================================================================= */
/* Hero vitrini: 3D deste — giden kart destenin üstünden geriye devrilir */
.reel-3d .reel__slide[data-pos="0"] { transform: perspective(1400px) translateY(0) rotateX(0deg) scale(1); }
.reel-3d .reel__slide[data-pos="0"]:hover { transform: perspective(1400px) translateY(-6px) rotateX(0deg) scale(1); }
.reel-3d .reel__slide[data-pos="1"] { transform: perspective(1400px) translateY(-6.5%) rotateX(0deg) scale(0.94); }
.reel-3d .reel__slide[data-pos="2"] { transform: perspective(1400px) translateY(-12.5%) rotateX(0deg) scale(0.88); }
.reel-3d .reel__slide[data-pos="hidden"] { transform: perspective(1400px) translateY(-17%) rotateX(0deg) scale(0.84); }
.reel-3d .reel__slide[data-pos="out"] { transform: perspective(1400px) translateY(-9%) rotateX(-78deg) scale(0.92); opacity: 0; }
.reel__glare { position: absolute; inset: 0; z-index: 6; border-radius: 14px; pointer-events: none; opacity: 0; transition: opacity 0.5s;
background: radial-gradient(440px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.24), transparent 55%); mix-blend-mode: soft-light; }
.reel__stage.is-tilting .reel__glare { opacity: 1; }

/* Sayılar: kilometre sayacı */
.odo { display: inline-flex; position: relative; height: 0.95em; line-height: 0.95em; overflow: hidden; vertical-align: top; }
.odo__col { display: flex; flex-direction: column; align-self: flex-start; flex: none; }
.odo__col > span, .odo__sep { display: block; height: 0.95em; line-height: 0.95em; }
.odo__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Uzmanlık: harf harf kayan başlık */
.has-motion .pillar__name .roll { display: inline-grid; overflow: hidden; vertical-align: top; padding-block: 0.16em; margin-block: -0.16em; }
.has-motion .pillar__name .roll > span { grid-area: 1 / 1; white-space: nowrap; }
.has-motion .pillar__name .rc { display: inline-block; transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); transition-delay: calc(var(--i, 0) * 16ms); }
.has-motion .pillar__name .roll__b .rc { transform: translateY(135%); }
.has-motion .pillar:hover .roll__a .rc, .has-motion .pillar:focus-visible .roll__a .rc { transform: translateY(-135%); }
.has-motion .pillar:hover .roll__b .rc, .has-motion .pillar:focus-visible .roll__b .rc { transform: translateY(0); }

/* Seçili işler: üzerinde gezinen ışık */
.work-glare { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.45s;
background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.38), transparent 60%); mix-blend-mode: soft-light; }
.work-card:hover .work-glare { opacity: 1; }

/* Referanslar: ışık halkası */
.has-motion .logos--select { background: radial-gradient(280px circle at var(--mx, -999px) var(--my, -999px), rgba(242, 93, 60, 0.09), transparent 70%); }
.has-motion .logos--select img { filter: grayscale(calc(1 - var(--k, 0))) contrast(1.05); opacity: calc(0.62 + 0.38 * var(--k, 0)); transform: scale(calc(1 + 0.04 * var(--k, 0))); }

/* Turuncu çağrı: imlece göre kalınlaşan harfler (sabit kutularda, satır kaymaz) */
.has-motion .cta__title .ww { white-space: nowrap; }
.has-motion .cta__title .wc { display: inline-block; text-align: center;
transition: font-weight 0.35s cubic-bezier(0.23, 1, 0.32, 1), font-stretch 0.35s cubic-bezier(0.23, 1, 0.32, 1); }

/* =========================================================================
Aşama 2 — açılış, akıcı kaydırma, başlıklar, imleç, işlerde WebGL
========================================================================= */
/* Açılış perdesi: yalnızca .is-intro varken görünür (hareketi azalt açıksa hiç gelmez) */
.intro { display: none; }
html.is-intro { overflow: hidden; }
.is-intro .intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: #0b0b0d; color: #f3f2ee;
clip-path: inset(0% 0% 0% 0%); }
.intro__inner { display: grid; justify-items: center; gap: 22px; }
.intro__logo { width: clamp(118px, 13vw, 180px); height: auto; animation: intro-logo 1.05s cubic-bezier(0.16, 1, 0.3, 1) both; }
.intro__words { display: flex; gap: 1.1em; margin: 0; font: 600 0.66rem/1 var(--f-mono, ui-monospace, monospace); letter-spacing: 0.3em; text-transform: uppercase; color: #8d8d95; }
.intro__words span { display: inline-block; animation: intro-word 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.intro__words span::first-letter { color: #f25d3c; }
.intro__words span:nth-child(1) { animation-delay: 0.28s; }
.intro__words span:nth-child(2) { animation-delay: 0.38s; }
.intro__words span:nth-child(3) { animation-delay: 0.48s; }
.intro__bar { display: block; width: clamp(150px, 16vw, 230px); height: 1px; background: rgba(243, 242, 238, 0.12); overflow: hidden; }
.intro__bar i { display: block; height: 100%; background: linear-gradient(90deg, #f25d3c, #92c83e); transform-origin: left center;
animation: intro-bar 2.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes intro-logo { from { clip-path: inset(100% 0 0 0); transform: translateY(16px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes intro-word { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes intro-bar { from { transform: scaleX(0); } to { transform: scaleX(0.82); } }
/* Hero'nun kendi giriş animasyonu perde kalkana kadar bekler */
.is-intro main, .is-intro .hero__title .line > span, .is-intro .hero__eyebrow, .is-intro .hero__lead,
.is-intro .hero__cta, .is-intro .hero__foot { animation-play-state: paused !important; }

/* Akıcı kaydırma (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Bölüm başlıkları: satır maskesi (Türkçe şapka ve kuyruklar kesilmesin) */
.has-motion .split-h.reveal { animation: none !important; opacity: 1; transform: none; }
/* Maske kutusu düzeni değiştirmez; kırpma alanı şapka ve kuyruklar için dışa taşar */
.split-h { margin-inline-end: -0.08em; }
.split-h .sh-line-mask { overflow: visible !important; clip-path: inset(-0.32em -0.2em -0.26em -0.2em); }

/* Seçili işler: WebGL sıvı mercek (yalnızca fare ile, 3D açıkken) */
.workfx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.workfx.is-on { opacity: 1; }
.work-card__url { z-index: 3; }
.fx-works:not(.no3d) .work-card:hover .work-card__media img { transform: none; }
.no3d .workfx { display: none; }

/* Üst bilgi: kaydırırken gizlen / geri gel + sayfa ilerleme çizgisi */
.has-motion .site-header { transition: background-color 0.45s var(--ease), border-color 0.45s var(--ease), backdrop-filter 0.45s, translate 0.65s cubic-bezier(0.16, 1, 0.3, 1); }
.has-motion .site-header.is-hidden { translate: 0 -101%; }
.has-motion .site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
background: linear-gradient(90deg, #f25d3c, #92c83e); transform: scaleX(var(--sp, 0)); transform-origin: 0 50%; }

/* Kapanış bandı: turuncu zeminde mürekkep lifler */
.cta__field3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none;
opacity: 0; transition: opacity 1.6s var(--ease-out, ease); }
.cta__field3d.is-ready { opacity: 1; }
.no3d .cta__field3d { display: none; }

/* Seçili işler: 7. ve 8. kart diğer çiftler gibi yan yana, köşeye sıkışmasın */
@media (min-width: 961px) {
.work-grid .work-card:nth-child(7) { grid-column: 1 / 7; }
.work-grid .work-card:nth-child(8) { grid-column: 7 / 12; margin-top: clamp(32px, 6vw, 110px); }
}

/* Seçili işler: kartın tamamı tıklanabilir.
Bağlantı katmanı (a.stretched::after) en yakın konumlu ataya göre yayılır; ad satırı
(.work-card__meta) konumlu olduğu için yalnızca o satırı kaplıyordu, görsel tıklanmıyordu.
Ad satırı konumsuz yapılır, alttaki çizgi efekti arka plan degradesiyle aynen korunur. */
.work-card__meta { position: static; background: linear-gradient(var(--paper-ink), var(--paper-ink)) no-repeat 0 100% / 0% 1px;
background-origin: border-box; transition: background-size 0.8s var(--ease); }
.work-card__meta::after { display: none; }
.work-card:hover .work-card__meta { background-size: 100% 1px; }
