/* =====================================================================
 * fx.css — burkaf.com ek etkileşim ve animasyon katmanı (stiller)
 * Mevcut tasarım değişkenlerini (--accent, --ink, --line, --surface...) kullanır;
 * açık/koyu tema ile otomatik uyumludur.
 * ===================================================================== */

:root {
    --fx-ease: cubic-bezier(.22, 1, .36, 1);
    --fx-spring: cubic-bezier(.34, 1.56, .64, 1);
    --fx-bubble: #d9fdd3;
}
html.dark { --fx-bubble: #144d37; }

/* ---------- Konfeti / parçacık tuvali ---------- */
.fx-confetti {
    position: fixed; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
}

/* ---------- Özel imleç halkası + imleci izleyen ışık ---------- */
.fx-ring {
    position: fixed; left: 0; top: 0; width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border: 1.5px solid var(--accent); border-radius: 50%;
    pointer-events: none; z-index: 9998; opacity: 0;
    transition: opacity .25s, scale .3s var(--fx-spring), background-color .25s;
    will-change: translate;
}
.fx-ring.on   { opacity: .7; }
.fx-ring.hot  { scale: 1.75; opacity: 1; background: color-mix(in oklab, var(--accent) 14%, transparent); }
.fx-ring.down { scale: .7; }
.fx-ring.txt  { opacity: 0; }

.fx-aurora {
    position: fixed; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px;
    border-radius: 50%; pointer-events: none; z-index: -1; opacity: 0;
    background: radial-gradient(circle, color-mix(in oklab, var(--accent) 16%, transparent), transparent 65%);
    transition: opacity .6s; will-change: translate;
}
.fx-aurora.on { opacity: 1; }

/* ---------- Hero: bağlantılı parçacık ağı ---------- */
.fx-net {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: -10; pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 35%, #000 35%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 85% at 50% 35%, #000 35%, transparent 80%);
}

/* ---------- Hero başlığı: kelime kelime etkileşim ---------- */
.fx-hw {
    display: inline-block; cursor: default;
    transition: transform .35s var(--fx-spring), color .25s;
}
.fx-hw:hover { transform: translateY(-5px) rotate(-1.5deg); color: var(--accent); }
.fx-hw.fx-wave { animation: fx-wave .85s var(--fx-ease) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes fx-wave {
    0%, 100% { transform: none; color: inherit; }
    40%      { transform: translateY(-9px); color: var(--accent); }
}

/* Yazı makinesi imleci */
.fx-caret {
    display: inline-block; width: 2px; height: 1.05em; margin-left: 3px;
    vertical-align: -0.15em; background: var(--accent);
    animation: fx-blink 1s steps(1) infinite;
}
@keyframes fx-blink { 50% { opacity: 0; } }

/* Önizleme penceresindeki kartlar */
#mock { cursor: pointer; }
#mock [data-mock="card"] { transition: translate .3s var(--fx-spring), border-color .25s; }
#mock [data-mock="card"]:hover { translate: 0 -5px; border-color: var(--accent); }
[data-mock="chip"] { transition: translate .35s ease-out; }

/* ---------- Bölüm başlıkları: kelime maskesiyle yükselme + çizgi ---------- */
.fx-split { position: relative; }
.fx-split .fx-wm {
    display: inline-block; overflow: hidden; vertical-align: top;
    padding-bottom: .14em; margin-bottom: -.14em;
}
.fx-split .fx-wm > span {
    display: inline-block; transform: translateY(108%);
    transition: transform .8s var(--fx-ease); transition-delay: calc(var(--i) * 60ms);
}
.fx-split.fx-in .fx-wm > span { transform: none; }
.fx-split::after {
    content: ''; position: absolute; left: 0; bottom: -.55rem; height: 3px; width: 56px;
    border-radius: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform .9s var(--fx-ease) .45s;
}
.fx-split.fx-in::after { transform: scaleX(1); }

/* ---------- İmleci izleyen spot ışığı (kartlar) ---------- */
.fx-spot { position: relative; }
.fx-spot::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%),
                color-mix(in oklab, var(--accent) 13%, transparent), transparent 70%);
}
.fx-spot:hover::after { opacity: 1; }

/* ---------- Butonlar: dalga (ripple) + parlama ---------- */
.fx-btn { position: relative; overflow: hidden; isolation: isolate; }
.fx-btn::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .8s var(--fx-ease);
}
.fx-btn:hover::after { transform: translateX(120%); }
.fx-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: currentColor; opacity: .2; transform: scale(0);
    animation: fx-rip .65s ease-out forwards;
}
@keyframes fx-rip { to { transform: scale(1); opacity: 0; } }

/* ---------- Üst menü ---------- */
body > header { transition: box-shadow .3s; }
body > header.fx-scrolled { box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .35); }
header nav[aria-label="Ana menü"] a { position: relative; }
header nav[aria-label="Ana menü"] a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform .35s var(--fx-ease);
}
header nav[aria-label="Ana menü"] a:hover::after,
header nav[aria-label="Ana menü"] a[data-active="true"]::after { transform: scaleX(1); }
#theme-toggle i { transition: transform .5s var(--fx-spring); }
#theme-toggle:hover i { transform: rotate(35deg) scale(1.15); }

/* Tema değişimi: tıklanan noktadan açılan daire */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Kayan şerit ---------- */
.marquee li { transition: color .25s, translate .3s var(--fx-spring); }
.marquee li i { transition: color .25s, scale .3s var(--fx-spring); }
.marquee li:hover { color: var(--ink); translate: 0 -3px; }
.marquee li:hover i { color: var(--accent); scale: 1.3; }

/* ---------- İstatistikler ---------- */
#hero dl > div { transition: background-color .3s; }
#hero dl > div dd { transition: scale .35s var(--fx-spring), color .25s; transform-origin: left; }
#hero dl > div:hover dd { scale: 1.08; color: var(--accent); }

/* ---------- Hizmetler ---------- */
#hizmetler > div > ul > li { transition: background-color .4s; }
#hizmetler > div > ul > li:hover { background-color: color-mix(in oklab, var(--surface) 65%, transparent); }
#hizmetler > div > ul > li > div:first-child > span.grid {
    transition: transform .5s var(--fx-spring), background-color .3s, color .3s, border-color .3s;
}
#hizmetler > div > ul > li:hover > div:first-child > span.grid { transform: rotate(-8deg) scale(1.15); }
#hizmetler ul ul li > i { transition: transform .45s var(--fx-spring); }
#hizmetler ul ul li > span { transition: translate .4s var(--fx-ease); }
#hizmetler > div > ul > li:hover ul li > i { transform: scale(1.4) rotate(-10deg); }
#hizmetler > div > ul > li:hover ul li > span { translate: 6px 0; }
#hizmetler > div > ul > li:hover ul li:nth-child(2) > i,
#hizmetler > div > ul > li:hover ul li:nth-child(2) > span { transition-delay: .04s; }
#hizmetler > div > ul > li:hover ul li:nth-child(3) > i,
#hizmetler > div > ul > li:hover ul li:nth-child(3) > span { transition-delay: .08s; }
#hizmetler > div > ul > li:hover ul li:nth-child(4) > i,
#hizmetler > div > ul > li:hover ul li:nth-child(4) > span { transition-delay: .12s; }

/* ---------- Paket oluşturucu ---------- */
#hesaplayici label {
    transition: translate .3s var(--fx-ease), border-color .2s, background-color .2s, box-shadow .3s;
}
#hesaplayici label:hover { translate: 6px 0; }
#hesaplayici label:has(input:checked) {
    box-shadow: 0 10px 30px -18px var(--accent);
    background-color: color-mix(in oklab, var(--accent) 5%, var(--canvas));
}
#pkg-cta.fx-ready { animation: fx-ready 1.1s ease-out 3; }
@keyframes fx-ready {
    0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ink) 45%, transparent); }
    100% { box-shadow: 0 0 0 16px transparent; }
}

/* ---------- Form ---------- */
#iletisim form div:has(> :focus-visible) > label { color: var(--accent); }
#iletisim form label { transition: color .2s; }
.fx-shake { animation: fx-shake .45s var(--fx-ease); }
@keyframes fx-shake {
    0%, 100% { translate: 0 0; }
    20% { translate: -8px 0; } 40% { translate: 7px 0; }
    60% { translate: -5px 0; } 80% { translate: 3px 0; }
}
.fx-count { margin-top: .35rem; text-align: right; font-size: .75rem; color: var(--muted); transition: color .2s; }
.fx-count.warn { color: var(--accent); font-weight: 600; }

.fx-chat .fx-bubble {
    position: relative; margin-left: auto; width: fit-content; max-width: 100%;
    padding: .55rem .75rem .4rem; border-radius: .7rem .15rem .7rem .7rem;
    background: var(--fx-bubble); color: var(--ink);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}
.fx-chat .fx-bubble > #fx-bubble-text > div { overflow-wrap: anywhere; }
.fx-dots { display: flex; gap: 4px; padding-top: 6px; }
.fx-dots[hidden] { display: none; }
.fx-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: fx-dot 1s infinite; }
.fx-dots i:nth-child(2) { animation-delay: .15s; }
.fx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fx-dot {
    0%, 60%, 100% { translate: 0 0; opacity: .4; }
    30%           { translate: 0 -4px; opacity: 1; }
}
.fx-bubble.pop { animation: fx-pop .3s var(--fx-spring); }
@keyframes fx-pop { from { scale: .96; } to { scale: 1; } }

/* ---------- Alt bilgi ---------- */
footer ul a {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px;
    transition: background-size .35s var(--fx-ease), color .2s;
}
footer ul a:hover { background-size: 100% 1px; }
.js .fx-rise { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--fx-ease), transform .8s var(--fx-ease); transition-delay: calc(var(--i, 0) * 100ms); }
.js .fx-rise.fx-in { opacity: 1; transform: none; }

/* ---------- Sayfa başına dön (ilerleme halkalı) ---------- */
.fx-btt {
    position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 50;
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--canvas); color: var(--ink); cursor: pointer;
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .45);
    opacity: 0; translate: 0 16px; pointer-events: none;
    transition: opacity .35s, translate .45s var(--fx-spring), scale .25s var(--fx-spring);
}
.fx-btt.show { opacity: 1; translate: 0 0; pointer-events: auto; }
.fx-btt:hover { scale: 1.08; }
.fx-btt:active { scale: .94; }
.fx-btt svg { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.fx-btt circle { fill: none; stroke-width: 2.5; }
.fx-btt .bg { stroke: var(--line); }
.fx-btt .ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .1s linear; }
.fx-btt i { font-size: .8rem; transition: translate .3s var(--fx-spring); }
.fx-btt:hover i { translate: 0 -2px; }

/* ---------- Bölüm noktaları (sağ kenar) ---------- */
.fx-dotnav {
    position: fixed; right: 1.1rem; top: 50%; translate: 0 -50%; z-index: 40;
    display: none; flex-direction: column; gap: 6px;
}
@media (min-width: 1280px) { .fx-dotnav { display: flex; } }
.fx-dotnav a { position: relative; display: grid; place-items: center; width: 22px; height: 22px; }
.fx-dotnav a span {
    width: 8px; height: 8px; border-radius: 999px; background: var(--line);
    transition: height .35s var(--fx-spring), background-color .25s, scale .25s;
}
.fx-dotnav a:hover span { background: var(--muted); scale: 1.3; }
.fx-dotnav a.on span { background: var(--accent); height: 22px; }
.fx-dotnav a::before {
    content: attr(data-label); position: absolute; right: 100%; margin-right: 8px; white-space: nowrap;
    padding: 4px 10px; border-radius: 6px; font-size: 12px; background: var(--ink); color: var(--canvas);
    opacity: 0; translate: 6px 0; pointer-events: none; transition: opacity .2s, translate .3s var(--fx-ease);
}
.fx-dotnav a:hover::before, .fx-dotnav a:focus-visible::before { opacity: 1; translate: 0 0; }

/* ---------- WhatsApp balonu ve sabit buton ---------- */
.fx-wa-bubble {
    position: fixed; right: 5.5rem; bottom: 1.6rem; z-index: 50;
    max-width: min(17rem, calc(100vw - 7.5rem));
    background: var(--canvas); color: var(--ink);
    border: 1px solid var(--line); border-radius: .9rem .9rem .2rem .9rem;
    box-shadow: 0 14px 36px -14px rgba(0, 0, 0, .5);
    padding: .7rem 2rem .7rem .85rem; font-size: .8125rem; line-height: 1.45;
    transform-origin: right bottom; animation: fx-bubble-in .5s var(--fx-spring) both;
}
.fx-wa-bubble.out { animation: fx-bubble-out .3s ease-in both; }
.fx-wa-bubble a { display: block; }
.fx-wa-bubble .x {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 6px;
    color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.fx-wa-bubble .x:hover { color: var(--ink); background: var(--surface); }
@keyframes fx-bubble-in  { from { opacity: 0; scale: .6; translate: 12px 8px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes fx-bubble-out { to { opacity: 0; scale: .8; translate: 10px 6px; } }

/* ---------- Bildirim (toast) ---------- */
.fx-toast {
    position: fixed; left: 50%; bottom: 1.5rem; z-index: 9990; translate: -50% 0;
    padding: .65rem 1rem; border-radius: 999px; font-size: .8125rem; font-weight: 500;
    background: var(--ink); color: var(--canvas); box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .55);
    animation: fx-toast 3.2s var(--fx-ease) both; pointer-events: none;
}
@keyframes fx-toast {
    0%   { opacity: 0; translate: -50% 20px; }
    10%, 85% { opacity: 1; translate: -50% 0; }
    100% { opacity: 0; translate: -50% 12px; }
}

/* ---------- Hareketi azalt tercihi ---------- */
@media (prefers-reduced-motion: reduce) {
    .fx-ring, .fx-aurora, .fx-net, .fx-confetti { display: none !important; }
    .fx-hw.fx-wave, .fx-caret, #pkg-cta.fx-ready, .fx-shake { animation: none; }
    .fx-hw:hover { transform: none; }
    .fx-rise { opacity: 1 !important; transform: none !important; }
    .fx-btn::after { display: none; }
}


/* =====================================================================
 * MOBİL / DOKUNMATİK UYUMLULUK
 * ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }

/* Sabit butonlar: çentik / ana ekran çubuğu güvenli alanı */
a.fixed[aria-label^="WhatsApp"] {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
}
.fx-btt { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); left: calc(1.25rem + env(safe-area-inset-left, 0px)); }
.fx-wa-bubble { bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px)); }

/* Hemen ara butonu (yalnızca telefon): WhatsApp butonunun üstünde */
.fx-call {
    position: fixed; z-index: 50; display: none; place-items: center;
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.05rem;
    right: calc(1.25rem + 4px + env(safe-area-inset-right, 0px));
    bottom: calc(1.25rem + 56px + 12px + env(safe-area-inset-bottom, 0px));
    background: var(--ink); color: var(--canvas);
    box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .55);
    transition: scale .25s var(--fx-spring), opacity .25s, translate .3s;
}
.fx-call:active { scale: .92; }
@media (max-width: 767px) and (pointer: coarse) { .fx-call { display: grid; } }

/* Klavye açıkken (form yazarken) sabit butonlar yazmayı engellemesin */
.fx-kbd .fx-call, .fx-kbd .fx-btt, .fx-kbd a.fixed[aria-label^="WhatsApp"], .fx-kbd .fx-wa-bubble {
    opacity: 0; pointer-events: none;
}

@media (max-width: 767px) {
    /* iOS Safari, 16px'den küçük yazı alanına odaklanınca sayfayı yakınlaştırır */
    #iletisim input, #iletisim select, #iletisim textarea { font-size: 16px; }

    /* Sabit butonlar alt bilginin üstünü kapatmasın */
    footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

    /* Karşılama balonu dar ekranda taşmasın */
    .fx-wa-bubble { right: calc(5.25rem + env(safe-area-inset-right, 0px)); max-width: calc(100vw - 7.25rem); }
}

/* Parmakla rahat dokunulabilir hedefler (en az ~44px) */
@media (pointer: coarse) {
    #theme-toggle, #mobile-menu-btn { width: 2.75rem; height: 2.75rem; }
    [data-swatch] { width: 1.75rem; height: 1.75rem; }
    #hero [role="group"] { gap: .6rem; }
    footer ul a { padding-block: .4rem; }
    #mobile-menu a { min-height: 2.75rem; display: flex; align-items: center; }
    .fx-btt { width: 52px; height: 52px; }
}

/* Dokunmatikte "yapışan hover" olmasın; yerine parmak basınca geri bildirim */
@media (hover: none) {
    .fx-hw:hover { transform: none; color: inherit; }
    #mock [data-mock="card"]:hover { translate: 0 0; border-color: var(--line); }
    #hesaplayici label:hover { translate: 0 0; }
    .marquee li:hover { color: inherit; translate: 0 0; }
    .marquee li:hover i { color: inherit; scale: 1; }
    #hero dl > div:hover dd { scale: 1; color: inherit; }
    #hizmetler > div > ul > li:hover { background-color: transparent; }
    #hizmetler > div > ul > li:hover > div:first-child > span.grid { transform: none; }
    #hizmetler > div > ul > li:hover ul li > i { transform: none; }
    #hizmetler > div > ul > li:hover ul li > span { translate: 0 0; }
    .fx-btn:hover::after { transform: translateX(-120%); }
    footer ul a:hover { background-size: 0 1px; }
    .fx-spot:hover::after { opacity: 0; }
    .fx-spot:active::after { opacity: 1; }
    #hesaplayici label:active { scale: .985; }
    .fx-btt:hover { scale: 1; }
}
