/* ==========================================================================
   Dosya Adı          : assets/css/kod-giris.css
   Amacı              : Ana sayfa açılış girişi — "kod yazıldıkça siteler kurulur".
                        Solda kodun aktığı editör, sağda parça parça oluşan
                        tarayıcı sayfası; en sonda ana sayfaya dönüşür.
   Hazırlayan         : Özgür Elibol
   Hazırlanma Tarihi  : 02.10.2026
   Değişiklik Tarihi  : 02.10.2026
   ========================================================================== */

/* === Görünürlük: yalnızca giriş oynayacaksa (head betiği html'e sınıf ekler) === */
.kg {
    display: none;
}

html.kg-oynat .kg {
    display: block;
}

html.kg-oynat,
html.kg-oynat body {
    overflow: hidden;
}

/* === Renk ve ölçü değişkenleri === */
.kg {
    --kg-zemin: #05070d;
    --kg-panel: #0b1020;
    --kg-cizgi: rgba(148, 163, 184, 0.14);
    --kg-yazi: #e2e8f0;
    --kg-soluk: #64748b;
    --kg-turuncu: #f97316;
    --kg-altin: #fbbf24;
    --kg-pembe: #ec4899;
    --kg-mavi: #3b82f6;
    --kg-mono: "Cascadia Code", "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;

    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at 18% 20%, rgba(249, 115, 22, 0.14), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.16), transparent 42%),
        var(--kg-zemin);
    color: var(--kg-yazi);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    transition: opacity 0.7s ease;
}

.kg.kg-bitti {
    opacity: 0;
    pointer-events: none;
}

.kg *,
.kg *::before,
.kg *::after {
    box-sizing: border-box;
}

/* === Arka planda akan kod sütunları === */
.kg-akan {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 2vw;
    opacity: 0.16;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.kg-akan pre {
    margin: 0;
    font-family: var(--kg-mono);
    font-size: 12px;
    line-height: 1.7;
    color: #94a3b8;
    white-space: pre;
    animation: kg-ak var(--sure, 22s) linear infinite;
}

.kg-akan pre:nth-child(2n) { color: #fdba74; }
.kg-akan pre:nth-child(3n) { color: #93c5fd; }

@keyframes kg-ak {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

/* === Sahne: editör + tarayıcı === */
.kg-sahne {
    position: absolute;
    inset: 70px 4vw 78px;
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 28px;
    align-items: stretch;
}

/* --- Ortak pencere çerçevesi --- */
.kg-pencere {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 16px;
    background: var(--kg-panel);
    border: 1px solid var(--kg-cizgi);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.kg-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 14px;
    border-bottom: 1px solid var(--kg-cizgi);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.kg-noktalar {
    display: flex;
    gap: 6px;
}

.kg-noktalar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.kg-noktalar i:nth-child(2) { background: #f59e0b; }
.kg-noktalar i:nth-child(3) { background: #22c55e; }

/* --- Editör --- */
.kg-sekme {
    font-family: var(--kg-mono);
    font-size: 12px;
    color: var(--kg-yazi);
    padding: 6px 12px;
    border-radius: 8px 8px 0 0;
    background: var(--kg-zemin);
    border: 1px solid var(--kg-cizgi);
    border-bottom: 0;
    transform: translateY(6px);
}

.kg-kod {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 16px 18px 40px;
    overflow: hidden;
    font-family: var(--kg-mono);
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--kg-yazi);
    white-space: pre-wrap;
    word-break: break-word;
    counter-reset: satir;
}

.kg-satir {
    display: block;
    position: relative;
    padding-left: 38px;
}

.kg-satir::before {
    counter-increment: satir;
    content: counter(satir);
    position: absolute;
    left: 0;
    width: 26px;
    text-align: right;
    color: #334155;
}

.kg-imlec {
    display: inline-block;
    width: 8px;
    height: 1.15em;
    margin-left: 1px;
    vertical-align: -0.2em;
    background: var(--kg-turuncu);
    animation: kg-yanip 0.9s steps(1) infinite;
}

@keyframes kg-yanip {
    50% { opacity: 0; }
}

/* Sözdizimi renkleri */
.kg .s-yorum { color: #64748b; font-style: italic; }
.kg .s-etiket { color: #60a5fa; }
.kg .s-ozellik { color: #fbbf24; }
.kg .s-metin { color: #34d399; }
.kg .s-anahtar { color: #f472b6; }
.kg .s-degisken { color: #22d3ee; }
.kg .s-tamam { color: #22c55e; font-weight: 700; }

/* --- Tarayıcı --- */
.kg-adres {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--kg-zemin);
    border: 1px solid var(--kg-cizgi);
    font-family: var(--kg-mono);
    font-size: 12px;
    color: #cbd5e1;
    overflow: hidden;
    white-space: nowrap;
}

.kg-adres::before {
    content: "🔒";
    font-size: 10px;
    opacity: 0.7;
}

.kg-sayfa {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #0f1626;
}

/* === Kurulan proje sayfası (tarayıcı içi) === */
.kg-p {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 0 14px;
    background: var(--kg-p-zemin, #0f172a);
    transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.45s ease;
}

.kg-p.kg-cikis {
    transform: translateX(-12%);
    opacity: 0;
}

.kg-p.kg-giris {
    transform: translateX(12%);
    opacity: 0;
}

/* Parçalar: önce gizli, kod satırı gelince .on ile belirir */
.kg-p [data-parca] {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.kg-p [data-parca].on {
    opacity: 1;
    transform: none;
}

.kg-p-ust {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 46px;
    padding: 0 18px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kg-p-ust b {
    font-size: 15px;
    letter-spacing: 0.02em;
    color: var(--kg-p-vurgu, #fbbf24);
    margin-right: auto;
    white-space: nowrap;
}

.kg-p-ust i {
    font-style: normal;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.kg-p-hero {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 0 14px;
    border-radius: 12px;
    overflow: hidden;
    /* Görsel gelene kadar iskelet parıltısı */
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 70%);
    background-size: 200% 100%;
    animation: kg-parilti 1.2s linear infinite;
}

@keyframes kg-parilti {
    to { background-position: -200% 0; }
}

.kg-p-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    filter: blur(14px) saturate(0.6);
    transform: scale(1.06);
    transition: opacity 0.6s ease, filter 0.9s ease, transform 1.2s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.kg-p-hero img.on {
    opacity: 1;
    filter: none;
    transform: none;
}

/* Hero üstünde küçük kategori etiketi (başlık yalnızca kodda; ekran görüntüsünde zaten var) */
.kg-p-etiket {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(5, 7, 13, 0.78);
    border: 1px solid var(--kg-p-vurgu, #fbbf24);
    color: var(--kg-p-vurgu, #fbbf24);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kg-p-kartlar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 14px;
    height: 64px;
    flex-shrink: 0;
}

.kg-p-kartlar span {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.kg-p-kartlar span::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 30%;
    bottom: 12px;
    height: 6px;
    border-radius: 3px;
    background: var(--kg-p-vurgu, #fbbf24);
    opacity: 0.8;
}

.kg-p-rozet {
    position: absolute;
    top: 60px;
    right: 26px;
    z-index: 3;
    padding: 7px 12px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(22, 163, 74, 0.45);
}

/* === Son sahne: ozgurelibol.com ana sayfası (gerçek sayfanın küçük kopyası) === */
.kg-ana {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    padding: 20px;
    text-align: center;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.24), transparent 34%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.24), transparent 34%),
        linear-gradient(135deg, #07111f 0%, #111827 55%, #1e293b 100%);
}

.kg-ana [data-parca] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.kg-ana [data-parca].on {
    opacity: 1;
    transform: none;
}

.kg-ana img {
    height: 44px;
    width: auto;
}

.kg-ana strong {
    font-size: clamp(18px, 2.2vw, 30px);
    color: #fff;
    max-width: 520px;
    line-height: 1.15;
}

.kg-ana-kartlar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: min(520px, 92%);
}

.kg-ana-kartlar span {
    height: 92px;
    border-radius: 16px;
    display: flex;
    align-items: flex-end;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-align: left;
}

.kg-ana-kartlar span:first-child { background: linear-gradient(135deg, #f97316, #ec4899); }
.kg-ana-kartlar span:last-child { background: linear-gradient(135deg, #2563eb, #22d3ee); }

/* === Alt bilgi: ilerleme + adım adı === */
.kg-alt {
    position: absolute;
    left: 4vw;
    right: 4vw;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--kg-mono);
    font-size: 12px;
    color: #94a3b8;
}

.kg-alt b {
    color: var(--kg-altin);
    font-weight: 400;
    white-space: nowrap;
}

.kg-ilerleme {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.kg-ilerleme i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--kg-turuncu), var(--kg-pembe), var(--kg-mavi));
    transition: width 0.4s ease;
}

/* === Üst: marka + atla === */
.kg-ust {
    position: absolute;
    top: 18px;
    left: 4vw;
    right: 4vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kg-ust img {
    height: 34px;
    width: auto;
}

.kg-atla {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-family: var(--kg-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.kg-atla:hover,
.kg-atla:focus-visible {
    background: var(--kg-altin);
    color: #111827;
}

.kg-atla:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* === Final: tarayıcı tam ekrana büyür, editör kenara çekilir === */
.kg.kg-final .kg-editor {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

/* Büyürken küçük ana sayfanın içeriği söner; yalnızca zemin büyür (çift görüntü olmasın) */
.kg.kg-final .kg-ana > *,
.kg.kg-final .kg-tarayici .kg-bar {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

.kg.kg-final .kg-alt,
.kg.kg-final .kg-akan {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.kg-tarayici {
    transform-origin: 0 0;
    transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), border-radius 0.9s ease;
}

/* === Tablet / mobil: editör üstte, tarayıcı altta === */
@media (max-width: 860px) {
    .kg-sahne {
        inset: 66px 14px 64px;
        grid-template-columns: 1fr;
        grid-template-rows: 36% 1fr;
        gap: 14px;
    }

    .kg-kod {
        font-size: 11px;
        padding: 10px 12px 24px;
    }

    .kg-satir {
        padding-left: 28px;
    }

    .kg-p-ust i {
        display: none;
    }

    .kg-p-kartlar {
        height: 44px;
    }

    .kg-alt {
        left: 14px;
        right: 14px;
        bottom: 22px;
        font-size: 11px;
    }

    .kg-ust {
        left: 14px;
        right: 14px;
    }

    .kg-ust img {
        height: 28px;
    }

    .kg-akan pre:nth-child(n + 4) {
        display: none;
    }
}
