:root {
    --black: #050505;
    --mid-grey: #1a1a1a;
    --industrial-grey: #888888;
    --phosphor-green: #00ff41;
    --white: #ffffff;
    --terminal-bg: rgba(7, 10, 4, 0.98);
    --border-style: 4px solid #252525;
}

/* --- RESET & LAYOUT --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background-color: var(--black);
    color: white;
    font-family: 'JetBrains Mono', monospace;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#matrixCanvas { position: fixed; top: 0; left: 0; z-index: 0; opacity: 0.35; pointer-events: none; }

/* --- HEADER & RESTORED BUTTONS --- */
.wrapper { position: relative; z-index: 100; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; flex-shrink: 0; }
nav { padding: 0.8rem 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--mid-grey); background: rgba(5,5,5,0.9); }
.logo { 
    display: flex; 
    font-weight: 700; 
    font-size: 1.4rem; 
    letter-spacing: 1px; 
    white-space: nowrap; /* Harflerin aşağı kaymasını kesin olarak durdurur */
    flex-shrink: 0;
}

.action-btn {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--phosphor-green);
    color: var(--phosphor-green);
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap; /* Buton metninin bölünmesini engeller */
}
.bit-c { color: var(--phosphor-green); text-shadow: 0 0 5px var(--phosphor-green); }

.btn-group { display: flex; gap: 10px; }

/* Butonlar*/
.action-btn {
    padding: 6px 14px; 
    background: transparent; 
    border: 1px solid var(--phosphor-green);
    color: var(--phosphor-green); 
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 100;
}
.action-btn:hover { 
    background: var(--phosphor-green); 
    color: var(--black); 
    box-shadow: 0 0 15px var(--phosphor-green); 
}

/* --- MAIN: CRT MONITOR --- */
main { flex: 1; display: flex; justify-content: center; align-items: center; z-index: 10; padding: 15px; }
.monitor-assembly { display: flex; flex-direction: column; align-items: center; width: 100%; }

.crt-monitor {
    position: relative; 
    height: 58vh; /* İlk yüklemede daha büyük monitör */
    width: 88vw; 
    max-width: 900px;
    background: #181818; padding: 18px; border-radius: 12px;
    border: var(--border-style); box-shadow: 0 25px 100px rgba(0,0,0,1);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1); flex-shrink: 1;
}
.crt-monitor.expanded { height: 62vh; max-width: 1200px; }
.screen-glass { position: relative; width: 100%; height: 100%; background: var(--terminal-bg); border-radius: 50% / 5%; overflow: hidden; border: 10px solid #000; }
.bash-text { padding: 25px; color: var(--phosphor-green); font-size: 0.85rem; line-height: 1.6; height: 100%; overflow-y: auto; white-space: pre-wrap; }

/* BELİRGİN ENDÜSTRİYEL AYAK */
/* --- GÜÇLENDİRİLMİŞ ENDÜSTRİYEL AYAK --- */
.stand-neck {
    width: 120px;
    height: 40px;
    background: linear-gradient(90deg, #121212 0%, #1a1a1a 50%, #121212 100%);
    border-left: 8px solid #222; /* Daha kalın metalik kenarlar */
    border-right: 8px solid #222;
    margin-top: -4px;
    position: relative;
    z-index: 4;
    flex-shrink: 0;
}

.stand-base {
    width: 280px;
    height: 22px;
    background: #0a0a0a;
    border: 6px solid #222; /* Monitör çerçevesiyle uyumlu kalınlık */
    border-radius: 6px 6px 0 0;
    box-shadow: 0 12px 0 #000, 0 20px 40px rgba(0,0,0,0.9);
    z-index: 3;
    flex-shrink: 0;
}

/* --- ARCHIVE SECTION --- */
.archive-section { position: relative; width: 100%; background: #080808; border-top: 1px solid var(--mid-grey); z-index: 150; flex-shrink: 0; }
.carousel { display: flex; overflow-x: auto; gap: 1rem; padding: 1rem 60px; scroll-behavior: smooth; }
.carousel::-webkit-scrollbar { display: none; }

.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; background: rgba(0,0,0,0.8);
    border: 0.5px solid rgba(0, 255, 65, 0.4);
    color: var(--phosphor-green); display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 200; transition: 0.3s;
}
.nav-btn:hover { border-color: var(--phosphor-green); box-shadow: 0 0 8px var(--phosphor-green); }
.btn-left { left: 10px; } .btn-right { right: 10px; }

/* Kartlar ve Hover Efekti */
.card { 
    min-width: 250px; background: #0c0c0c; 
    border: 1px solid #1a1a1a; padding: 1rem; 
    cursor: pointer; transition: 0.3s; 
}
.card:hover { 
    border-color: var(--phosphor-green); 
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}
.card h3 { color: var(--phosphor-green); font-size: 0.55rem; margin-bottom: 0.4rem; opacity: 0.9; }
.card h2 { font-size: 0.85rem; font-weight: 400; color: var(--white); line-height: 1.3; }

/* --- FOOTER (ESKİ HALİNE DÖNDÜRÜLDÜ) --- */
footer { 
    padding: 0.6rem 2rem; border-top: 1px solid #1a1a1a; 
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.55rem; color: #444; flex-shrink: 0;
}
.site-url { 
    color: var(--phosphor-green); 
    font-weight: bold; 
    opacity: 0.8; 
    letter-spacing: 1px;
    text-shadow: 0 0 3px var(--phosphor-green); /* Fosforlu parlama geri geldi */
}

/* --- RAIN & MATRIX --- */
.flying-cmd { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; color: var(--phosphor-green); font-size: 1rem; animation: fly linear forwards; opacity: 0; }
@keyframes fly { 0% { transform: translate(var(--sx), var(--sy)); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(var(--tx), var(--ty)) rotate(5deg); opacity: 0; } }

/* --- GLOBAL TERMINAL SCROLLBAR (DESKTOP & GENERAL) --- */

/* 1. Kaydırma çubuğunun genişliği */
.bash-text::-webkit-scrollbar {
    width: 6px;
}

/* 2. Kanal (Track) - Arka planla uyumlu, hafif şeffaf */
.bash-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

/* 3. Hareketli Parça (Thumb) - İstediğin soluk yeşil tonu */
.bash-text::-webkit-scrollbar-thumb {
    /* Phosphor-green renginin %20 opaklıkta soluk hali */
    background: rgba(0, 255, 65, 0.2); 
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 65, 0.05); /* Çok hafif bir parıltı hattı */
    transition: background 0.3s ease;
}

/* 4. Etkileşim: Mouse ile üzerine gelindiğinde */
.bash-text::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 65, 0.4); /* Biraz daha belirginleşir */
}

/* 5. Firefox Uyumluluğu */
.bash-text {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 65, 0.2) transparent;
}


/* --- MOBILE --- */
@media (max-width: 768px) {
    .logo { font-size: 1.1rem; }
    .action-btn { font-size: 0.55rem; padding: 4px 8px; }

    .bash-text {
        overflow-y: scroll !important; /* 'auto' yerine 'scroll' mobilde daha garantidir */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; 
        touch-action: pan-y; /* Dokunmatik hareketi sadece dikeyde serbest bırakır */
        pointer-events: auto; /* Dokunmatik algılamanın açık olduğundan emin olur */
        
        display: block;
        height: 100%;
        padding: 15px;
        color: var(--phosphor-green);
        font-size: 0.65rem;
        line-height: 1.5;
        white-space: pre-wrap;
    }

    /* --- TERMINAL GREEN SCROLLBAR (MOBILE & DESKTOP) --- */

    /* 1. Kaydırma çubuğunun genişliği */
    .bash-text::-webkit-scrollbar {
        width: 5px; /* Mobilde parmakla tutmak için çok ince olmamalı */
    }

    /* 2. Kaydırma çubuğunun arkasındaki kanal (Track) */
    .bash-text::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3); /* Terminal arka planıyla uyumlu koyu siyah */
    }

    /* 3. Hareket eden bar (Thumb) - İşte burası istediğin soluk yeşil */
    .bash-text::-webkit-scrollbar-thumb {
        background: rgba(0, 255, 65, 0.25); /* Phosphor-green'in %25 şeffaf hali */
        border-radius: 4px;
        border: 1px solid rgba(0, 255, 65, 0.1); /* Kenarlarda çok hafif bir parıltı */
    }

    /* 4. Dokunulduğunda veya üzerine gelindiğinde renk belirginleşsin */
    .bash-text::-webkit-scrollbar-thumb:hover,
    .bash-text::-webkit-scrollbar-thumb:active {
        background: rgba(0, 255, 65, 0.5); /* Dokunma anında %50 opaklık */
    }

    /* Firefox için standart kural (Modern mobil tarayıcılar için yedek) */
    .bash-text {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 255, 65, 0.25) transparent;
    }

    .crt-monitor { 
        height: 42vh; 
        width: 92vw; 
        padding: 10px;
    }

    /* İÇERİK AÇILDIĞINDA (EXPANDED) DİKEY UZAMA */
    .crt-monitor.expanded { 
        height: 50vh; /* İçerik açıkken monitörün dikey ekseni %50'ye kadar uzar */
        margin-top: 5px; 
    }

    /* AYAĞIN BELİRGİNLİĞİNİ KORUMAK İÇİN ÖLÇEKLENDİRME */
    .stand-neck { 
        width: 90px; 
        height: 30px; /* Boyun yüksekliği */
        border-width: 4px; 
    }
    
    .stand-base { 
        width: 180px; 
        height: 15px; /* Taban yüksekliği */
        border-width: 4px; 
    }
}

/* --- GLITCH ANIMATION --- */
.glitch-active {
    animation: monitor-shake 0.2s infinite;
    position: relative;
}

/* Renk Kayması ve Sarsıntı */
@keyframes monitor-shake {
    0% { transform: translate(0,0) skew(0deg); box-shadow: 2px 0 0 red, -2px 0 0 blue; }
    20% { transform: translate(-2px, 2px) skew(1deg); box-shadow: -2px 0 0 red, 2px 0 0 blue; }
    40% { transform: translate(2px, -2px) skew(-1deg); box-shadow: 2px 0 0 blue, -2px 0 0 red; }
    60% { transform: translate(-2px, -2px) skew(0deg); box-shadow: 1px 0 0 red, -1px 0 0 blue; }
    80% { transform: translate(2px, 2px) skew(1deg); box-shadow: -1px 0 0 blue, 1px 0 0 red; }
    100% { transform: translate(0,0) skew(0deg); box-shadow: 2px 0 0 red, -2px 0 0 blue; }
}

/* Terminaldeki yazıların da glitchlenmesi için */
.glitch-text {
    text-shadow: 2px 0 0 red, -2px 0 0 blue;
    filter: blur(0.5px);
    opacity: 0.8;
}

/* --- SCANLINE EFFECT --- */
.screen-glass::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 255, 65, 0.03) 50%
    ), linear-gradient(
        90deg, 
        rgba(255, 0, 0, 0.01), 
        rgba(0, 255, 0, 0.01), 
        rgba(0, 0, 255, 0.01)
    );
    z-index: 2;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

/* --- LAZER (SCANLINE) EFEKTİ --- */
.screen-glass {
    position: relative; /* Bu mutlaka olmalı */
}

/* Ekran üzerindeki ince statik çizgiler */
.screen-glass::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 255, 65, 0.05) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.02));
    z-index: 10;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

/* Hareket eden parlak lazer çizgisi */
.screen-glass::after {
    content: "";
    position: absolute;
    top: -100px; /* Ekranın dışından başlar */
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--phosphor-green);
    box-shadow: 0 0 15px var(--phosphor-green);
    opacity: 0.2; /* Parlaklık artırıldı */
    z-index: 11;
    pointer-events: none;
    animation: laser-scan 5s linear infinite;
}

@keyframes laser-scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* --- LOGO KARAKTER SABİTLEME --- */
.char {
    display: inline-block;
    min-width: 0.8em;
    text-align: center;
    transition: all 0.1s ease;
}

/* --- BLINKING CURSOR --- */
#cursor {
    display: inline-block;
    width: 10px;
    height: 1.1em; /* Yazı boyutuyla orantılı yükseklik */
    background: var(--phosphor-green);
    margin-left: 3px; /* Prompt ile arasına küçük bir boşluk */
    vertical-align: middle; /* Metinle dikeyde hizalar */
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}