@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;500;700&display=swap');

:root {
    --bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --accent: #38bdf8;
    --text: #f3f4f6;
    --text-dim: #9ca3af;
    --glass: rgba(255, 255, 255, 0.05);
}

html { scroll-behavior: smooth; }

body {
    margin: 0; 
    background-color: var(--bg); 
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif; 
    overflow-x: hidden;
    scrollbar-width: none; 
    cursor: none;
}
body::-webkit-scrollbar { display: none; }

.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px);
    background-size: 30px 30px; opacity: 0.15; z-index: -1;
}

/* HEADER */
.topbar {
    position: fixed; top: 0; width: 100%; height: 85px; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; background: rgba(3,7,18,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass); box-sizing: border-box;
}
.nav-left .logo { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 12px; }
.nav-btn { 
    color: var(--text); text-decoration: none; font-size: 0.85rem;
    border: 1px solid var(--glass); padding: 8px 16px; border-radius: 8px; 
    transition: 0.3s; white-space: nowrap;
}
.nav-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.lang-box select {
    background: #111827; color: #fff; border: 2px solid var(--accent);
    padding: 8px 12px; border-radius: 8px; 
    font-weight: 600; font-family: 'Space Grotesk', sans-serif; outline: none;
}

/* HERO */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.typing-text {
    font-size: clamp(1.8rem, 5vw, 3.5rem); font-weight: 700;
    border-right: 3px solid var(--accent); white-space: nowrap;
    overflow: hidden; width: 0; margin: 0 auto;
    animation: typing 3s steps(30) forwards, blink 0.8s infinite;
}
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink { 50% { border-color: transparent } }

/* CARDS */
main { padding: 120px 5% 50px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.card {
    background: var(--card-bg); border: 1px solid var(--glass);
    border-radius: 20px; padding: 25px; backdrop-filter: blur(5px);
    opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.card.reveal { opacity: 1; transform: translateY(0); }
.thumb { width: 100%; height: 200px; border-radius: 12px; object-fit: cover; margin-bottom: 20px; }

.filter-wrapper, .lang-filter { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 20px 0; }
.filter-item { display: flex; align-items: center; gap: 8px; background: var(--card-bg); border: 1px solid var(--glass); padding: 8px 16px; border-radius: 12px;  transition: all 0.3s ease; }
.filter-item:hover { background: var(--accent); color: var(--bg); transform: translateY(-3px); }
.filter-item img { width: 20px; height: 20px; object-fit: contain; }
.filter-item span { font-size: 0.9rem; font-weight: 500; }
.all-filter { border: 2px solid var(--accent); font-weight: bold; }

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-btn { border: 1px solid var(--glass); background: transparent; color: var(--text); padding: 8px 14px; border-radius: 10px;  font-size: 0.8rem; transition: all 0.25s; text-decoration: none; }
.card-btn:hover { transform: translateY(-2px); }
.card-btn.repo:hover { background: #24292e; border-color: #24292e; }
.card-btn.site:hover { background: var(--accent); color: black; border-color: var(--accent); }
.card-btn.demo:hover { background: #22c55e; border-color: #22c55e; color: black; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { position: relative; width: 80%; max-width: 900px; background: #000; border-radius: 15px; overflow: hidden; border: 1px solid var(--accent); }
.modal-content video { width: 100%; display: block; }
.close-modal { position: absolute; top: 15px; right: 20px; color: white; font-size: 30px;  z-index: 10; }

.project-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.lang-badge { display: flex; align-items: center; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.badge-icon { width: 16px; height: 16px; margin-right: 6px; object-fit: contain; }

.footer { padding: 50px 0; text-align: center; border-top: 1px solid var(--glass); }
.social-links { display: flex; justify-content: center; gap: 25px; }
.soc-icon { width: 30px; height: 30px; object-fit: contain; transition: transform 0.3s ease; filter: invert(1); }
.soc-icon:hover { transform: scale(1.2); filter: invert(1) drop-shadow(0 0 5px var(--accent)); }
.thumb-wrapper {
    position: relative;

}

.preview-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.play-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: white;
    pointer-events: none;
}

#cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Crucial: allows you to click buttons "through" the animation */
    z-index: 9999;       /* Keeps it on top of all other sections */
}

.segment {
    position: fixed;     /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ffcc, #0077ff);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    /* Remove the transition if the movement feels "laggy" */
}