/* --- IMPORT FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-color: #050505;
    --card-bg: #0a0a0a;
    --text-main: #e0e0e0;
    --text-muted: #888;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --border: #222;
    
    --font-header: 'Orbitron', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

[data-theme="light"] {
    --bg-color: #f0f0f5;
    --card-bg: #ffffff;
    --text-main: #111;
    --text-muted: #555;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --border: #ccc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* --- UTILITIES --- */
.no-drag { user-select: none; -webkit-user-drag: none; pointer-events: none; }
.mono { font-family: var(--font-mono); font-size: 0.9rem; }

/* --- NAVIGATION (Responsive Fix) --- */
nav {
    display: flex; justify-content: space-between; padding: 1.5rem 5%;
    align-items: center; flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 100;
}
.logo { font-family: var(--font-header); font-weight: 700; font-size: 1.4rem; letter-spacing: 1px; color: var(--text-main); }

.nav-right { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--text-muted); text-decoration: none;
    transition: color 0.3s; font-family: var(--font-mono); font-size: 0.85rem; 
    text-transform: uppercase; position: relative; padding: 5px 0;
}
/* Underline Hover Animation */
.nav-links a::before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 2px;
    background: var(--accent); transition: 0.3s;
}
.nav-links a:hover { color: var(--text-main); }
.nav-links a:hover::before, .nav-links a.active::before { width: 100%; }

.theme-toggle {
    background: transparent; border: 1px solid var(--border); color: var(--text-main);
    width: 36px; height: 36px; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.theme-toggle:hover { background: var(--card-bg); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* --- PROFILE IMAGE --- */
.profile-container { 
    margin-bottom: 2rem; position: relative; width: 150px; height: 150px; 
}
.profile-img {
    width: 100%; height: 100%; 
    border-radius: 15px; 
    object-fit: cover;
    border: 2px solid var(--accent); 
    position: relative; z-index: 2;
    box-shadow: 0 0 25px var(--accent-glow);
    animation: intro-reveal 1.5s ease-out forwards, glitch-idle 5s infinite 1.5s;
}
.profile-container::before {
    content: ''; position: absolute; top: -5px; left: -5px; 
    width: calc(100% + 10px); height: calc(100% + 10px); 
    border-radius: 18px; 
    border: 1px dashed var(--text-muted); opacity: 0.3; z-index: 1;
}
/* Intro Animation (Negative Flash) */
@keyframes intro-reveal {
    0% { filter: invert(1); transform: scale(0.9); clip-path: inset(0 0 0 0); }
    50% { clip-path: inset(10% 0 40% 0); }
    100% { filter: invert(0); transform: scale(1); clip-path: inset(0 0 0 0); }
}
/* Idle Glitch Loop */
@keyframes glitch-idle {
    0%, 95% { transform: translate(0); clip-path: inset(0 0 0 0); }
    96% { transform: translate(-2px, 2px); clip-path: inset(10% 0 85% 0); }
    98% { transform: translate(2px, -2px); clip-path: inset(85% 0 10% 0); }
    100% { transform: translate(0); clip-path: inset(0 0 0 0); }
}

/* --- TYPOGRAPHY & FIXED GLITCH --- */
h1 {
    font-family: var(--font-header); 
    font-size: 3rem; /* Better base size */
    line-height: 1.2; 
    margin-bottom: 1.5rem;
    text-transform: uppercase; 
    letter-spacing: -1px;
    color: var(--text-main);
}
.subtitle { font-family: var(--font-mono); color: var(--accent); margin-bottom: 1.5rem; font-size: 0.9rem; letter-spacing: 1px; }

/* NEW GLITCH: Text Shadow Shift (Safe for multi-line) */
.glitch {
    position: relative;
    animation: glitch-skew 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite both;
}
@keyframes glitch-skew {
    0%, 100% { text-shadow: 0 0 0 transparent; transform: translate(0); }
    92% { text-shadow: 0 0 0 transparent; transform: translate(0); }
    93% { text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; transform: translate(-1px, 1px); }
    95% { text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; transform: translate(1px, -1px); }
    96% { text-shadow: 0 0 0 transparent; transform: translate(0); }
}

/* --- TERMINAL BOX --- */
.terminal-card {
    background: rgba(255, 255, 255, 0.02); border-left: 3px solid var(--accent);
    padding: 1.5rem; max-width: 650px; margin-bottom: 2rem; backdrop-filter: blur(5px);
}
.terminal-header {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
    margin-bottom: 0.5rem; display: block; letter-spacing: 1px;
}

/* --- BUTTONS --- */
.btn-group { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 1rem; }
.btn {
    text-decoration: none; padding: 12px 24px; border-radius: 2px;
    transition: all 0.2s ease; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; text-transform: uppercase;
}
.btn-outline { border-color: var(--border); color: var(--text-main); background: rgba(128,128,128,0.05); }
.btn-outline:hover { border-color: var(--accent); background: rgba(59,130,246,0.1); box-shadow: 0 0 15px var(--accent-glow); transform: translateY(-2px); }

.btn-glow { border-color: rgba(234, 179, 8, 0.4); color: #eab308; background: rgba(234, 179, 8, 0.05); }
.btn-glow:hover { background: rgba(234, 179, 8, 0.15); box-shadow: 0 0 20px rgba(234, 179, 8, 0.2); transform: translateY(-2px); }

.btn-github { border-color: var(--border); color: var(--text-main); background: rgba(255,255,255,0.05); }
.btn-github:hover { background: rgba(255,255,255,0.1); border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.2); transform: translateY(-2px); }

.btn-discord { background-color: #5865F2; color: white; border: none; font-family: var(--font-mono); font-size: 0.8rem; padding: 6px 14px; border-radius: 2px; cursor: pointer; transition: all 0.2s; text-transform: uppercase; }
.btn-discord:hover { background-color: #4752C4; box-shadow: 0 0 15px rgba(88, 101, 242, 0.4); }

/* --- GRID & LAYOUT --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding: 3rem 0; }

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Better mobile fit */
    gap: 2rem; margin-top: 4rem; 
}
.card {
    background: var(--card-bg); border: 1px solid var(--border);
    padding: 2rem; border-radius: 4px; transition: 0.2s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px -10px var(--accent-glow); }
.card h3 { font-family: var(--font-header); margin-bottom: 1rem; color: var(--text-main); letter-spacing: 0.5px; }
.tag {
    display: inline-block; background: transparent; padding: 4px 8px; border-radius: 2px;
    font-family: var(--font-mono); font-size: 0.7rem; margin-right: 5px; color: var(--accent);
    margin-top: auto; border: 1px solid var(--border); text-transform: uppercase;
}

/* --- IDENTITY GRID --- */
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.identity-card { border: 1px solid var(--border); padding: 2rem; background: var(--card-bg); position: relative; }
.identity-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.id-badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--bg-color); background: var(--accent); padding: 2px 6px; font-weight: bold; }
.tech-list li { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; border-left: 2px solid var(--border); padding-left: 10px; }
.tech-list li strong { color: var(--text-main); }

/* --- FOOTER --- */
footer { text-align: center; padding: 4rem 0; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); margin-top: 4rem; font-family: var(--font-mono); }

/* --- ANIMATIONS --- */
.hidden { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.show { opacity: 1; transform: translateY(0); }
.typing-cursor::after { content: '_'; animation: blink 0.8s step-start infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* --- MOBILE RESPONSIVENESS (FIXED) --- */
@media (max-width: 768px) {
    nav { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .nav-right { width: 100%; justify-content: space-between; }
    .nav-links { gap: 1rem; font-size: 0.8rem; }
    
    .hero { text-align: left; padding: 2rem 0; }
    h1 { font-size: 2rem; /* Prevent overflow */ }
    
    .identity-grid { grid-template-columns: 1fr; }
    
    .btn-group { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
}